Commit a86851e9 authored by fangxinjiang's avatar fangxinjiang

MVP1.2:项目档案-减档逻辑调整

parent 1b5248b2
...@@ -386,9 +386,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -386,9 +386,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId()); TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId());
TEmployeeProject tEmployeeProjectOld = this.getById(tEmployeeProject.getId()); TEmployeeProject tEmployeeProjectOld = this.getById(tEmployeeProject.getId());
String code = ""; String code = "";
if (CommonConstants.ONE_INT == tEmployeeProject.getSocialStatus() StringBuilder errorTemp = new StringBuilder();
|| CommonConstants.ONE_INT == tEmployeeProject.getFundStatus()) { if (tEmployeeProject.getSocialStatus() == CommonConstants.dingleDigitIntArray[1]) {
return R.failed("人员在该项目下存在进行中/未完结的服务"); errorTemp.append("社保未派减、");
}
if (tEmployeeProject.getFundStatus() == CommonConstants.dingleDigitIntArray[1]) {
errorTemp.append("公积金未派减、");
} }
// 未作废,在用 或 审核中 // 未作废,在用 或 审核中
long contractCount = contractInfoMapper.selectCount(Wrappers.<TEmployeeContractInfo>query().lambda() long contractCount = contractInfoMapper.selectCount(Wrappers.<TEmployeeContractInfo>query().lambda()
...@@ -403,7 +406,10 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -403,7 +406,10 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_STRING)) .eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_STRING))
); );
if (contractCount > CommonConstants.ZERO_INT){ if (contractCount > CommonConstants.ZERO_INT){
return R.failed(MsgUtils.getMessage(ErrorCodes.ARCHIVES_PROJECT_CHANGE_CONTRACT_EXIST)); errorTemp.append("合同可用或在途、");
}
if (Common.isNotNull(errorTemp)){
return R.failed(errorTemp.substring(0,errorTemp.length()-1) +",禁止减项");
} }
tEmployeeProject.setProjectStatus(CommonConstants.dingleDigitIntArray[1]); tEmployeeProject.setProjectStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeProject.setLeaveTime(LocalDateTime.now()); tEmployeeProject.setLeaveTime(LocalDateTime.now());
...@@ -544,6 +550,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -544,6 +550,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
TEmployeeProject tEmployeeProjectOld; TEmployeeProject tEmployeeProjectOld;
// 在途和在用合同数目 // 在途和在用合同数目
long contractCount; long contractCount;
StringBuilder errorTemp;
StringBuilder errorMessage;
// 执行数据插入操作 组装 PostDto // 执行数据插入操作 组装 PostDto
for (EmployeeXProjectVO excel : excelVOList) { for (EmployeeXProjectVO excel : excelVOList) {
//根据身份证和项目编码获取项目档案 //根据身份证和项目编码获取项目档案
...@@ -555,7 +563,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -555,7 +563,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
leaveReason = null == dicObj? "":dicObj.get(excel.getLeaveReason()); leaveReason = null == dicObj? "":dicObj.get(excel.getLeaveReason());
StringBuilder errorMessage = new StringBuilder(); errorMessage = new StringBuilder();
if (Common.isNotNull(excel.getEmpName())) { if (Common.isNotNull(excel.getEmpName())) {
errorMessage.append(excel.getEmpName()); errorMessage.append(excel.getEmpName());
errorMessage.append(";"); errorMessage.append(";");
...@@ -571,11 +579,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -571,11 +579,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
errorMessage.append(";"); errorMessage.append(";");
} }
if (Common.isNotNull(tEmployeeProject)) { if (Common.isNotNull(tEmployeeProject)) {
if (tEmployeeProject.getSocialStatus() == CommonConstants.dingleDigitIntArray[1] || errorTemp = new StringBuilder();
tEmployeeProject.getFundStatus() == CommonConstants.dingleDigitIntArray[1]) { if (tEmployeeProject.getSocialStatus() == CommonConstants.dingleDigitIntArray[1]) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), errorMessage + errorTemp.append("社保未派减、");
MsgUtils.getMessage(ErrorCodes.ARCHIVES_PROJECT_CHANGE_NOT_EXIST))); }
break; if (tEmployeeProject.getFundStatus() == CommonConstants.dingleDigitIntArray[1]) {
errorTemp.append("公积金未派减、");
} }
// 未作废,在用 或 审核中 // 未作废,在用 或 审核中
contractCount = contractInfoMapper.selectCount(Wrappers.<TEmployeeContractInfo>query().lambda() contractCount = contractInfoMapper.selectCount(Wrappers.<TEmployeeContractInfo>query().lambda()
...@@ -590,8 +599,10 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -590,8 +599,10 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_STRING)) .eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.ONE_STRING))
); );
if (contractCount > CommonConstants.ZERO_INT){ if (contractCount > CommonConstants.ZERO_INT){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), errorMessage + errorTemp.append("合同可用或在途、");
MsgUtils.getMessage(ErrorCodes.ARCHIVES_PROJECT_CHANGE_CONTRACT_EXIST))); }
if (Common.isNotNull(errorTemp)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), errorMessage +errorTemp.substring(0,errorTemp.length()-1) +",禁止减项"));
break; break;
} }
tEmployeeProjectOld = this.getById(tEmployeeProject.getId()); tEmployeeProjectOld = this.getById(tEmployeeProject.getId());
......
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