Commit 573bd694 authored by 李灿灿's avatar 李灿灿

投保成功 按天计算保留两位小数

parent f55345ec
......@@ -741,7 +741,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//计算起止时间的天数
long day = LocalDateUtil.betweenDay(detail.getPolicyStart().toString(), detail.getPolicyEnd().toString());
//预估保费 = (购买标准 / 365) * 天数
BigDecimal estimatePremium = new BigDecimal(detail.getBuyStandard()).divide(new BigDecimal("365"),BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(day)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal estimatePremium = new BigDecimal(detail.getBuyStandard()).divide(new BigDecimal("365"),CommonConstants.TWO_INT,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(day)).setScale(CommonConstants.TWO_INT,BigDecimal.ROUND_HALF_UP);
detail.setEstimatePremium(estimatePremium);
if (detail.getBuyType() == CommonConstants.THREE_INT){
detail.setPolicyEffect(LocalDate.now().plusDays(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