Commit a86851e9 authored by fangxinjiang's avatar fangxinjiang

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

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