Commit 9de6c97b authored by huyuchen's avatar huyuchen

优化修改

parent 39da503f
...@@ -807,9 +807,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -807,9 +807,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeProjectService.updateById(tEmployeeProject); tEmployeeProjectService.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(tEmployeeProject.getEmpId());
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum() - CommonConstants.ONE_INT);
// 判断人员有无审核通过的其他合同 // 判断人员有无审核通过的其他合同
TEmployeeContractInfo contractInfoInUse = this.getOne(Wrappers.<TEmployeeContractInfo>query() TEmployeeContractInfo contractInfoInUse = this.getOne(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getEmpId, contractInfo.getEmpId()) .lambda().eq(TEmployeeContractInfo::getEmpId, contractInfo.getEmpId())
...@@ -823,17 +822,20 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -823,17 +822,20 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
} else { } else {
tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT); tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT);
} }
//减项成功把人员档案现存项目数减一 if (tEmployeeProject.getProjectStatus() == CommonConstants.ONE_INT) {
if (tEmployeeInfo.getProjectNum() == CommonConstants.ZERO_INT) { tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum() - CommonConstants.ONE_INT);
//减档 //减项成功把人员档案现存项目数减一
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]); if (tEmployeeInfo.getProjectNum() == CommonConstants.ZERO_INT) {
tEmployeeInfo.setLeaveRemark(tEmployeeProject.getLeaveRemark()); //减档
tEmployeeInfo.setLeaveTime(DateUtil.getCurrentDateTime()); tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeInfo.setLeaveUser(user.getId()); tEmployeeInfo.setLeaveRemark(tEmployeeProject.getLeaveRemark());
tEmployeeInfo.setLeaveUserName(user.getNickname()); tEmployeeInfo.setLeaveTime(DateUtil.getCurrentDateTime());
workInfo.append("减档成功,"); tEmployeeInfo.setLeaveUser(user.getId());
} else { tEmployeeInfo.setLeaveUserName(user.getNickname());
failueInfo.append("存在其他项目,无法减档"); workInfo.append("减档成功,");
} else {
failueInfo.append("存在其他项目,无法减档");
}
} }
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], tEmployeeInfo.getId(), tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], tEmployeeInfo.getId(),
"", tEmployeeInfoOld, tEmployeeInfo); "", tEmployeeInfoOld, tEmployeeInfo);
...@@ -1760,9 +1762,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1760,9 +1762,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeProjectService.updateById(tEmployeeProject); tEmployeeProjectService.updateById(tEmployeeProject);
//如果项目档案已减项,如果人员存在多个项目不处理,反之则减档 //如果项目档案已减项,如果人员存在多个项目不处理,反之则减档
tEmployeeInfo = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId()); 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);
// 判断人员有无审核通过的其他合同 // 判断人员有无审核通过的其他合同
contractInfoInUse = this.getOne(Wrappers.<TEmployeeContractInfo>query() contractInfoInUse = this.getOne(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getEmpId, contract.getEmpId()) .lambda().eq(TEmployeeContractInfo::getEmpId, contract.getEmpId())
...@@ -1776,18 +1777,20 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -1776,18 +1777,20 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
} else { } else {
tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT); tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT);
} }
//减项成功把人员档案现存项目数减一 if (tEmployeeProject.getProjectStatus() == CommonConstants.ONE_INT) {
if (tEmployeeInfo.getProjectNum() == CommonConstants.ZERO_INT) { tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum() - CommonConstants.ONE_INT);
//减档 //减项成功把人员档案现存项目数减一
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]); if (tEmployeeInfo.getProjectNum() == CommonConstants.ZERO_INT) {
tEmployeeInfo.setLeaveRemark(tEmployeeProject.getLeaveRemark()); //减档
tEmployeeInfo.setLeaveTime(DateUtil.getCurrentDateTime()); tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeInfo.setLeaveUser(user.getId()); tEmployeeInfo.setLeaveRemark(tEmployeeProject.getLeaveRemark());
tEmployeeInfo.setLeaveUserName(user.getNickname()); tEmployeeInfo.setLeaveTime(DateUtil.getCurrentDateTime());
workInfo.append("减档成功,"); tEmployeeInfo.setLeaveUser(user.getId());
tEmployeeInfoMapper.updateById(tEmployeeInfo); tEmployeeInfo.setLeaveUserName(user.getNickname());
} else { workInfo.append("减档成功,");
failueInfo.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