Commit c7a21362 authored by fangxinjiang's avatar fangxinjiang

代码优化-fxj

parent ee8f5fa6
......@@ -350,10 +350,10 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
preMap = exsitPreList.stream().filter(v -> v.getContractId() != null)
.collect(Collectors.toMap(TEmployeeContractPreNew::getContractId, v -> v.getId()));
}
if (null == preMap){
preMap = new HashMap<>();
TAutoContractScheme scheme = null;
if (null != preVo.getConfigId()){
scheme = contractSchemeMapper.selectById(preVo.getConfigId());
}
TAutoContractScheme scheme = contractSchemeMapper.selectById(preVo.getConfigId());
TAutoContractRuleInfo rule = null;
if (null != scheme){
rule = contractRuleInfoMapper.selectOne(Wrappers.<TAutoContractRuleInfo>query().lambda()
......@@ -365,10 +365,6 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
List<TEmployeeAutoRegistCheckVo> errorList = new ArrayList<>();
TEmployeeAutoRegistCheckVo checkVo;
TEmpContractAlert alert = null;
TEmployeeContractDateVo vo = null;
TEmployeeContractPreNew preNew = null;
String innitError = null;
String preId = null;
//已合同Id 组建map
Map<String,ContractAlertConfirmResVo> confirmMap = null;
List<ContractAlertConfirmResVo> confirmVos = preVo.getConfirmVos();
......@@ -376,9 +372,6 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
confirmMap = confirmVos.stream().filter(v -> v.getContractId() != null)
.collect(Collectors.toMap(ContractAlertConfirmResVo::getContractId, v -> v));
}
if (null == confirmMap){
confirmMap = new HashMap<>();
}
ContractAlertConfirmResVo temp = null;
TEmployeeContractPreNewVo preVoTemp = null;
for (TEmployeeContractInfo contract : contractList){
......@@ -389,8 +382,10 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
checkVo = check(preMap, scheme, rule, alert, preVoTemp, contract);
if (null != checkVo){
if (null != temp ) {
temp.setDeptNo(null != alert?alert.getProjectNo():"");
temp.setDeptName(null != alert?alert.getProject():"");
if (null != alert){
temp.setDeptNo(alert.getProjectNo());
temp.setDeptName(alert.getProject());
}
temp.setErrorMsg(checkVo.getErrorMsg());
temp.setPost(preVoTemp.getPost());
temp.setContractEndNew(preVoTemp.getContractEnd());
......@@ -446,7 +441,6 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
TEmpContractAlert alert,
TEmployeeContractPreNewVo preVoTemp,
TEmployeeContractInfo contract) {
TEmployeeContractPreNew preNew;
String preId;
String initError;
if (null == alert){
......@@ -466,14 +460,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
if (LocalDateUtil.hasOverlap(contract.getContractStart(), contract.getContractEnd(), preVoTemp.getContractStart(), preVoTemp.getContractEnd())){
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){
......@@ -507,7 +494,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
// 检查电子签是否超期(和续签的合同开始日期进行比较)
if (null != preVoTemp.getContractStart() && CommonConstants.ZERO_STRING.equals(preVoTemp.getSignType())){
LocalDate contractStartDateNew = parseContractEndDate(preVoTemp.getContractStart());
if (null == contractEndDate) {
if (null == contractStartDateNew) {
return buildErrorCheckVo(contract, preVoTemp, "续签合同开始日期解析失败");
}
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