Commit 2ab2f144 authored by 查济's avatar 查济

Merge branch 'feature-zhaji' into 'develop'

"feature-zhaJi:修改变更项目时,同步更新预估保费"

See merge request fangxinjiang/yifu!72
parents 52144992 7ad3d911
......@@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @author zhaji
......@@ -101,13 +102,13 @@ public class DeptChangeCheckParam implements Serializable {
* 预估保费
*/
@Schema(description = "预估保费")
private String estimatePremium;
private BigDecimal estimatePremium;
/**
* 实际保费
*/
@Schema(description = "实际保费")
private String actualPremium;
private BigDecimal actualPremium;
}
......@@ -2427,6 +2427,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.set(TInsuranceDetail :: getDeptNo,success.getNewDeptNo())
.set(TInsuranceDetail :: getSettleType,success.getNewSettleType())
.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper);
}
......@@ -3183,13 +3184,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//计算起止时间的天数
long day = LocalDateUtil.betweenDay(insuranceDetail.getPolicyStart().toString(), insuranceDetail.getPolicyEnd().toString());
//预估保费 = (购买标准 / 365) * 天数
BigDecimal estimatePremium = new BigDecimal(insuranceDetail.getBuyStandard()).divide(new BigDecimal("365")).multiply(new BigDecimal(day)).setScale(2,BigDecimal.ROUND_HALF_UP);
BigDecimal estimatePremium = new BigDecimal(insuranceDetail.getBuyStandard()).divide(new BigDecimal("365"),2,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(day)).setScale(2,BigDecimal.ROUND_HALF_UP);
insuranceDetail.setEstimatePremium(estimatePremium);
}
}
}
}
//判断当前数据中是否存在重复数据
param.setEstimatePremium(insuranceDetail.getEstimatePremium());
param.setActualPremium(insuranceDetail.getActualPremium());
param.setId(insuranceDetail.getId());
successList.add(param);
}
......
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