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

20221107 针对批增的:“购买周期”是用生效日期同原保单截止日期进行计算得出,然后去计算预估保费

parent 8a2d11ad
......@@ -782,6 +782,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//购买周期
String buyCycle = month + "个月/" + day + "天";
insuranceDetailVO.setBuyCycle(buyCycle);
//如果是批增需要重新处理购买周期,按生效日期和保单结束时间计算
if (CommonConstants.THREE_INT == insuranceDetailVO.getBuyType()){
if (Objects.isNull(insuranceDetailVO.getPolicyEffect())){
insuranceDetailVO.setBuyCycle(null);
}else {
day = LocalDateUtil.betweenDay(insuranceDetailVO.getPolicyEffect().toString(),insuranceDetailVO.getPolicyEnd().toString());
month = LocalDateUtil.betweenMonth(insuranceDetailVO.getPolicyEffect().toString(),insuranceDetailVO.getPolicyEnd().toString());
buyCycle = month + "个月/" + day + "天";
insuranceDetailVO.setBuyCycle(buyCycle);
}
}
//派单类型
insuranceDetailVO.setDistributeType(insuranceDetailVO.getReduceHandleStatus() == null?insuranceDetailVO.getBuyType():CommonConstants.FIVE_INT);
//派单状态
......@@ -1309,12 +1320,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//按天
//计算起止时间的天数
long day = LocalDateUtil.betweenDay(detail.getPolicyStart().toString(), detail.getPolicyEnd().toString());
//预估保费 = (购买标准 / 365) * 天数
BigDecimal estimatePremium = new BigDecimal(detail.getBuyStandard()).multiply(new BigDecimal(day)).divide(new BigDecimal("365"),CommonConstants.TWO_INT,BigDecimal.ROUND_HALF_UP);
detail.setEstimatePremium(estimatePremium);
if (detail.getBuyType() == CommonConstants.THREE_INT){
detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT));
day = LocalDateUtil.betweenDay(detail.getPolicyEffect().toString(), detail.getPolicyEnd().toString());
}
//预估保费 = (购买标准 / 365) * 天数
BigDecimal estimatePremium = new BigDecimal(detail.getBuyStandard()).multiply(new BigDecimal(day)).divide(new BigDecimal("365"),CommonConstants.TWO_INT,BigDecimal.ROUND_HALF_UP);
detail.setEstimatePremium(estimatePremium);
//记录状态均置为「已投保」
detail.setBuyHandleStatus(CommonConstants.THREE_INT);
detail.setSignFlag(CommonConstants.ONE_INT);
......
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