Commit c3f85d4f authored by huyuchen's avatar huyuchen

Merge remote-tracking branch 'origin/MVP1.7.19' into MVP1.7.19

parents dc6013aa 603d4439
...@@ -446,12 +446,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -446,12 +446,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setId(RandomStringUtils.randomNumeric(19)); detail.setId(RandomStringUtils.randomNumeric(19));
//是否见费出单逻辑处理:预估保费结算、购买周期计算、保单结束日期结算、参保开始日期计算、预计办理日期计算 //是否见费出单逻辑处理:预估保费结算、购买周期计算、保单结束日期结算、参保开始日期计算、预计办理日期计算
initJfcdInfo(preDispatchDate, detail,settleList); initJfcdInfo(preDispatchDate, detail,settleList);
//生成收入数据
createInsuranceInfo(detail,mapSelectVo.get(detail.getDeptNo()));
detailList.add(detail); detailList.add(detail);
sourceIdCardList.add(detail.getEmpIdcardNo()); sourceIdCardList.add(detail.getEmpIdcardNo());
baseMapper.insert(detail); baseMapper.insert(detail);
if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){ if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){
//生成收入数据
createInsuranceInfo(detail,mapSelectVo.get(detail.getDeptNo()));
updateEmployeeInsurancePre(success.getInsurancePreId(),detail,CommonConstants.SEVEN_STRING); updateEmployeeInsurancePre(success.getInsurancePreId(),detail,CommonConstants.SEVEN_STRING);
updateEmployeeInsurancePreRenew(success.getInsurancePreRenewId(),detail,CommonConstants.SEVEN_STRING); updateEmployeeInsurancePreRenew(success.getInsurancePreRenewId(),detail,CommonConstants.SEVEN_STRING);
//异步任务推送 //异步任务推送
...@@ -547,6 +547,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -547,6 +547,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.multiply(new BigDecimal(day)) .multiply(new BigDecimal(day))
.divide(new BigDecimal("365"), 2, RoundingMode.HALF_UP) .divide(new BigDecimal("365"), 2, RoundingMode.HALF_UP)
.add(new BigDecimal("5.00"))); .add(new BigDecimal("5.00")));
//按月计费方式
}else if (null != detail.getBillingType() && CommonConstants.ONE_INT == detail.getBillingType().intValue()){
TInsuranceTypeRate typeRate = tInsuranceTypeRateService.getOne(Wrappers.<TInsuranceTypeRate>query().lambda() TInsuranceTypeRate typeRate = tInsuranceTypeRateService.getOne(Wrappers.<TInsuranceTypeRate>query().lambda()
.eq(TInsuranceTypeRate::getInsuranceTypeId, detail.getInsuranceTypeId()) .eq(TInsuranceTypeRate::getInsuranceTypeId, detail.getInsuranceTypeId())
.eq(TInsuranceTypeRate::getMonth, purchaseCycle) .eq(TInsuranceTypeRate::getMonth, purchaseCycle)
...@@ -556,8 +558,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -556,8 +558,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (null != typeRate){ if (null != typeRate){
detail.setRate(new BigDecimal(typeRate.getRate())); detail.setRate(new BigDecimal(typeRate.getRate()));
} }
//按月计费方式
}else if (null != detail.getBillingType() && CommonConstants.ONE_INT == detail.getBillingType().intValue()){
detail.setEstimatePremium(new BigDecimal(detail.getBuyStandard()) detail.setEstimatePremium(new BigDecimal(detail.getBuyStandard())
.multiply(null== detail.getRate()?BigDecimal.ZERO: detail.getRate()) .multiply(null== detail.getRate()?BigDecimal.ZERO: detail.getRate())
.add(new BigDecimal("5.00"))); .add(new BigDecimal("5.00")));
...@@ -582,6 +582,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -582,6 +582,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
settle.setId(RandomStringUtils.randomNumeric(19)); settle.setId(RandomStringUtils.randomNumeric(19));
settleList.add(settle); settleList.add(settle);
detail.setDefaultSettleId(settle.getId()); detail.setDefaultSettleId(settle.getId());
}else {
detail.setEstimatePremium(BigDecimal.ZERO);
} }
} }
...@@ -663,10 +665,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -663,10 +665,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
replaceIdList.add(detail.getId()); replaceIdList.add(detail.getId());
//是否见费出单逻辑处理:预估保费结算、购买周期计算、保单结束日期结算、参保开始日期计算、预计办理日期计算 //是否见费出单逻辑处理:预估保费结算、购买周期计算、保单结束日期结算、参保开始日期计算、预计办理日期计算
initJfcdInfo(preDispatchDate, detail,settleList); initJfcdInfo(preDispatchDate, detail,settleList);
//生成收入数据
createInsuranceInfo(detail,mapSelectVo.get(detail.getDeptNo()));
baseMapper.insert(detail); baseMapper.insert(detail);
if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){ if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){
//生成收入数据
createInsuranceInfo(detail,mapSelectVo.get(detail.getDeptNo()));
updateEmployeeInsurancePre(success.getInsurancePreId(),detail,CommonConstants.SEVEN_STRING); updateEmployeeInsurancePre(success.getInsurancePreId(),detail,CommonConstants.SEVEN_STRING);
updateEmployeeInsurancePreRenew(success.getInsurancePreRenewId(),detail,CommonConstants.SEVEN_STRING); updateEmployeeInsurancePreRenew(success.getInsurancePreRenewId(),detail,CommonConstants.SEVEN_STRING);
//异步任务推送 //异步任务推送
...@@ -1199,6 +1201,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1199,6 +1201,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceDetailVO.setPremiumType(CommonConstants.ONE_INT); insuranceDetailVO.setPremiumType(CommonConstants.ONE_INT);
} }
} }
if (null != insuranceDetailVO.getPremiumType() && CommonConstants.ONE_INT == insuranceDetailVO.getPremiumType().intValue()){
insuranceDetailVO.setEstimatePremium(BigDecimal.ZERO);
}
long day = LocalDateUtil.betweenDay(insuranceDetailVO.getPolicyStart().toString(),insuranceDetailVO.getPolicyEnd().toString()); long day = LocalDateUtil.betweenDay(insuranceDetailVO.getPolicyStart().toString(),insuranceDetailVO.getPolicyEnd().toString());
long month = LocalDateUtil.betweenMonth(insuranceDetailVO.getPolicyStart().toString(),insuranceDetailVO.getPolicyEnd().toString()); long month = LocalDateUtil.betweenMonth(insuranceDetailVO.getPolicyStart().toString(),insuranceDetailVO.getPolicyEnd().toString());
String defaultSettleId = insuranceDetailVO.getDefaultSettleId(); String defaultSettleId = insuranceDetailVO.getDefaultSettleId();
...@@ -1779,7 +1784,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1779,7 +1784,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//添加日志 //添加日志
newDetail.setPaymentTime(CommonConstants.EMPTY_STRING); newDetail.setPaymentTime(CommonConstants.EMPTY_STRING);
newDetail.setPaymentStatus(CommonConstants.ZERO_STRING); newDetail.setPaymentStatus(CommonConstants.ZERO_STRING);
tBusinessOperateService.saveModificationRecord(detail.getId(),oldDetail,newDetail,"投保退回更新缴费状态、缴费时间","EKP系统"); tBusinessOperateService.saveModificationRecord(detail.getId(),oldDetail,newDetail,"投保退回更新缴费状态、缴费时间",user.getNickname());
//投保成功后再次投保退回,需要将保单生效日期、是否有效、是否过期置为空 //投保成功后再次投保退回,需要将保单生效日期、是否有效、是否过期置为空
if (detail.getSignFlag() == CommonConstants.ONE_INT){ if (detail.getSignFlag() == CommonConstants.ONE_INT){
detail.setHandledTime(null); detail.setHandledTime(null);
...@@ -2098,7 +2103,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2098,7 +2103,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
// 预估保费 = 费率 * 购买标准 + 5元 // 预估保费 = 费率 * 购买标准 + 5元
BigDecimal estimatePremium = new BigDecimal(detail.getBuyStandard()) BigDecimal estimatePremium = new BigDecimal(detail.getBuyStandard())
.multiply(detail.getRate()) .multiply(detail.getRate())
.add(BigDecimal.valueOf(5.00))
.setScale(2,BigDecimal.ROUND_HALF_UP); .setScale(2,BigDecimal.ROUND_HALF_UP);
detail.setEstimatePremium(estimatePremium); detail.setEstimatePremium(estimatePremium);
if (detail.getBuyType() == CommonConstants.THREE_INT){ if (detail.getBuyType() == CommonConstants.THREE_INT){
...@@ -2142,8 +2146,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2142,8 +2146,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//预估保费 = (购买标准 / 365) * 天数 + 5元 //预估保费 = (购买标准 / 365) * 天数 + 5元
BigDecimal estimatePremium = new BigDecimal(detail.getBuyStandard()) BigDecimal estimatePremium = new BigDecimal(detail.getBuyStandard())
.multiply(new BigDecimal(day)) .multiply(new BigDecimal(day))
.divide(new BigDecimal("365"),CommonConstants.TWO_INT,BigDecimal.ROUND_HALF_UP) .divide(new BigDecimal("365"),CommonConstants.TWO_INT,BigDecimal.ROUND_HALF_UP);
.add(BigDecimal.valueOf(5.00));
detail.setEstimatePremium(estimatePremium); detail.setEstimatePremium(estimatePremium);
//记录状态均置为「已投保」 //记录状态均置为「已投保」
detail.setBuyHandleStatus(CommonConstants.THREE_INT); detail.setBuyHandleStatus(CommonConstants.THREE_INT);
...@@ -2204,29 +2207,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2204,29 +2207,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
successOne.add(detail); successOne.add(detail);
updateEmployeeInsurancePreById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING); updateEmployeeInsurancePreById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING);
updateEmployeeInsurancePreRenewById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING, false); updateEmployeeInsurancePreRenewById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING, false);
//如果是见费出单,生成差额数据 //如果是见费出单,不重复生成预估,具体差额在登记保单保费处处理
if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){ if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){
//保费存储
TInsuranceSettle settle = new TInsuranceSettle();
settle.setInsDetailId(detail.getId());
settle.setSettleType(CommonConstants.TWO_INT);
settle.setSettleHandleStatus(CommonConstants.ONE_STRING);
settle.setEstimatePremium(BigDecimalUtils.safeAdd(detail.getActualPremium(),detail.getEstimatePremium()));
settle.setActualPremium(BigDecimal.ZERO);
//调完ekp接口才会是1
settle.setIsEstimatePush(CommonConstants.ONE_INT);
settle.setEstimatePushTime(LocalDateTime.now());
settle.setCreateTime(LocalDateTime.now());
settle.setId(RandomStringUtils.randomNumeric(19));
settleList.add(settle);
TInsuranceDetail detailTemp = new TInsuranceDetail();
BeanCopyUtils.copyProperties(detail,detailTemp);
detailTemp.setDefaultSettleId(settle.getId());
detailTemp.setEstimatePremium(BigDecimalUtils.safeAdd(detail.getActualPremium(),detail.getEstimatePremium()));
detailTemp.setActualPremium(BigDecimal.ZERO);
//差额结算
detailTemp.setSettleType(CommonConstants.TWO_INT);
successBanlance.add(detailTemp);
successThree.add(detail); successThree.add(detail);
} }
} }
...@@ -8057,8 +8039,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -8057,8 +8039,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
// 预估保费 = 费率 * 购买标准 // 预估保费 = 费率 * 购买标准
BigDecimal estimatePremium = new BigDecimal(insuranceDetail.getBuyStandard()) BigDecimal estimatePremium = new BigDecimal(insuranceDetail.getBuyStandard())
.multiply(insuranceDetail.getRate()) .multiply(insuranceDetail.getRate())
.setScale(2,BigDecimal.ROUND_HALF_UP) .setScale(2,BigDecimal.ROUND_HALF_UP);
.add(BigDecimal.valueOf(5.00));
param.setEstimatePremium(estimatePremium); param.setEstimatePremium(estimatePremium);
}else { }else {
//按天 //按天
...@@ -8067,8 +8048,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -8067,8 +8048,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//预估保费 = (购买标准 / 365) * 天数 //预估保费 = (购买标准 / 365) * 天数
BigDecimal estimatePremium = new BigDecimal(insuranceDetail.getBuyStandard()) BigDecimal estimatePremium = new BigDecimal(insuranceDetail.getBuyStandard())
.multiply(new BigDecimal(day)) .multiply(new BigDecimal(day))
.divide(new BigDecimal("365"),CommonConstants.TWO_INT,BigDecimal.ROUND_HALF_UP) .divide(new BigDecimal("365"),CommonConstants.TWO_INT,BigDecimal.ROUND_HALF_UP);
.add(BigDecimal.valueOf(5.00));
param.setEstimatePremium(estimatePremium); param.setEstimatePremium(estimatePremium);
} }
} }
......
...@@ -639,6 +639,10 @@ public class DoJointInsuranceTask { ...@@ -639,6 +639,10 @@ public class DoJointInsuranceTask {
if (InsurancesConstants.ACTUAL_SETTLE_BILL.equals(param.getSettleType())){ if (InsurancesConstants.ACTUAL_SETTLE_BILL.equals(param.getSettleType())){
ys = 0L; ys = 0L;
} }
//针对启用BPO结算模式的,无论是否为预估模式是否需提前缴费,都不会产生商险的预估数据
if (InsurancesConstants.ESTIMATE_SETTLE_BILL.equals(param.getSettleType())){
return null;
}
}else { }else {
if (!"0".equals(param.getIsJfcd())){ if (!"0".equals(param.getIsJfcd())){
//1、针对非提前缴费也非预估模式也未启用BPO结算模式的项目下,商险只存在实缴费用,实缴费用中应收等于应支——此类费用“实缴费用”需已收才能支出 //1、针对非提前缴费也非预估模式也未启用BPO结算模式的项目下,商险只存在实缴费用,实缴费用中应收等于应支——此类费用“实缴费用”需已收才能支出
...@@ -663,6 +667,8 @@ public class DoJointInsuranceTask { ...@@ -663,6 +667,8 @@ public class DoJointInsuranceTask {
} else if ("0".equals(param.getIsJfcd())){ } else if ("0".equals(param.getIsJfcd())){
//见费出单 是否全部结算 都是 是 //见费出单 是否全部结算 都是 是
pushParam.setFd_3b13b2ecc164aa("是"); pushParam.setFd_3b13b2ecc164aa("是");
//实际结算月份置空
pushParam.setFd_3af9d11088facc(null);
//3、针对提前缴费的项目,无论是否为预估模式,商险存在预估费用,预估费用中应收有值为按照规则计算得出的,应支为0;存在实缴费用,实缴费用应收为0,应支等于导入的实缴金额; //3、针对提前缴费的项目,无论是否为预估模式,商险存在预估费用,预估费用中应收有值为按照规则计算得出的,应支为0;存在实缴费用,实缴费用应收为0,应支等于导入的实缴金额;
// 存在差额费用,差额费用应收有值,等于“实缴的应支金额-预估的应收金额——此类实缴支出会判断是否存在提前缴费的标识,若存在,则支出可以选择的到, // 存在差额费用,差额费用应收有值,等于“实缴的应支金额-预估的应收金额——此类实缴支出会判断是否存在提前缴费的标识,若存在,则支出可以选择的到,
// 选择后即可支出(差额明细逻辑:导入后根据预估明细和实缴明细,生成“单据类型”为“差额”的商险明细数据(只有应收金额没有应支,应收金额=实缴的应支-预估的应收,若>0, // 选择后即可支出(差额明细逻辑:导入后根据预估明细和实缴明细,生成“单据类型”为“差额”的商险明细数据(只有应收金额没有应支,应收金额=实缴的应支-预估的应收,若>0,
...@@ -729,6 +735,8 @@ public class DoJointInsuranceTask { ...@@ -729,6 +735,8 @@ public class DoJointInsuranceTask {
if ("0".equals(param.getIsJfcd())) { if ("0".equals(param.getIsJfcd())) {
//见费出单 是否全部结算 都是 是 //见费出单 是否全部结算 都是 是
info.setFd_3b13b2ecc164aa("是"); info.setFd_3b13b2ecc164aa("是");
//实际结算月份置空
info.setFd_3af9d11088facc(null);
} }
if (Common.isNotNull(info)) { if (Common.isNotNull(info)) {
initValueUpdate(info, deptInfoVo, param); initValueUpdate(info, deptInfoVo, param);
...@@ -737,7 +745,8 @@ public class DoJointInsuranceTask { ...@@ -737,7 +745,8 @@ public class DoJointInsuranceTask {
} }
//红冲 //红冲
if (InsurancesConstants.CORRECT_SETTLE_BILL.equals(param.getInteractiveType()) && "否".equals(param.getBpoFlag())) { if (InsurancesConstants.CORRECT_SETTLE_BILL.equals(param.getInteractiveType())
&& ("否".equals(param.getBpoFlag()) || "0".equals(param.getIsJfcd()))) {
EkpInsurancesInfo pushParam = new EkpInsurancesInfo(); EkpInsurancesInfo pushParam = new EkpInsurancesInfo();
String code = ""; String code = "";
if (InsurancesConstants.ESTIMATE_SETTLE_BILL.equals(param.getSettleType())) { if (InsurancesConstants.ESTIMATE_SETTLE_BILL.equals(param.getSettleType())) {
...@@ -760,6 +769,8 @@ public class DoJointInsuranceTask { ...@@ -760,6 +769,8 @@ public class DoJointInsuranceTask {
if ("0".equals(param.getIsJfcd())) { if ("0".equals(param.getIsJfcd())) {
//见费出单 是否全部结算 都是 是 //见费出单 是否全部结算 都是 是
pushParam.setFd_3b13b2ecc164aa("是"); pushParam.setFd_3b13b2ecc164aa("是");
//实际结算月份置空
pushParam.setFd_3af9d11088facc(null);
} }
insurancesInfoMapper.insert(pushParam); insurancesInfoMapper.insert(pushParam);
} }
......
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