lipf 2 месяцев назад
Родитель
Сommit
4497bd8dfa

+ 2 - 2
commons/src/main/java/com/jzg/commons/util/BigDecimalUtil.java

@@ -66,7 +66,7 @@ public class BigDecimalUtil {
         return sum;
     }
 
-    public static BigDecimal toZero(String amount){
+    public static BigDecimal null2Zero(String amount){
         if(StrUtil.isEmpty(amount)){
             return BigDecimal.ZERO;
         }
@@ -176,7 +176,7 @@ public class BigDecimalUtil {
         return new BigDecimal(v);
     }
 
-    public static BigDecimal toZero(BigDecimal amount) {
+    public static BigDecimal null2Zero(BigDecimal amount) {
         if(amount == null){
             return BigDecimal.ZERO;
         }

+ 20 - 20
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsFeeOrdersServiceImpl.java

@@ -105,26 +105,26 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
         InsFeeOrders insFeeOrders = insFeeOrdersMapper.selectById(insOrders.getId());
 
         // add by lipf, 2026年6月23日18:32:24 按照财务和田智沟通后的结果,当入口手续费比例大于入口比例的时候,强制设置入口手续费比例为入口比例。
-        BigDecimal jqInletRatio = insFeeOrders.getJqInletRatio();
-        BigDecimal syInletRatio = insFeeOrders.getSyInletRatio();
-        BigDecimal jyInletRatio = insFeeOrders.getJyInletRatio();
-
-        BigDecimal jqCommissionRatio = insFeeOrders.getJqCommissionRatio();
-        BigDecimal syCommissionRatio = insFeeOrders.getSyCommissionRatio();
-        BigDecimal jyCommissionRatio = insFeeOrders.getJyCommissionRatio();
-
-        if(BigDecimalUtil.subtract(jqCommissionRatio,jqInletRatio).compareTo(BigDecimal.ZERO)>0){
-            insFeeOrders.setJqCommissionRatio(jqInletRatio);
-            insFeeOrders.setJqFollowRatio(BigDecimal.ZERO);
-        }
-        if(BigDecimalUtil.subtract(syCommissionRatio,syInletRatio).compareTo(BigDecimal.ZERO)>0){
-            insFeeOrders.setSyCommissionRatio(syInletRatio);
-            insFeeOrders.setSyFollowRatio(BigDecimal.ZERO);
-        }
-        if(BigDecimalUtil.subtract(jyCommissionRatio,jyInletRatio).compareTo(BigDecimal.ZERO)>0){
-            insFeeOrders.setJyCommissionRatio(jyInletRatio);
-            insFeeOrders.setJyFollowRatio(BigDecimal.ZERO);
-        }
+//        BigDecimal jqInletRatio = insFeeOrders.getJqInletRatio();
+//        BigDecimal syInletRatio = insFeeOrders.getSyInletRatio();
+//        BigDecimal jyInletRatio = insFeeOrders.getJyInletRatio();
+//
+//        BigDecimal jqCommissionRatio = insFeeOrders.getJqCommissionRatio();
+//        BigDecimal syCommissionRatio = insFeeOrders.getSyCommissionRatio();
+//        BigDecimal jyCommissionRatio = insFeeOrders.getJyCommissionRatio();
+//
+//        if(BigDecimalUtil.subtract(jqCommissionRatio,jqInletRatio).compareTo(BigDecimal.ZERO)>0){
+//            insFeeOrders.setJqCommissionRatio(jqInletRatio);
+//            insFeeOrders.setJqFollowRatio(BigDecimal.ZERO);
+//        }
+//        if(BigDecimalUtil.subtract(syCommissionRatio,syInletRatio).compareTo(BigDecimal.ZERO)>0){
+//            insFeeOrders.setSyCommissionRatio(syInletRatio);
+//            insFeeOrders.setSyFollowRatio(BigDecimal.ZERO);
+//        }
+//        if(BigDecimalUtil.subtract(jyCommissionRatio,jyInletRatio).compareTo(BigDecimal.ZERO)>0){
+//            insFeeOrders.setJyCommissionRatio(jyInletRatio);
+//            insFeeOrders.setJyFollowRatio(BigDecimal.ZERO);
+//        }
 
         // 关键:获取是否含税标识
         Integer withTax = ptlAgreement.getWithTax(); // 0-否 1-是

+ 1 - 1
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsOrdersServiceImpl.java

@@ -1733,7 +1733,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
      */
     private PtlAgreementCostRatioVo calRatio(InsFeeOrders insFeeOrders, BatchModifyVo batchModifyVo, BigDecimal taxFactor) {
         log.info("batchModifyVo.转换百分比之前的数据=【{}】", JSONUtil.toJsonStr(batchModifyVo));
-        batchModifyVo.divide100();
+        // batchModifyVo.divide100();
         PtlAgreementCostRatioVo vo = new PtlAgreementCostRatioVo();
         vo.setOrderNo(insFeeOrders.getOrderNo());
 

+ 21 - 18
tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java

@@ -2320,7 +2320,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             jqCommissionRatio = batchModifyVo.getJqSuperviseCostsProportion();
             jqFollowRatio = BigDecimalUtil.subtract(jqInletRatio,jqCommissionRatio);
         }else if(batchModifyVo.getJqSuperviseCostsProportion() == null && batchModifyVo.getJqOtherCostsProportion() != null){
-            jqCommissionRatio = BigDecimalUtil.toZero(insPlyIncome.getJqSuperviseCostsProportion());
+            jqCommissionRatio = BigDecimalUtil.null2Zero(insPlyIncome.getJqSuperviseCostsProportion());
             jqFollowRatio = batchModifyVo.getJqOtherCostsProportion();
             jqInletRatio = BigDecimalUtil.add(jqCommissionRatio,jqFollowRatio);
         }else if(batchModifyVo.getJqSuperviseCostsProportion() != null && batchModifyVo.getJqOtherCostsProportion() != null){
@@ -2329,8 +2329,8 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             jqInletRatio = BigDecimalUtil.add(jqCommissionRatio,jqFollowRatio);
         }else if(batchModifyVo.getJqSuperviseCostsProportion() == null && batchModifyVo.getJqOtherCostsProportion() == null){
             jqInletRatio = insFeeOrders.getJqInletRatio();
-            jqCommissionRatio = BigDecimalUtil.toZero(insPlyIncome.getJqSuperviseCostsProportion());
-            jqFollowRatio = BigDecimalUtil.toZero(insPlyIncome.getJqOtherCostsProportion());
+            jqCommissionRatio = BigDecimalUtil.null2Zero(insPlyIncome.getJqSuperviseCostsProportion());
+            jqFollowRatio = BigDecimalUtil.null2Zero(insPlyIncome.getJqOtherCostsProportion());
         }
         vo.setJqInletRatio(jqInletRatio);
         vo.setJqCommissionRatio(jqCommissionRatio);
@@ -2345,7 +2345,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             syCommissionRatio = batchModifyVo.getSySuperviseCostsProportion();
             syFollowRatio = BigDecimalUtil.subtract(syInletRatio,syCommissionRatio);
         }else if(batchModifyVo.getSySuperviseCostsProportion() == null && null != batchModifyVo.getSyOtherCostsProportion()){
-            syCommissionRatio = BigDecimalUtil.toZero(insPlyIncome.getSySuperviseCostsProportion());
+            syCommissionRatio = BigDecimalUtil.null2Zero(insPlyIncome.getSySuperviseCostsProportion());
             syFollowRatio = batchModifyVo.getSyOtherCostsProportion();
             syInletRatio = BigDecimalUtil.add(syCommissionRatio,syFollowRatio);
         }else if(batchModifyVo.getSySuperviseCostsProportion() != null && batchModifyVo.getSyOtherCostsProportion() != null){
@@ -2354,8 +2354,8 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             syInletRatio = BigDecimalUtil.add(syCommissionRatio,syFollowRatio);
         }else if(batchModifyVo.getSySuperviseCostsProportion() == null && batchModifyVo.getSyOtherCostsProportion() == null){
             syInletRatio = insFeeOrders.getSyInletRatio();
-            syCommissionRatio = BigDecimalUtil.toZero(insPlyIncome.getSySuperviseCostsProportion());
-            syFollowRatio = BigDecimalUtil.toZero(insPlyIncome.getSyOtherCostsProportion());
+            syCommissionRatio = BigDecimalUtil.null2Zero(insPlyIncome.getSySuperviseCostsProportion());
+            syFollowRatio = BigDecimalUtil.null2Zero(insPlyIncome.getSyOtherCostsProportion());
         }
         vo.setSyInletRatio(syInletRatio);
         vo.setSyCommissionRatio(syCommissionRatio);
@@ -2370,7 +2370,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             jyCommissionRatio = batchModifyVo.getJySuperviseCostsProportion();
             jyFollowRatio = BigDecimalUtil.subtract(jyInletRatio,jyCommissionRatio);
         }else if(batchModifyVo.getJySuperviseCostsProportion() == null && batchModifyVo.getJyOtherCostsProportion() != null){
-            jyCommissionRatio = BigDecimalUtil.toZero(insPlyIncome.getJySuperviseCostsProportion());
+            jyCommissionRatio = BigDecimalUtil.null2Zero(insPlyIncome.getJySuperviseCostsProportion());
             jyFollowRatio = batchModifyVo.getJyOtherCostsProportion();
             jyInletRatio = BigDecimalUtil.add(jyCommissionRatio,jyFollowRatio);
         }else if(batchModifyVo.getJySuperviseCostsProportion() != null && batchModifyVo.getJyOtherCostsProportion() != null){
@@ -2379,8 +2379,8 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             jyInletRatio = BigDecimalUtil.add(jyCommissionRatio,jyFollowRatio);
         }else if(batchModifyVo.getJySuperviseCostsProportion() == null && batchModifyVo.getJyOtherCostsProportion() == null){
             jyInletRatio = insFeeOrders.getJyInletRatio();
-            jyCommissionRatio = BigDecimalUtil.toZero(insPlyIncome.getJySuperviseCostsProportion());
-            jyFollowRatio = BigDecimalUtil.toZero(insPlyIncome.getJyOtherCostsProportion());
+            jyCommissionRatio = BigDecimalUtil.null2Zero(insPlyIncome.getJySuperviseCostsProportion());
+            jyFollowRatio = BigDecimalUtil.null2Zero(insPlyIncome.getJyOtherCostsProportion());
         }
         vo.setJyInletRatio(jyInletRatio);
         vo.setJyCommissionRatio(jyCommissionRatio);
@@ -2478,6 +2478,9 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             BigDecimal taxRate = taxRateMap.getOrDefault(income.getOrderNo(), BigDecimal.ONE);
             InsPlyIncome updateIncome = new InsPlyIncome();
             updateIncome.setId(income.getId());
+            updateIncome.setJqPremium(income.getJqPremium());
+            updateIncome.setSyPremium(income.getSyPremium());
+            updateIncome.setJyPremium(income.getJyPremium());
             // 因为 实体对象的settlementStatus设置了初始默认值0, 为了避免已经结算的数据被调整未未结算, 这里将settlementStatus设置为null 2026-6-24 14:33:47
             updateIncome.setSettlementStatus(null);
             // 根据income的order_no查询inss_fee_order
@@ -2555,9 +2558,9 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
     private void calPremium(InsPlyIncome updateIncome, PtlAgreementCostRatioVo ratioVo, BigDecimal taxRate) {
         log.info("根据入口比例等比例值计算对应的金额。 ptlAgreementCostRatioVo=[{}], updateIncome=[{}]", JSONUtil.toJsonStr(ratioVo), JSONUtil.toJsonStr(updateIncome));
 
-        BigDecimal jqPremium = BigDecimalUtil.toZero(updateIncome.getJqPremium());
-        BigDecimal syPremium = BigDecimalUtil.toZero(updateIncome.getSyPremium()) ;
-        BigDecimal jyPremium = BigDecimalUtil.toZero(updateIncome.getJyPremium());
+        BigDecimal jqPremium = BigDecimalUtil.null2Zero(updateIncome.getJqPremium());
+        BigDecimal syPremium = BigDecimalUtil.null2Zero(updateIncome.getSyPremium()) ;
+        BigDecimal jyPremium = BigDecimalUtil.null2Zero(updateIncome.getJyPremium());
 
 
         BigDecimal jqInletPremium = BigDecimalUtil.divide(BigDecimalUtil.multiply(jqPremium,ratioVo.getJqInletRatio()), taxRate);
@@ -2725,22 +2728,22 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         if (insFeeOrders != null) {
             switch (type) {
                 case "jqFollow":
-                    followPremium = BigDecimalUtil.toZero(insFeeOrders.getJqFollowPremium());
+                    followPremium = BigDecimalUtil.null2Zero(insFeeOrders.getJqFollowPremium());
                     break;
                 case "syFollow":
-                    followPremium = BigDecimalUtil.toZero(insFeeOrders.getSyFollowPremium());
+                    followPremium = BigDecimalUtil.null2Zero(insFeeOrders.getSyFollowPremium());
                     break;
                 case "jqCommission":
-                    followPremium = BigDecimalUtil.toZero(insFeeOrders.getJqCommissionPremium());
+                    followPremium = BigDecimalUtil.null2Zero(insFeeOrders.getJqCommissionPremium());
                     break;
                 case "syCommission":
-                    followPremium = BigDecimalUtil.toZero(insFeeOrders.getSyCommissionPremium());
+                    followPremium = BigDecimalUtil.null2Zero(insFeeOrders.getSyCommissionPremium());
                     break;
                 case "jyCommission":
-                    followPremium = BigDecimalUtil.toZero(insFeeOrders.getJyCommissionPremium());
+                    followPremium = BigDecimalUtil.null2Zero(insFeeOrders.getJyCommissionPremium());
                     break;
                 case "jyFollow":
-                    followPremium = BigDecimalUtil.toZero(insFeeOrders.getJyFollowPremium());
+                    followPremium = BigDecimalUtil.null2Zero(insFeeOrders.getJyFollowPremium());
                     break;
             }
         }