Qchen 1 рік тому
батько
коміт
07f8a12a81

+ 54 - 0
commons/src/main/java/com/jzg/commons/entity/po/InsFeeOrders.java

@@ -100,4 +100,58 @@ public class InsFeeOrders {
 
 
     @Schema(description = "驾意险留点费用")
     @Schema(description = "驾意险留点费用")
     private BigDecimal jyKeepPointPremium;
     private BigDecimal jyKeepPointPremium;
+
+    @Schema(description = "交强险入口比例")
+    private BigDecimal jqInletRatio;
+
+    @Schema(description = "商业险入口比例")
+    private BigDecimal syInletRatio;
+
+    @Schema(description = "驾意险入口比例")
+    private BigDecimal jyInletRatio;
+
+    @Schema(description = "交强险手续费比例")
+    private BigDecimal jqCommissionRatio;
+
+    @Schema(description = "商业险手续费比例")
+    private BigDecimal syCommissionRatio;
+
+    @Schema(description = "驾意险手续费比例")
+    private BigDecimal jyCommissionRatio;
+
+    @Schema(description = "交强险跟单费比例")
+    private BigDecimal jqFollowRatio;
+
+    @Schema(description = "商业险跟单费比例")
+    private BigDecimal syFollowRatio;
+
+    @Schema(description = "驾意险跟单费比例")
+    private BigDecimal jyFollowRatio;
+
+    @Schema(description = "交强险加投费费比例")
+    private BigDecimal jqAdditionalRatio;
+
+    @Schema(description = "商业险加投费费比例")
+    private BigDecimal syAdditionalRatio;
+
+    @Schema(description = "驾意险加投费费比例")
+    private BigDecimal jyAdditionalRatio;
+
+    @Schema(description = "交强险留点比例")
+    private BigDecimal jqKeepPointRatio;
+
+    @Schema(description = "商业险留点比例")
+    private BigDecimal syKeepPointRatio;
+
+    @Schema(description = "驾意险留点比例")
+    private BigDecimal jyKeepPointRatio;
+
+    @Schema(description = "交强出口比例")
+    private BigDecimal jqExportRatio;
+
+    @Schema(description = "商业险出口比例")
+    private BigDecimal syExportRatio;
+
+    @Schema(description = "驾意险出口比例")
+    private BigDecimal jyExportRatio;
 }
 }

+ 1 - 1
gateway/src/main/resources/application-dev.yml

@@ -33,7 +33,7 @@ spring:
         - id: tenant_route
         - id: tenant_route
           uri: http://localhost:8084/
           uri: http://localhost:8084/
           predicates:
           predicates:
-            - Path=/tenant/**,/dept/**,/area/**,/dict/**,/userInfo/**,/sysOrganization/**,/activity/**,/message/**,/messageNotice/**,/poster/**,/agreement/**,/pltAgreement/**,/agreementRules/**,/plt/areaLicense/**,/scheme/**,/schemeRules/**,/schemeRulesAttrLink/**,/schemeRulesAttr/**,/schemeRulesDictLable/**,/schemeRulesUndwrt/**,/schemeRulesUndwrtAttrLink/**,/schemeRulesUndwrtAttr/**,/schemeRulesUndwrtDictLable/**,/schemeRulesUndwrtRules/**,/schemeRulesUndwrtRulesAttrLink/**,/schemeRules,/ptlAgreementCost/**,/ptlAgreementCost/**,/ptlAgreementCostExternal/**,/operatorTrajectory/**,/messageTemplate/**,/message/**,/appUser/**
+            - Path=/tenant/**,/dept/**,/area/**,/dict/**,/userInfo/**,/sysOrganization/**,/activity/**,/message/**,/messageNotice/**,/poster/**,/agreement/**,/pltAgreement/**,/agreementRules/**,/plt/areaLicense/**,/scheme/**,/schemeRules/**,/schemeRulesAttrLink/**,/schemeRulesAttr/**,/schemeRulesDictLable/**,/schemeRulesUndwrt/**,/schemeRulesUndwrtAttrLink/**,/schemeRulesUndwrtAttr/**,/schemeRulesUndwrtDictLable/**,/schemeRulesUndwrtRules/**,/schemeRulesUndwrtRulesAttrLink/**,/schemeRules,/ptlAgreementCost/**,/ptlAgreementCost/**,/ptlAgreementCostExternal/**,/operatorTrajectory/**,/messageTemplate/**,/message/**,/appUser/**,/userBankCard/**
 
 
         - id: summary_route
         - id: summary_route
           uri: http://localhost:9898/
           uri: http://localhost:9898/

+ 34 - 1
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/aop/aspect/QuoteVerificationAspect.java

@@ -718,7 +718,8 @@ public class QuoteVerificationAspect {
                 InsFeeOrders::setJyCommissionPremium, InsFeeOrders::setJyFollowPremium, InsFeeOrders::setJyAdditionalPremium
                 InsFeeOrders::setJyCommissionPremium, InsFeeOrders::setJyFollowPremium, InsFeeOrders::setJyAdditionalPremium
         );
         );
 
 
-        // 7. 计算总应收、总应付并保存
+        // 7. 计算总应收、总应付、保存费用比例 入库
+        saveRatio(insFeeOrders, agreementInfoVo, jqCostType, syCostType, jyCostType);
         calculateTotalPremium(insFeeOrders);
         calculateTotalPremium(insFeeOrders);
         insFeeOrdersService.save(insFeeOrders);
         insFeeOrdersService.save(insFeeOrders);
     }
     }
@@ -829,6 +830,38 @@ public class QuoteVerificationAspect {
         insFeeOrders.setTotalPayablePremium(totalPayable);
         insFeeOrders.setTotalPayablePremium(totalPayable);
     }
     }
 
 
+    /**
+     * 保存比例
+     */
+    private void saveRatio(InsFeeOrders insFeeOrders, AgreementInfoVo agreementInfoVo,PtlAgreementCostTypeVo jqCostType,PtlAgreementCostTypeVo syCostType,PtlAgreementCostTypeVo jyCostType) {
+        // 手续费比例
+        insFeeOrders.setJqCommissionRatio(convertPercent(agreementInfoVo.getAgreement().getJqEntranceFeeRatio()));
+        insFeeOrders.setSyCommissionRatio(convertPercent(agreementInfoVo.getAgreement().getSyEntranceFeeRatio()));
+        insFeeOrders.setJyCommissionRatio(convertPercent(agreementInfoVo.getAgreement().getJyEntranceFeeRatio()));
+        // 入口比例
+        insFeeOrders.setJqInletRatio(convertPercent(jqCostType.getInlet()));
+        insFeeOrders.setSyInletRatio(convertPercent(syCostType.getInlet()));
+        insFeeOrders.setJyInletRatio(convertPercent(jyCostType.getInlet()));
+        // 跟单比例
+        insFeeOrders.setJqFollowRatio(calculateFollowRatio(jqCostType, agreementInfoVo.getAgreement().getJqEntranceFeeRatio()));
+        insFeeOrders.setSyFollowRatio(calculateFollowRatio(syCostType, agreementInfoVo.getAgreement().getSyEntranceFeeRatio()));
+        insFeeOrders.setJyFollowRatio(calculateFollowRatio(jyCostType, agreementInfoVo.getAgreement().getJyEntranceFeeRatio()));
+        // 加投比例
+        insFeeOrders.setJqAdditionalRatio(convertPercent(jqCostType.getAddThrow()));
+        insFeeOrders.setSyAdditionalRatio(convertPercent(syCostType.getAddThrow()));
+        insFeeOrders.setJyAdditionalRatio(convertPercent(jyCostType.getAddThrow()));
+        // 留点比例
+        insFeeOrders.setJqKeepPointRatio(convertPercent(jqCostType.getKeepPointRatio()));
+        insFeeOrders.setSyKeepPointRatio(convertPercent(syCostType.getKeepPointRatio()));
+        insFeeOrders.setJyKeepPointRatio(convertPercent(jyCostType.getKeepPointRatio()));
+        // 出口比例
+        insFeeOrders.setJqExportRatio(convertPercent(jqCostType.getExport()));
+        insFeeOrders.setSyExportRatio(convertPercent(syCostType.getExport()));
+        insFeeOrders.setJyExportRatio(convertPercent(jyCostType.getExport()));
+    }
+
+
+
     //    // 获取协议录入的 手续费比例 保留百分比
     //    // 获取协议录入的 手续费比例 保留百分比
 //    BigDecimal jqEntranceFeeRatio = agreementInfoVo.getAgreement().getJqEntranceFeeRatio().divide(BigDecimal.valueOf(100), 10, RoundingMode.HALF_EVEN);
 //    BigDecimal jqEntranceFeeRatio = agreementInfoVo.getAgreement().getJqEntranceFeeRatio().divide(BigDecimal.valueOf(100), 10, RoundingMode.HALF_EVEN);
 //    BigDecimal syEntranceFeeRatio = agreementInfoVo.getAgreement().getSyEntranceFeeRatio().divide(BigDecimal.valueOf(100), 10, RoundingMode.HALF_EVEN);
 //    BigDecimal syEntranceFeeRatio = agreementInfoVo.getAgreement().getSyEntranceFeeRatio().divide(BigDecimal.valueOf(100), 10, RoundingMode.HALF_EVEN);