Commit 27b05f6e authored by huyuchen's avatar huyuchen

优化修改

parent 3cc0796a
...@@ -46,4 +46,6 @@ public class UpProjectSocialFundVo implements Serializable { ...@@ -46,4 +46,6 @@ public class UpProjectSocialFundVo implements Serializable {
String mobile; String mobile;
//是否同步终止合同、减项、减档 0 是 1 否 //是否同步终止合同、减项、减档 0 是 1 否
String changeContractAndEmployee; String changeContractAndEmployee;
String userName;
String userId;
} }
...@@ -771,10 +771,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -771,10 +771,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
TEmployeeProject tEmployeeProjectOld = tEmployeeProjectService.getById(tEmployeeProject.getId()); TEmployeeProject tEmployeeProjectOld = tEmployeeProjectService.getById(tEmployeeProject.getId());
tEmployeeProject.setContractStatus(CommonConstants.TWO_INT); tEmployeeProject.setContractStatus(CommonConstants.TWO_INT);
//如果该项目仍有社保、公积金的数据不同步减项,如正常减项,记录项目档案操作记录 //如果该项目仍有社保、公积金的数据不同步减项,如正常减项,记录项目档案操作记录
if (tEmployeeProject.getSocialStatus() == CommonConstants.ZERO_INT if ((tEmployeeProject.getSocialStatus() == CommonConstants.ZERO_INT
|| tEmployeeProject.getSocialStatus() == CommonConstants.FOUR_INT || tEmployeeProject.getSocialStatus() == CommonConstants.FOUR_INT)
|| tEmployeeProject.getFundStatus() == CommonConstants.ZERO_INT && (tEmployeeProject.getFundStatus() == CommonConstants.ZERO_INT
|| tEmployeeProject.getFundStatus() == CommonConstants.FOUR_INT) { || tEmployeeProject.getFundStatus() == CommonConstants.FOUR_INT)) {
tEmployeeProject.setProjectStatus(CommonConstants.ONE_INT); tEmployeeProject.setProjectStatus(CommonConstants.ONE_INT);
tEmployeeProject.setLeaveRemark("终止合同联动减项"); tEmployeeProject.setLeaveRemark("终止合同联动减项");
tEmployeeProject.setLeaveTime(LocalDateTime.now()); tEmployeeProject.setLeaveTime(LocalDateTime.now());
......
...@@ -37,10 +37,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpEducationMapper; ...@@ -37,10 +37,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpEducationMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TBusinessEmployeeExtendInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService;
import com.yifu.cloud.plus.v1.yifu.archives.utils.DoJointTask; import com.yifu.cloud.plus.v1.yifu.archives.utils.DoJointTask;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*; import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
...@@ -108,6 +105,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -108,6 +105,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Lazy @Lazy
private DoJointTask doJointTask; private DoJointTask doJointTask;
@Autowired
private TWorkHandlerInfoService workHandlerInfoService;
@Autowired
private TEmployeeContractAuditService tEmployeeContractAuditService;
@Override @Override
public R addCheck(TEmployeeProject tEmployeeProject) { public R addCheck(TEmployeeProject tEmployeeProject) {
...@@ -1382,47 +1385,143 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -1382,47 +1385,143 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if (Common.isEmpty(vo) || Common.isEmpty(vo.getEmpIdCard()) || Common.isEmpty(vo.getDepartNo())){ if (Common.isEmpty(vo) || Common.isEmpty(vo.getEmpIdCard()) || Common.isEmpty(vo.getDepartNo())){
return false; return false;
} }
TEmployeeInfo employee = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda() //是否同步终止合同、减项、减档为是的时候 单独写逻辑
.eq(TEmployeeInfo::getEmpIdcard,vo.getEmpIdCard()) if (Common.isNotNull(vo.getChangeContractAndEmployee())) {
.eq(TEmployeeInfo::getDeleteFlag,CommonConstants.ZERO_STRING).last(CommonConstants.LAST_ONE_SQL)); List<TEmployeeContractInfo> contractInfoList;
// : 0 无社保|无公积金 1 处理中 2.部分购买 3.正常 4.已派减 List<TEmployeeContractInfo> contractInfoListZt;
if (Common.isNotNull(employee)){ //同步任务处理清单执行详情
if (Common.isNotNull(vo.getSocialStatus())){ StringBuilder workInfo = new StringBuilder();
employee.setSocialStatus(Integer.parseInt(vo.getSocialStatus())); StringBuilder failueInfo = new StringBuilder();
} workInfo.append("合同终止成功,");
if (Common.isNotNull(vo.getFundStatus())){ //该项目下其他在用的合同统一更新成不在用
employee.setFundStatus(Integer.parseInt(vo.getFundStatus())); contractInfoList = contractInfoMapper.selectList(Wrappers.<TEmployeeContractInfo>query()
} .lambda().eq(TEmployeeContractInfo::getDeptNo, vo.getDepartNo())
if (Common.isNotNull(vo.getFileProvince())){ .eq(TEmployeeContractInfo::getEmpIdcard, vo.getEmpIdCard())
employee.setFileProvince(Integer.parseInt(vo.getFileProvince())); .eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT));
if (Common.isNotNull(contractInfoList)) {
for (TEmployeeContractInfo contractInfo1 : contractInfoList) {
contractInfo1.setInUse(CommonConstants.ONE_STRING);
contractInfoMapper.updateById(contractInfo1);
//增加审核记录
this.setAuditInfoNew(contractInfo1, CommonConstants.ZERO_STRING);
}
} }
if (Common.isNotNull(vo.getFileCity())){ //在途的合同更新为审核不通过
employee.setFileCity(Integer.parseInt(vo.getFileCity())); contractInfoListZt = contractInfoMapper.selectList(Wrappers.<TEmployeeContractInfo>query()
if (Common.isNotNull(vo.getFileTown())){ .lambda().eq(TEmployeeContractInfo::getEmpIdcard, vo.getEmpIdCard())
employee.setFileTown(Integer.parseInt(vo.getFileTown())); .eq(TEmployeeContractInfo::getDeptNo, vo.getDepartNo())
}else { .eq(TEmployeeContractInfo::getAuditStatus, CommonConstants.ZERO_INT)
employee.setFileTown(null); .eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT));
if (Common.isNotNull(contractInfoListZt)) {
for (TEmployeeContractInfo contractInfo1 : contractInfoListZt) {
contractInfo1.setAuditStatus(CommonConstants.THREE_INT);
contractInfoMapper.updateById(contractInfo1);
//增加审核记录
this.setAuditInfoNew(contractInfo1, CommonConstants.ONE_STRING);
} }
} }
if (Common.isNotNull(vo.getMobile())){ //项目档案处理
employee.setEmpPhone(vo.getMobile()); TEmployeeProject tEmployeeProject = baseMapper.selectOne(Wrappers.<TEmployeeProject>query()
.lambda().eq(TEmployeeProject::getEmpIdcard, vo.getEmpIdCard())
.eq(TEmployeeProject::getDeptNo, vo.getDepartNo())
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT)
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.last(CommonConstants.LAST_ONE_SQL));
if (null != tEmployeeProject) {
TEmployeeProject tEmployeeProjectOld = baseMapper.selectById(tEmployeeProject.getId());
tEmployeeProject.setContractStatus(CommonConstants.TWO_INT);
//如果该项目仍有社保、公积金的数据不同步减项,如正常减项,记录项目档案操作记录
if ((tEmployeeProject.getSocialStatus() == CommonConstants.ZERO_INT
|| tEmployeeProject.getSocialStatus() == CommonConstants.FOUR_INT) &&
(tEmployeeProject.getFundStatus() == CommonConstants.ZERO_INT
|| tEmployeeProject.getFundStatus() == CommonConstants.FOUR_INT)) {
tEmployeeProject.setProjectStatus(CommonConstants.ONE_INT);
tEmployeeProject.setLeaveRemark("终止合同联动减项");
tEmployeeProject.setLeaveTime(LocalDateTime.now());
workInfo.append("减项成功,");
} else {
failueInfo.append("存在社保/公积金,无法减项");
}
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "",
tEmployeeProject.getId(), tEmployeeProjectOld, tEmployeeProject);
baseMapper.updateById(tEmployeeProject);
//如果项目档案已减项,如果人员存在多个项目不处理,反之则减档
if (tEmployeeProject.getProjectStatus() == CommonConstants.ONE_INT) {
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId());
if (Common.isNotNull(tEmployeeInfo) && tEmployeeInfo.getProjectNum() == CommonConstants.ONE_INT) {
//减档
TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeInfo.getId());
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeInfo.setLeaveRemark(tEmployeeProject.getLeaveRemark());
tEmployeeInfo.setLeaveTime(DateUtil.getCurrentDateTime());
tEmployeeInfo.setLeaveUser(vo.getUserId());
tEmployeeInfo.setLeaveUserName(vo.getUserName());
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], tEmployeeInfo.getId(),
"", tEmployeeInfoOld, tEmployeeInfo);
workInfo.append("减档成功,");
tEmployeeInfoMapper.updateById(tEmployeeInfo);
} else {
failueInfo.append("存在其他项目,无法减档");
}
}
} }
tEmployeeInfoMapper.updateSocialInfoById(employee); //增加任务处理情况查询表数据
} TWorkHandlerInfo handlerInfo = new TWorkHandlerInfo();
TEmployeeProject project = baseMapper.selectOne(Wrappers.<TEmployeeProject>query().lambda() handlerInfo.setEmpIdcard(vo.getEmpIdCard());
.eq(TEmployeeProject::getDeptNo,vo.getDepartNo()) handlerInfo.setEmpName(null == tEmployeeProject.getEmpName() ? "" : tEmployeeProject.getEmpName());
.eq(TEmployeeProject::getEmpIdcard,vo.getEmpIdCard()) handlerInfo.setDepartName(null == tEmployeeProject.getDeptName() ? "" : tEmployeeProject.getDeptName());
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.ZERO_STRING) handlerInfo.setDepartNo(vo.getDepartNo());
.last(CommonConstants.LAST_ONE_SQL)); handlerInfo.setInfoFrom("合同终止");
// : 0 无社保|无公积金 1 处理中 2.部分购买 3.正常 4.已派减 handlerInfo.setOperInfo(workInfo.substring(0, workInfo.length() - 1));
if (Common.isNotNull(project)){ handlerInfo.setReason(failueInfo.length() > 1 ? failueInfo.toString() : "");
if (Common.isNotNull(vo.getSocialStatus())){ handlerInfo.setOperResult(failueInfo.length() > 1 ? "1" : "2");
project.setSocialStatus(Integer.parseInt(vo.getSocialStatus())); handlerInfo.setOperUser(vo.getUserName());
handlerInfo.setOperTime(LocalDateTime.now());
workHandlerInfoService.save(handlerInfo);
}else {
TEmployeeInfo employee = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard, vo.getEmpIdCard())
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.ZERO_STRING).last(CommonConstants.LAST_ONE_SQL));
// : 0 无社保|无公积金 1 处理中 2.部分购买 3.正常 4.已派减
if (Common.isNotNull(employee)) {
if (Common.isNotNull(vo.getSocialStatus())) {
employee.setSocialStatus(Integer.parseInt(vo.getSocialStatus()));
}
if (Common.isNotNull(vo.getFundStatus())) {
employee.setFundStatus(Integer.parseInt(vo.getFundStatus()));
}
if (Common.isNotNull(vo.getFileProvince())) {
employee.setFileProvince(Integer.parseInt(vo.getFileProvince()));
}
if (Common.isNotNull(vo.getFileCity())) {
employee.setFileCity(Integer.parseInt(vo.getFileCity()));
if (Common.isNotNull(vo.getFileTown())) {
employee.setFileTown(Integer.parseInt(vo.getFileTown()));
} else {
employee.setFileTown(null);
}
}
if (Common.isNotNull(vo.getMobile())) {
employee.setEmpPhone(vo.getMobile());
}
tEmployeeInfoMapper.updateSocialInfoById(employee);
} }
if (Common.isNotNull(vo.getFundStatus())){ TEmployeeProject project = baseMapper.selectOne(Wrappers.<TEmployeeProject>query().lambda()
project.setFundStatus(Integer.parseInt(vo.getFundStatus())); .eq(TEmployeeProject::getDeptNo, vo.getDepartNo())
.eq(TEmployeeProject::getEmpIdcard, vo.getEmpIdCard())
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
// : 0 无社保|无公积金 1 处理中 2.部分购买 3.正常 4.已派减
if (Common.isNotNull(project)) {
if (Common.isNotNull(vo.getSocialStatus())) {
project.setSocialStatus(Integer.parseInt(vo.getSocialStatus()));
}
if (Common.isNotNull(vo.getFundStatus())) {
project.setFundStatus(Integer.parseInt(vo.getFundStatus()));
}
baseMapper.updateSocialAndFundStatusById(project);
} }
baseMapper.updateSocialAndFundStatusById(project);
} }
return true; return true;
} }
...@@ -1725,4 +1824,21 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -1725,4 +1824,21 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
public void updateContractStatus(String empId, int status) { public void updateContractStatus(String empId, int status) {
baseMapper.updateContractStatus(empId,status); baseMapper.updateContractStatus(empId,status);
} }
/**
* @param tEmployeeContractInfo
* @Description: 保存审核操作记录
* @Author: huyc
* @Date: 2023/6/16 10:16
* @return: void
**/
private void setAuditInfoNew(TEmployeeContractInfo tEmployeeContractInfo,String flag) {
TEmployeeContractAudit audit = new TEmployeeContractAudit();
audit.setRootName("合同审核");
audit.setAuditStatus(CommonConstants.ZERO_STRING.equals(flag) ? "审核通过" : "审核不通过");
audit.setRemark("终止合同联动");
audit.setLinkId(tEmployeeContractInfo.getId());
audit.setLinkType(CommonConstants.ONE_INT);
tEmployeeContractAuditService.save(audit);
}
} }
...@@ -3929,6 +3929,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -3929,6 +3929,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
//派减审核通过才会处理合同档案状态 //派减审核通过才会处理合同档案状态
if (CommonConstants.ONE_INT == flag) { if (CommonConstants.ONE_INT == flag) {
vo.setChangeContractAndEmployee(dis.getChangeContractAndEmployee()); vo.setChangeContractAndEmployee(dis.getChangeContractAndEmployee());
vo.setUserId(user.getId());
vo.setUserName(user.getNickname());
} }
R<Boolean> resUp = archivesDaprUtil.updateProjectSocialFund(vo); R<Boolean> resUp = archivesDaprUtil.updateProjectSocialFund(vo);
if (Common.isEmpty(resUp) || !(CommonConstants.SUCCESS.intValue() == resUp.getCode()) || !resUp.getData().booleanValue()){ if (Common.isEmpty(resUp) || !(CommonConstants.SUCCESS.intValue() == resUp.getCode()) || !resUp.getData().booleanValue()){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment