三江-业务中台接收合作单位接口
This commit is contained in:
parent
ec18d6b193
commit
810140b6da
@ -5,6 +5,7 @@ import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.SjEnterpriseInfo;
|
||||
import com.zhgd.xmgl.modules.worker.service.IEnterpriseInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@ -21,11 +22,11 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 劳务公司
|
||||
* @author: pds
|
||||
* @date: 2020-08-13
|
||||
* @date: 2020-08-13
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@ -33,114 +34,152 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@Api(tags = "劳务公司")
|
||||
public class EnterpriseInfoController {
|
||||
@Autowired
|
||||
private IEnterpriseInfoService enterpriseInfoService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = " 列表查询劳务公司信息", notes = "列表查询劳务公司信息", httpMethod="POST")
|
||||
@Autowired
|
||||
private IEnterpriseInfoService enterpriseInfoService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = " 列表查询劳务公司信息", notes = "列表查询劳务公司信息", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userEnterpriseId", value = "用户能查看的企业", paramType = "query", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "enterpriseName", value = "劳务公司名称", paramType = "query", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "enterpriseTypeId", value = "企业类型", paramType = "query", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sN", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/list")
|
||||
public Result<List<EntityMap>> getEnterpriseInfoList(@RequestBody Map<String,Object> map) {
|
||||
return Result.success(enterpriseInfoService.getEnterpriseInfoList(map));
|
||||
}
|
||||
@PostMapping(value = "/list")
|
||||
public Result<List<EntityMap>> getEnterpriseInfoList(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(enterpriseInfoService.getEnterpriseInfoList(map));
|
||||
}
|
||||
|
||||
@ApiOperation(value = " 层级查询劳务公司信息", notes = "列表查询劳务公司信息", httpMethod="POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userEnterpriseId", value = "用户能查看的企业", paramType = "query", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "enterpriseName", value = "劳务公司名称", paramType = "query", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "enterpriseTypeId", value = "企业类型", paramType = "query", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sN", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/selectHierarchyEnterpriseList")
|
||||
public Result<JSONArray> selectHierarchyEnterpriseList(@RequestBody Map<String,Object> map) {
|
||||
return Result.success(enterpriseInfoService.selectHierarchyEnterpriseList(map));
|
||||
}
|
||||
/**
|
||||
* 添加
|
||||
* @param enterpriseInfo
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "劳务管理",operType = "添加劳务公司",operDesc = "添加劳务公司")
|
||||
@ApiOperation(value = " 添加劳务公司信息", notes = "添加劳务公司信息" , httpMethod="POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<EnterpriseInfo> add(@RequestBody EnterpriseInfo enterpriseInfo) {
|
||||
@ApiOperation(value = " 层级查询劳务公司信息", notes = "列表查询劳务公司信息", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userEnterpriseId", value = "用户能查看的企业", paramType = "query", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "enterpriseName", value = "劳务公司名称", paramType = "query", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "enterpriseTypeId", value = "企业类型", paramType = "query", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sN", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/selectHierarchyEnterpriseList")
|
||||
public Result<JSONArray> selectHierarchyEnterpriseList(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(enterpriseInfoService.selectHierarchyEnterpriseList(map));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param enterpriseInfo
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "劳务管理", operType = "添加劳务公司", operDesc = "添加劳务公司")
|
||||
@ApiOperation(value = " 添加劳务公司信息", notes = "添加劳务公司信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<EnterpriseInfo> add(@RequestBody EnterpriseInfo enterpriseInfo) {
|
||||
enterpriseInfoService.saveEnterpriseInfo(enterpriseInfo);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param enterpriseInfo
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "劳务管理",operType = "编辑劳务公司",operDesc = "编辑劳务公司")
|
||||
@ApiOperation(value = "编辑劳务公司信息", notes = "编辑劳务公司信息" , httpMethod="POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<EnterpriseInfo> edit(@RequestBody EnterpriseInfo enterpriseInfo) {
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 三江业务中台添加合作单位
|
||||
*
|
||||
* @param enterpriseInfo
|
||||
* @return
|
||||
*/
|
||||
//@OperLog(operModul = "劳务管理",operType = "添加劳务公司",operDesc = "添加劳务公司")
|
||||
@ApiOperation(value = " 三江业务中台添加合作单位", notes = "三江业务中台添加合作单位", httpMethod = "POST")
|
||||
@PostMapping(value = "/sj/add")
|
||||
public Result addSj(@RequestBody SjEnterpriseInfo enterpriseInfo) {
|
||||
return enterpriseInfoService.addSj(enterpriseInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param enterpriseInfo
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "劳务管理", operType = "编辑劳务公司", operDesc = "编辑劳务公司")
|
||||
@ApiOperation(value = "编辑劳务公司信息", notes = "编辑劳务公司信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<EnterpriseInfo> edit(@RequestBody EnterpriseInfo enterpriseInfo) {
|
||||
enterpriseInfoService.updateEnterpriseInfo(enterpriseInfo);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "劳务管理",operType = "删除劳务公司",operDesc = "删除劳务公司")
|
||||
@ApiOperation(value = "删除劳务公司信息", notes = "删除劳务公司信息" , httpMethod="POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "enterpriseId", value = "劳务公司ID", paramType = "query", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sN", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<EnterpriseInfo> delete(@RequestBody Map<String,Object> map) {
|
||||
enterpriseInfoService.removeEnterpriseInfo(map);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询劳务公司信息", notes = "通过id查询劳务公司信息" , httpMethod="POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "enterpriseId", value = "劳务公司ID", paramType = "query", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sN", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/getEnterpriseInfoById")
|
||||
public Result<EnterpriseInfo> getEnterpriseInfoById(@RequestBody Map<String,Object> map) {
|
||||
return Result.success(enterpriseInfoService.getEnterpriseInfoById(map));
|
||||
}
|
||||
/**
|
||||
* 三江业务中台编辑合作单位
|
||||
*
|
||||
* @param enterpriseInfo
|
||||
* @return
|
||||
*/
|
||||
//@OperLog(operModul = "劳务管理", operType = "编辑劳务公司", operDesc = "编辑劳务公司")
|
||||
@ApiOperation(value = "三江业务中台编辑合作单位", notes = "三江业务中台编辑合作单位", httpMethod = "POST")
|
||||
@PostMapping(value = "/sj/edit")
|
||||
public Result editSj(@RequestBody SjEnterpriseInfo enterpriseInfo) {
|
||||
return enterpriseInfoService.editSj(enterpriseInfo);
|
||||
}
|
||||
|
||||
@OperLog(operModul = "劳务管理", operType = "删除劳务公司", operDesc = "删除劳务公司")
|
||||
@ApiOperation(value = "删除劳务公司信息", notes = "删除劳务公司信息", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "enterpriseId", value = "劳务公司ID", paramType = "query", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sN", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<EnterpriseInfo> delete(@RequestBody Map<String, Object> map) {
|
||||
enterpriseInfoService.removeEnterpriseInfo(map);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 三江业务中台通过id和projectNumber删除合作单位
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
//@OperLog(operModul = "劳务管理", operType = "删除劳务公司", operDesc = "删除劳务公司")
|
||||
@ApiOperation(value = "三江业务中台通过id和projectNumber删除合作单位", notes = "三江业务中台通过id和projectNumber删除合作单位", httpMethod = "POST")
|
||||
@PostMapping(value = "/sj/delete")
|
||||
public Result deleteSj(@RequestBody SjEnterpriseInfo enterpriseInfo) {
|
||||
return enterpriseInfoService.deleteSj(enterpriseInfo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "通过社会统一信用代码查询劳务公司", notes = "通过社会统一信用代码查询劳务公司" , httpMethod="POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "socialCode", value = "社会统一信用代码", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/getEnterpriseInfoBySocialCode")
|
||||
public Result<EnterpriseInfo> getEnterpriseInfoBySocialCode(@RequestBody Map<String,Object> map) {
|
||||
return Result.success(enterpriseInfoService.getEnterpriseInfoBySocialCode(map));
|
||||
}
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询劳务公司信息", notes = "通过id查询劳务公司信息", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "enterpriseId", value = "劳务公司ID", paramType = "query", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sN", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/getEnterpriseInfoById")
|
||||
public Result<EnterpriseInfo> getEnterpriseInfoById(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(enterpriseInfoService.getEnterpriseInfoById(map));
|
||||
}
|
||||
|
||||
@ApiOperation(value = " 列表查询总公司下所有项目劳务公司信息", notes = "列表查询总公司下所有项目劳务公司信息", httpMethod="POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "enterpriseName", value = "劳务公司名称", paramType = "query", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "headquartersSn", value = "总公司sn", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/getAllEnterpriseList")
|
||||
public Result<List<EnterpriseInfo>> getAllEnterpriseList(@RequestBody Map<String,Object> map) {
|
||||
return Result.success(enterpriseInfoService.getAllEnterpriseList(map));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通过社会统一信用代码查询劳务公司", notes = "通过社会统一信用代码查询劳务公司", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "socialCode", value = "社会统一信用代码", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/getEnterpriseInfoBySocialCode")
|
||||
public Result<EnterpriseInfo> getEnterpriseInfoBySocialCode(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(enterpriseInfoService.getEnterpriseInfoBySocialCode(map));
|
||||
}
|
||||
|
||||
@ApiOperation(value = " 列表查询总公司下所有项目劳务公司信息", notes = "列表查询总公司下所有项目劳务公司信息", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "enterpriseName", value = "劳务公司名称", paramType = "query", required = false, dataType = "String"),
|
||||
@ApiImplicitParam(name = "headquartersSn", value = "总公司sn", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/getAllEnterpriseList")
|
||||
public Result<List<EnterpriseInfo>> getAllEnterpriseList(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(enterpriseInfoService.getAllEnterpriseList(map));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,189 @@
|
||||
package com.zhgd.xmgl.modules.worker.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "企业实体类")
|
||||
public class SjEnterpriseInfo {
|
||||
/**
|
||||
* 企业账号表
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "企业账号表")
|
||||
private java.lang.Long id;
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
@Excel(name = "企业名称", width = 15)
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private java.lang.String enterpriseName;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@Excel(name = "描述", width = 15)
|
||||
@ApiModelProperty(value = "描述")
|
||||
private java.lang.String description;
|
||||
/**
|
||||
* 企业地址
|
||||
*/
|
||||
@Excel(name = "企业地址", width = 15)
|
||||
@ApiModelProperty(value = "企业地址")
|
||||
private java.lang.String enterpriseAddress;
|
||||
/**
|
||||
* 法定代表人
|
||||
*/
|
||||
@Excel(name = "法定代表人", width = 15)
|
||||
@ApiModelProperty(value = "法定代表人")
|
||||
private java.lang.String enterpriseLegalPerson;
|
||||
/**
|
||||
* 法定人证件号
|
||||
*/
|
||||
@Excel(name = "法定人证件号", width = 15)
|
||||
@ApiModelProperty(value = "法定人证件号")
|
||||
private java.lang.String legalPersonIdCard;
|
||||
/**
|
||||
* 企业安全生产许可证
|
||||
*/
|
||||
@Excel(name = "企业安全生产许可证", width = 15)
|
||||
@ApiModelProperty(value = "企业安全生产许可证")
|
||||
private java.lang.String enterpriseSafeAllow;
|
||||
/**
|
||||
* 单位性质 1.国有企业 2三资企业 3集体企业 4私营企业
|
||||
*/
|
||||
@Excel(name = "单位性质 1.国有企业 2三资企业 3集体企业 4私营企业", width = 15)
|
||||
@ApiModelProperty(value = "单位性质 1.国有企业 2三资企业 3集体企业 4私营企业")
|
||||
private java.lang.Integer enterpriseProperty;
|
||||
/**
|
||||
* 法人电话
|
||||
*/
|
||||
@Excel(name = "法人电话", width = 15)
|
||||
@ApiModelProperty(value = "法人电话")
|
||||
private java.lang.String legalPersonTel;
|
||||
/**
|
||||
* 社会统一信用代码
|
||||
*/
|
||||
@Excel(name = "社会统一信用代码", width = 15)
|
||||
@ApiModelProperty(value = "社会统一信用代码")
|
||||
private java.lang.String socialCode;
|
||||
/**
|
||||
* 营业执照注册号
|
||||
*/
|
||||
@Excel(name = "营业执照注册号", width = 15)
|
||||
@ApiModelProperty(value = "营业执照注册号")
|
||||
private java.lang.String businessNumber;
|
||||
/**
|
||||
* 资质证书号
|
||||
*/
|
||||
@Excel(name = "资质证书号", width = 15)
|
||||
@ApiModelProperty(value = "资质证书号")
|
||||
private java.lang.String qualificationNumber;
|
||||
/**
|
||||
* 企业邮箱
|
||||
*/
|
||||
@Excel(name = "企业邮箱", width = 15)
|
||||
@ApiModelProperty(value = "企业邮箱")
|
||||
private java.lang.String enterpriseEmail;
|
||||
/**
|
||||
* 注册资金
|
||||
*/
|
||||
@Excel(name = "注册资金", width = 15)
|
||||
@ApiModelProperty(value = "注册资金")
|
||||
private java.lang.String registeredCapital;
|
||||
/**
|
||||
* 开户行
|
||||
*/
|
||||
@Excel(name = "开户行", width = 15)
|
||||
@ApiModelProperty(value = "开户行")
|
||||
private java.lang.String bankname;
|
||||
/**
|
||||
* 银行卡号
|
||||
*/
|
||||
@Excel(name = "银行卡号", width = 15)
|
||||
@ApiModelProperty(value = "银行卡号")
|
||||
private java.lang.String bankcardnumber;
|
||||
/**
|
||||
* 银行代码
|
||||
*/
|
||||
@Excel(name = "银行代码", width = 15)
|
||||
@ApiModelProperty(value = "银行代码")
|
||||
private java.lang.String bankcode;
|
||||
/**
|
||||
* 企业资质图片地址
|
||||
*/
|
||||
@Excel(name = "企业资质图片地址", width = 15)
|
||||
@ApiModelProperty(value = "企业资质图片地址")
|
||||
private java.lang.String enterpriseQualificationUrl;
|
||||
/**
|
||||
* 营业执照截止日期
|
||||
*/
|
||||
@Excel(name = "营业执照截止日期", width = 15)
|
||||
@ApiModelProperty(value = "营业执照截止日期")
|
||||
private java.lang.String businessLicenseEndDate;
|
||||
|
||||
/**
|
||||
* 注册人姓名
|
||||
*/
|
||||
@Excel(name = "注册人姓名", width = 15)
|
||||
@ApiModelProperty(value = "注册人姓名")
|
||||
private java.lang.String registerPersonName;
|
||||
/**
|
||||
* 注册人电话
|
||||
*/
|
||||
@Excel(name = "注册人电话 ", width = 15)
|
||||
@ApiModelProperty(value = "注册人电话 ")
|
||||
private java.lang.String registerPersonPhoneTel;
|
||||
/**
|
||||
* 企业sn
|
||||
*/
|
||||
@Excel(name = "企业sn", width = 15)
|
||||
@ApiModelProperty(value = "企业sn")
|
||||
private java.lang.String enterpriseSn;
|
||||
/**
|
||||
* logo
|
||||
*/
|
||||
@Excel(name = "logo", width = 15)
|
||||
@ApiModelProperty(value = "logo")
|
||||
private java.lang.String logo;
|
||||
/**
|
||||
* 企业注册日期
|
||||
*/
|
||||
@Excel(name = "企业注册日期", width = 15)
|
||||
@ApiModelProperty(value = "企业注册日期")
|
||||
private java.lang.String registDate;
|
||||
@Excel(name = "营业执照图片地址", width = 15)
|
||||
@ApiModelProperty(value = "营业执照图片地址")
|
||||
private java.lang.String businessLicenseUrl;
|
||||
/////////////////////下面的不是enterprise_info表///////////////////////////
|
||||
|
||||
/**
|
||||
* enterprise_type表外键
|
||||
*/
|
||||
@ApiModelProperty(value = "企业类型(1专业分包,2设备分包,3材料分包,4后勤服务,5特殊设备,6劳务分包,7监理单位,8建设单位,9总承包单位,10勘查单位,11设计单位,12其它)")
|
||||
private Long enterpriseTypeId;
|
||||
/**
|
||||
* enterprise_type表外键
|
||||
*/
|
||||
@ApiModelProperty(value = "父级企业ID")
|
||||
private java.lang.Long parentEnterpriseId;
|
||||
|
||||
@ApiModelProperty(value = "企业类型名称")
|
||||
private java.lang.String enterpriseTypeName;
|
||||
|
||||
@ApiModelProperty(value = "项目负责人")
|
||||
private java.lang.String projectDirectorName;
|
||||
|
||||
@ApiModelProperty(value = "项目负责人电话")
|
||||
private java.lang.String projectDirectorPhone;
|
||||
|
||||
///////////////////////////////下面自己添加属性//////////////////////////////////////
|
||||
|
||||
@ApiModelProperty(value = "项目编号")
|
||||
private String projectNumber;
|
||||
|
||||
}
|
||||
@ -1,10 +1,12 @@
|
||||
package com.zhgd.xmgl.modules.worker.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.base.CompanyVo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.xmgl.modules.worker.entity.SjEnterpriseInfo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -34,4 +36,11 @@ public interface IEnterpriseInfoService extends IService<EnterpriseInfo> {
|
||||
JSONArray selectHierarchyEnterpriseList(Map<String, Object> map);
|
||||
|
||||
Map<String, Object> modCompany(CompanyVo companyVo);
|
||||
|
||||
|
||||
Result addSj(SjEnterpriseInfo enterpriseInfo);
|
||||
|
||||
Result editSj(SjEnterpriseInfo enterpriseInfo);
|
||||
|
||||
Result deleteSj(SjEnterpriseInfo enterpriseInfo);
|
||||
}
|
||||
|
||||
@ -2,25 +2,31 @@ package com.zhgd.xmgl.modules.worker.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.async.AsyncWorker;
|
||||
import com.zhgd.xmgl.base.CompanyVo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
|
||||
import com.zhgd.xmgl.modules.project.entity.Project;
|
||||
import com.zhgd.xmgl.modules.project.entity.ProjectEnterprise;
|
||||
import com.zhgd.xmgl.modules.project.mapper.ProjectEnterpriseMapper;
|
||||
import com.zhgd.xmgl.modules.project.mapper.ProjectMapper;
|
||||
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.SjEnterpriseInfo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.TeamInfo;
|
||||
import com.zhgd.xmgl.modules.worker.mapper.EnterpriseInfoMapper;
|
||||
import com.zhgd.xmgl.modules.project.mapper.ProjectEnterpriseMapper;
|
||||
import com.zhgd.xmgl.modules.worker.mapper.TeamInfoMapper;
|
||||
import com.zhgd.xmgl.modules.worker.service.IEnterpriseInfoService;
|
||||
import com.zhgd.xmgl.util.ListUtils;
|
||||
import com.zhgd.xmgl.util.MessageUtil;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
@ -31,12 +37,14 @@ import java.util.UUID;
|
||||
/**
|
||||
* @Description: 劳务公司
|
||||
* @author: pds
|
||||
* @date: 2020-08-13
|
||||
* @date: 2020-08-13
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper, EnterpriseInfo> implements IEnterpriseInfoService {
|
||||
@Autowired
|
||||
ProjectMapper projectMapper;
|
||||
@Autowired
|
||||
private EnterpriseInfoMapper enterpriseInfoMapper;
|
||||
@Autowired
|
||||
@ -53,24 +61,24 @@ public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper,
|
||||
|
||||
@Override
|
||||
public EnterpriseInfo saveEnterpriseInfo(EnterpriseInfo enterpriseInfo) {
|
||||
QueryWrapper<EnterpriseInfo> queryWrapper=new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(EnterpriseInfo::getSocialCode,enterpriseInfo.getSocialCode());
|
||||
EnterpriseInfo tempEnterpriseInfo=enterpriseInfoMapper.selectOne(queryWrapper);
|
||||
if(enterpriseInfo.getParentEnterpriseId()==null){
|
||||
QueryWrapper<EnterpriseInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(EnterpriseInfo::getSocialCode, enterpriseInfo.getSocialCode());
|
||||
EnterpriseInfo tempEnterpriseInfo = enterpriseInfoMapper.selectOne(queryWrapper);
|
||||
if (enterpriseInfo.getParentEnterpriseId() == null) {
|
||||
enterpriseInfo.setParentEnterpriseId(0L);
|
||||
}
|
||||
ProjectEnterprise projectEnterprise=new ProjectEnterprise();
|
||||
if(tempEnterpriseInfo!=null){
|
||||
QueryWrapper<ProjectEnterprise> queryWrapper1=new QueryWrapper<>();
|
||||
ProjectEnterprise projectEnterprise = new ProjectEnterprise();
|
||||
if (tempEnterpriseInfo != null) {
|
||||
QueryWrapper<ProjectEnterprise> queryWrapper1 = new QueryWrapper<>();
|
||||
queryWrapper1.lambda().eq(ProjectEnterprise::getEnterpriseId, tempEnterpriseInfo.getId())
|
||||
.eq(ProjectEnterprise::getProjectSn,enterpriseInfo.getProjectSn());
|
||||
int count=projectEnterpriseMapper.selectCount(queryWrapper1);
|
||||
if(count>0){
|
||||
.eq(ProjectEnterprise::getProjectSn, enterpriseInfo.getProjectSn());
|
||||
int count = projectEnterpriseMapper.selectCount(queryWrapper1);
|
||||
if (count > 0) {
|
||||
throw new OpenAlertException(MessageUtil.get("existsEnterpriseErr"));
|
||||
}
|
||||
enterpriseInfo.setId(tempEnterpriseInfo.getId());
|
||||
enterpriseInfoMapper.updateById(enterpriseInfo);
|
||||
}else {
|
||||
} else {
|
||||
String uuid = UUID.randomUUID().toString().replace("-", "").toUpperCase();
|
||||
enterpriseInfo.setEnterpriseSn(uuid);
|
||||
enterpriseInfoMapper.insert(enterpriseInfo);
|
||||
@ -97,18 +105,18 @@ public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper,
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void removeEnterpriseInfo(Map<String, Object> map) {
|
||||
QueryWrapper<TeamInfo> wrapper=new QueryWrapper<>();
|
||||
wrapper.lambda().eq(TeamInfo::getEnterpriseId,MapUtils.getString(map,"enterpriseId"))
|
||||
.eq(TeamInfo::getProjectSn,MapUtils.getString(map,"projectSn"));
|
||||
int count=teamInfoMapper.selectCount(wrapper);
|
||||
if(count>0){
|
||||
QueryWrapper<TeamInfo> wrapper = new QueryWrapper<>();
|
||||
wrapper.lambda().eq(TeamInfo::getEnterpriseId, MapUtils.getString(map, "enterpriseId"))
|
||||
.eq(TeamInfo::getProjectSn, MapUtils.getString(map, "projectSn"));
|
||||
int count = teamInfoMapper.selectCount(wrapper);
|
||||
if (count > 0) {
|
||||
throw new OpenAlertException(MessageUtil.get("notDeleteEnterpriseErr"));
|
||||
}
|
||||
QueryWrapper<ProjectEnterprise> queryWrapper=new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(ProjectEnterprise::getEnterpriseId, MapUtils.getString(map,"enterpriseId"))
|
||||
.eq(ProjectEnterprise::getProjectSn,MapUtils.getString(map,"projectSn"));
|
||||
ProjectEnterprise projectEnterprise=projectEnterpriseMapper.selectOne(queryWrapper);
|
||||
if(projectEnterprise!=null){
|
||||
QueryWrapper<ProjectEnterprise> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(ProjectEnterprise::getEnterpriseId, MapUtils.getString(map, "enterpriseId"))
|
||||
.eq(ProjectEnterprise::getProjectSn, MapUtils.getString(map, "projectSn"));
|
||||
ProjectEnterprise projectEnterprise = projectEnterpriseMapper.selectOne(queryWrapper);
|
||||
if (projectEnterprise != null) {
|
||||
//projectEnterpriseMapper.delete(queryWrapper);
|
||||
projectEnterpriseMapper.deleteById(projectEnterprise.getId());
|
||||
asyncWorker.removeEnterpriseInfo(projectEnterprise);
|
||||
@ -124,33 +132,33 @@ public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper,
|
||||
|
||||
@Override
|
||||
public EnterpriseInfo updateEnterpriseInfo(EnterpriseInfo enterpriseInfo) {
|
||||
QueryWrapper<EnterpriseInfo> queryWrapper=new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(EnterpriseInfo::getSocialCode,enterpriseInfo.getSocialCode())
|
||||
.ne(EnterpriseInfo::getId,enterpriseInfo.getId());
|
||||
int count=enterpriseInfoMapper.selectCount(queryWrapper);
|
||||
if(count>0){
|
||||
QueryWrapper<EnterpriseInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(EnterpriseInfo::getSocialCode, enterpriseInfo.getSocialCode())
|
||||
.ne(EnterpriseInfo::getId, enterpriseInfo.getId());
|
||||
int count = enterpriseInfoMapper.selectCount(queryWrapper);
|
||||
if (count > 0) {
|
||||
throw new OpenAlertException(MessageUtil.get("existsEnterpriseSocialCodeErr"));
|
||||
}
|
||||
//企业如果选择有父级时候,需要排除企业和父级企业存在相互绑定的情况
|
||||
if(enterpriseInfo.getParentEnterpriseId()!=null){
|
||||
QueryWrapper<ProjectEnterprise> qu=new QueryWrapper<>();
|
||||
if (enterpriseInfo.getParentEnterpriseId() != null) {
|
||||
QueryWrapper<ProjectEnterprise> qu = new QueryWrapper<>();
|
||||
qu.lambda().eq(ProjectEnterprise::getEnterpriseId, enterpriseInfo.getParentEnterpriseId())
|
||||
.eq(ProjectEnterprise::getParentEnterpriseId, enterpriseInfo.getId())
|
||||
.eq(ProjectEnterprise::getProjectSn,enterpriseInfo.getProjectSn());
|
||||
int count1=projectEnterpriseMapper.selectCount(qu);
|
||||
if(count1>0){
|
||||
.eq(ProjectEnterprise::getProjectSn, enterpriseInfo.getProjectSn());
|
||||
int count1 = projectEnterpriseMapper.selectCount(qu);
|
||||
if (count1 > 0) {
|
||||
throw new OpenAlertException(MessageUtil.get("enterpriseBoundErr"));
|
||||
}
|
||||
}
|
||||
if(enterpriseInfo.getParentEnterpriseId()==null){
|
||||
if (enterpriseInfo.getParentEnterpriseId() == null) {
|
||||
enterpriseInfo.setParentEnterpriseId(0L);
|
||||
}
|
||||
enterpriseInfoMapper.updateById(enterpriseInfo);
|
||||
//保存企业和项目关联记录
|
||||
QueryWrapper<ProjectEnterprise> queryWrapper1=new QueryWrapper<>();
|
||||
QueryWrapper<ProjectEnterprise> queryWrapper1 = new QueryWrapper<>();
|
||||
queryWrapper1.lambda().eq(ProjectEnterprise::getEnterpriseId, enterpriseInfo.getId())
|
||||
.eq(ProjectEnterprise::getProjectSn,enterpriseInfo.getProjectSn());
|
||||
ProjectEnterprise projectEnterpris=projectEnterpriseMapper.selectOne(queryWrapper1);
|
||||
.eq(ProjectEnterprise::getProjectSn, enterpriseInfo.getProjectSn());
|
||||
ProjectEnterprise projectEnterpris = projectEnterpriseMapper.selectOne(queryWrapper1);
|
||||
projectEnterpris.setEnterpriseTypeId(enterpriseInfo.getEnterpriseTypeId());
|
||||
projectEnterpris.setParentEnterpriseId(enterpriseInfo.getParentEnterpriseId());
|
||||
projectEnterpris.setProjectDirectorName(enterpriseInfo.getProjectDirectorName());
|
||||
@ -171,15 +179,15 @@ public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper,
|
||||
|
||||
@Override
|
||||
public JSONArray selectHierarchyEnterpriseList(Map<String, Object> map) {
|
||||
List<EntityMap> list=enterpriseInfoMapper.getEnterpriseInfoList(map);
|
||||
JSONArray result = ListUtils.listToTree(JSONArray.parseArray(JSON.toJSONString(list)),"id","parentEnterpriseId","children");
|
||||
List<EntityMap> list = enterpriseInfoMapper.getEnterpriseInfoList(map);
|
||||
JSONArray result = ListUtils.listToTree(JSONArray.parseArray(JSON.toJSONString(list)), "id", "parentEnterpriseId", "children");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> modCompany(CompanyVo companyVo) {
|
||||
Map<String, Object> resultMap=new HashMap<>();
|
||||
EnterpriseInfo enterpriseInfo=new EnterpriseInfo();
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
EnterpriseInfo enterpriseInfo = new EnterpriseInfo();
|
||||
enterpriseInfo.setSocialCode(companyVo.getSocialCode());
|
||||
enterpriseInfo.setEnterpriseName(companyVo.getCompanyName());
|
||||
enterpriseInfo.setEnterpriseLegalPerson(companyVo.getCompanyLegalPerson());
|
||||
@ -192,20 +200,100 @@ public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper,
|
||||
enterpriseInfo.setQualificationNumber(companyVo.getQualificationNumber());
|
||||
enterpriseInfo.setEnterpriseQualificationUrl(companyVo.getCompanyQualificationUrl());
|
||||
enterpriseInfo.setBusinessLicenseEndDate(companyVo.getBusinessLicenseEndDate());
|
||||
QueryWrapper<EnterpriseInfo> queryWrapper=new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(EnterpriseInfo::getSocialCode,enterpriseInfo.getSocialCode());
|
||||
EnterpriseInfo tempEnterpriseInfo=enterpriseInfoMapper.selectOne(queryWrapper);
|
||||
if(tempEnterpriseInfo!=null){
|
||||
QueryWrapper<EnterpriseInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(EnterpriseInfo::getSocialCode, enterpriseInfo.getSocialCode());
|
||||
EnterpriseInfo tempEnterpriseInfo = enterpriseInfoMapper.selectOne(queryWrapper);
|
||||
if (tempEnterpriseInfo != null) {
|
||||
enterpriseInfo.setId(tempEnterpriseInfo.getId());
|
||||
enterpriseInfoMapper.updateById(enterpriseInfo);
|
||||
}else {
|
||||
} else {
|
||||
enterpriseInfo.setParentEnterpriseId(0L);
|
||||
String uuid = UUID.randomUUID().toString().replace("-", "").toUpperCase();
|
||||
enterpriseInfo.setEnterpriseSn(uuid);
|
||||
enterpriseInfoMapper.insert(enterpriseInfo);
|
||||
}
|
||||
resultMap.put("msg","操作成功");
|
||||
resultMap.put("status","1");
|
||||
resultMap.put("msg", "操作成功");
|
||||
resultMap.put("status", "1");
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result addSj(SjEnterpriseInfo e) {
|
||||
EnterpriseInfo ei = getEnterpriseInfo(e);
|
||||
saveEnterpriseInfo(ei);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result editSj(SjEnterpriseInfo e) {
|
||||
EnterpriseInfo ei = getEnterpriseInfo(e);
|
||||
updateEnterpriseInfo(ei);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result deleteSj(SjEnterpriseInfo enterpriseInfo) {
|
||||
if (StringUtils.isBlank(enterpriseInfo.getProjectNumber()) || enterpriseInfo.getId() == null) {
|
||||
return Result.error("项目编号projectNumber和企业id都不能为空");
|
||||
}
|
||||
String projectSn = getProjectSn(enterpriseInfo.getProjectNumber());
|
||||
List<ProjectEnterprise> projectEnterprises = projectEnterpriseMapper.selectList(new LambdaQueryWrapper<ProjectEnterprise>()
|
||||
.eq(ProjectEnterprise::getEnterpriseId, enterpriseInfo.getId())
|
||||
.eq(ProjectEnterprise::getProjectSn, projectSn));
|
||||
if (CollectionUtils.isNotEmpty(projectEnterprises)) {
|
||||
for (ProjectEnterprise projectEnterprise : projectEnterprises) {
|
||||
if (projectEnterprise != null) {
|
||||
projectEnterpriseMapper.deleteById(projectEnterprise.getId());
|
||||
asyncWorker.removeEnterpriseInfo(projectEnterprise);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
private EnterpriseInfo getEnterpriseInfo(SjEnterpriseInfo e) {
|
||||
EnterpriseInfo enterpriseInfo = new EnterpriseInfo();
|
||||
enterpriseInfo.setId(e.getId());
|
||||
enterpriseInfo.setEnterpriseName(e.getEnterpriseName());
|
||||
enterpriseInfo.setDescription(e.getDescription());
|
||||
enterpriseInfo.setEnterpriseAddress(e.getEnterpriseAddress());
|
||||
enterpriseInfo.setEnterpriseLegalPerson(e.getEnterpriseLegalPerson());
|
||||
enterpriseInfo.setLegalPersonIdCard(e.getLegalPersonIdCard());
|
||||
enterpriseInfo.setEnterpriseSafeAllow(e.getEnterpriseSafeAllow());
|
||||
enterpriseInfo.setEnterpriseProperty(e.getEnterpriseProperty());
|
||||
enterpriseInfo.setLegalPersonTel(e.getLegalPersonTel());
|
||||
enterpriseInfo.setSocialCode(e.getSocialCode());
|
||||
enterpriseInfo.setBusinessNumber(e.getBusinessNumber());
|
||||
enterpriseInfo.setQualificationNumber(e.getQualificationNumber());
|
||||
enterpriseInfo.setEnterpriseEmail(e.getEnterpriseEmail());
|
||||
enterpriseInfo.setRegisteredCapital(e.getRegisteredCapital());
|
||||
enterpriseInfo.setBankname(e.getBankname());
|
||||
enterpriseInfo.setBankcardnumber(e.getBankcardnumber());
|
||||
enterpriseInfo.setBankcode(e.getBankcode());
|
||||
enterpriseInfo.setEnterpriseQualificationUrl(e.getEnterpriseQualificationUrl());
|
||||
enterpriseInfo.setBusinessLicenseEndDate(e.getBusinessLicenseEndDate());
|
||||
enterpriseInfo.setRegisterPersonName(e.getRegisterPersonName());
|
||||
enterpriseInfo.setRegisterPersonPhoneTel(e.getRegisterPersonPhoneTel());
|
||||
enterpriseInfo.setEnterpriseSn(e.getEnterpriseSn());
|
||||
enterpriseInfo.setLogo(e.getLogo());
|
||||
enterpriseInfo.setRegistDate(e.getRegistDate());
|
||||
enterpriseInfo.setBusinessLicenseUrl(e.getBusinessLicenseUrl());
|
||||
enterpriseInfo.setEnterpriseTypeId(e.getEnterpriseTypeId());
|
||||
enterpriseInfo.setParentEnterpriseId(e.getParentEnterpriseId());
|
||||
enterpriseInfo.setEnterpriseTypeName(e.getEnterpriseTypeName());
|
||||
enterpriseInfo.setProjectSn(getProjectSn(e.getProjectNumber()));
|
||||
enterpriseInfo.setType(1);
|
||||
enterpriseInfo.setProjectDirectorName(e.getProjectDirectorName());
|
||||
enterpriseInfo.setProjectDirectorPhone(e.getProjectDirectorPhone());
|
||||
enterpriseInfo.setDepartmentType(1);
|
||||
return enterpriseInfo;
|
||||
}
|
||||
|
||||
private String getProjectSn(String projectNumber) {
|
||||
if (StringUtils.isBlank(projectNumber)) {
|
||||
return null;
|
||||
}
|
||||
Project project = projectMapper.selectOne(new LambdaQueryWrapper<Project>().eq(Project::getProjectNumber, projectNumber));
|
||||
return project == null ? null : project.getProjectSn();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user