Commit a55cde94 authored by fangxinjiang's avatar fangxinjiang

合同续签优化-fxj

parent 64c39899
...@@ -633,7 +633,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -633,7 +633,7 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
} }
} }
if (CommonConstants.TWENTY_STRING.equals(preVo.getContractType())){ if (CommonConstants.TWENTY_STRING.equals(preVo.getContractType())){
//处理劳务协议: 先看上一份合同是否为劳务协议,如果是取值上一份合同的劳务协议结束日期 //处理务派遣合同: 先看上一份合同是否为劳务协议,如果是取值上一份合同的劳务协议结束日期
Date initDate = contract.getContractEnd(); Date initDate = contract.getContractEnd();
if (Common.isNotNull(contract.getPreNewId())){ if (Common.isNotNull(contract.getPreNewId())){
TEmployeeContractPreNew preNew = baseMapper.selectOne(Wrappers.<TEmployeeContractPreNew>query().lambda() TEmployeeContractPreNew preNew = baseMapper.selectOne(Wrappers.<TEmployeeContractPreNew>query().lambda()
...@@ -652,6 +652,22 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -652,6 +652,22 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
} }
preVo.setDispatchPeriodStart(DateUtil.addDayByDate(initDate,1)); preVo.setDispatchPeriodStart(DateUtil.addDayByDate(initDate,1));
if (Common.isNotNull(preVo.getDispatchPeriodYear()) && Common.isNotNull(preVo.getDispatchPeriodMonth())){ if (Common.isNotNull(preVo.getDispatchPeriodYear()) && Common.isNotNull(preVo.getDispatchPeriodMonth())){
//校验劳务派遣的派遣年限必须为两年
final int REQUIRED_SERVICE_YEARS = 2;
int year = 0;
try {
year = Integer.parseInt(Common.isEmpty(preVo.getDispatchPeriodYear()) ? "0" : preVo.getDispatchPeriodYear().trim());
} catch (NumberFormatException e) {
return "劳务派遣的派遣年限格式不正确";
}
String dispatchMonth = preVo.getDispatchPeriodMonth();
if ("12".equals(dispatchMonth)) {
year = year + 1;
}
if (year < REQUIRED_SERVICE_YEARS) {
return "劳务派遣合同的合同年限不能小于2年,请检查";
}
vo = new TEmployeeContractDateVo(); vo = new TEmployeeContractDateVo();
vo.setMonthAfter(Integer.parseInt(Common.isEmpty(preVo.getDispatchPeriodMonth()) ? "0": preVo.getDispatchPeriodMonth())); vo.setMonthAfter(Integer.parseInt(Common.isEmpty(preVo.getDispatchPeriodMonth()) ? "0": preVo.getDispatchPeriodMonth()));
vo.setYearAfter(Integer.parseInt(Common.isEmpty(preVo.getDispatchPeriodYear()) ? "0": preVo.getDispatchPeriodYear())); vo.setYearAfter(Integer.parseInt(Common.isEmpty(preVo.getDispatchPeriodYear()) ? "0": preVo.getDispatchPeriodYear()));
...@@ -663,6 +679,15 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon ...@@ -663,6 +679,15 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
return "派遣结束日期需大于等于派遣开始日期"; return "派遣结束日期需大于等于派遣开始日期";
} }
} }
//合同开始时间、合同截止时间 与派遣的合同开始时间、合同截止时间一致
if (Common.isNotNull(preVo.getContractStart()) && Common.isNotNull(preVo.getDispatchPeriodStart())
&& !preVo.getContractStart().equals(preVo.getDispatchPeriodStart())){
return "合同开始日期与派遣开始日期不一致";
}
if (Common.isNotNull(preVo.getContractEnd()) && Common.isNotNull(preVo.getDispatchPeriodEnd())
&& !preVo.getContractEnd().equals(preVo.getDispatchPeriodEnd())){
return "合同截止日期与派遣截止日期不一致";
}
} }
//同商务合同一直 要 验证时间 截止时间大于等于开始时间、时间交叉 //同商务合同一直 要 验证时间 截止时间大于等于开始时间、时间交叉
if (Common.isNotNull(preVo.getContractStart()) && Common.isNotNull(preVo.getContractEnd())){ if (Common.isNotNull(preVo.getContractStart()) && Common.isNotNull(preVo.getContractEnd())){
......
...@@ -428,6 +428,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -428,6 +428,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<TInsuranceSettle> settleList = new ArrayList<>(); List<TInsuranceSettle> settleList = new ArrayList<>();
List<String> sourceIdCardList = new ArrayList<>(); List<String> sourceIdCardList = new ArrayList<>();
List<TInsuranceDetail> pushList = new ArrayList<>(); List<TInsuranceDetail> pushList = new ArrayList<>();
//找到对应项目的前端客服及客服的登录ID
// 前端客服对应的账号信息
Map<String,SysUser> sysUserMap = null;
//自动化派单才处理创建人信息
sysUserMap = getSysUserMapAdd(autoFlag, listSuccess, sysUserMap);
SysUser userTemp = null;
for (InsuranceAddParam success : listSuccess) { for (InsuranceAddParam success : listSuccess) {
TInsuranceDetail detail = new TInsuranceDetail(); TInsuranceDetail detail = new TInsuranceDetail();
BeanCopyUtils.copyProperties(success,detail); BeanCopyUtils.copyProperties(success,detail);
...@@ -445,8 +451,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -445,8 +451,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//保费都默认是0 //保费都默认是0
detail.setActualPremium(new BigDecimal("0.00")); detail.setActualPremium(new BigDecimal("0.00"));
detail.setEstimatePremium(new BigDecimal("0.00")); detail.setEstimatePremium(new BigDecimal("0.00"));
detail.setCreateBy(null == user ? "1" : user.getId()); if (null == user){
detail.setCreateName(null == user ? "自动化派单" + "-" + success.getCustomerUserName() : user.getNickname()); userTemp = sysUserMap.get(detail.getDeptNo());
if (null != userTemp){
detail.setCreateBy(userTemp.getUserId());
detail.setCreateName("自动化派单" + "-" + userTemp.getNickname() );
}else {
detail.setCreateBy( "1");
detail.setCreateName("自动化派单" + "-" + success.getCustomerUserName());
}
}else {
detail.setCreateBy(user.getId());
detail.setCreateName(user.getNickname());
}
detail.setId(RandomStringUtils.randomNumeric(19)); detail.setId(RandomStringUtils.randomNumeric(19));
//是否见费出单逻辑处理:预估保费结算、购买周期计算、保单结束日期结算、参保开始日期计算、预计办理日期计算 //是否见费出单逻辑处理:预估保费结算、购买周期计算、保单结束日期结算、参保开始日期计算、预计办理日期计算
initJfcdInfo(preDispatchDate, detail,settleList); initJfcdInfo(preDispatchDate, detail,settleList);
...@@ -667,6 +684,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -667,6 +684,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<String> sourceIdCardList = new ArrayList<>(); List<String> sourceIdCardList = new ArrayList<>();
List<String> replaceIdList = new ArrayList<>(); List<String> replaceIdList = new ArrayList<>();
List<TInsuranceSettle> settleList = new ArrayList<>(); List<TInsuranceSettle> settleList = new ArrayList<>();
//找到对应项目的前端客服及客服的登录ID
// 前端客服对应的账号信息
Map<String,SysUser> sysUserMap = null;
//自动化派单才处理创建人信息
sysUserMap = getSysUserMapBatch(autoFlag, listSuccess, sysUserMap);
SysUser userTemp = null;
for (InsuranceBatchParam success : listSuccess) { for (InsuranceBatchParam success : listSuccess) {
detail = new TInsuranceDetail(); detail = new TInsuranceDetail();
BeanCopyUtils.copyProperties(success,detail); BeanCopyUtils.copyProperties(success,detail);
...@@ -682,8 +705,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -682,8 +705,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
detail.setActualPremium(new BigDecimal("0.00")); detail.setActualPremium(new BigDecimal("0.00"));
detail.setEstimatePremium(new BigDecimal("0.00")); detail.setEstimatePremium(new BigDecimal("0.00"));
detail.setCreateBy(null == user ? "1" : user.getId()); if (null == user){
detail.setCreateName(null == user ? "自动化派单" + "-" + success.getCustomerUserName() : user.getNickname()); userTemp = sysUserMap.get(detail.getDeptNo());
if (null != userTemp){
detail.setCreateBy(userTemp.getUserId());
detail.setCreateName("自动化派单" + "-" + userTemp.getNickname() );
}else {
detail.setCreateBy( "1");
detail.setCreateName("自动化派单" + "-" + success.getCustomerUserName());
}
}else {
detail.setCreateBy(user.getId());
detail.setCreateName(user.getNickname());
}
detailList.add(detail); detailList.add(detail);
sourceIdCardList.add(detail.getEmpIdcardNo()); sourceIdCardList.add(detail.getEmpIdcardNo());
replaceIdList.add(detail.getId()); replaceIdList.add(detail.getId());
...@@ -807,6 +841,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -807,6 +841,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
boolean isAuto = false; boolean isAuto = false;
List<TInsuranceOperate> operateList = new ArrayList<>(); List<TInsuranceOperate> operateList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(listSuccess)){ if (CollectionUtils.isNotEmpty(listSuccess)){
//找到对应项目的前端客服及客服的登录ID
// 前端客服对应的账号信息
Map<String,SysUser> sysUserMap = null;
//自动化派单才处理创建人信息
sysUserMap = getSysUserMap(autoFlag, listSuccess, sysUserMap);
SysUser userTemp = null;
for (InsuranceReplaceParam success : listSuccess) { for (InsuranceReplaceParam success : listSuccess) {
//替换 //替换
TInsuranceDetail newDetail = new TInsuranceDetail(); TInsuranceDetail newDetail = new TInsuranceDetail();
...@@ -864,8 +904,20 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -864,8 +904,20 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
newDetail.setSignFlag(CommonConstants.ZERO_INT); newDetail.setSignFlag(CommonConstants.ZERO_INT);
//创建时间是新数据插入时间 //创建时间是新数据插入时间
newDetail.setCreateTime(LocalDateTime.now()); newDetail.setCreateTime(LocalDateTime.now());
newDetail.setCreateBy(null == user ? "1" : user.getId()); if (null == user){
newDetail.setCreateName(null == user ? "自动化派单" + "-" + success.getCustomerUserName() : user.getNickname()); userTemp = sysUserMap.get(newDetail.getDeptNo());
if (null != userTemp){
newDetail.setCreateBy(userTemp.getUserId());
newDetail.setCreateName("自动化派单" + "-" + userTemp.getNickname() );
}else {
newDetail.setCreateBy( "1");
newDetail.setCreateName("自动化派单" + "-" + success.getCustomerUserName());
}
}else {
newDetail.setCreateBy(user.getId());
newDetail.setCreateName(user.getNickname());
}
//替换不参与结算 //替换不参与结算
newDetail.setDefaultSettleId(null); newDetail.setDefaultSettleId(null);
//替换不继承备注 20250331 fxj 替换模板新增备注字段不用清空 //替换不继承备注 20250331 fxj 替换模板新增备注字段不用清空
...@@ -909,8 +961,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -909,8 +961,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
replace.setReplaceStatus(CommonConstants.ONE_INT); replace.setReplaceStatus(CommonConstants.ONE_INT);
replace.setReplaceTime(LocalDateTime.now()); replace.setReplaceTime(LocalDateTime.now());
replace.setCreateBy(null == user ? "1" : user.getId()); if (null == user){
replace.setCreateName(null == user ? "自动化派单" + "-" + success.getCustomerUserName() : user.getNickname()); userTemp = sysUserMap.get(newDetail.getDeptNo());
if (null != userTemp){
replace.setCreateBy(userTemp.getUserId());
replace.setCreateName("自动化派单" + "-" + userTemp.getNickname() );
}else {
replace.setCreateBy( "1");
replace.setCreateName("自动化派单" + "-" + success.getCustomerUserName());
}
}else {
replace.setCreateBy(user.getId());
replace.setCreateName(user.getNickname());
}
replace.setCreateTime(LocalDateTime.now()); replace.setCreateTime(LocalDateTime.now());
tInsuranceReplaceService.save(replace); tInsuranceReplaceService.save(replace);
updateEmployeeInsurancePre(success.getInsurancePreId(),newDetail,CommonConstants.THREE_STRING); updateEmployeeInsurancePre(success.getInsurancePreId(),newDetail,CommonConstants.THREE_STRING);
...@@ -961,6 +1024,76 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -961,6 +1024,76 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
} }
private Map<String, SysUser> getSysUserMapBatch(boolean autoFlag, List<InsuranceBatchParam> listSuccess, Map<String, SysUser> sysUserMap) {
if (autoFlag) {
List<String> codes = listSuccess != null && !listSuccess.isEmpty()
? listSuccess.stream()
.map(InsuranceBatchParam::getDeptNo)
.filter(Objects::nonNull)
.distinct()
.collect(Collectors.toCollection(ArrayList::new))
: Collections.emptyList();
sysUserMap = getStringSysUserMap(codes, sysUserMap);
}
if (sysUserMap == null) {
sysUserMap = new HashMap<>();
}
return sysUserMap;
}
private Map<String, SysUser> getSysUserMap(boolean autoFlag, List<InsuranceReplaceParam> listSuccess, Map<String, SysUser> sysUserMap) {
if (autoFlag) {
List<String> codes = listSuccess != null && !listSuccess.isEmpty()
? listSuccess.stream()
.map(InsuranceReplaceParam::getReplaceDeptNo)
.filter(Objects::nonNull)
.distinct()
.collect(Collectors.toCollection(ArrayList::new))
: Collections.emptyList();
sysUserMap = getStringSysUserMap(codes, sysUserMap);
}
if (sysUserMap == null) {
sysUserMap = new HashMap<>();
}
return sysUserMap;
}
private Map<String, SysUser> getSysUserMapAdd(boolean autoFlag, List<InsuranceAddParam> listSuccess, Map<String, SysUser> sysUserMap) {
if (autoFlag) {
List<String> codes = listSuccess != null && !listSuccess.isEmpty()
? listSuccess.stream()
.map(InsuranceAddParam::getDeptNo)
.filter(Objects::nonNull)
.distinct()
.collect(Collectors.toCollection(ArrayList::new))
: Collections.emptyList();
sysUserMap = getStringSysUserMap(codes, sysUserMap);
}
if (sysUserMap == null) {
sysUserMap = new HashMap<>();
}
return sysUserMap;
}
private Map<String, SysUser> getStringSysUserMap(List<String> codes, Map<String, SysUser> sysUserMap) {
if (!codes.isEmpty()) {
// 查到前端客服的登录名 (登录名称唯一) 然后去找登录 ID
// 获取对应项目信息
Map<String, TSettleDomain> domainHashMap = new HashMap<>();
R<TSettleDomainListVo> infoByCodes = archivesDaprUtil.getSettleInfoByCodes(codes);
if (infoByCodes != null && Common.isNotNull(infoByCodes.getData())) {
TSettleDomainListVo data = infoByCodes.getData();
if (Common.isNotNull(data.getMapVO())) {
domainHashMap = data.getMapVO();
}
}
// 获取项目对应的前端客服用户信息
sysUserMap = getStringSysUserMap(sysUserMap, domainHashMap);
}
return sysUserMap;
}
/** /**
* 通过id删除 * 通过id删除
* *
...@@ -10209,4 +10342,44 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -10209,4 +10342,44 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
return baseMapper.getInsuranceListPagePaymentMoney(param); return baseMapper.getInsuranceListPagePaymentMoney(param);
} }
/**
* @Author fxj
* @Description 根据项目编码CODES 获取项目前端客服用户信息
* @Date 19:07 2025/3/12
**/
private Map<String, SysUser> getStringSysUserMap(Map<String, SysUser> sysUserMap, Map<String, TSettleDomain> domainHashMap) {
if (Common.isEmpty(sysUserMap)){
sysUserMap = new HashMap<>(16);
}
if (Common.isNotKong(domainHashMap)) {
// 项目用户对应关系表
Map<String, String> userNameMap = new HashMap<>();
List<String> loginNameList = new ArrayList<>();
for (TSettleDomain val : domainHashMap.values()) {
if (val != null && Common.isNotNull(val.getCsLoginName())) {
userNameMap.put(val.getCsLoginName(), val.getDepartNo());
loginNameList.add(val.getCsLoginName());
}
}
if (!loginNameList.isEmpty()) {
String userNames = String.join(CommonConstants.COMMA_STRING, loginNameList);
R<SysUserListVo> res = upmsDaprUtils.getUserIdsByUserNames(userNames);
if (Common.isNotNull(res) && Common.isNotNull(res.getData())) {
List<SysUser> users = res.getData().getUserList();
if (Common.isNotKong(users)) {
for (SysUser user : users) {
if (Common.isNotNull(user.getUsername()) && userNameMap.containsKey(user.getUsername())) {
sysUserMap.put(userNameMap.get(user.getUsername()), user);
}
}
}
}
}
}
return sysUserMap;
}
} }
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