|
|
@@ -110,7 +110,7 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
|
|
|
BigDecimal jyPremium = insOrdersCosts.getJyPremium() == null ? BigDecimal.ZERO : insOrdersCosts.getJyPremium();
|
|
|
|
|
|
// 更新对象中的比例字段
|
|
|
- copyRatio(ptlAgreementCostRatioVo, insFeeOrders);
|
|
|
+ copyRatio(ptlAgreementCostRatioVo, insFeeOrders, withTax);
|
|
|
|
|
|
// 核心:规则重新计算所有费用
|
|
|
// 1. 交强险
|
|
|
@@ -286,7 +286,12 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
|
|
|
}
|
|
|
|
|
|
// 保存比例
|
|
|
- private void copyRatio(PtlAgreementCostRatioVo ptlAgreementCostRatioVo, InsFeeOrders insFeeOrders) {
|
|
|
+ private void copyRatio(PtlAgreementCostRatioVo ptlAgreementCostRatioVo, InsFeeOrders insFeeOrders, Integer withTax) {
|
|
|
+ BigDecimal bigDecimal = new BigDecimal("1");
|
|
|
+ if (withTax == 0) {
|
|
|
+ // 不含税:保费 / 1.06
|
|
|
+ bigDecimal = new BigDecimal("1.06");
|
|
|
+ }
|
|
|
// 手续费比例
|
|
|
BigDecimal jqCommissionRatio = covertPercent(ptlAgreementCostRatioVo.getJqCommissionRatio());
|
|
|
BigDecimal syCommissionRatio = covertPercent(ptlAgreementCostRatioVo.getSyCommissionRatio());
|
|
|
@@ -323,9 +328,9 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
|
|
|
insFeeOrders.setSyExportRatio(syExportRatio);
|
|
|
insFeeOrders.setJyExportRatio(jyExportRatio);
|
|
|
// 需求:入口 + 加投 - 出口 = 留点
|
|
|
- BigDecimal jqKeepPointRatio = jqInletRatio.add(jqAdditionalRatio).subtract(jqExportRatio);
|
|
|
- BigDecimal syKeepPointRatio = syInletRatio.add(syAdditionalRatio).subtract(syExportRatio);
|
|
|
- BigDecimal jyKeepPointRatio = jyInletRatio.add(jyAdditionalRatio).subtract(jyExportRatio);
|
|
|
+ BigDecimal jqKeepPointRatio = (jqInletRatio.divide(bigDecimal, 5, RoundingMode.HALF_EVEN)).add(jqAdditionalRatio).subtract(jqExportRatio);
|
|
|
+ BigDecimal syKeepPointRatio = (syInletRatio.divide(bigDecimal, 5, RoundingMode.HALF_EVEN)).add(syAdditionalRatio).subtract(syExportRatio);
|
|
|
+ BigDecimal jyKeepPointRatio = (jyInletRatio.divide(bigDecimal, 5, RoundingMode.HALF_EVEN)).add(jyAdditionalRatio).subtract(jyExportRatio);
|
|
|
// 留点比例
|
|
|
insFeeOrders.setJqKeepPointRatio(jqKeepPointRatio);
|
|
|
insFeeOrders.setSyKeepPointRatio(syKeepPointRatio);
|