Commit f6950e7a authored by hongguangwu's avatar hongguangwu

MVP1.7.17-离职待办-优化代码

parent 07ec4846
...@@ -1069,17 +1069,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1069,17 +1069,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
String[] insuranceArr; String[] insuranceArr;
String errorMessage; String errorMessage;
for (EmployeeRegistrationLeave leave : leaveList) { for (EmployeeRegistrationLeave leave : leaveList) {
if ((Common.isEmpty(doType) || doType.contains(CommonConstants.ONE_STRING)) if (judgeToUpdateSocial(isExit, doType, nowTime, leave) ) {
&& Common.isNotNull(leave.getSocialDispatchIdOld()) && (CommonConstants.ZERO_STRING.equals(isExit)
|| (CommonConstants.ONE_STRING.equals(isExit) && leave.getSocialExpectedTime().isBefore(nowTime)))
&& Common.isNotNull(leave.getDoStatusSocial())
&& (leave.getDoStatusSocial().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusSocial().equals(CommonConstants.THREE_STRING)
|| leave.getDoStatusSocial().equals(CommonConstants.SIX_STRING)
|| leave.getDoStatusSocial().equals(CommonConstants.NINE_STRING)
|| leave.getDoStatusSocial().equals(CommonConstants.TEN_STRING)
)
) {
leave.setFailSocialUser(userName); leave.setFailSocialUser(userName);
vo = new TDispatchReduceVo(); vo = new TDispatchReduceVo();
vo.setLeaveId(leave.getId()); vo.setLeaveId(leave.getId());
...@@ -1098,16 +1088,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1098,16 +1088,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
} }
socialOldList.add(vo); socialOldList.add(vo);
} }
if ((Common.isEmpty(doType) || doType.contains(CommonConstants.TWO_STRING)) if (judgeToUpdateFund(isExit, doType, nowTime, leave) ) {
&& Common.isNotNull(leave.getFundDispatchIdOld()) && (CommonConstants.ZERO_STRING.equals(isExit)
|| (CommonConstants.ONE_STRING.equals(isExit) && leave.getFundExpectedTime().isBefore(nowTime)))
&& Common.isNotNull(leave.getDoStatusFund())
&& (leave.getDoStatusFund().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusFund().equals(CommonConstants.THREE_STRING)
|| leave.getDoStatusFund().equals(CommonConstants.NINE_STRING)
|| leave.getDoStatusFund().equals(CommonConstants.TEN_STRING)
)
) {
leave.setFailFundUser(userName); leave.setFailFundUser(userName);
vo = new TDispatchReduceVo(); vo = new TDispatchReduceVo();
vo.setLeaveId(leave.getId()); vo.setLeaveId(leave.getId());
...@@ -1126,15 +1107,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1126,15 +1107,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
} }
fundOldList.add(vo); fundOldList.add(vo);
} }
if ((Common.isEmpty(doType) || doType.contains(CommonConstants.THREE_STRING)) if (judgeToUpdateInsurance(isExit, doType, nowTime, leave) ) {
&& Common.isNotNull(leave.getInsuranceIdOld()) && (CommonConstants.ZERO_STRING.equals(isExit)
|| (CommonConstants.ONE_STRING.equals(isExit) && leave.getInsuranceExpectedTime().isBefore(nowTime)))
&& Common.isNotNull(leave.getDoStatusInsurance())
&& (leave.getDoStatusInsurance().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusInsurance().equals(CommonConstants.THREE_STRING)
|| leave.getDoStatusInsurance().equals(CommonConstants.NINE_STRING)
)
) {
insuranceArr = leave.getInsuranceIdOld().split(","); insuranceArr = leave.getInsuranceIdOld().split(",");
insuranceList = new ArrayList<>(); insuranceList = new ArrayList<>();
for (String id : insuranceArr) { for (String id : insuranceArr) {
...@@ -1143,15 +1116,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1143,15 +1116,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
} }
leaveInsuranceMap.put(leave.getId(), insuranceList); leaveInsuranceMap.put(leave.getId(), insuranceList);
} }
if ((Common.isEmpty(doType) || doType.contains(CommonConstants.FOUR_STRING)) if (judgeToUpdateContract(isExit, doType, nowTime, leave) ) {
&& Common.isNotNull(leave.getContractIdOld()) && (CommonConstants.ZERO_STRING.equals(isExit)
|| (CommonConstants.ONE_STRING.equals(isExit) && leave.getContractExpectedTime().isBefore(nowTime)))
&& Common.isNotNull(leave.getDoStatusContract())
&& (leave.getDoStatusContract().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusContract().equals(CommonConstants.THREE_STRING)
|| leave.getDoStatusContract().equals(CommonConstants.TEN_STRING)
)
) {
leave.setFailContractUser(userName); leave.setFailContractUser(userName);
searchVo = new BaseSearchVO(); searchVo = new BaseSearchVO();
searchVo.setSearchKey(leave.getContractIdOld()); searchVo.setSearchKey(leave.getContractIdOld());
...@@ -1165,13 +1130,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1165,13 +1130,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
listParamContract.add(searchVo); listParamContract.add(searchVo);
} }
if ((Common.isEmpty(doType) || doType.contains(CommonConstants.FIVE_STRING)) if (judgeToUpdateProject(doType, leave) ) {
&& Common.isNotNull(leave.getEmpProjectIdOld())
&& Common.isNotNull(leave.getDoStatusProject())
&& (leave.getDoStatusProject().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusProject().equals(CommonConstants.NINE_STRING)
)
) {
leave.setFailEmpUser(userName); leave.setFailEmpUser(userName);
searchVo = new BaseSearchVO(); searchVo = new BaseSearchVO();
searchVo.setSearchKey(leave.getEmpProjectIdOld()); searchVo.setSearchKey(leave.getEmpProjectIdOld());
...@@ -1186,13 +1145,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1186,13 +1145,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
} }
listParamProject.add(searchVo); listParamProject.add(searchVo);
} }
if ((Common.isEmpty(doType) || doType.contains(CommonConstants.SIX_STRING)) if (judgeToUpdateEmp(doType, leave) ) {
&& Common.isNotNull(leave.getEmpIdOld())
&& Common.isNotNull(leave.getDoStatusEmp())
&& (leave.getDoStatusEmp().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusEmp().equals(CommonConstants.NINE_STRING)
)
) {
leave.setFailEmpProjectUser(userName); leave.setFailEmpProjectUser(userName);
searchVo = new BaseSearchVO(); searchVo = new BaseSearchVO();
searchVo.setSearchKey(leave.getEmpProjectIdOld()); searchVo.setSearchKey(leave.getEmpProjectIdOld());
...@@ -1238,19 +1191,21 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1238,19 +1191,21 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
} }
} }
for (EmployeeRegistrationLeave leave : leaveList) { for (EmployeeRegistrationLeave leave : leaveList) {
// 成功 if (judgeToUpdateSocial(isExit, doType, nowTime, leave) ) {
if (successMap.get(leave.getId()) != null) { // 成功
leave.setSocialId(successMap.get(leave.getId())); if (successMap.get(leave.getId()) != null) {
leave.setDoStatusSocial(CommonConstants.FOUR_STRING); leave.setSocialId(successMap.get(leave.getId()));
} else if (errorMap.get(leave.getId()) != null) { leave.setDoStatusSocial(CommonConstants.FOUR_STRING);
// 失败 } else if (errorMap.get(leave.getId()) != null) {
errorMessage = errorMap.get(leave.getId()); // 失败
if (Common.isNotNull(errorMessage) && errorMessage.length() > 300) { errorMessage = errorMap.get(leave.getId());
errorMessage = errorMessage.substring(0, 300); if (Common.isNotNull(errorMessage) && errorMessage.length() > 300) {
errorMessage = errorMessage.substring(0, 300);
}
leave.setFailSocialRemark(errorMessage);
leave.setFailSocialTime(LocalDateTime.now());
leave.setDoStatusSocial(CommonConstants.THREE_STRING);
} }
leave.setFailSocialRemark(errorMessage);
leave.setFailSocialTime(LocalDateTime.now());
leave.setDoStatusSocial(CommonConstants.THREE_STRING);
} }
} }
} }
...@@ -1278,19 +1233,21 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1278,19 +1233,21 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
} }
} }
for (EmployeeRegistrationLeave leave : leaveList) { for (EmployeeRegistrationLeave leave : leaveList) {
// 成功 if (judgeToUpdateFund(isExit, doType, nowTime, leave) ) {
if (successMap.get(leave.getId()) != null) { // 成功
leave.setFundId(successMap.get(leave.getId())); if (successMap.get(leave.getId()) != null) {
leave.setDoStatusFund(CommonConstants.FOUR_STRING); leave.setFundId(successMap.get(leave.getId()));
} else if (errorMap.get(leave.getId()) != null) { leave.setDoStatusFund(CommonConstants.FOUR_STRING);
// 失败 } else if (errorMap.get(leave.getId()) != null) {
errorMessage = errorMap.get(leave.getId()); // 失败
if (Common.isNotNull(errorMessage) && errorMessage.length() > 300) { errorMessage = errorMap.get(leave.getId());
errorMessage = errorMessage.substring(0, 300); if (Common.isNotNull(errorMessage) && errorMessage.length() > 300) {
errorMessage = errorMessage.substring(0, 300);
}
leave.setFailFundRemark(errorMessage);
leave.setFailFundTime(LocalDateTime.now());
leave.setDoStatusFund(CommonConstants.THREE_STRING);
} }
leave.setFailFundRemark(errorMessage);
leave.setFailFundTime(LocalDateTime.now());
leave.setDoStatusFund(CommonConstants.THREE_STRING);
} }
} }
} }
...@@ -1321,31 +1278,33 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1321,31 +1278,33 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
List<String> errorList = new ArrayList<>(); List<String> errorList = new ArrayList<>();
List<String> successList = new ArrayList<>(); List<String> successList = new ArrayList<>();
for (EmployeeRegistrationLeave leave : leaveList) { for (EmployeeRegistrationLeave leave : leaveList) {
errorMsg = new StringBuilder(); if (judgeToUpdateInsurance(isExit, doType, nowTime, leave) ) {
leave.setInsuranceId(leave.getInsuranceIdOld()); errorMsg = new StringBuilder();
insuranceList = leaveInsuranceMap.get(leave.getId()); leave.setInsuranceId(leave.getInsuranceIdOld());
if (insuranceList != null) { insuranceList = leaveInsuranceMap.get(leave.getId());
// 处理每一条商险 if (insuranceList != null) {
for (String insuranceId : insuranceList) { // 处理每一条商险
if (errorMap.get(insuranceId) != null) { for (String insuranceId : insuranceList) {
errorMsg.append(errorMap.get(insuranceId)).append(CommonConstants.SEMICOLON_STRING); if (errorMap.get(insuranceId) != null) {
errorList.add(insuranceId); errorMsg.append(errorMap.get(insuranceId)).append(CommonConstants.SEMICOLON_STRING);
} else { errorList.add(insuranceId);
successList.add(insuranceId); } else {
successList.add(insuranceId);
}
} }
} if (errorMsg.length() > CommonConstants.ZERO_INT) {
if (errorMsg.length() > CommonConstants.ZERO_INT) { leave.setFailInsuranceUser(userName);
leave.setFailInsuranceUser(userName); errorMessage = errorMsg.toString();
errorMessage = errorMsg.toString(); if (Common.isNotNull(errorMessage) && errorMessage.length() > 300) {
if (Common.isNotNull(errorMessage) && errorMessage.length() > 300) { errorMessage = errorMessage.substring(0, 300);
errorMessage = errorMessage.substring(0, 300); }
leave.setFailInsuranceRemark(errorMessage);
leave.setFailInsuranceTime(LocalDateTime.now());
leave.setDoStatusInsurance(CommonConstants.THREE_STRING);
} else {
// 待减员
leave.setDoStatusInsurance(CommonConstants.FOUR_STRING);
} }
leave.setFailInsuranceRemark(errorMessage);
leave.setFailInsuranceTime(LocalDateTime.now());
leave.setDoStatusInsurance(CommonConstants.THREE_STRING);
} else {
// 待减员
leave.setDoStatusInsurance(CommonConstants.FOUR_STRING);
} }
} }
} }
...@@ -1359,9 +1318,11 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1359,9 +1318,11 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
} else { } else {
// 全部成功 // 全部成功
for (EmployeeRegistrationLeave leave : leaveList) { for (EmployeeRegistrationLeave leave : leaveList) {
leave.setInsuranceId(leave.getInsuranceIdOld()); if (judgeToUpdateInsurance(isExit, doType, nowTime, leave) ) {
// 待办理 leave.setInsuranceId(leave.getInsuranceIdOld());
leave.setDoStatusInsurance(CommonConstants.FOUR_STRING); // 待办理
leave.setDoStatusInsurance(CommonConstants.FOUR_STRING);
}
} }
leaveInsuranceMapper.updateLeaveInsuranceListByIdAndStatus(CommonConstants.FOUR_STRING, insuranceOldList); leaveInsuranceMapper.updateLeaveInsuranceListByIdAndStatus(CommonConstants.FOUR_STRING, insuranceOldList);
} }
...@@ -1391,19 +1352,21 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1391,19 +1352,21 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
} }
} }
for (EmployeeRegistrationLeave leave : leaveList) { for (EmployeeRegistrationLeave leave : leaveList) {
// 成功 if (judgeToUpdateContract(isExit, doType, nowTime, leave) ) {
if (successMap.get(leave.getId()) != null) { // 成功
leave.setContractId(successMap.get(leave.getId())); if (successMap.get(leave.getId()) != null) {
leave.setDoStatusContract(CommonConstants.FOUR_STRING); leave.setContractId(successMap.get(leave.getId()));
} else if (errorMap.get(leave.getId()) != null) { leave.setDoStatusContract(CommonConstants.FOUR_STRING);
// 失败 } else if (errorMap.get(leave.getId()) != null) {
errorMessage = errorMap.get(leave.getId()); // 失败
if (Common.isNotNull(errorMessage) && errorMessage.length() > 300) { errorMessage = errorMap.get(leave.getId());
errorMessage = errorMessage.substring(0, 300); if (Common.isNotNull(errorMessage) && errorMessage.length() > 300) {
errorMessage = errorMessage.substring(0, 300);
}
leave.setFailContractRemark(errorMessage);
leave.setFailContractTime(LocalDateTime.now());
leave.setDoStatusContract(CommonConstants.THREE_STRING);
} }
leave.setFailContractRemark(errorMessage);
leave.setFailContractTime(LocalDateTime.now());
leave.setDoStatusContract(CommonConstants.THREE_STRING);
} }
} }
} }
...@@ -1424,21 +1387,25 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1424,21 +1387,25 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
errorMap.put(message.getKey(), message.getMessage()); errorMap.put(message.getKey(), message.getMessage());
} }
for (EmployeeRegistrationLeave leave : leaveList) { for (EmployeeRegistrationLeave leave : leaveList) {
if (errorMap.get(leave.getId()) != null) { if (judgeToUpdateProject(doType, leave) ) {
errorMessage = errorMap.get(leave.getId()); if (errorMap.get(leave.getId()) != null) {
if (Common.isNotNull(errorMessage) && errorMessage.length() > 300) { errorMessage = errorMap.get(leave.getId());
errorMessage = errorMessage.substring(0, 300); if (Common.isNotNull(errorMessage) && errorMessage.length() > 300) {
errorMessage = errorMessage.substring(0, 300);
}
leave.setFailEmpProjectRemark(errorMessage);
leave.setFailEmpProjectTime(LocalDateTime.now());
leave.setDoStatusProject(CommonConstants.NINE_STRING);
} }
leave.setFailEmpProjectRemark(errorMessage);
leave.setFailEmpProjectTime(LocalDateTime.now());
leave.setDoStatusProject(CommonConstants.NINE_STRING);
} }
} }
} else { } else {
// 全部成功 // 全部成功
for (EmployeeRegistrationLeave leave : leaveList) { for (EmployeeRegistrationLeave leave : leaveList) {
leave.setEmpProjectId(leave.getEmpProjectIdOld()); if (judgeToUpdateProject(doType, leave) ) {
leave.setDoStatusProject(CommonConstants.EIGHT_STRING); leave.setEmpProjectId(leave.getEmpProjectIdOld());
leave.setDoStatusProject(CommonConstants.EIGHT_STRING);
}
} }
} }
} }
...@@ -1459,21 +1426,25 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1459,21 +1426,25 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
errorMap.put(message.getKey(), message.getMessage()); errorMap.put(message.getKey(), message.getMessage());
} }
for (EmployeeRegistrationLeave leave : leaveList) { for (EmployeeRegistrationLeave leave : leaveList) {
if (errorMap.get(leave.getId()) != null) { if (judgeToUpdateEmp(doType, leave) ) {
errorMessage = errorMap.get(leave.getId()); if (errorMap.get(leave.getId()) != null) {
if (Common.isNotNull(errorMessage) && errorMessage.length() > 300) { errorMessage = errorMap.get(leave.getId());
errorMessage = errorMessage.substring(0, 300); if (Common.isNotNull(errorMessage) && errorMessage.length() > 300) {
errorMessage = errorMessage.substring(0, 300);
}
leave.setFailEmpRemark(errorMessage);
leave.setFailEmpTime(LocalDateTime.now());
leave.setDoStatusEmp(CommonConstants.NINE_STRING);
} }
leave.setFailEmpRemark(errorMessage);
leave.setFailEmpTime(LocalDateTime.now());
leave.setDoStatusEmp(CommonConstants.NINE_STRING);
} }
} }
} else { } else {
// 全部成功 // 全部成功
for (EmployeeRegistrationLeave leave : leaveList) { for (EmployeeRegistrationLeave leave : leaveList) {
leave.setEmpId(leave.getEmpIdOld()); if (judgeToUpdateEmp(doType, leave) ) {
leave.setDoStatusEmp(CommonConstants.EIGHT_STRING); leave.setEmpId(leave.getEmpIdOld());
leave.setDoStatusEmp(CommonConstants.EIGHT_STRING);
}
} }
} }
} }
...@@ -1511,16 +1482,14 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1511,16 +1482,14 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
leaveLog.setCreateTime(LocalDateTime.now()); leaveLog.setCreateTime(LocalDateTime.now());
leaveLog.setContent(preContent); leaveLog.setContent(preContent);
logList.add(leaveLog); logList.add(leaveLog);
if (!isReturn) { if (!isReturn && (Common.isNotNull(leave.getDoStatusSocial()) && CommonConstants.THREE_STRING.equals(leave.getDoStatusSocial()))
if ((Common.isNotNull(leave.getDoStatusSocial()) && CommonConstants.THREE_STRING.equals(leave.getDoStatusSocial()))
|| (Common.isNotNull(leave.getDoStatusFund()) && CommonConstants.THREE_STRING.equals(leave.getDoStatusFund())) || (Common.isNotNull(leave.getDoStatusFund()) && CommonConstants.THREE_STRING.equals(leave.getDoStatusFund()))
|| (Common.isNotNull(leave.getDoStatusContract()) && CommonConstants.THREE_STRING.equals(leave.getDoStatusContract())) || (Common.isNotNull(leave.getDoStatusContract()) && CommonConstants.THREE_STRING.equals(leave.getDoStatusContract()))
|| (Common.isNotNull(leave.getDoStatusInsurance()) && CommonConstants.THREE_STRING.equals(leave.getDoStatusInsurance())) || (Common.isNotNull(leave.getDoStatusInsurance()) && CommonConstants.THREE_STRING.equals(leave.getDoStatusInsurance()))
|| (Common.isNotNull(leave.getDoStatusProject()) && CommonConstants.NINE_STRING.equals(leave.getDoStatusProject())) || (Common.isNotNull(leave.getDoStatusProject()) && CommonConstants.NINE_STRING.equals(leave.getDoStatusProject()))
|| (Common.isNotNull(leave.getDoStatusEmp()) && CommonConstants.NINE_STRING.equals(leave.getDoStatusEmp())) || (Common.isNotNull(leave.getDoStatusEmp()) && CommonConstants.NINE_STRING.equals(leave.getDoStatusEmp()))
) { ) {
isReturn = true; isReturn = true;
}
} }
} }
leaveLogService.saveBatch(logList); leaveLogService.saveBatch(logList);
...@@ -1532,6 +1501,72 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe ...@@ -1532,6 +1501,72 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
} }
} }
private boolean judgeToUpdateEmp(String doType, EmployeeRegistrationLeave leave) {
return (Common.isEmpty(doType) || doType.contains(CommonConstants.SIX_STRING))
&& Common.isNotNull(leave.getEmpIdOld())
&& Common.isNotNull(leave.getDoStatusEmp())
&& (leave.getDoStatusEmp().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusEmp().equals(CommonConstants.NINE_STRING)
);
}
private boolean judgeToUpdateProject(String doType, EmployeeRegistrationLeave leave) {
return (Common.isEmpty(doType) || doType.contains(CommonConstants.FIVE_STRING))
&& Common.isNotNull(leave.getEmpProjectIdOld())
&& Common.isNotNull(leave.getDoStatusProject())
&& (leave.getDoStatusProject().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusProject().equals(CommonConstants.NINE_STRING)
);
}
private boolean judgeToUpdateContract(String isExit, String doType, LocalDateTime nowTime, EmployeeRegistrationLeave leave) {
return (Common.isEmpty(doType) || doType.contains(CommonConstants.FOUR_STRING))
&& Common.isNotNull(leave.getContractIdOld()) && (CommonConstants.ZERO_STRING.equals(isExit)
|| (CommonConstants.ONE_STRING.equals(isExit) && leave.getContractExpectedTime().isBefore(nowTime)))
&& Common.isNotNull(leave.getDoStatusContract())
&& (leave.getDoStatusContract().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusContract().equals(CommonConstants.THREE_STRING)
|| leave.getDoStatusContract().equals(CommonConstants.TEN_STRING)
);
}
private boolean judgeToUpdateSocial(String isExit, String doType, LocalDateTime nowTime, EmployeeRegistrationLeave leave) {
return (Common.isEmpty(doType) || doType.contains(CommonConstants.ONE_STRING))
&& Common.isNotNull(leave.getSocialDispatchIdOld()) && (CommonConstants.ZERO_STRING.equals(isExit)
|| (CommonConstants.ONE_STRING.equals(isExit) && leave.getSocialExpectedTime().isBefore(nowTime)))
&& Common.isNotNull(leave.getDoStatusSocial())
&& (leave.getDoStatusSocial().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusSocial().equals(CommonConstants.THREE_STRING)
|| leave.getDoStatusSocial().equals(CommonConstants.SIX_STRING)
|| leave.getDoStatusSocial().equals(CommonConstants.NINE_STRING)
|| leave.getDoStatusSocial().equals(CommonConstants.TEN_STRING)
);
}
private boolean judgeToUpdateFund(String isExit, String doType, LocalDateTime nowTime, EmployeeRegistrationLeave leave) {
return (Common.isEmpty(doType) || doType.contains(CommonConstants.TWO_STRING))
&& Common.isNotNull(leave.getFundDispatchIdOld()) && (CommonConstants.ZERO_STRING.equals(isExit)
|| (CommonConstants.ONE_STRING.equals(isExit) && leave.getFundExpectedTime().isBefore(nowTime)))
&& Common.isNotNull(leave.getDoStatusFund())
&& (leave.getDoStatusFund().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusFund().equals(CommonConstants.THREE_STRING)
|| leave.getDoStatusFund().equals(CommonConstants.NINE_STRING)
|| leave.getDoStatusFund().equals(CommonConstants.TEN_STRING)
);
}
// 派单时,判断是否需要办理此条商险
private boolean judgeToUpdateInsurance(String isExit, String doType, LocalDateTime nowTime, EmployeeRegistrationLeave leave) {
return (Common.isEmpty(doType) || doType.contains(CommonConstants.THREE_STRING))
&& Common.isNotNull(leave.getInsuranceIdOld()) && (CommonConstants.ZERO_STRING.equals(isExit)
|| (CommonConstants.ONE_STRING.equals(isExit) && leave.getInsuranceExpectedTime().isBefore(nowTime)))
&& Common.isNotNull(leave.getDoStatusInsurance())
&& (leave.getDoStatusInsurance().equals(CommonConstants.TWO_STRING)
|| leave.getDoStatusInsurance().equals(CommonConstants.THREE_STRING)
|| leave.getDoStatusInsurance().equals(CommonConstants.NINE_STRING)
);
}
@Override @Override
public void reduceHandleToLeave(BaseServiceParamListVO vo) { public void reduceHandleToLeave(BaseServiceParamListVO vo) {
if (vo == null) { if (vo == null) {
......
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