Commit bc75a10c authored by huyuchen's avatar huyuchen

优化修改

parent 89715d2e
...@@ -1452,21 +1452,36 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -1452,21 +1452,36 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
baseMapper.updateById(tEmployeeProject); baseMapper.updateById(tEmployeeProject);
//如果项目档案已减项,如果人员存在多个项目不处理,反之则减档 //如果项目档案已减项,如果人员存在多个项目不处理,反之则减档
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId()); TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId());
if (tEmployeeProject.getProjectStatus() == CommonConstants.ONE_INT && Common.isNotNull(tEmployeeInfo)) { if (Common.isNotNull(tEmployeeInfo)) {
TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeInfo.getId()); TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeInfo.getId());
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum() - CommonConstants.ONE_INT); // 判断人员有无审核通过的其他合同
tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT); TEmployeeContractInfo contractInfoInUse = contractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query()
//减项成功把人员档案现存项目数减一 .lambda().eq(TEmployeeContractInfo::getEmpIdcard, vo.getEmpIdCard())
if (tEmployeeInfo.getProjectNum() == CommonConstants.ZERO_INT) { .and(obj -> obj.ge(TEmployeeContractInfo::getContractEnd, DateUtil.getThisDayByPatten("yyyy-MM-dd"))
//减档 .or().isNull(TEmployeeContractInfo::getContractEnd))
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]); .eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT)
tEmployeeInfo.setLeaveRemark(tEmployeeProject.getLeaveRemark()); .eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
tEmployeeInfo.setLeaveTime(DateUtil.getCurrentDateTime()); .last(CommonConstants.LAST_ONE_SQL));
tEmployeeInfo.setLeaveUser(vo.getUserId()); if (contractInfoInUse != null) {
tEmployeeInfo.setLeaveUserName(vo.getUserName()); tEmployeeInfo.setContractStatus(CommonConstants.ONE_INT);
workInfo.append("减档成功,");
} else { } else {
failueInfo.append("存在其他项目,无法减档"); tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT);
}
if (tEmployeeProject.getProjectStatus() == CommonConstants.ONE_INT) {
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum() - CommonConstants.ONE_INT);
tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT);
//减项成功把人员档案现存项目数减一
if (tEmployeeInfo.getProjectNum() == CommonConstants.ZERO_INT) {
//减档
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeInfo.setLeaveRemark(tEmployeeProject.getLeaveRemark());
tEmployeeInfo.setLeaveTime(DateUtil.getCurrentDateTime());
tEmployeeInfo.setLeaveUser(vo.getUserId());
tEmployeeInfo.setLeaveUserName(vo.getUserName());
workInfo.append("减档成功,");
} else {
failueInfo.append("存在其他项目,无法减档");
}
} }
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], tEmployeeInfo.getId(), tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], tEmployeeInfo.getId(),
"", tEmployeeInfoOld, tEmployeeInfo); "", tEmployeeInfoOld, tEmployeeInfo);
......
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