wks 2 سال پیش
والد
کامیت
22e285a267

+ 5 - 1
src/main/java/com/ydtech/modules/fee/constants/CostAllocation.java

@@ -8,9 +8,13 @@ import lombok.Getter;
 @Getter
 public enum CostAllocation {
 
+    // 不够减扣除比例
     CA_01("retailProportion", "分销比例", "0.2"),
     CA_02("deptProportion", "机构比例", "0.1"),
-    CA_03("enterProportion", "代课录单比例", "1");
+    CA_03("proxyProportion", "代课录单比例", "0.1"),
+
+    // 够减扣除比例
+    CA_04("enterProportion", "代课录单扣减比例", "1");
 
     private final String code;
 

+ 3 - 0
src/main/java/com/ydtech/modules/fee/dto/vo/ReCalcuLateProportion.java

@@ -32,6 +32,9 @@ public class ReCalcuLateProportion {
     @ApiModelProperty("三级分销费")
     private BigDecimal retail_level_3_proportion;
 
+    @ApiModelProperty("代课录单比例")
+    private BigDecimal proxyProportion;
+
     public ReCalcuLateProportion() {
         this.dept_level_1_proportion = new BigDecimal(0);
         this.dept_level_2_proportion = new BigDecimal(0);

+ 22 - 13
src/main/java/com/ydtech/modules/fee/service/FeeRuleSchemeNewService.java

@@ -32,6 +32,7 @@ public interface FeeRuleSchemeNewService {
 
     /**
      * 查询费用明细
+     *
      * @param companyId
      * @return
      */
@@ -41,22 +42,25 @@ public interface FeeRuleSchemeNewService {
 
     /**
      * 比较和更新总费用比例
+     *
      * @param insOrderNo
      * @param jqCostsProportionStr
      * @param syCostsProportionStr
      */
-    void compareAndUpdateFeeOrderInfo(String insOrderNo ,String jqCostsProportionStr,String syCostsProportionStr,String dealUser);
+    void compareAndUpdateFeeOrderInfo(String insOrderNo, String jqCostsProportionStr, String syCostsProportionStr, String dealUser);
 
 
     /**
      * 查找匹配的费用因子
+     *
      * @param insAreaCompany
      * @param insOrders
      */
-    void verificationCostFactor(InsAreaCompany insAreaCompany, InsOrders insOrders,StringBuilder logs);
+    void verificationCostFactor(InsAreaCompany insAreaCompany, InsOrders insOrders, StringBuilder logs);
 
     /**
      * 查找匹配承保规则的因子
+     *
      * @param insAreaCompany
      * @param insOrders
      */
@@ -64,6 +68,7 @@ public interface FeeRuleSchemeNewService {
 
     /**
      * 重新计算费用
+     *
      * @param costsProportion
      * @param deptProportion
      * @param retailProportion
@@ -73,29 +78,33 @@ public interface FeeRuleSchemeNewService {
      * @param type
      * @return
      */
-    public ReCalcuLateProportion recalculateProportion(BigDecimal costsProportion,
-                                                       BigDecimal deptProportion,
-                                                       BigDecimal retailProportion,
-                                                       BigDecimal taxRadio,
-                                                       Integer retailLevel,
-                                                       PtlAgreementProductCostsExport ptlAgreementProductCostsExport,
-                                                       RetailProportion originalRetailProportion,
-                                                       String type);
+    ReCalcuLateProportion recalculateProportion(BigDecimal costsProportion,
+                                                BigDecimal deptProportion,
+                                                BigDecimal retailProportion,
+                                                BigDecimal taxRadio,
+                                                Integer retailLevel,
+                                                PtlAgreementProductCostsExport ptlAgreementProductCostsExport,
+                                                RetailProportion originalRetailProportion,
+                                                String type,
+                                                BigDecimal enterProportion
+    );
 
 
     /**
      * 计算费用因子
+     *
      * @param costsId
      */
-    void calcCosts(String costsId,InsAreaCompany insAreaCompany);
+    void calcCosts(String costsId, InsAreaCompany insAreaCompany);
 
 
-    void calcCostsTest(String costsId,InsAreaCompany insAreaCompany);
+    void calcCostsTest(String costsId, InsAreaCompany insAreaCompany);
 
     /**
      * 计算费用因子  外部订单录入使用
+     *
      * @param costsNew
      * @param insAreaCompany
      */
-    void calcCostsExternal(PtlAgreementProductCostsNew costsNew,InsAreaCompany insAreaCompany);
+    void calcCostsExternal(PtlAgreementProductCostsNew costsNew, InsAreaCompany insAreaCompany);
 }

+ 47 - 23
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceNewImpl.java

@@ -177,28 +177,38 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
                                                        Integer retailLevel,
                                                        PtlAgreementProductCostsExport ptlAgreementProductCostsExport,
                                                        RetailProportion originalRetailProportion,
-                                                       String type) {
+                                                       String type,
+                                                       BigDecimal enterProportion) {
         ReCalcuLateProportion reCalcuLateProportion = new ReCalcuLateProportion();
         BigDecimal costsProportion = sumCostsProportion.divide(taxRadio, 2, BigDecimal.ROUND_DOWN);
         List<InsFeeOrderConfig> list = insFeeOrderConfigService.list();
         //总比例 / 比例 / 分销等级
+        // 不够减扣除比例
+        Map<String, BigDecimal> notEnoughReduce = list.stream().collect(Collectors.toMap(InsFeeOrderConfig::getKeyword, InsFeeOrderConfig::getVal));
         //分销配置的比例
-        BigDecimal retailProportionConfig = list.stream().filter(x -> x.getKeyword().equals("retailProportion")).findFirst().get().getVal();
+        BigDecimal retailProportionConfig = notEnoughReduce.get(CostAllocation.CA_01.getCode());
+
         BigDecimal retailSettingProportion = new BigDecimal(retailProportionConfig.toString());
+        // 机构配置的比例
+        BigDecimal deptProportionConfig = notEnoughReduce.get(CostAllocation.CA_02.getCode());
+        // 代课录单比例
+        BigDecimal proxyProportionConfig = notEnoughReduce.get(CostAllocation.CA_03.getCode());
 
-        //分销比例均分
-        BigDecimal jqAverageRetail = new BigDecimal(0);
-        if (retailLevel != 0) {
-            jqAverageRetail = twoPeople(twoPeople(costsProportion.multiply(retailSettingProportion)).divide(new BigDecimal(retailLevel), 2, RoundingMode.DOWN));
-        }
-        //机构配置的比例
-        BigDecimal deptProportionConfig = list.stream().filter(x -> x.getKeyword().equals("deptProportion")).findFirst().get().getVal();
         BigDecimal deptSettingProportion = new BigDecimal(deptProportionConfig.toString());
         //机构比例均分
         BigDecimal jqAverageDept = twoPeople(twoPeople(costsProportion.multiply(deptSettingProportion)).divide(new BigDecimal(5)));
 
         //如果不够减的话
-        if (deptProportion.add(retailProportion).compareTo(costsProportion) > 0) {
+        if (deptProportion.add(retailProportion).add(enterProportion).compareTo(costsProportion) > 0) {
+            //分销比例均分
+            BigDecimal jqAverageRetail = new BigDecimal(0);
+            if (retailLevel != 0) {
+                jqAverageRetail = twoPeople(twoPeople(costsProportion.multiply(retailSettingProportion)).divide(new BigDecimal(retailLevel), 2, RoundingMode.DOWN));
+            }
+            // 代课比例
+            BigDecimal proxyProportion = twoPeople(costsProportion.multiply(proxyProportionConfig));
+            reCalcuLateProportion.setProxyProportion(proxyProportion);
+
             if (retailLevel >= 3) {
                 reCalcuLateProportion.setRetail_level_3_proportion(jqAverageRetail);
             }
@@ -243,6 +253,9 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
                 reCalcuLateProportion.setRetail_level_2_proportion(originalRetailProportion.getNoRetailLevel2Proportion());
                 reCalcuLateProportion.setRetail_level_3_proportion(originalRetailProportion.getNoRetailLevel3Proportion());
             }
+            // 代课比例
+            reCalcuLateProportion.setProxyProportion(enterProportion);
+
         }
         return reCalcuLateProportion;
     }
@@ -392,35 +405,40 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
 
         //重新计算比例  入口是否超出支付的比例
         ReCalcuLateProportion jqReCalcuLateProportion = recalculateProportion(
-                new BigDecimal(ptlAgreementProductCostsNew.getJqCostsProportion()).subtract(enterProportion),
+                new BigDecimal(ptlAgreementProductCostsNew.getJqCostsProportion()),
                 jqDeptProportion,
                 jqRetailProportion,
                 taxRadio,
                 retailLevel,
                 ptlAgreementProductCostsExport,
                 retailProportion,
-                "jq"
+                "jq",
+                enterProportion
         );
 
         ReCalcuLateProportion syReCalcuLateProportion = recalculateProportion(
-                new BigDecimal(ptlAgreementProductCostsNew.getSyCostsProportion()).subtract(enterProportion),
+                new BigDecimal(ptlAgreementProductCostsNew.getSyCostsProportion()),
                 syDeptProportion,
                 syRetailProportion,
                 taxRadio,
                 retailLevel,
                 ptlAgreementProductCostsExport,
                 retailProportion,
-                "sy");
+                "sy",
+                enterProportion
+        );
 
         ReCalcuLateProportion noReCalcuLateProportion = recalculateProportion(
-                new BigDecimal(ptlAgreementProductCostsNew.getNoCostsProportion()).subtract(enterProportion),
+                new BigDecimal(ptlAgreementProductCostsNew.getNoCostsProportion()),
                 noDeptProportion,
                 noRetailProportion,
                 taxRadio,
                 retailLevel,
                 ptlAgreementProductCostsExport,
                 retailProportion,
-                "no");
+                "no",
+                enterProportion
+        );
 
         retailProportion.setProportion(jqReCalcuLateProportion, syReCalcuLateProportion, noReCalcuLateProportion);
 //        ptlAgreementProductCostsExportService.updateById(ptlAgreementProductCostsExport);
@@ -503,7 +521,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
 
                     insFeeOrderNew.setFirstDetailPremiums(retailFeeLevel1.getTotalRetailPremiums());
 
-                    if (parents != null && parents.size() > 0) {
+                    if (parents != null && !parents.isEmpty()) {
                         insFeeOrderNew.setFirstLevelUserId(parents.get(0).getId());
                     }
 
@@ -1178,34 +1196,40 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
 
         //重新计算比例  入口是否超出支付的比例
         ReCalcuLateProportion jqReCalcuLateProportion = recalculateProportion(
-                new BigDecimal(ptlAgreementProductCostsNew.getJqCostsProportion()).subtract(enterProportion),
+                new BigDecimal(ptlAgreementProductCostsNew.getJqCostsProportion()),
                 jqDeptProportion,
                 jqRetailProportion,
                 taxRadio,
                 retailLevel,
                 ptlAgreementProductCostsExport,
                 retailProportion,
-                "jq");
+                "jq",
+                enterProportion
+                );
 
         ReCalcuLateProportion syReCalcuLateProportion = recalculateProportion(
-                new BigDecimal(ptlAgreementProductCostsNew.getSyCostsProportion()).subtract(enterProportion),
+                new BigDecimal(ptlAgreementProductCostsNew.getSyCostsProportion()),
                 syDeptProportion,
                 syRetailProportion,
                 taxRadio,
                 retailLevel,
                 ptlAgreementProductCostsExport,
                 retailProportion,
-                "sy");
+                "sy",
+                enterProportion
+                );
 
         ReCalcuLateProportion noReCalcuLateProportion = recalculateProportion(
-                new BigDecimal(ptlAgreementProductCostsNew.getNoCostsProportion()).subtract(enterProportion),
+                new BigDecimal(ptlAgreementProductCostsNew.getNoCostsProportion()),
                 noDeptProportion,
                 noRetailProportion,
                 taxRadio,
                 retailLevel,
                 ptlAgreementProductCostsExport,
                 retailProportion,
-                "no");
+                "no",
+                enterProportion
+        );
 
         retailProportion.setProportion(jqReCalcuLateProportion, syReCalcuLateProportion, noReCalcuLateProportion);
 //        ptlAgreementProductCostsExportService.updateById(ptlAgreementProductCostsExport);

+ 64 - 62
src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java

@@ -228,11 +228,11 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 .gt(PtlAgreementProductCostsNew::getCostsEndDate, LocalDateTime.now());
 
         //现询费用id
-        if(agreementProductQueryVo.getNowCostsId() != null){
+        if (agreementProductQueryVo.getNowCostsId() != null) {
             ptlAgreementProductCostsNewLambdaQueryWrapper.eq(PtlAgreementProductCostsNew::getId, agreementProductQueryVo.getNowCostsId());
             //如果是现询则设置现询id 为1
             ptlAgreementProductCostsNewLambdaQueryWrapper.eq(PtlAgreementProductCostsNew::getIsInquiryNow, "0");
-        }else{
+        } else {
             ptlAgreementProductCostsNewLambdaQueryWrapper.eq(PtlAgreementProductCostsNew::getIsInquiryNow, "1");
 
         }
@@ -498,7 +498,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         for (int i = 0; i < agreementProductCosts.getProductId().size(); i++) {
             PtlAgreement ptlAgreement = ptlAgreementService.getById(agreementProductCosts.getAgreementId());
             //是外部订单 并且 是现询的费用 只有一个
-            if(ptlAgreement.getIsExternal() == 1  && agreementProductCosts.getIsInquiryNow().equals("1")) {
+            if (ptlAgreement.getIsExternal() == 1 && agreementProductCosts.getIsInquiryNow().equals("1")) {
                 // 外部订单的检测  每个产品只可有一个费用
                 List<PtlAgreementProductCostsNew> list = ptlAgreementProductCostsNewService.list(new LambdaQueryWrapper<PtlAgreementProductCostsNew>()
                         .eq(PtlAgreementProductCostsNew::getProductId, agreementProductCosts.getProductId().get(i))
@@ -1050,10 +1050,10 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
     }
 
     @Override
-    public boolean costsDeleteBatch(String[] ids){
+    public boolean costsDeleteBatch(String[] ids) {
         for (String id : ids) {
             PtlAgreementProductCostsNew ptlAgreementProductCostsNew = this.getById(id);
-            if(ptlAgreementProductCostsNew == null){
+            if (ptlAgreementProductCostsNew == null) {
                 throw new SystemException("费用不存在");
             }
             PtlAgreementProductCostsExport productCostsExport = ptlAgreementProductCostsExportService.getOne(new LambdaQueryWrapper<PtlAgreementProductCostsExport>().eq(PtlAgreementProductCostsExport::getCostsId, id));
@@ -1102,7 +1102,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
             baseMapper.deleteById(id);
             ptlAgreementProductCostsAttrLinkService.remove(new LambdaQueryWrapper<PtlAgreementProductCostsAttrLink>().eq(PtlAgreementProductCostsAttrLink::getCostsId, id));
             //添加费用因子轨迹
-            ptlAgreementProductCostsTrajectoryService.addCostsTrajectory(ptlAgreementProductCostsNew.getId(),"删除费用因子",BaseController.getUser().getId());
+            ptlAgreementProductCostsTrajectoryService.addCostsTrajectory(ptlAgreementProductCostsNew.getId(), "删除费用因子", BaseController.getUser().getId());
 
         }
         return true;
@@ -1159,7 +1159,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         }
 
         //添加历史记录
-        if(!modifyCostsHistory(feeOrderNewRecordVo)){
+        if (!modifyCostsHistory(feeOrderNewRecordVo)) {
             throw new SystemException("调整费用失败");
         }
 
@@ -1183,7 +1183,6 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         }
 
 
-
         List<FeeOrderNewVo.EntranceFee> entranceFeeList = new ArrayList<>();
         List<FeeOrderNewVo.DeptManagerFee> deptManagerFeeList = new ArrayList<>();
         List<FeeOrderNewVo.ExportFee> exportFeeList = new ArrayList<>();
@@ -1231,21 +1230,20 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
 
         //默认分销比例设置
         RetailProportion retailProportion = new RetailProportion();
-        if(!Objects.isNull(esmRetailList) && !esmRetailList.isEmpty())
-        {
+        if (!Objects.isNull(esmRetailList) && !esmRetailList.isEmpty()) {
             retailLevel = Integer.parseInt(esmRetailList.get(0).getRetailtype());
             //赋值默认的分销比例
-            retailProportion.setProportion(esmRetailList.get(0).getDisrate1(),esmRetailList.get(0).getDisrate2(),esmRetailList.get(0).getDisrate3());
+            retailProportion.setProportion(esmRetailList.get(0).getDisrate1(), esmRetailList.get(0).getDisrate2(), esmRetailList.get(0).getDisrate3());
         }
 
 
         //获取交强机构管理费总比例
         BigDecimal jqDeptProportion =
-                     feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelOne()
-                .add(feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelTwo())
-                .add(feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelThree())
-                .add(feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelFoure())
-                .add(feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelFive());
+                feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelOne()
+                        .add(feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelTwo())
+                        .add(feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelThree())
+                        .add(feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelFoure())
+                        .add(feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelFive());
         //获取商业机构管理费总比例
         BigDecimal syDeptProportion =
                 feeOrderNewVo.getDeptManagerFee().get(1).getDeptProportionLevelOne()
@@ -1297,36 +1295,41 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
 
         //重新计算比例  入口是否超出支付的比例
         ReCalcuLateProportion jqReCalcuLateProportion = feeRuleSchemeNewService.recalculateProportion(
-                feeOrderNewVo.getEntranceFee().get(0).getTotalProportion().subtract(enterProportion),
+                feeOrderNewVo.getEntranceFee().get(0).getTotalProportion(),
                 jqDeptProportion,
                 jqRetailProportion,
                 taxRadio,
                 retailLevel,
                 ptlAgreementProductCostsExport,
                 retailProportion,
-                "jq");
+                "jq",
+                enterProportion);
 
         ReCalcuLateProportion syReCalcuLateProportion = feeRuleSchemeNewService.recalculateProportion(
-                feeOrderNewVo.getEntranceFee().get(1).getTotalProportion().subtract(enterProportion),
+                feeOrderNewVo.getEntranceFee().get(1).getTotalProportion(),
                 syDeptProportion,
                 syRetailProportion,
                 taxRadio,
                 retailLevel,
                 ptlAgreementProductCostsExport,
                 retailProportion,
-                "sy");
+                "sy",
+                enterProportion
+        );
 
         ReCalcuLateProportion noReCalcuLateProportion = feeRuleSchemeNewService.recalculateProportion(
-                feeOrderNewVo.getEntranceFee().get(2).getTotalProportion().subtract(enterProportion),
+                feeOrderNewVo.getEntranceFee().get(2).getTotalProportion(),
                 noDeptProportion,
                 noRetailProportion,
                 taxRadio,
                 retailLevel,
                 ptlAgreementProductCostsExport,
                 retailProportion,
-                "no");
+                "no",
+                enterProportion
+        );
 
-        retailProportion.setProportion(jqReCalcuLateProportion,syReCalcuLateProportion,noReCalcuLateProportion);
+        retailProportion.setProportion(jqReCalcuLateProportion, syReCalcuLateProportion, noReCalcuLateProportion);
 //        ptlAgreementProductCostsExportService.updateById(ptlAgreementProductCostsExport);
 
 
@@ -1362,12 +1365,12 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                             retailProportion.getJqRetailLevel3Proportion(),
                             retailProportion.getSyRetailLevel3Proportion(),
                             retailProportion.getNoRetailLevel3Proportion());
-                    if(insFeeOrderNew.getFirstLevelUserId() != null){
+                    if (insFeeOrderNew.getFirstLevelUserId() != null) {
                         SysUser byId = sysUserService.getById(insFeeOrderNew.getThreeLevelUserId());
-                        retailFeeLevel3.setUserName(byId.getName()+"("+byId.getId()+")");
+                        retailFeeLevel3.setUserName(byId.getName() + "(" + byId.getId() + ")");
                     }
                     insFeeOrderNew.setThirdDetailPremiums(retailFeeLevel3.getTotalRetailPremiums());
-                }else{
+                } else {
                     insFeeOrderNew.setThirdDetailProportion(new BigDecimal(0));
                 }
                 if (Integer.parseInt(esmRetail.getRetailtype()) >= 2) {
@@ -1383,11 +1386,11 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                             retailProportion.getNoRetailLevel2Proportion());
 
                     insFeeOrderNew.setSecondDetailPremiums(retailFeeLevel2.getTotalRetailPremiums());
-                    if(insFeeOrderNew.getTwoLevelUserId() != null) {
+                    if (insFeeOrderNew.getTwoLevelUserId() != null) {
                         SysUser byId = sysUserService.getById(insFeeOrderNew.getTwoLevelUserId());
                         retailFeeLevel2.setUserName(byId.getName() + "(" + byId.getId() + ")");
                     }
-                }else{
+                } else {
                     insFeeOrderNew.setSecondDetailProportion(new BigDecimal(0));
                 }
                 if (Integer.parseInt(esmRetail.getRetailtype()) >= 1) {
@@ -1403,19 +1406,19 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                             retailProportion.getNoRetailLevel1Proportion());
 
                     insFeeOrderNew.setFirstDetailPremiums(retailFeeLevel1.getTotalRetailPremiums());
-                    if(insFeeOrderNew.getFirstLevelUserId() != null) {
+                    if (insFeeOrderNew.getFirstLevelUserId() != null) {
                         SysUser byId = sysUserService.getById(insFeeOrderNew.getFirstLevelUserId());
                         retailFeeLevel1.setUserName(byId.getName() + "(" + byId.getId() + ")");
                     }
-                }else{
+                } else {
                     insFeeOrderNew.setFirstDetailProportion(new BigDecimal(0));
                 }
-            }else{
+            } else {
                 insFeeOrderNew.setFirstDetailPremiums(new BigDecimal(0));
                 insFeeOrderNew.setSecondDetailPremiums(new BigDecimal(0));
                 insFeeOrderNew.setThirdDetailPremiums(new BigDecimal(0));
             }
-        }else{
+        } else {
             insFeeOrderNew.setFirstDetailProportion(new BigDecimal(0));
             insFeeOrderNew.setSecondDetailProportion(new BigDecimal(0));
             insFeeOrderNew.setThirdDetailProportion(new BigDecimal(0));
@@ -1441,10 +1444,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         retailFeeList.add(retailFeeLevel3);
 
 
-
-
-
-        insFeeOrderNew.assignRetail(retailFeeLevel1,retailFeeLevel2,retailFeeLevel3);
+        insFeeOrderNew.assignRetail(retailFeeLevel1, retailFeeLevel2, retailFeeLevel3);
 
         //endregion
 
@@ -1505,7 +1505,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         noDeptManagerFee.setInsuranceType("非车险");
         deptManagerFeeList.add(noDeptManagerFee);
 
-        insFeeOrderNew.assignDept(jqDeptManagerFee,syDeptManagerFee,noDeptManagerFee);
+        insFeeOrderNew.assignDept(jqDeptManagerFee, syDeptManagerFee, noDeptManagerFee);
 
 
         //endregion
@@ -1522,7 +1522,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 jqDeptRadio,
                 jqRetailRadio,
                 taxRadio,
-                enterProportion
+                jqReCalcuLateProportion.getProxyProportion()
         );
 
         jqExportFee.setInsuranceType("交强险");
@@ -1537,7 +1537,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 syDeptRadio,
                 syRetailRadio,
                 taxRadio,
-                enterProportion
+                syReCalcuLateProportion.getProxyProportion()
         );
 
         syExportFee.setInsuranceType("商业险");
@@ -1552,7 +1552,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 noDeptRadio,
                 noRetailRadio,
                 taxRadio,
-                enterProportion
+                noReCalcuLateProportion.getProxyProportion()
         );
 
         noExportFee.setInsuranceType("非车险");
@@ -1695,19 +1695,19 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
 
         //分销交强费用
         //分开算  1  2 3 级
-        BigDecimal jqFirst = insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getJqRetailProportionLevel1().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
-        BigDecimal jqSecond = insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getJqRetailProportionLevel2().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
-        BigDecimal jqThird = insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getJqRetailProportionLevel3().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
+        BigDecimal jqFirst = insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getJqRetailProportionLevel1().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
+        BigDecimal jqSecond = insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getJqRetailProportionLevel2().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
+        BigDecimal jqThird = insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getJqRetailProportionLevel3().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
         BigDecimal jqFenXiao = jqFirst.add(jqSecond).add(jqThird);
         //分销商业费用
-        BigDecimal syFirst = insFeeOrderNew.getSyPremium().multiply(insFeeOrderNew.getSyRetailProportionLevel1().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
-        BigDecimal sySecond = insFeeOrderNew.getSyPremium().multiply(insFeeOrderNew.getSyRetailProportionLevel2().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
-        BigDecimal syThird = insFeeOrderNew.getSyPremium().multiply(insFeeOrderNew.getSyRetailProportionLevel3().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
+        BigDecimal syFirst = insFeeOrderNew.getSyPremium().multiply(insFeeOrderNew.getSyRetailProportionLevel1().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
+        BigDecimal sySecond = insFeeOrderNew.getSyPremium().multiply(insFeeOrderNew.getSyRetailProportionLevel2().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
+        BigDecimal syThird = insFeeOrderNew.getSyPremium().multiply(insFeeOrderNew.getSyRetailProportionLevel3().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
         BigDecimal syFenXiao = syFirst.add(sySecond).add(syThird);
         //分销非车费用
-        BigDecimal noFirst = insFeeOrderNew.getNoPremium().multiply(insFeeOrderNew.getNoRetailProportionLevel1().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
-        BigDecimal noSecond = insFeeOrderNew.getNoPremium().multiply(insFeeOrderNew.getNoRetailProportionLevel2().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
-        BigDecimal noThird = insFeeOrderNew.getNoPremium().multiply(insFeeOrderNew.getNoRetailProportionLevel3().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN);
+        BigDecimal noFirst = insFeeOrderNew.getNoPremium().multiply(insFeeOrderNew.getNoRetailProportionLevel1().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
+        BigDecimal noSecond = insFeeOrderNew.getNoPremium().multiply(insFeeOrderNew.getNoRetailProportionLevel2().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
+        BigDecimal noThird = insFeeOrderNew.getNoPremium().multiply(insFeeOrderNew.getNoRetailProportionLevel3().divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_DOWN);
         BigDecimal noFenXiao = noFirst.add(noSecond).add(noThird);
 
 
@@ -1747,7 +1747,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         insFeeOrderNewService.updateById(insFeeOrderNew);
 
         //添加轨迹
-        InsFeeAuditHistory insFeeAuditHistory = new InsFeeAuditHistory(insAreaCompany,"6",BaseController.getUser().getName());
+        InsFeeAuditHistory insFeeAuditHistory = new InsFeeAuditHistory(insAreaCompany, "6", BaseController.getUser().getName());
         insFeeAuditHistoryService.save(insFeeAuditHistory);
 
         return resultFeeOrderNewVo;
@@ -1757,9 +1757,10 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
 
     /**
      * 修改费用历史记录
+     *
      * @return
      */
-    private boolean modifyCostsHistory(FeeOrderNewRecordVo feeOrderNewRecordVo){
+    private boolean modifyCostsHistory(FeeOrderNewRecordVo feeOrderNewRecordVo) {
         InsFeeOrderNewRecord record = new InsFeeOrderNewRecord();
         FeeOrderNewVo feeOrderNewVoOld = feeOrderNewRecordVo.getFeeOrderNewVoOld();
         FeeOrderNewVo feeOrderNewVoNew = feeOrderNewRecordVo.getFeeOrderNewVoNew();
@@ -1902,6 +1903,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
 
     /**
      * 获取现询费用
+     *
      * @param inquiryNowFeeQueryVo
      * @return
      */
@@ -1909,29 +1911,29 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
     public List<PtlAgreementProductCostsNew> getInquiryNowFee(InquiryNowFeeQueryVo inquiryNowFeeQueryVo) {
         LambdaQueryWrapper<PtlAgreementProductCostsNew> queryWrapper = new LambdaQueryWrapper<>();
 
-        queryWrapper.eq(PtlAgreementProductCostsNew::getAgreementId,inquiryNowFeeQueryVo.getAgreementId());
-        if(inquiryNowFeeQueryVo.getProductId() != null) {
+        queryWrapper.eq(PtlAgreementProductCostsNew::getAgreementId, inquiryNowFeeQueryVo.getAgreementId());
+        if (inquiryNowFeeQueryVo.getProductId() != null) {
             queryWrapper.eq(PtlAgreementProductCostsNew::getProductId, inquiryNowFeeQueryVo.getProductId());
         }
         queryWrapper.lt(PtlAgreementProductCostsNew::getCostsStartDate, LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
-        queryWrapper.gt(PtlAgreementProductCostsNew::getCostsEndDate,LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+        queryWrapper.gt(PtlAgreementProductCostsNew::getCostsEndDate, LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
 
-        queryWrapper.eq(PtlAgreementProductCostsNew::getIsAudit,"1");
-        queryWrapper.eq(PtlAgreementProductCostsNew::getIsInquiryNow,"0");
+        queryWrapper.eq(PtlAgreementProductCostsNew::getIsAudit, "1");
+        queryWrapper.eq(PtlAgreementProductCostsNew::getIsInquiryNow, "0");
         List<PtlAgreementProductCostsNew> ptlAgreementProductCostsNews = baseMapper.selectList(queryWrapper);
 
-        ptlAgreementProductCostsNews.forEach(item->{
-            if(item.getProductId().equals(ProductsType.PT_0330.getCode())){
-                if(item.getSyCostsProportion().equals("0")){
+        ptlAgreementProductCostsNews.forEach(item -> {
+            if (item.getProductId().equals(ProductsType.PT_0330.getCode())) {
+                if (item.getSyCostsProportion().equals("0")) {
                     item.setSyCostsProportion(null);
                 }
 
-            }else if(item.getProductId().equals(ProductsType.PT_034002.getCode()) || item.getProductId().equals(ProductsType.PT_034001.getCode())){
-                if(item.getJqCostsProportion().equals("0")){
+            } else if (item.getProductId().equals(ProductsType.PT_034002.getCode()) || item.getProductId().equals(ProductsType.PT_034001.getCode())) {
+                if (item.getJqCostsProportion().equals("0")) {
                     item.setJqCostsProportion(null);
                 }
             }
-            if(item.getNoCarCostsProportion().equals("0")){
+            if (item.getNoCarCostsProportion().equals("0")) {
                 item.setNoCostsProportion(null);
             }
         });