Commit 793c1169 authored by fangxinjiang's avatar fangxinjiang

合同续签--续签待办生成新增字段-fxj

parent 323e82e4
......@@ -68,6 +68,7 @@ import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
import java.util.function.Function;
/**
* 员工合同续签待办
......@@ -97,6 +98,9 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
private final TSettleDomainService tSettleDomainService;
@Autowired
TAutoContractRuleInfoMapper autoContractRuleInfoMapper;
@Autowired
private UpmsDaprUtils upmsDaprUtils;
......@@ -402,9 +406,45 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
Map<String,TEmpContractAlert> existMap = new HashMap<>();
initExistMap(existMap);
if (Common.isNotNull(alertList)) {
List<TSettleDomain> projects = settleDomainMapper.selectList(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDeleteFlag,CommonConstants.ZERO_STRING));
List<TAutoContractRuleInfo> contractRuleInfos = autoContractRuleInfoMapper.selectList(Wrappers.<TAutoContractRuleInfo>query().lambda());
//判空、判重,处理重复键和null值
Map<String,TSettleDomain> projectMap= null;
if (Common.isNotNull(projects)){
projectMap = projects.stream()
.filter(Objects::nonNull)
.filter(project -> project.getDepartNo() != null)
.collect(Collectors.toMap(
TSettleDomain::getDepartNo,
obj -> obj,
(existing, replacement) -> existing // 保留第一个遇到的值
));
}
//判空、判重,处理重复键和null值
Map<String,TAutoContractRuleInfo> contractRuleMap = null;
if (Common.isNotNull(contractRuleInfos)){
contractRuleMap = contractRuleInfos.stream()
.filter(Objects::nonNull)
.filter(rule -> rule.getDeptNo() != null)
.collect(Collectors.toMap(
TAutoContractRuleInfo::getDeptNo,
obj -> obj,
(existing, replacement) -> existing // 保留第一个遇到的值
));
}
Date nowDate = new Date();
TAutoContractRuleInfo ruleInfo = null;
TSettleDomain project = null;
for (TEmployeeContractInfo contract:alertList){
extracted(nowDate, contract,alertMap,existMap);
if (Common.isNotNull(projectMap)){
project = projectMap.get(contract.getDeptNo());
}
if (Common.isNotNull(contractRuleMap)){
ruleInfo = contractRuleMap.get(contract.getDeptNo());
}
extracted(nowDate, contract,alertMap,existMap,project,ruleInfo);
}
}
if (Common.isNotNull(notAccessList) && Common.isNotNull(alertMap)){
......@@ -437,21 +477,24 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
private void extracted(Date nowDate,
TEmployeeContractInfo contract,
Map<String, TEmpContractAlert> alertMap,
Map<String, TEmpContractAlert> existMap) {
Map<String, TEmpContractAlert> existMap,
TSettleDomain project,
TAutoContractRuleInfo contractRule
) {
TEmployeeInfo employeeInfo = employeeInfoMapper.selectById(contract.getEmpId());
if (Common.isNotNull(employeeInfo)){
TEmployeeProject project = projectMapper.selectOne(Wrappers.<TEmployeeProject>query().lambda()
TEmployeeProject empProject = projectMapper.selectOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard,employeeInfo.getEmpIdcard())
.eq(TEmployeeProject::getDeleteFlag,CommonConstants.ZERO_STRING)
.eq(TEmployeeProject::getDeptNo,contract.getDeptNo())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(project)
&& ((Common.isNotNull(project.getProjectStatus())
&& project.getProjectStatus().intValue()== CommonConstants.ONE_INT)
if (Common.isNotNull(empProject)
&& ((Common.isNotNull(empProject.getProjectStatus())
&& empProject.getProjectStatus().intValue()== CommonConstants.ONE_INT)
|| (
!CommonConstants.ZERO_STRING.equals(project.getEmpNatrue())
&& !CommonConstants.ONE_STRING.equals(project.getEmpNatrue())
&& !CommonConstants.THREE_STRING.equals(project.getEmpNatrue()))
!CommonConstants.ZERO_STRING.equals(empProject.getEmpNatrue())
&& !CommonConstants.ONE_STRING.equals(empProject.getEmpNatrue())
&& !CommonConstants.THREE_STRING.equals(empProject.getEmpNatrue()))
)){
return;
}
......@@ -479,6 +522,18 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
}else {
alert.setFirstAlertTime(new Date());
}
//获取项目信息,合同配置信息,初始化前端客服、续签状态、自动化标识
if (null != project){
alert.setCsName(project.getCsName());
alert.setCsLoginName(project.getCsLoginName());
}
//默认自动化为否
alert.setAutoFlag(CommonConstants.ONE_STRING);
if (null != contractRule){
alert.setAutoFlag(CommonConstants.ZERO_STRING);
}
FeedBackDetail feedBackDetail1 = feedbackDetailMapper.findByApplyNo(contract.getApplyNo());
if (null != feedBackDetail1) {
alert.setIsFeedback(feedBackDetail1.getIsFeedback());
......
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