Commit 1da50ef6 authored by hongguangwu's avatar hongguangwu

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

parent aa6997cb
......@@ -115,6 +115,7 @@ public interface TEmployeeContractInfoMapper extends BaseMapper<TEmployeeContrac
String getContractByEmpIdCardAndDeptId(@Param("empIdCard") String empIdCard, @Param("deptId") String deptId);
String getContractByEmpIdCardAndDeptNo(@Param("empIdCard") String empIdCard, @Param("deptNo") String deptNo);
String getContractByEmpIdCardAndDeptNoByEnd(@Param("empIdCard") String empIdCard, @Param("deptNo") String deptNo);
String getMinDateByCardAndDeptId(@Param("vo") IdNameNoVo vo);
......
......@@ -204,5 +204,7 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract
// 获取合同ID,在用,已审核
String getContractByEmpIdCardAndDeptNo(String empIdCard, String deptNo);
// 查找最近的终止合同
String getContractByEmpIdCardAndDeptNoByEnd(String empIdCard, String deptNo);
}
......@@ -2277,6 +2277,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
public String getContractByEmpIdCardAndDeptNo(String empIdCard, String deptNo) {
return baseMapper.getContractByEmpIdCardAndDeptNo(empIdCard, deptNo);
}
@Override
public String getContractByEmpIdCardAndDeptNoByEnd(String empIdCard, String deptNo) {
return baseMapper.getContractByEmpIdCardAndDeptNoByEnd(empIdCard, deptNo);
}
@Override
public String getMinDateByCardAndDeptId(IdNameNoVo vo) {
......
......@@ -4769,6 +4769,10 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (Common.isNotNull(contractId)) {
returnVo.setResultIdThree(contractId);
returnVo.setResultIdThreeStatus("可用");
} else {
// 如果没有可用的,查找终止的,放在离职待办的详情里
contractId = contractServicer.getContractByEmpIdCardAndDeptNoByEnd(paramVo.getEmpIdCard(), paramVo.getDeptNo());
returnVo.setResultIdFour(contractId);
}
}
return returnVo;
......
......@@ -878,6 +878,15 @@
and e.DELETE_FLAG = '0' and e.AUDIT_STATUS = '2' AND e.IN_USE = '0'
limit 1
</select>
<!-- 查找最近一次终止的合同 -->
<select id="getContractByEmpIdCardAndDeptNoByEnd" resultType="java.lang.String">
select
e.id
from t_employee_contract_info e
where e.EMP_IDCARD = #{empIdCard} and e.DEPT_NO = #{deptNo}
and e.DELETE_FLAG = '0' and e.AUDIT_STATUS = '2' AND e.IN_USE = '1' and e.SITUATION = '终止'
ORDER BY e.CREATE_TIME desc limit 1
</select>
<!-- 获取最小的审核通过的合同,税友自动生成 离职证明书使用 -->
<select id="getMinDateByCardAndDeptId" resultType="java.lang.String">
......
......@@ -604,6 +604,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
logInfo.append("商险;");
if (!CommonConstants.ONE_STRING.equals(leave.getDoStatusInsurance())
&& !CommonConstants.EIGHT_STRING.equals(leave.getDoStatusInsurance())) {
leave.setInsuranceId(leave.getInsuranceIdOld());
leave.setCloseRemarkInsurance(remark);
leave.setDoStatusInsurance(CommonConstants.ONE_STRING);
} else {
......@@ -614,6 +615,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
logInfo.append("人员档案;");
if (!CommonConstants.ONE_STRING.equals(leave.getDoStatusEmp())
&& !CommonConstants.EIGHT_STRING.equals(leave.getDoStatusEmp())) {
leave.setEmpId(leave.getEmpIdOld());
leave.setCloseRemarkEmp(remark);
leave.setDoStatusEmp(CommonConstants.ONE_STRING);
......@@ -656,9 +658,11 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
&& !CommonConstants.EIGHT_STRING.equals(leave.getDoStatusSocial())) {
if (Common.isEmpty(socialDispatchId)) {
errorInfo.append("社保未派减完结!");
}
} else {
leave.setSocialId(socialDispatchId);
leave.setDoStatusSocial(CommonConstants.ONE_STRING);
leave.setCloseRemarkSocial(closeRemark);
}
} else {
errorInfo.append("社保状态已完结,不可处理!");
}
......@@ -669,9 +673,11 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
&& !CommonConstants.EIGHT_STRING.equals(leave.getDoStatusFund())) {
if (Common.isEmpty(fundDispatchId)) {
errorInfo.append("公积金未派减完结!");
}
} else {
leave.setFundId(fundDispatchId);
leave.setDoStatusFund(CommonConstants.ONE_STRING);
leave.setCloseRemarkFund(closeRemark);
}
} else {
errorInfo.append("公积金状态已完结,不可处理!");
}
......@@ -691,9 +697,11 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
// 这个反着查的,有未减完的,表示不可以关闭它,只能忽略它
if (Common.isNotNull(insuranceId)) {
errorInfo.append("商险未派减完结!");
}
} else {
leave.setInsuranceId(leave.getInsuranceIdOld());
leave.setDoStatusInsurance(CommonConstants.ONE_STRING);
leave.setCloseRemarkInsurance(closeRemark);
}
} else {
errorInfo.append("商险状态已完结,不可处理!");
}
......@@ -701,20 +709,28 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
if (doTypeYi.contains(CommonConstants.FOUR_STRING)) {
logInfo.append("合同;");
String contractId = "";
String contractIdEnd = "";
returnR = archivesDaprUtil.getEmpAndContractStatus(paramVo);
if (null != returnR && Common.isNotNull(returnR.getData())) {
returnVo = returnR.getData();
if (Common.isNotNull(returnVo.getResultIdThree())) {
contractId = returnVo.getResultIdThree();
contractIdEnd = returnVo.getResultIdFour();
}
}
if (!CommonConstants.ONE_STRING.equals(leave.getDoStatusContract())
&& !CommonConstants.EIGHT_STRING.equals(leave.getDoStatusContract())) {
if (Common.isNotNull(contractId)) {
errorInfo.append("存在可用的合同!");
}
} else {
if (Common.isNotNull(contractIdEnd)) {
leave.setContractId(contractIdEnd);
leave.setDoStatusContract(CommonConstants.ONE_STRING);
leave.setCloseRemarkContract(closeRemark);
} else {
errorInfo.append("未找到终止的合同!");
}
}
} else {
errorInfo.append("合同状态已完结,不可处理!");
}
......@@ -1431,7 +1447,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
paramVoProject.setListParam(tempProject);
R<BaseSearchListVO> listR = archivesDaprUtil.leaveToReduceProject(paramVoProject);
if (Common.isNotNull(listR) && Common.isNotNull(listR.getData()) && !listR.getData().getErrorMessageList().isEmpty()) {
projectParamList = listR.getData().getErrorMessageList();
projectParamList.addAll(listR.getData().getErrorMessageList());
}
}
if (!projectParamList.isEmpty()) {
......@@ -1478,7 +1494,7 @@ public class EmployeeRegistrationLeaveServiceImpl extends ServiceImpl<EmployeeRe
paramVoEmp.setListParam(tempEmp);
R<BaseSearchListVO> listR = archivesDaprUtil.leaveToReduceEmp(paramVoEmp);
if (Common.isNotNull(listR) && Common.isNotNull(listR.getData()) && !listR.getData().getErrorMessageList().isEmpty()) {
empParamList = listR.getData().getErrorMessageList();
empParamList.addAll(listR.getData().getErrorMessageList());
}
}
if (!empParamList.isEmpty()) {
......
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