Commit 4bc7d3d1 authored by fangxinjiang's avatar fangxinjiang

合同待办处理

parent 9e9c8458
......@@ -228,10 +228,12 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
.eq(TEmployeeContractInfo::getWorkFlag,CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_STRING));
Map<String,TEmpContractAlert> alertMap = new HashMap<>();
Map<String,TEmpContractAlert> existMap = new HashMap<>();
initExistMap(existMap);
if (Common.isNotNull(alertList)){
Date nowDate = DateUtil.dateIncreaseByDay(new Date(),CommonConstants.ONE_INT);
for (TEmployeeContractInfo contract:alertList){
extracted(nowDate, contract,alertMap);
extracted(nowDate, contract,alertMap,existMap);
}
}
if (Common.isNotNull(notAccessList) && Common.isNotNull(alertMap)){
......@@ -251,16 +253,29 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
return R.ok();
}
private void initExistMap(Map<String, TEmpContractAlert> existMap) {
List<TEmpContractAlert> exists = baseMapper.selectList(Wrappers.<TEmpContractAlert>query());
if (Common.isNotNull(exists)){
for (TEmpContractAlert alert:exists){
existMap.put(alert.getEmpIdcard()
+CommonConstants.DOWN_LINE_STRING
+alert.getProjectNo()
+CommonConstants.DOWN_LINE_STRING
+alert.getContractId(),alert);
}
}
}
private void extracted(Date nowDate,
TEmployeeContractInfo contract,
Map<String,TEmpContractAlert> alertMap) {
Map<String, TEmpContractAlert> alertMap, Map<String, TEmpContractAlert> existMap) {
TEmployeeInfo employeeInfo = employeeInfoMapper.selectById(contract.getEmpId());
if (Common.isNotNull(employeeInfo)
&& !CommonConstants.ZERO_STRING.equals(employeeInfo.getEmpNatrue())
&& !CommonConstants.ONE_STRING.equals(employeeInfo.getEmpNatrue())){
return;
}
TEmpContractAlert alert = alertMap.get(contract.getEmpIdcard());
TEmpContractAlert alert = alertMap.get(contract.getEmpIdcard()+CommonConstants.DOWN_LINE_STRING+contract.getDeptNo());
// 存在多个审核通过的数据 用最新的审核通过的合同覆盖已有的
if (Common.isNotNull(alert)
&& Common.isNotNull(alert.getContractEnd())
......@@ -268,7 +283,17 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
&& alert.getAuditTime().after(contract.getContractEnd())){
return;
}
TEmpContractAlert exist = existMap.get(alert.getEmpIdcard()
+CommonConstants.DOWN_LINE_STRING
+alert.getProjectNo()
+CommonConstants.DOWN_LINE_STRING
+alert.getContractId());
alert = new TEmpContractAlert();
if (Common.isNotNull(exist) && Common.isNotNull(exist.getFirstAlertTime())){
alert.setFirstAlertTime(exist.getFirstAlertTime());
}else {
alert.setFirstAlertTime(new Date());
}
alert.setContractId(contract.getId());
alert.setAlertPerson(contract.getCreateName());
alert.setEmpName(contract.getEmpName());
......@@ -300,9 +325,8 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
alert.setDaysDue(DateUtil.daysBetween( nowDate,alert.getContractEnd()));
alert.setDueFlag(CommonConstants.ZERO_STRING);
}
alert.setFirstAlertTime(DateUtil.dateIncreaseByMonth(alert.getContractEnd(),CommonConstants.THREE_INT_NEGATE));
}
alert.setHandleStatus(CommonConstants.ZERO_STRING);
alertMap.put(alert.getEmpIdcard(),alert);
alertMap.put(alert.getEmpIdcard()+CommonConstants.DOWN_LINE_STRING+alert.getProjectNo(),alert);
}
}
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