Commit d063e368 authored by 李灿灿's avatar 李灿灿

20221108 登记保单保费逻辑优化

parent e1313ee0
...@@ -277,10 +277,6 @@ public class InsurancesConstants { ...@@ -277,10 +277,6 @@ public class InsurancesConstants {
* 购买标准不存在 * 购买标准不存在
*/ */
public static final String BUY_STANDARD_NOT_EXIST = "购买标准不存在"; public static final String BUY_STANDARD_NOT_EXIST = "购买标准不存在";
/**
* 购买标准格式错误
*/
public static final String BUY_STANDARD_PARSE_ERROR = "购买标准格式错误";
/** /**
* 商险购买地省名称不能为空 * 商险购买地省名称不能为空
*/ */
......
...@@ -611,6 +611,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -611,6 +611,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}else { }else {
//冗余保险公司计费方式 //冗余保险公司计费方式
byId.setBillingType(Integer.valueOf(insuranceCompany.getBillingType())); byId.setBillingType(Integer.valueOf(insuranceCompany.getBillingType()));
//冗余办理地省、市
param.setInsuranceHandleProvince(insuranceCompany.getInsuranceHandleProvince());
param.setInsuranceHandleProvinceName(insuranceCompany.getInsuranceHandleProvinceName());
param.setInsuranceHandleCity(insuranceCompany.getInsuranceHandleCity());
param.setInsuranceHandleCityName(insuranceCompany.getInsuranceHandleCityName());
TInsuranceType insuranceType = tInsuranceTypeService.getOne(Wrappers.<TInsuranceType>query().lambda() TInsuranceType insuranceType = tInsuranceTypeService.getOne(Wrappers.<TInsuranceType>query().lambda()
.eq(TInsuranceType::getName, param.getInsuranceTypeName()) .eq(TInsuranceType::getName, param.getInsuranceTypeName())
...@@ -657,7 +662,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -657,7 +662,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
} }
} }
//记录查重校验:姓名 + 身份证号 + 保险公司 + 险种 + 保单开始日期~保单结束日期 是唯一(剔除退回、过期状态的记录) //记录查重校验:姓名 + 身份证号 + 保险公司 + 险种 + 保单开始日期~保单结束日期 + 购买标准 是唯一(剔除退回、过期状态的记录)
//待投保、投保中、已投保(有效、未过期) //待投保、投保中、已投保(有效、未过期)
Set<Integer> setRStatus = Sets.newHashSet(); Set<Integer> setRStatus = Sets.newHashSet();
setRStatus.add(CommonConstants.FOUR_INT); setRStatus.add(CommonConstants.FOUR_INT);
...@@ -669,6 +674,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -669,6 +674,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail::getInsuranceTypeName, param.getInsuranceTypeName()) .eq(TInsuranceDetail::getInsuranceTypeName, param.getInsuranceTypeName())
.eq(TInsuranceDetail::getPolicyStart, param.getPolicyStart()) .eq(TInsuranceDetail::getPolicyStart, param.getPolicyStart())
.eq(TInsuranceDetail::getPolicyEnd, param.getPolicyEnd()) .eq(TInsuranceDetail::getPolicyEnd, param.getPolicyEnd())
.eq(TInsuranceDetail::getBuyStandard, param.getBuyStandard())
.notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus) .notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
//有效 //有效
...@@ -1461,7 +1467,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1461,7 +1467,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CollectionUtils.isNotEmpty(listSuccess)){ if (CollectionUtils.isNotEmpty(listSuccess)){
for (InsuranceRegisterParam success : listSuccess) { for (InsuranceRegisterParam success : listSuccess) {
//登记保单保费 //登记保单保费
//查数据:姓名 + 身份证号 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间 //查数据:姓名 + 身份证号 + 保险公司 + 险种名称 + 保单开始时间 + 保单结束时间 + 购买标准
TInsuranceDetail detail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda() TInsuranceDetail detail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpName, success.getEmpName()) .eq(TInsuranceDetail::getEmpName, success.getEmpName())
.eq(TInsuranceDetail::getEmpIdcardNo, success.getEmpIdcardNo()) .eq(TInsuranceDetail::getEmpIdcardNo, success.getEmpIdcardNo())
...@@ -1469,6 +1475,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1469,6 +1475,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail::getInsuranceTypeName, success.getInsuranceTypeName()) .eq(TInsuranceDetail::getInsuranceTypeName, success.getInsuranceTypeName())
.eq(TInsuranceDetail::getPolicyStart, LocalDateUtil.parseLocalDate(success.getPolicyStart())) .eq(TInsuranceDetail::getPolicyStart, LocalDateUtil.parseLocalDate(success.getPolicyStart()))
.eq(TInsuranceDetail::getPolicyEnd, LocalDateUtil.parseLocalDate(success.getPolicyEnd())) .eq(TInsuranceDetail::getPolicyEnd, LocalDateUtil.parseLocalDate(success.getPolicyEnd()))
.eq(TInsuranceDetail::getBuyStandard, success.getBuyStandard())
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceDetail::getUpdateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
...@@ -1924,6 +1931,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1924,6 +1931,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//20221107 现在需求要求允许同一个人同时存在多个不同的在保信息 //20221107 现在需求要求允许同一个人同时存在多个不同的在保信息
//&& LocalDateUtil.hasOverlap(LocalDateUtil.parseLocalDate(param.getPolicyStart()),LocalDateUtil.parseLocalDate(param.getPolicyEnd()),LocalDateUtil.parseLocalDate(repeat.getPolicyStart()),LocalDateUtil.parseLocalDate(repeat.getPolicyEnd())) //&& LocalDateUtil.hasOverlap(LocalDateUtil.parseLocalDate(param.getPolicyStart()),LocalDateUtil.parseLocalDate(param.getPolicyEnd()),LocalDateUtil.parseLocalDate(repeat.getPolicyStart()),LocalDateUtil.parseLocalDate(repeat.getPolicyEnd()))
&& param.getPolicyStart().equals(repeat.getPolicyStart()) && param.getPolicyEnd().equals(repeat.getPolicyEnd()) && param.getPolicyStart().equals(repeat.getPolicyStart()) && param.getPolicyEnd().equals(repeat.getPolicyEnd())
&& param.getBuyStandard().equals(repeat.getBuyStandard())
&& i != j){ && i != j){
param.setErrorMessage(InsurancesConstants.DUPLICATE_DATA_ERROR); param.setErrorMessage(InsurancesConstants.DUPLICATE_DATA_ERROR);
listResult.add(param); listResult.add(param);
...@@ -2093,7 +2101,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2093,7 +2101,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
//记录查重校验:姓名 + 身份证号 + 保险公司 + 险种 + 保单开始日期~保单结束日期 是唯一(剔除退回、过期状态的记录) //记录查重校验:姓名 + 身份证号 + 保险公司 + 险种 + 保单开始日期~保单结束日期 + 购买标准 是唯一(剔除退回、过期状态的记录)
//待投保、投保中、已投保(有效、未过期) //待投保、投保中、已投保(有效、未过期)
Set<Integer> setRStatus = Sets.newHashSet(); Set<Integer> setRStatus = Sets.newHashSet();
setRStatus.add(CommonConstants.FOUR_INT); setRStatus.add(CommonConstants.FOUR_INT);
...@@ -2105,6 +2113,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2105,6 +2113,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail::getInsuranceTypeName, param.getInsuranceTypeName()) .eq(TInsuranceDetail::getInsuranceTypeName, param.getInsuranceTypeName())
.eq(TInsuranceDetail::getPolicyStart, param.getPolicyStart()) .eq(TInsuranceDetail::getPolicyStart, param.getPolicyStart())
.eq(TInsuranceDetail::getPolicyEnd, param.getPolicyEnd()) .eq(TInsuranceDetail::getPolicyEnd, param.getPolicyEnd())
.eq(TInsuranceDetail::getBuyStandard, param.getBuyStandard())
.notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus) .notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus)
//有效 //有效
.and( .and(
...@@ -2234,7 +2243,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2234,7 +2243,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param); listResult.add(param);
continue; continue;
} }
//表内数据重复 员工姓名、员工身份证号码、保险公司、险种 //表内数据重复 员工姓名、员工身份证号码、保险公司、险种、购买标准
for (int j = 0; j < distinctList.size(); j++) { for (int j = 0; j < distinctList.size(); j++) {
InsuranceBatchParam repeat = distinctList.get(j); InsuranceBatchParam repeat = distinctList.get(j);
if (param.getEmpName().equals(repeat.getEmpName()) if (param.getEmpName().equals(repeat.getEmpName())
...@@ -2450,7 +2459,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2450,7 +2459,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
//记录查重校验:姓名 + 身份证号 + 保险公司 + 险种 //记录查重校验:姓名 + 身份证号 + 保单号 + 保险公司 + 险种 + 购买标准
//待投保、投保中、已投保(有效、未过期) //待投保、投保中、已投保(有效、未过期)
Set<Integer> setRStatus = Sets.newHashSet(); Set<Integer> setRStatus = Sets.newHashSet();
setRStatus.add(CommonConstants.FOUR_INT); setRStatus.add(CommonConstants.FOUR_INT);
...@@ -2863,21 +2872,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2863,21 +2872,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue; continue;
} }
if (StringUtils.isBlank(param.getBuyStandard())){ if (StringUtils.isBlank(param.getBuyStandard())){
param.setErrorMessage(InsurancesConstants.BUY_STANDARD_NOT_EXIST); param.setErrorMessage(InsurancesConstants.BUY_STANDARD_NOT_EMPTY);
listResult.add(param);
continue;
}else {
if (!ValidityUtil.validateMoney(param.getBuyStandard())){
param.setErrorMessage(InsurancesConstants.BUY_STANDARD_PARSE_ERROR);
listResult.add(param);
continue;
}
if (!ValidityUtil.validateMoneyMax(param.getBuyStandard())){
param.setErrorMessage(InsurancesConstants.INSURANCE_TYPE_STANDARD_MAX_ERROR);
listResult.add(param); listResult.add(param);
continue; continue;
} }
}
if (StringUtils.isNotBlank(param.getPolicyNo())){ if (StringUtils.isNotBlank(param.getPolicyNo())){
if (!ValidityUtil.validate50(param.getPolicyNo())){ if (!ValidityUtil.validate50(param.getPolicyNo())){
param.setErrorMessage(InsurancesConstants.POLICY_NO_MORE_THAN_50); param.setErrorMessage(InsurancesConstants.POLICY_NO_MORE_THAN_50);
......
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