三江-业务中台接收合作单位接口

This commit is contained in:
Administrator 2023-04-15 11:25:21 +08:00
parent ec18d6b193
commit 810140b6da
4 changed files with 473 additions and 148 deletions

View File

@ -5,6 +5,7 @@ import com.zhgd.annotation.OperLog;
import com.zhgd.jeecg.common.api.vo.Result; import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.mybatis.EntityMap; import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo; 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 com.zhgd.xmgl.modules.worker.service.IEnterpriseInfoService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
@ -38,6 +39,7 @@ public class EnterpriseInfoController {
/** /**
* 分页列表查询 * 分页列表查询
*
* @return * @return
*/ */
@ApiOperation(value = " 列表查询劳务公司信息", notes = "列表查询劳务公司信息", httpMethod = "POST") @ApiOperation(value = " 列表查询劳务公司信息", notes = "列表查询劳务公司信息", httpMethod = "POST")
@ -63,8 +65,10 @@ public class EnterpriseInfoController {
public Result<JSONArray> selectHierarchyEnterpriseList(@RequestBody Map<String, Object> map) { public Result<JSONArray> selectHierarchyEnterpriseList(@RequestBody Map<String, Object> map) {
return Result.success(enterpriseInfoService.selectHierarchyEnterpriseList(map)); return Result.success(enterpriseInfoService.selectHierarchyEnterpriseList(map));
} }
/** /**
* 添加 * 添加
*
* @param enterpriseInfo * @param enterpriseInfo
* @return * @return
*/ */
@ -76,8 +80,22 @@ public class EnterpriseInfoController {
return Result.ok(); 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 * @param enterpriseInfo
* @return * @return
*/ */
@ -90,10 +108,18 @@ public class EnterpriseInfoController {
} }
/** /**
* 通过id删除 * 三江业务中台编辑合作单位
* @param *
* @param enterpriseInfo
* @return * @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 = "删除劳务公司") @OperLog(operModul = "劳务管理", operType = "删除劳务公司", operDesc = "删除劳务公司")
@ApiOperation(value = "删除劳务公司信息", notes = "删除劳务公司信息", httpMethod = "POST") @ApiOperation(value = "删除劳务公司信息", notes = "删除劳务公司信息", httpMethod = "POST")
@ApiImplicitParams({ @ApiImplicitParams({
@ -106,10 +132,23 @@ public class EnterpriseInfoController {
return Result.ok(); 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);
}
/** /**
* 通过id查询 * 通过id查询
*
* @param * @param
* @return * @return
*/ */

View File

@ -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;
}

View File

@ -1,10 +1,12 @@
package com.zhgd.xmgl.modules.worker.service; package com.zhgd.xmgl.modules.worker.service;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.mybatis.EntityMap; import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.base.CompanyVo; import com.zhgd.xmgl.base.CompanyVo;
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo; import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.xmgl.modules.worker.entity.SjEnterpriseInfo;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -34,4 +36,11 @@ public interface IEnterpriseInfoService extends IService<EnterpriseInfo> {
JSONArray selectHierarchyEnterpriseList(Map<String, Object> map); JSONArray selectHierarchyEnterpriseList(Map<String, Object> map);
Map<String, Object> modCompany(CompanyVo companyVo); Map<String, Object> modCompany(CompanyVo companyVo);
Result addSj(SjEnterpriseInfo enterpriseInfo);
Result editSj(SjEnterpriseInfo enterpriseInfo);
Result deleteSj(SjEnterpriseInfo enterpriseInfo);
} }

View File

@ -2,25 +2,31 @@ package com.zhgd.xmgl.modules.worker.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; 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.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.execption.OpenAlertException;
import com.zhgd.jeecg.common.mybatis.EntityMap; import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.async.AsyncWorker; import com.zhgd.xmgl.async.AsyncWorker;
import com.zhgd.xmgl.base.CompanyVo; 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.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.entity.TeamInfo;
import com.zhgd.xmgl.modules.worker.mapper.EnterpriseInfoMapper; 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.mapper.TeamInfoMapper;
import com.zhgd.xmgl.modules.worker.service.IEnterpriseInfoService; import com.zhgd.xmgl.modules.worker.service.IEnterpriseInfoService;
import com.zhgd.xmgl.util.ListUtils; import com.zhgd.xmgl.util.ListUtils;
import com.zhgd.xmgl.util.MessageUtil; import com.zhgd.xmgl.util.MessageUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap; import java.util.HashMap;
@ -37,6 +43,8 @@ import java.util.UUID;
@Service @Service
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper, EnterpriseInfo> implements IEnterpriseInfoService { public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper, EnterpriseInfo> implements IEnterpriseInfoService {
@Autowired
ProjectMapper projectMapper;
@Autowired @Autowired
private EnterpriseInfoMapper enterpriseInfoMapper; private EnterpriseInfoMapper enterpriseInfoMapper;
@Autowired @Autowired
@ -208,4 +216,84 @@ public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper,
resultMap.put("status", "1"); resultMap.put("status", "1");
return resultMap; 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();
}
} }