Commit c7a21362 authored by fangxinjiang's avatar fangxinjiang

代码优化-fxj

parent ee8f5fa6
...@@ -350,10 +350,10 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -350,10 +350,10 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
preMap = exsitPreList.stream().filter(v -> v.getContractId() != null) preMap = exsitPreList.stream().filter(v -> v.getContractId() != null)
.collect(Collectors.toMap(TEmployeeContractPreNew::getContractId, v -> v.getId())); .collect(Collectors.toMap(TEmployeeContractPreNew::getContractId, v -> v.getId()));
} }
if (null == preMap){ TAutoContractScheme scheme = null;
preMap = new HashMap<>(); if (null != preVo.getConfigId()){
scheme = contractSchemeMapper.selectById(preVo.getConfigId());
} }
TAutoContractScheme scheme = contractSchemeMapper.selectById(preVo.getConfigId());
TAutoContractRuleInfo rule = null; TAutoContractRuleInfo rule = null;
if (null != scheme){ if (null != scheme){
rule = contractRuleInfoMapper.selectOne(Wrappers.<TAutoContractRuleInfo>query().lambda() rule = contractRuleInfoMapper.selectOne(Wrappers.<TAutoContractRuleInfo>query().lambda()
...@@ -365,10 +365,6 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -365,10 +365,6 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
List<TEmployeeAutoRegistCheckVo> errorList = new ArrayList<>(); List<TEmployeeAutoRegistCheckVo> errorList = new ArrayList<>();
TEmployeeAutoRegistCheckVo checkVo; TEmployeeAutoRegistCheckVo checkVo;
TEmpContractAlert alert = null; TEmpContractAlert alert = null;
TEmployeeContractDateVo vo = null;
TEmployeeContractPreNew preNew = null;
String innitError = null;
String preId = null;
//已合同Id 组建map //已合同Id 组建map
Map<String,ContractAlertConfirmResVo> confirmMap = null; Map<String,ContractAlertConfirmResVo> confirmMap = null;
List<ContractAlertConfirmResVo> confirmVos = preVo.getConfirmVos(); List<ContractAlertConfirmResVo> confirmVos = preVo.getConfirmVos();
...@@ -376,9 +372,6 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -376,9 +372,6 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
confirmMap = confirmVos.stream().filter(v -> v.getContractId() != null) confirmMap = confirmVos.stream().filter(v -> v.getContractId() != null)
.collect(Collectors.toMap(ContractAlertConfirmResVo::getContractId, v -> v)); .collect(Collectors.toMap(ContractAlertConfirmResVo::getContractId, v -> v));
} }
if (null == confirmMap){
confirmMap = new HashMap<>();
}
ContractAlertConfirmResVo temp = null; ContractAlertConfirmResVo temp = null;
TEmployeeContractPreNewVo preVoTemp = null; TEmployeeContractPreNewVo preVoTemp = null;
for (TEmployeeContractInfo contract : contractList){ for (TEmployeeContractInfo contract : contractList){
...@@ -389,8 +382,10 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -389,8 +382,10 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
checkVo = check(preMap, scheme, rule, alert, preVoTemp, contract); checkVo = check(preMap, scheme, rule, alert, preVoTemp, contract);
if (null != checkVo){ if (null != checkVo){
if (null != temp ) { if (null != temp ) {
temp.setDeptNo(null != alert?alert.getProjectNo():""); if (null != alert){
temp.setDeptName(null != alert?alert.getProject():""); temp.setDeptNo(alert.getProjectNo());
temp.setDeptName(alert.getProject());
}
temp.setErrorMsg(checkVo.getErrorMsg()); temp.setErrorMsg(checkVo.getErrorMsg());
temp.setPost(preVoTemp.getPost()); temp.setPost(preVoTemp.getPost());
temp.setContractEndNew(preVoTemp.getContractEnd()); temp.setContractEndNew(preVoTemp.getContractEnd());
...@@ -446,7 +441,6 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -446,7 +441,6 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
TEmpContractAlert alert, TEmpContractAlert alert,
TEmployeeContractPreNewVo preVoTemp, TEmployeeContractPreNewVo preVoTemp,
TEmployeeContractInfo contract) { TEmployeeContractInfo contract) {
TEmployeeContractPreNew preNew;
String preId; String preId;
String initError; String initError;
if (null == alert){ if (null == alert){
...@@ -466,14 +460,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -466,14 +460,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
if (LocalDateUtil.hasOverlap(contract.getContractStart(), contract.getContractEnd(), preVoTemp.getContractStart(), preVoTemp.getContractEnd())){ if (LocalDateUtil.hasOverlap(contract.getContractStart(), contract.getContractEnd(), preVoTemp.getContractStart(), preVoTemp.getContractEnd())){
return buildErrorCheckVo(contract, preVoTemp, EmployeeConstants.DATA_CONTRACT_OVERLAP); return buildErrorCheckVo(contract, preVoTemp, EmployeeConstants.DATA_CONTRACT_OVERLAP);
} }
//如果电子签是系统自动撤销对应的签署方式必须更新为 线下签, //如果电子签是系统自动撤销对应的签署方式必须更新为 线下签, 如果是批量确认 有已确认直接提示了不做这个判断
if (CommonConstants.ZERO_STRING.equals(preVoTemp.getSignType())){
preNew = baseMapper.selectOne(Wrappers.<TEmployeeContractPreNew>query().lambda()
.eq(TEmployeeContractPreNew::getContractId, contract.getId()).last(CommonConstants.LAST_ONE_SQL));
if (null != preNew && CommonConstants.ELEVEN_STRING.equals(preNew.getProcessStatus())){
return buildErrorCheckVo(contract, preVoTemp, EmployeeConstants.DATA_CONTRACT_CANCEL_MUST_OFFLINE_SIGN);
}
}
//初始化岗位名称 //初始化岗位名称
if (Common.isNotNull(preVoTemp.getConfigId()) && "固定岗位".equals(preVoTemp.getPost()) && null != scheme){ if (Common.isNotNull(preVoTemp.getConfigId()) && "固定岗位".equals(preVoTemp.getPost()) && null != scheme){
...@@ -507,7 +494,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -507,7 +494,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
// 检查电子签是否超期(和续签的合同开始日期进行比较) // 检查电子签是否超期(和续签的合同开始日期进行比较)
if (null != preVoTemp.getContractStart() && CommonConstants.ZERO_STRING.equals(preVoTemp.getSignType())){ if (null != preVoTemp.getContractStart() && CommonConstants.ZERO_STRING.equals(preVoTemp.getSignType())){
LocalDate contractStartDateNew = parseContractEndDate(preVoTemp.getContractStart()); LocalDate contractStartDateNew = parseContractEndDate(preVoTemp.getContractStart());
if (null == contractEndDate) { if (null == contractStartDateNew) {
return buildErrorCheckVo(contract, preVoTemp, "续签合同开始日期解析失败"); return buildErrorCheckVo(contract, preVoTemp, "续签合同开始日期解析失败");
} }
if (reminderDate.isAfter(contractStartDateNew.plusMonths(1))) { if (reminderDate.isAfter(contractStartDateNew.plusMonths(1))) {
......
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