Procházet zdrojové kódy

费用调整 订单详情页面调整 bug修改

785834757 před 2 roky
rodič
revize
c0e05860a7

+ 8 - 0
src/main/java/com/ydtech/modules/admin/service/SysDeptService.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.PageRequest;
 import com.ydtech.core.page.PageResult;
+import com.ydtech.modules.admin.model.SysArea;
 import com.ydtech.modules.admin.model.SysDept;
 import com.ydtech.modules.admin.model.vo.SysDeptVo;
 import com.ydtech.modules.admin.model.vo.TreeSysDeptVO;
@@ -82,6 +83,13 @@ public interface SysDeptService extends IService<SysDept> {
      *  @Description:  查询省、市、县、门店列表信息
      */
     List<SysDept> queryListByParentId(String level, String parentId);
+
+    /**
+     * 查询归属地区信息
+     * @param deptId
+     * @return
+     */
+    String queryBelongArea(String deptId);
 }
 
 

+ 26 - 0
src/main/java/com/ydtech/modules/admin/service/impl/SysDeptServiceImpl.java

@@ -9,10 +9,13 @@ import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.PageRequest;
 import com.ydtech.core.page.PageResult;
 import com.ydtech.exception.SystemException;
+import com.ydtech.modules.admin.dao.SysAreaMapper;
 import com.ydtech.modules.admin.dao.SysDeptMapper;
+import com.ydtech.modules.admin.model.SysArea;
 import com.ydtech.modules.admin.model.SysDept;
 import com.ydtech.modules.admin.model.vo.SysDeptVo;
 import com.ydtech.modules.admin.model.vo.TreeSysDeptVO;
+import com.ydtech.modules.admin.service.SysAreaService;
 import com.ydtech.modules.admin.service.SysDeptService;
 import com.ydtech.modules.protocol.utils.AssertionUtils;
 import com.ydtech.utils.StringUtils;
@@ -35,6 +38,13 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
 
     @Autowired
     private SysDeptMapper sysDeptMapper;
+
+    @Autowired
+    private SysAreaService sysAreaService;
+
+    @Autowired
+    private SysAreaMapper sysAreaMapper;
+
     @Override
     public List<SysDept> findTree(String deptId,String managementSource) {
         if(null == deptId || "".equals(deptId) || "undefined".equals(deptId)){
@@ -379,6 +389,22 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
         return sysDeptMapper.queryListByParentId(level,parentId);
     }
 
+    @Override
+    public String queryBelongArea(String deptId){
+        //长度大于8的话 进行切割
+        StringBuilder result = new StringBuilder();
+        if(deptId.length() >= 8)
+        {
+            String area = deptId.substring(2,8);
+            SysArea sysArea = sysAreaMapper.selectOne(new LambdaQueryWrapper<SysArea>().eq(SysArea::getAreaCode, area));
+            List<SysArea> sysAreas = sysAreaService.queryAllParent(sysArea);
+            result.append(sysAreas.get(2).getAreaCname());
+            result.append(sysAreas.get(1).getAreaCname());
+            result.append(sysAreas.get(0).getAreaCname());
+        }
+        return result.toString();
+    }
+
 }
 
 

+ 36 - 0
src/main/java/com/ydtech/modules/fee/service/FeeRuleSchemeService.java

@@ -3,9 +3,11 @@ package com.ydtech.modules.fee.service;
 
 import com.ydtech.modules.ins.model.vo.QuoteRespVo;
 import com.ydtech.modules.order.entity.vo.BaseQuoteInfoVo;
+import com.ydtech.modules.order.entity.vo.FeeOrderNewVo;
 import com.ydtech.modules.order.entity.vo.QueryOrderFeeResultVo;
 import com.ydtech.modules.order.entity.vo.QueryOrderFeeVo;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -39,4 +41,38 @@ public interface FeeRuleSchemeService {
      * @param syCostsProportionStr
      */
     void compareAndUpdateFeeOrderInfo(String insOrderNo ,String jqCostsProportionStr,String syCostsProportionStr,String dealUser);
+
+    /**
+     * 计算入口费用
+     * @param premium    保费
+     * @param superviseCostsProportion  手续费比例
+     * @param otherCostsProportion      跟单比例
+     */
+    FeeOrderNewVo.EntranceFee calcEntranceFee(BigDecimal premium, BigDecimal superviseCostsProportion, BigDecimal otherCostsProportion, BigDecimal taxRate);
+
+    /**
+     * 计算机构管理费用
+     * @param premium   保费
+     * @param level1Proportion  一级比例
+     * @param level2Proportion  二级比例
+     * @param level3Proportion  三级比例
+     * @param level4Proportion  四级比例
+     * @param level5Proportion  五级比例
+     * @return
+     */
+    public FeeOrderNewVo.DeptManagerFee calcDeptManagerFee(BigDecimal premium, BigDecimal level1Proportion,BigDecimal level2Proportion,
+                                                           BigDecimal level3Proportion,BigDecimal level4Proportion,BigDecimal level5Proportion);
+
+    /**
+     * 计算出口费用
+     * @param premium   保费
+     * @param superviseCostsProportion  出口手续费
+     * @param entranceTotalProportion   入口总比例
+     * @param deptTotalProportion       机构管理费总比例
+     * @param retailTotalProportion     分销总比例
+     * @param taxRate                   税率
+     * @return
+     */
+    public FeeOrderNewVo.ExportFee calcExportFee(BigDecimal premium, BigDecimal superviseCostsProportion, BigDecimal entranceTotalProportion,
+                                                 BigDecimal deptTotalProportion,BigDecimal retailTotalProportion,BigDecimal taxRate);
 }

+ 2 - 2
src/main/java/com/ydtech/modules/fee/service/impl/CostsCalServiceImpl.java

@@ -162,12 +162,12 @@ public class CostsCalServiceImpl implements CostsCalcService {
         ExportFee exportFee = new ExportFee();
         //计算出口费用
         //出口比例
-        BigDecimal jqExportRadio = entranceFee.getTotalProportion().subtract(deptManagerFee.getDeptManagerRadio()).subtract(retailStoreFee.getRetailStoreRadio());
+        BigDecimal exportRadio = entranceFee.getTotalProportion().subtract(deptManagerFee.getDeptManagerRadio()).subtract(retailStoreFee.getRetailStoreRadio());
         //出口费用
         exportFee.setSuperviseCosts(exportProceduresRadio);
         exportFee.setSuperviseCostsPremiums(entranceFee.getPremium().multiply(exportProceduresRadio.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
         //跟单比例
-        exportFee.setOtherCostsProportion(entranceFee.getTotalProportion().subtract(exportProceduresRadio));
+        exportFee.setOtherCostsProportion(exportRadio.subtract(exportProceduresRadio));
         //跟单费用
         exportFee.setOtherCostsPremiums(entranceFee.getPremium().multiply(exportFee.getOtherCostsProportion().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
         //总比例

+ 152 - 163
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceImpl.java

@@ -2616,52 +2616,16 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         List<FeeOrderNewVo.ExportFee> exportFeeList = new ArrayList<>();
         List<FeeOrderNewVo.DeptManagerFee> deptManagerFeeList = new ArrayList<>();
 
-        FeeOrderNewVo.EntranceFee jqEntranceFee = new FeeOrderNewVo.EntranceFee();
-        FeeOrderNewVo.ExportFee jqExportFee = new  FeeOrderNewVo.ExportFee();
-        FeeOrderNewVo.DeptManagerFee jqDeptManagerFee = new FeeOrderNewVo.DeptManagerFee();
+        FeeOrderNewVo.EntranceFee jqEntranceFee,syEntranceFee,noEntranceFee;
+        FeeOrderNewVo.ExportFee jqExportFee,syExportFee,noExportFee;
+        FeeOrderNewVo.DeptManagerFee jqDeptManagerFee,syDeptManagerFee,noDeptManagerFee;
 
-        FeeOrderNewVo.EntranceFee syEntranceFee = new FeeOrderNewVo.EntranceFee();
-        FeeOrderNewVo.ExportFee syExportFee = new  FeeOrderNewVo.ExportFee();
-        FeeOrderNewVo.DeptManagerFee syDeptManagerFee = new FeeOrderNewVo.DeptManagerFee();
-
-        FeeOrderNewVo.EntranceFee nonEntranceFee = new FeeOrderNewVo.EntranceFee();
-        FeeOrderNewVo.ExportFee nonExportFee = new  FeeOrderNewVo.ExportFee();
-        FeeOrderNewVo.DeptManagerFee nonDeptManagerFee = new FeeOrderNewVo.DeptManagerFee();
-
-        //入口费用
-        jqEntranceFee.setInsuranceType("交强险");  // 险种
-        jqEntranceFee.setPremium(insFeeOrderNew.getJqPremium());  //保费
-        jqEntranceFee.setTotalAmount(insFeeOrderNew.getJqCostsPremiums());   //总费用
-        jqEntranceFee.setTotalProportion(insFeeOrderNew.getJqCostsProportion()); //总比例
-        jqEntranceFee.setSySuperviseCostsPremiums(insFeeOrderNew.getJqSuperviseCostsPremiums());   //手续费
-        jqEntranceFee.setOtherCostsProportion(insFeeOrderNew.getJqOtherCostsProportion());   // 跟单比例
-        jqEntranceFee.setOtherCostsPremiums(insFeeOrderNew.getJqOtherCostsPremiums());      // 跟单费
-        jqEntranceFee.setSuperviseCosts(insFeeOrderNew.getJqSuperviseCostsProportion());  // 手续费比例
-        jqEntranceFee.setExportSuperviseCosts(insFeeOrderNew.getJqCostsExportProportion());  // 出口费比例
-        entranceFeeList.add(jqEntranceFee);
-
-
-        // 机构管理费
-        jqDeptManagerFee.setInsuranceType("交强险");
-        jqDeptManagerFee.setDeptProportionLevelOne(insFeeOrderNew.getJqDeptProportionLevel1());
-        jqDeptManagerFee.setDeptPremiumsLevelOne(insFeeOrderNew.getJqDeptPremiumsLevel1());
-        jqDeptManagerFee.setDeptProportionLevelTwo(insFeeOrderNew.getJqDeptProportionLevel2());
-        jqDeptManagerFee.setDeptPremiumsLevelTwo(insFeeOrderNew.getJqDeptPremiumsLevel2());
-        jqDeptManagerFee.setDeptProportionLevelThree(insFeeOrderNew.getJqDeptProportionLevel3());
-        jqDeptManagerFee.setDeptPremiumsLevelThree(insFeeOrderNew.getJqDeptPremiumsLevel3());
-        jqDeptManagerFee.setDeptProportionLevelFoure(insFeeOrderNew.getJqDeptProportionLevel4());
-        jqDeptManagerFee.setDeptPremiumsLevelFoure(insFeeOrderNew.getJqDeptPremiumsLevel4());
-        jqDeptManagerFee.setDeptProportionLevelFive(insFeeOrderNew.getJqDeptProportionLevel5());
-        jqDeptManagerFee.setDeptPremiumsLevelFive(insFeeOrderNew.getJqDeptPremiumsLevel5());
-        deptManagerFeeList.add(jqDeptManagerFee);
-
-        //出口费用
-        jqExportFee.setInsuranceType("交强险");  // 险种
-        BigDecimal sumJqDeptProportion = insFeeOrderNew.getJqDeptProportionLevel1()
-                .add(insFeeOrderNew.getJqDeptProportionLevel2())
-                .add(insFeeOrderNew.getJqDeptProportionLevel3())
-                .add(insFeeOrderNew.getJqDeptProportionLevel4())
-                .add(insFeeOrderNew.getJqDeptProportionLevel5());
+        //查询协议是否包含税
+        PtlAgreement ptlAgreement = ptlAgreementService.getById(insFeeOrderNew.getAgreementId());
+        BigDecimal taxRadio = new BigDecimal("1.00");
+        if(ptlAgreement.getWithTax().equals("是")){
+            taxRadio = new BigDecimal("1.06");
+        }
 
         //分销总比例
         BigDecimal sumRetail = new BigDecimal(0);
@@ -2675,143 +2639,79 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
             sumRetail = sumRetail.add(insFeeOrderNew.getThirdDetailProportion());
         }
 
-        //交强总出口费比例
-        BigDecimal jqExportTotalProportion = jqEntranceFee.getTotalProportion().subtract(sumJqDeptProportion).subtract(sumRetail);
+        //交强入口费用
+        jqEntranceFee = calcEntranceFee(insFeeOrderNew.getJqPremium(),insFeeOrderNew.getJqSuperviseCostsProportion(),insFeeOrderNew.getJqOtherCostsProportion(),taxRadio);
+        jqEntranceFee.setInsuranceType("交强险");  // 险种
+        jqEntranceFee.setExportSuperviseCosts(insFeeOrderNew.getJqCostsExportProportion());  // 出口费比例
+        entranceFeeList.add(jqEntranceFee);
 
-        //交强出口手续费比例
-        BigDecimal jqExportSuperviseCosts =
-                jqExportTotalProportion.compareTo(jqEntranceFee.getExportSuperviseCosts()) > 0 ? jqEntranceFee.getExportSuperviseCosts() : jqExportTotalProportion;
+        //交强机构管理费比例
+        jqDeptManagerFee = calcDeptManagerFee(insFeeOrderNew.getJqPremium(),insFeeOrderNew.getJqDeptProportionLevel1(),
+                insFeeOrderNew.getJqDeptProportionLevel2(),insFeeOrderNew.getJqDeptProportionLevel3(),
+                insFeeOrderNew.getJqDeptProportionLevel4(),insFeeOrderNew.getJqDeptProportionLevel5());
+        jqDeptManagerFee.setInsuranceType("交强险");
+        deptManagerFeeList.add(jqDeptManagerFee);
 
-        //交强出口其他费比例
-        BigDecimal jqOtherCostsProportion =
-                jqExportTotalProportion.compareTo(jqEntranceFee.getExportSuperviseCosts()) > 0 ? jqExportTotalProportion.subtract(jqExportSuperviseCosts) : new BigDecimal(0);
+        //交强机构管理费总比例
+        BigDecimal jqDeptManagerRadio = jqDeptManagerFee.getDeptProportionLevelOne().add(jqDeptManagerFee.getDeptProportionLevelTwo())
+                .add(jqDeptManagerFee.getDeptProportionLevelThree()).add(jqDeptManagerFee.getDeptProportionLevelFoure())
+                .add(jqDeptManagerFee.getDeptProportionLevelFive());
 
-        jqExportFee.setSuperviseCosts(jqExportSuperviseCosts);
-        jqExportFee.setSuperviseCostsPremiums(insFeeOrderNew.getJqPremium().multiply(jqExportSuperviseCosts.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
-        jqExportFee.setOtherCostsProportion(jqOtherCostsProportion);
-        jqExportFee.setOtherCostsPremiums(insFeeOrderNew.getJqPremium().multiply(jqOtherCostsProportion.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
-        jqExportFee.setTotalProportion(jqExportSuperviseCosts.add(jqOtherCostsProportion));
-        jqExportFee.setTotalAmount(insFeeOrderNew.getJqPremium().multiply(jqExportFee.getTotalProportion().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
+        //交强出口费用
+        jqExportFee = calcExportFee(insFeeOrderNew.getJqPremium(),insFeeOrderNew.getJqCostsExportProportion(),jqEntranceFee.getTotalProportion(),
+                jqDeptManagerRadio,sumRetail,taxRadio);
+        jqExportFee.setInsuranceType("交强险");
         exportFeeList.add(jqExportFee);
 
-
-
-
         //商业入口
+        syEntranceFee = calcEntranceFee(insFeeOrderNew.getSyPremium(),insFeeOrderNew.getSySuperviseCostsProportion(),insFeeOrderNew.getSyOtherCostsProportion(),taxRadio);
         syEntranceFee.setInsuranceType("商业险");  // 险种
-        syEntranceFee.setPremium(insFeeOrderNew.getSyPremium());  //保费
-        syEntranceFee.setTotalProportion(insFeeOrderNew.getSyCostsProportion()); //总保费
-        syEntranceFee.setTotalAmount(insFeeOrderNew.getSyCostsPremiums());   //总费用
-        syEntranceFee.setSySuperviseCostsPremiums(insFeeOrderNew.getSySuperviseCostsPremiums());   //手续费
-        syEntranceFee.setOtherCostsProportion(insFeeOrderNew.getSyOtherCostsProportion());   // 跟单比例
-        syEntranceFee.setOtherCostsPremiums(insFeeOrderNew.getSyOtherCostsPremiums());      // 跟单费
-        syEntranceFee.setSuperviseCosts(insFeeOrderNew.getSySuperviseCostsProportion());  // 手续费比例
         syEntranceFee.setExportSuperviseCosts(insFeeOrderNew.getSyCostsExportProportion());  // 出口费比例
         entranceFeeList.add(syEntranceFee);
 
         // 商业管理费
+        syDeptManagerFee = calcDeptManagerFee(insFeeOrderNew.getSyPremium(),insFeeOrderNew.getSyDeptProportionLevel1(),
+                insFeeOrderNew.getSyDeptProportionLevel2(),insFeeOrderNew.getSyDeptProportionLevel3(),
+                insFeeOrderNew.getSyDeptProportionLevel4(),insFeeOrderNew.getSyDeptProportionLevel5());
         syDeptManagerFee.setInsuranceType("商业险");
-        syDeptManagerFee.setDeptProportionLevelOne(insFeeOrderNew.getSyDeptProportionLevel1());
-        syDeptManagerFee.setDeptPremiumsLevelOne(insFeeOrderNew.getSyDeptPremiumsLevel1());
-        syDeptManagerFee.setDeptProportionLevelTwo(insFeeOrderNew.getSyDeptProportionLevel2());
-        syDeptManagerFee.setDeptPremiumsLevelTwo(insFeeOrderNew.getSyDeptPremiumsLevel2());
-        syDeptManagerFee.setDeptProportionLevelThree(insFeeOrderNew.getSyDeptProportionLevel3());
-        syDeptManagerFee.setDeptPremiumsLevelThree(insFeeOrderNew.getSyDeptPremiumsLevel3());
-        syDeptManagerFee.setDeptProportionLevelFoure(insFeeOrderNew.getSyDeptProportionLevel4());
-        syDeptManagerFee.setDeptPremiumsLevelFoure(insFeeOrderNew.getSyDeptPremiumsLevel4());
-        syDeptManagerFee.setDeptProportionLevelFive(insFeeOrderNew.getSyDeptProportionLevel5());
-        syDeptManagerFee.setDeptPremiumsLevelFive(insFeeOrderNew.getSyDeptPremiumsLevel5());
         deptManagerFeeList.add(syDeptManagerFee);
 
-        //商业出口
-        syExportFee.setInsuranceType("商业险");  // 险种
-        BigDecimal sumSyDeptProportion = insFeeOrderNew.getSyDeptProportionLevel1()
-                .add(insFeeOrderNew.getSyDeptProportionLevel2())
-                .add(insFeeOrderNew.getSyDeptProportionLevel3())
-                .add(insFeeOrderNew.getSyDeptProportionLevel4())
-                .add(insFeeOrderNew.getSyDeptProportionLevel5());
-
-        //商业总出口费比例
-        BigDecimal syExportTotalProportion = new BigDecimal(0);
-        if(syEntranceFee.getTotalProportion().compareTo(new BigDecimal(0)) > 0) {
-            syExportTotalProportion = syEntranceFee.getTotalProportion().subtract(sumSyDeptProportion).subtract(sumRetail);
-        }
-        //商业出口手续费比例
-        BigDecimal syExportSuperviseCosts =
-                syExportTotalProportion.compareTo(syEntranceFee.getExportSuperviseCosts()) > 0 ? syEntranceFee.getExportSuperviseCosts() : syExportTotalProportion;
-
-        //商业出口其他费比例
-        BigDecimal syOtherCostsProportion =
-                syExportTotalProportion.compareTo(syEntranceFee.getExportSuperviseCosts()) > 0 ? syExportTotalProportion.subtract(syExportSuperviseCosts) : new BigDecimal(0);
-
-        syExportFee.setSuperviseCosts(syExportSuperviseCosts);
-        syExportFee.setSuperviseCostsPremiums(insFeeOrderNew.getSyPremium().multiply(syExportSuperviseCosts.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
-        syExportFee.setOtherCostsProportion(syOtherCostsProportion);
-        syExportFee.setOtherCostsPremiums(insFeeOrderNew.getSyPremium().multiply(syOtherCostsProportion.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
-        //如果入口的总比例等于0  则出口的总比例也等于0
-        syExportFee.setTotalProportion(syExportSuperviseCosts.add(syExportFee.getOtherCostsProportion()));
-        syExportFee.setTotalAmount(syExportSuperviseCosts.add(syExportFee.getOtherCostsPremiums()));
-        exportFeeList.add(syExportFee);
 
+        //商业机构管理费总比例
+        BigDecimal syDeptManagerRadio = syDeptManagerFee.getDeptProportionLevelOne().add(syDeptManagerFee.getDeptProportionLevelTwo())
+                .add(syDeptManagerFee.getDeptProportionLevelThree()).add(syDeptManagerFee.getDeptProportionLevelFoure())
+                .add(syDeptManagerFee.getDeptProportionLevelFive());
 
+        //商业出口费用
+        syExportFee = calcExportFee(insFeeOrderNew.getSyPremium(),insFeeOrderNew.getSyCostsExportProportion(),syEntranceFee.getTotalProportion(),
+                syDeptManagerRadio,sumRetail,taxRadio);
+        syExportFee.setInsuranceType("商业险");
+        exportFeeList.add(syExportFee);
 
 
         //非车入口
-        nonEntranceFee.setInsuranceType("非车险");  // 险种
-        nonEntranceFee.setPremium(insFeeOrderNew.getNoPremium());  //保费
-        nonEntranceFee.setTotalProportion(insFeeOrderNew.getNoCostsProportion()); //总保费
-        nonEntranceFee.setTotalAmount(insFeeOrderNew.getNoCostsPremiums());   //总费用
-        nonEntranceFee.setSySuperviseCostsPremiums(insFeeOrderNew.getNoSuperviseCostsPremiums());   //手续费
-        nonEntranceFee.setOtherCostsProportion(insFeeOrderNew.getNoOtherCostsProportion());   // 跟单比例
-        nonEntranceFee.setOtherCostsPremiums(insFeeOrderNew.getNoOtherCostsPremiums());      // 跟单费
-        nonEntranceFee.setSuperviseCosts(insFeeOrderNew.getNoSuperviseCostsProportion());  // 手续费比例
-        nonEntranceFee.setExportSuperviseCosts(insFeeOrderNew.getNoCostsExportProportion());  // 出口费比例
-        entranceFeeList.add(nonEntranceFee);
-
-        // 五级管理费
-        nonDeptManagerFee.setInsuranceType("非车险");
-        nonDeptManagerFee.setDeptProportionLevelOne(insFeeOrderNew.getNoDeptProportionLevel1());
-        nonDeptManagerFee.setDeptPremiumsLevelOne(insFeeOrderNew.getNoDeptPremiumsLevel1());
-        nonDeptManagerFee.setDeptProportionLevelTwo(insFeeOrderNew.getNoDeptProportionLevel2());
-        nonDeptManagerFee.setDeptPremiumsLevelTwo(insFeeOrderNew.getNoDeptPremiumsLevel2());
-        nonDeptManagerFee.setDeptProportionLevelThree(insFeeOrderNew.getNoDeptProportionLevel3());
-        nonDeptManagerFee.setDeptPremiumsLevelThree(insFeeOrderNew.getNoDeptPremiumsLevel3());
-        nonDeptManagerFee.setDeptProportionLevelFoure(insFeeOrderNew.getNoDeptProportionLevel4());
-        nonDeptManagerFee.setDeptPremiumsLevelFoure(insFeeOrderNew.getNoDeptPremiumsLevel4());
-        nonDeptManagerFee.setDeptProportionLevelFive(insFeeOrderNew.getNoDeptProportionLevel5());
-        nonDeptManagerFee.setDeptPremiumsLevelFive(insFeeOrderNew.getNoDeptPremiumsLevel5());
-        deptManagerFeeList.add(nonDeptManagerFee);
-
-
-        //出口费用
-        nonExportFee.setInsuranceType("非车险");  // 险种
-        BigDecimal sumNonDeptProportion = insFeeOrderNew.getNoDeptProportionLevel1()
-                .add(insFeeOrderNew.getNoDeptProportionLevel2())
-                .add(insFeeOrderNew.getNoDeptProportionLevel3())
-                .add(insFeeOrderNew.getNoDeptProportionLevel4())
-                .add(insFeeOrderNew.getNoDeptProportionLevel5());
-
-        //非车总出口费比例
-        BigDecimal nonExportTotalProportion = new BigDecimal(0);
-        if(nonEntranceFee.getTotalProportion().compareTo(new BigDecimal(0)) > 0) {
-            nonExportTotalProportion = nonEntranceFee.getTotalProportion().subtract(sumSyDeptProportion).subtract(sumRetail);
-        }
-
-        //非车出口手续费比例
-        BigDecimal nonExportSuperviseCosts =
-                nonExportTotalProportion.compareTo(nonEntranceFee.getExportSuperviseCosts()) > 0 ? nonEntranceFee.getExportSuperviseCosts() : nonExportTotalProportion;
-
-        //非车出口其他费比例
-        BigDecimal nonOtherCostsProportion =
-                nonExportTotalProportion.compareTo(nonEntranceFee.getExportSuperviseCosts()) > 0 ? nonExportTotalProportion.subtract(nonExportSuperviseCosts) : new BigDecimal(0);
-
-        nonExportFee.setSuperviseCosts(nonExportSuperviseCosts);
-        nonExportFee.setSuperviseCostsPremiums(insFeeOrderNew.getNoPremium().multiply(nonExportSuperviseCosts.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
-        nonExportFee.setOtherCostsProportion(nonOtherCostsProportion);
-        nonExportFee.setOtherCostsPremiums(insFeeOrderNew.getNoPremium().multiply(nonOtherCostsProportion.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
-        nonExportFee.setTotalProportion(nonExportSuperviseCosts.add(nonOtherCostsProportion));
-        nonExportFee.setTotalAmount(nonExportFee.getSuperviseCostsPremiums().add(nonExportFee.getOtherCostsPremiums()));
-        exportFeeList.add(nonExportFee);
+        noEntranceFee = calcEntranceFee(insFeeOrderNew.getNoPremium(),insFeeOrderNew.getNoSuperviseCostsProportion(),insFeeOrderNew.getNoOtherCostsProportion(),taxRadio);
+        noEntranceFee.setInsuranceType("非车险");  // 险种
+        noEntranceFee.setExportSuperviseCosts(insFeeOrderNew.getNoCostsExportProportion());  // 出口费比例
+        entranceFeeList.add(noEntranceFee);
+
+        //非车五级管理费
+        noDeptManagerFee = calcDeptManagerFee(insFeeOrderNew.getNoPremium(),insFeeOrderNew.getNoDeptProportionLevel1(),
+                insFeeOrderNew.getNoDeptProportionLevel2(),insFeeOrderNew.getNoDeptProportionLevel3(),
+                insFeeOrderNew.getNoDeptProportionLevel4(),insFeeOrderNew.getNoDeptProportionLevel5());
+        noDeptManagerFee.setInsuranceType("非车险");
+        deptManagerFeeList.add(noDeptManagerFee);
+
+        //非车机构管理费总比例
+        BigDecimal noDeptManagerRadio = noDeptManagerFee.getDeptProportionLevelOne().add(noDeptManagerFee.getDeptProportionLevelTwo())
+                .add(noDeptManagerFee.getDeptProportionLevelThree()).add(noDeptManagerFee.getDeptProportionLevelFoure())
+                .add(noDeptManagerFee.getDeptProportionLevelFive());
+
+        //非车出口费用
+        noExportFee = calcExportFee(insFeeOrderNew.getNoPremium(),insFeeOrderNew.getNoCostsExportProportion(),noEntranceFee.getTotalProportion(),
+                noDeptManagerRadio,sumRetail,taxRadio);
+        noExportFee.setInsuranceType("非车险");
+        exportFeeList.add(noExportFee);
 
         feeOrderNewVo.setEntranceFee(entranceFeeList);
         feeOrderNewVo.setExportFee(exportFeeList);
@@ -2819,6 +2719,95 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         return feeOrderNewVo;
     }
 
+    /**
+     * 计算入口费用
+     * @param premium    保费
+     * @param superviseCostsProportion  手续费比例
+     * @param otherCostsProportion      跟单比例
+     */
+    public FeeOrderNewVo.EntranceFee calcEntranceFee(BigDecimal premium, BigDecimal superviseCostsProportion, BigDecimal otherCostsProportion, BigDecimal taxRate){
+        FeeOrderNewVo.EntranceFee entranceFee = new FeeOrderNewVo.EntranceFee();
+        entranceFee.setPremium(premium);
+        premium = premium.divide(taxRate,2,RoundingMode.DOWN);
+        //手续费
+        entranceFee.setSuperviseCostsPremiums(premium.multiply(superviseCostsProportion.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
+        entranceFee.setSuperviseCosts(superviseCostsProportion);
+        //跟单费
+        entranceFee.setOtherCostsPremiums(premium.multiply(otherCostsProportion.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
+        entranceFee.setOtherCostsProportion(otherCostsProportion);
+        //总费用比例
+        BigDecimal totalCostsProportion = superviseCostsProportion.add(otherCostsProportion);
+        entranceFee.setTotalAmount(premium.multiply(totalCostsProportion.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
+        entranceFee.setTotalProportion(totalCostsProportion);
+        return entranceFee;
+    }
+
+    /**
+     * 计算机构管理费用
+     * @param premium   保费
+     * @param level1Proportion  一级比例
+     * @param level2Proportion  二级比例
+     * @param level3Proportion  三级比例
+     * @param level4Proportion  四级比例
+     * @param level5Proportion  五级比例
+     * @return
+     */
+    public FeeOrderNewVo.DeptManagerFee calcDeptManagerFee(BigDecimal premium, BigDecimal level1Proportion,BigDecimal level2Proportion,
+                                                           BigDecimal level3Proportion,BigDecimal level4Proportion,BigDecimal level5Proportion){
+        FeeOrderNewVo.DeptManagerFee deptManagerFee = new FeeOrderNewVo.DeptManagerFee();
+        //一级管理费
+        deptManagerFee.setDeptPremiumsLevelOne(premium.multiply(level1Proportion.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
+        deptManagerFee.setDeptProportionLevelOne(level1Proportion);
+        //二级管理费
+        deptManagerFee.setDeptPremiumsLevelTwo(premium.multiply(level2Proportion.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
+        deptManagerFee.setDeptProportionLevelTwo(level2Proportion);
+        //三级管理费
+        deptManagerFee.setDeptPremiumsLevelThree(premium.multiply(level3Proportion.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
+        deptManagerFee.setDeptProportionLevelThree(level3Proportion);
+        //四级管理费
+        deptManagerFee.setDeptPremiumsLevelFoure(premium.multiply(level4Proportion.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
+        deptManagerFee.setDeptProportionLevelFoure(level4Proportion);
+        //五级管理费
+        deptManagerFee.setDeptPremiumsLevelFive(premium.multiply(level5Proportion.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
+        deptManagerFee.setDeptProportionLevelFive(level5Proportion);
+        return deptManagerFee;
+    }
+
+    /**
+     * 计算出口费用
+     * @param premium   保费
+     * @param superviseCostsProportion  出口手续费
+     * @param entranceTotalProportion   入口总比例
+     * @param deptTotalProportion       机构管理费总比例
+     * @param retailTotalProportion     分销总比例
+     * @param taxRate                   税率
+     * @return
+     */
+    public FeeOrderNewVo.ExportFee calcExportFee(BigDecimal premium, BigDecimal superviseCostsProportion, BigDecimal entranceTotalProportion,
+                                                 BigDecimal deptTotalProportion,BigDecimal retailTotalProportion,BigDecimal taxRate){
+        FeeOrderNewVo.ExportFee exportFee = new FeeOrderNewVo.ExportFee();
+        exportFee.setPremium(premium);
+        //去税后的入口比例
+        BigDecimal noTaxEntranceTotalProportion = entranceTotalProportion.divide(taxRate,2,RoundingMode.DOWN);
+        //出口的总比例
+        BigDecimal exportTotalProportion = noTaxEntranceTotalProportion.subtract(deptTotalProportion).subtract(retailTotalProportion);
+        //如果手续费 大于 总比例 则出口手续费等于总比例
+        if(superviseCostsProportion.compareTo(exportTotalProportion) >= 0 ){
+            superviseCostsProportion = exportTotalProportion;
+            exportFee.setSuperviseCosts(superviseCostsProportion);
+            exportFee.setOtherCostsProportion(new BigDecimal(0));
+            exportFee.setTotalProportion(superviseCostsProportion);
+        }else{
+            exportFee.setTotalProportion(exportTotalProportion);
+            exportFee.setOtherCostsProportion(exportTotalProportion.subtract(superviseCostsProportion));
+            exportFee.setSuperviseCosts(superviseCostsProportion);
+        }
+        exportFee.setSuperviseCostsPremiums(premium.multiply(exportFee.getSuperviseCosts().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
+        exportFee.setOtherCostsPremiums(premium.multiply(exportFee.getOtherCostsProportion().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
+        exportFee.setTotalAmount(premium.multiply(exportFee.getTotalProportion().divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
+        return exportFee;
+    }
+
     public List<DistributionLevelVo> converDistrbutionData(InsFeeOrderNew insFeeOrderNew) {
         ArrayList<DistributionLevelVo> resultList = new ArrayList<>();
         DistributionLevelVo  levelOne  =  new DistributionLevelVo();

+ 3 - 1
src/main/java/com/ydtech/modules/order/entity/vo/FeeOrderNewVo.java

@@ -47,7 +47,7 @@ public class FeeOrderNewVo implements Serializable {
         @ApiModelProperty("手续费比例")
         private BigDecimal superviseCosts;
         @ApiModelProperty("手续费")
-        private BigDecimal sySuperviseCostsPremiums;
+        private BigDecimal SuperviseCostsPremiums;
         @ApiModelProperty("跟单比例")
         private BigDecimal otherCostsProportion;
         @ApiModelProperty("跟单费")
@@ -65,6 +65,8 @@ public class FeeOrderNewVo implements Serializable {
     public static class ExportFee {
         @ApiModelProperty("险种")
         private String insuranceType;
+        @ApiModelProperty("保费")
+        private BigDecimal premium;
         @ApiModelProperty("总比例")
         private BigDecimal totalProportion;
         @ApiModelProperty("总费用")

+ 56 - 0
src/main/java/com/ydtech/modules/order/entity/vo/OrderVo.java

@@ -61,6 +61,12 @@ public class OrderVo implements Serializable {
     @TableField(value = "deptid")
     private String deptid;
 
+    /**
+     * 代理团队归属信息
+     */
+    private String deptAreaInfo;
+
+
     /**
      * 代理团队名称
      */
@@ -366,4 +372,54 @@ public class OrderVo implements Serializable {
     @TableField(value = "ubi_predicted_info_score")
     private String ubiPredictedInfoScore;
 
+
+    /**
+     * 推荐人工号
+     */
+    private String referrerNo;
+
+    /**
+     * 推荐人姓名
+     */
+    private String referrerName;
+
+    /**
+     * 推荐人机构编号
+     */
+    private String referrerDeptId;
+
+    /**
+     * 推荐人机构名称
+     */
+    private String referrerDeptName;
+
+    /**
+     * 推荐人机构归属信息
+     */
+    private String referrerDeptAreaInfo;
+
+    /**
+     * 推荐人手机号
+     */
+    private String referrerMobile;
+
+    /**
+     * 推荐人性别
+     */
+    private String referrerSex;
+
+    /**
+     * 费用综合
+     */
+    private String sumFee;
+
+    /**
+     * 出单人电话
+     */
+    public String mobile;
+
+    /**
+     * 出单人性别
+     */
+    public String sex;
 }

+ 51 - 8
src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java

@@ -23,13 +23,13 @@ import com.ydtech.modules.admin.constants.RoleConstants;
 import com.ydtech.modules.admin.dao.SysUserLinkAreaMapper;
 import com.ydtech.modules.admin.dao.SysUserLinkPtlAgreementMapper;
 import com.ydtech.modules.admin.dao.SysUserMapper;
-import com.ydtech.modules.admin.model.SysDept;
-import com.ydtech.modules.admin.model.SysUser;
-import com.ydtech.modules.admin.model.SysUserRole;
+import com.ydtech.modules.admin.model.*;
 import com.ydtech.modules.admin.model.dto.SysUserLinkPtlAgreementDto;
 import com.ydtech.modules.admin.service.SysDeptService;
+import com.ydtech.modules.admin.service.SysUserInfoService;
 import com.ydtech.modules.admin.service.SysUserRoleService;
 import com.ydtech.modules.admin.service.SysUserService;
+import com.ydtech.modules.esm.model.EsmUserReferrer;
 import com.ydtech.modules.esm.service.EsmUserReferrerService;
 import com.ydtech.modules.fee.service.CostsCalcService;
 import com.ydtech.modules.fee.service.impl.FeeRuleSchemeServiceImpl;
@@ -80,6 +80,7 @@ import org.springframework.util.ObjectUtils;
 
 import javax.validation.constraints.NotBlank;
 import java.io.File;
+import java.math.BigDecimal;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
@@ -119,6 +120,10 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
 
     private final InsFileMapper insFileMapper;
 
+    @Autowired
+    private SysUserInfoService sysUserInfoService;
+
+
     @Autowired
     private InsFeeOrderNewService insFeeOrderNewService;
 
@@ -614,13 +619,42 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
     @Override
     public HttpResult<OrderVo> getByCompanyId(@NotBlank(message = "子订单不能为空") String companyId, String userId) {
         OrderVo orderAndAreaCompany = baseMapper.getOrderAndAreaCompany(companyId);
+        //团队归属信息
+        String areaInfo = sysDeptService.queryBelongArea(orderAndAreaCompany.getDeptid());
+        SysUser sysUser = sysUserService.getById(orderAndAreaCompany.getUserid());
+        SysUserInfo sysUserInfo = sysUserInfoService.getById(orderAndAreaCompany.getUserid());
+        if(sysUserInfo.getSex().equals("M")){
+            orderAndAreaCompany.setSex("男");
+        }else{
+            orderAndAreaCompany.setSex("女");
+        }
+        orderAndAreaCompany.setMobile(sysUser.getMobile());
+        orderAndAreaCompany.setDeptAreaInfo(areaInfo);
+        //推荐人信息查询
+        EsmUserReferrer esmUserReferrer = esmUserReferrerService.getById(orderAndAreaCompany.getUserid());
+        if(esmUserReferrer != null){
+            SysUser referrerUser = sysUserService.findByUserId(esmUserReferrer.getReferrerId());
+            SysUserInfo referrerSysUserInfo = sysUserInfoService.getById(esmUserReferrer.getReferrerId());
+            if(referrerSysUserInfo.getSex().equals("M")){
+                orderAndAreaCompany.setReferrerSex("男");
+            }else{
+                orderAndAreaCompany.setReferrerSex("女");
+            }
+            orderAndAreaCompany.setReferrerMobile(referrerUser.getMobile());
+            orderAndAreaCompany.setReferrerNo(referrerUser.getId());
+            orderAndAreaCompany.setReferrerName(referrerUser.getName());
+            orderAndAreaCompany.setReferrerDeptId(referrerUser.getDeptId());
+            SysDept sysDept = sysDeptService.getById(referrerUser.getDeptId());
+            orderAndAreaCompany.setReferrerDeptName(sysDept.getName());
+            orderAndAreaCompany.setReferrerDeptAreaInfo(sysDeptService.queryBelongArea(referrerUser.getDeptId()));
+        }
 
         //计算今年应缴税
-        JSONArray vehicleAndVesselTaxs = orderAndAreaCompany.getTaxArrears();
-        if(vehicleAndVesselTaxs != null && !vehicleAndVesselTaxs.isEmpty()) {
-            JSONObject vehicleAndVesselTax = vehicleAndVesselTaxs.getJSONObject(0);
-            vehicleAndVesselTax.put("dayYearTax", orderAndAreaCompany.getTaxamount().subtract(vehicleAndVesselTax.getBigDecimal("taxDefault")
-                    .subtract(vehicleAndVesselTax.getBigDecimal("lateFee"))));
+        JSONArray taxArrears = orderAndAreaCompany.getTaxArrears();
+        if(taxArrears != null && !taxArrears.isEmpty()) {
+            JSONObject taxArrear = taxArrears.getJSONObject(0);
+            taxArrear.put("dayYearTax", orderAndAreaCompany.getTaxamount().subtract(taxArrear.getBigDecimal("taxDefault")
+                    .subtract(taxArrear.getBigDecimal("lateFee"))));
         }
 
         YaExtendInfoDto yaExtendInfoDto = new YaExtendInfoDto();
@@ -689,6 +723,13 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             FeeOrderNewVo feeOrderNewVo = feeRuleSchemeService.newConvertOrderFeeVoData(insFeeOrderNew, ptlAgreementProductCostsNew);
             feeOrderNewVo.setFeeId(insFeeOrderNew.getId());
             orderAndAreaCompany.setFeeOrderNewVo(feeOrderNewVo);
+            //计算总和
+
+            BigDecimal sum = feeOrderNewVo.getExportFee()
+                    .stream()
+                    .map(FeeOrderNewVo.ExportFee::getTotalAmount)
+                    .reduce(BigDecimal.ZERO, BigDecimal::add);
+            orderAndAreaCompany.setSumFee(sum.toString());
             List<DistributionLevelVo> distributionLevelVoList = feeRuleSchemeService.converDistrbutionData(insFeeOrderNew);
             orderAndAreaCompany.setDistributionLevelVoList(distributionLevelVoList);
         }
@@ -704,6 +745,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         if (null == orderAndAreaCompany.getKindinfo()) orderAndAreaCompany.setKindinfo(JSON.parseArray("[]"));
         if (null == orderAndAreaCompany.getFeeStatus()) orderAndAreaCompany.setFeeStatus("0");
 
+        //获取出单员地区信息
+
         return HttpResult.ok("success", orderAndAreaCompany);
     }
 

+ 126 - 79
src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java

@@ -12,6 +12,7 @@ import com.ydtech.modules.fee.dto.vo.EntranceFee;
 import com.ydtech.modules.fee.dto.vo.ExportFee;
 import com.ydtech.modules.fee.dto.vo.RetailStoreFee;
 import com.ydtech.modules.fee.service.CostsCalcService;
+import com.ydtech.modules.fee.service.FeeRuleSchemeService;
 import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.vo.FeeOrderNewRecordVo;
@@ -865,11 +866,15 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
     @Autowired
     InsAreaCompanyService insAreaCompanyService;
 
+    @Autowired
+    FeeRuleSchemeService feeRuleSchemeService;
+
     @Transactional
     @Override
     public FeeOrderNewVo costsAdjust(FeeOrderNewRecordVo feeOrderNewRecordVo) {
         String feeId = feeOrderNewRecordVo.getFeeId();
         InsFeeOrderNew insFeeOrderNew = insFeeOrderNewService.getById(feeId);
+
         //查询协议是否包含税
         PtlAgreement ptlAgreement = ptlAgreementService.getById(insFeeOrderNew.getAgreementId());
         BigDecimal taxRadio = new BigDecimal("1.00");
@@ -877,24 +882,48 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
             taxRadio = new BigDecimal("1.06");
         }
 
+        //分销费用
+        InsAreaCompany insAreaCompany = insAreaCompanyService.getById(insFeeOrderNew.getInsOrderNo());
+        InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
+        SysUser sysUser = sysUserService.findByUserId(insOrders.getUserid());
+        RetailStoreFee retailStoreFee = costsCalcService.getRetailStoreFee(sysUser.getId(),
+                insFeeOrderNew.getJqPremium().add(insFeeOrderNew.getSyPremium()).add(insFeeOrderNew.getNoPremium()));
+
         InsFeeOrderNewRecord record = new InsFeeOrderNewRecord();
         FeeOrderNewVo feeOrderNewVoOld = feeOrderNewRecordVo.getFeeOrderNewVoOld();
         FeeOrderNewVo feeOrderNewVo = feeOrderNewRecordVo.getFeeOrderNewVoNew();
 
+        if(feeOrderNewVo.getEntranceFee().get(0).getSuperviseCosts().add(feeOrderNewVo.getEntranceFee().get(0).getOtherCostsProportion()).compareTo(feeOrderNewVo.getEntranceFee().get(0).getTotalProportion()) != 0)
+        {
+            throw new SystemException("交强入口费用不匹配,调整费用失败!");
+        }
+        if(feeOrderNewVo.getEntranceFee().get(1).getSuperviseCosts().add(feeOrderNewVo.getEntranceFee().get(1).getOtherCostsProportion()).compareTo(feeOrderNewVo.getEntranceFee().get(1).getTotalProportion()) != 0)
+        {
+            throw new SystemException("商业入口费用不匹配,调整费用失败!");
+        }
+        if(feeOrderNewVo.getEntranceFee().get(2).getSuperviseCosts().add(feeOrderNewVo.getEntranceFee().get(2).getOtherCostsProportion()).compareTo(feeOrderNewVo.getEntranceFee().get(2).getTotalProportion()) != 0)
+        {
+            throw new SystemException("非车入口费用不匹配,调整费用失败!");
+        }
+        //调整后的费用计算
+
         //交强入口费用
-        EntranceFee jqEntranceFee = costsCalcService.getEntranceFee("交强险", feeOrderNewVo.getEntranceFee().get(0).getPremium().divide(taxRadio,10, RoundingMode.UP),
-                feeOrderNewVo.getEntranceFee().get(0).getSuperviseCosts(), feeOrderNewVo.getEntranceFee().get(0).getOtherCostsProportion());
+        FeeOrderNewVo.EntranceFee jqEntranceFee = feeRuleSchemeService.calcEntranceFee(insFeeOrderNew.getJqPremium(),
+                feeOrderNewVo.getEntranceFee().get(0).getSuperviseCosts(),
+                feeOrderNewVo.getEntranceFee().get(0).getOtherCostsProportion(), taxRadio);
 
         //商业入口费用
-        EntranceFee syEntranceFee = costsCalcService.getEntranceFee("商业险", feeOrderNewVo.getEntranceFee().get(1).getPremium().divide(taxRadio,10, RoundingMode.UP),
-                feeOrderNewVo.getEntranceFee().get(1).getSuperviseCosts(), feeOrderNewVo.getEntranceFee().get(1).getOtherCostsProportion());
+        FeeOrderNewVo.EntranceFee syEntranceFee = feeRuleSchemeService.calcEntranceFee(insFeeOrderNew.getSyPremium(),
+                feeOrderNewVo.getEntranceFee().get(1).getSuperviseCosts(),
+                feeOrderNewVo.getEntranceFee().get(1).getOtherCostsProportion(), taxRadio);
 
         //非车入口费用
-        EntranceFee noEntranceFee = costsCalcService.getEntranceFee("非车险", feeOrderNewVo.getEntranceFee().get(2).getPremium().divide(taxRadio,10, RoundingMode.UP),
-                feeOrderNewVo.getEntranceFee().get(2).getSuperviseCosts(), feeOrderNewVo.getEntranceFee().get(2).getOtherCostsProportion());
+        FeeOrderNewVo.EntranceFee noEntranceFee = feeRuleSchemeService.calcEntranceFee(insFeeOrderNew.getNoPremium(),
+                feeOrderNewVo.getEntranceFee().get(2).getSuperviseCosts(),
+                feeOrderNewVo.getEntranceFee().get(2).getOtherCostsProportion(), taxRadio);
 
         //交强部门管理费用
-        DeptManagerFee jqDeptManagerFee = costsCalcService.getDeptManagerFee("交强险", insFeeOrderNew.getJqPremium().divide(taxRadio,10, RoundingMode.UP),
+        FeeOrderNewVo.DeptManagerFee jqDeptManagerFee = feeRuleSchemeService.calcDeptManagerFee(insFeeOrderNew.getJqPremium(),
                 feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelOne(),
                 feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelTwo(),
                 feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelThree(),
@@ -902,32 +931,48 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelFive());
 
         //商业部门管理费用
-        DeptManagerFee syDeptManagerFee = costsCalcService.getDeptManagerFee("商业险", insFeeOrderNew.getSyPremium().divide(taxRadio,10, RoundingMode.UP),
-                insFeeOrderNew.getSyDeptProportionLevel1(), insFeeOrderNew.getSyDeptProportionLevel2(), insFeeOrderNew.getSyDeptProportionLevel3(),
-                insFeeOrderNew.getSyDeptProportionLevel4(), insFeeOrderNew.getSyDeptProportionLevel5());
+        FeeOrderNewVo.DeptManagerFee syDeptManagerFee = feeRuleSchemeService.calcDeptManagerFee(insFeeOrderNew.getSyPremium(),
+                feeOrderNewVo.getDeptManagerFee().get(1).getDeptProportionLevelOne(),
+                feeOrderNewVo.getDeptManagerFee().get(1).getDeptProportionLevelTwo(),
+                feeOrderNewVo.getDeptManagerFee().get(1).getDeptProportionLevelThree(),
+                feeOrderNewVo.getDeptManagerFee().get(1).getDeptProportionLevelFoure(),
+                feeOrderNewVo.getDeptManagerFee().get(1).getDeptProportionLevelFive());
 
         //非车部门管理费用
-        DeptManagerFee noDeptManagerFee = costsCalcService.getDeptManagerFee("非车险", insFeeOrderNew.getNoPremium().divide(taxRadio,10, RoundingMode.UP),
-                insFeeOrderNew.getNoDeptProportionLevel1(), insFeeOrderNew.getNoDeptProportionLevel2(), insFeeOrderNew.getNoDeptProportionLevel3(),
-                insFeeOrderNew.getNoDeptProportionLevel4(), insFeeOrderNew.getNoDeptProportionLevel5());
+        FeeOrderNewVo.DeptManagerFee noDeptManagerFee = feeRuleSchemeService.calcDeptManagerFee(insFeeOrderNew.getNoPremium(),
+                feeOrderNewVo.getDeptManagerFee().get(2).getDeptProportionLevelOne(),
+                feeOrderNewVo.getDeptManagerFee().get(2).getDeptProportionLevelTwo(),
+                feeOrderNewVo.getDeptManagerFee().get(2).getDeptProportionLevelThree(),
+                feeOrderNewVo.getDeptManagerFee().get(2).getDeptProportionLevelFoure(),
+                feeOrderNewVo.getDeptManagerFee().get(2).getDeptProportionLevelFive());
 
 
-        //分销费用
-        InsAreaCompany insAreaCompany = insAreaCompanyService.getById(insFeeOrderNew.getInsOrderNo());
-        InsOrders insOrders = insOrdersService.getById(insAreaCompany.getOrderno());
-        SysUser sysUser = sysUserService.findByUserId(insOrders.getUserid());
-        RetailStoreFee retailStoreFee = costsCalcService.getRetailStoreFee(sysUser.getId(),
-                insFeeOrderNew.getJqPremium().add(insFeeOrderNew.getSyPremium()).add(insFeeOrderNew.getNoPremium()));
 
-        //出口
-        ExportFee jqExportFee = costsCalcService.getExportFee("交强险",jqEntranceFee,jqDeptManagerFee,retailStoreFee,
-                feeOrderNewRecordVo.getFeeOrderNewVoNew().getExportFee().get(0).getSuperviseCosts());
+        BigDecimal jqDeptManagerTotalProportion = jqDeptManagerFee.getDeptProportionLevelOne().add(jqDeptManagerFee.getDeptProportionLevelTwo())
+                .add(jqDeptManagerFee.getDeptProportionLevelThree()).add(jqDeptManagerFee.getDeptProportionLevelFoure())
+                .add(jqDeptManagerFee.getDeptProportionLevelFive());
+
+        //交强出口费用
+        FeeOrderNewVo.ExportFee jqExportFee = feeRuleSchemeService.calcExportFee(insFeeOrderNew.getJqPremium(),insFeeOrderNew.getJqCostsExportProportion(),
+                jqEntranceFee.getTotalProportion(),jqDeptManagerTotalProportion,retailStoreFee.getRetailStoreRadio(),taxRadio);
+
+        BigDecimal syDeptManagerTotalProportion = syDeptManagerFee.getDeptProportionLevelOne().add(syDeptManagerFee.getDeptProportionLevelTwo())
+                .add(syDeptManagerFee.getDeptProportionLevelThree()).add(syDeptManagerFee.getDeptProportionLevelFoure())
+                .add(syDeptManagerFee.getDeptProportionLevelFive());
+
+        //商业出口费用
+        FeeOrderNewVo.ExportFee syExportFee = feeRuleSchemeService.calcExportFee(insFeeOrderNew.getSyPremium(),insFeeOrderNew.getSyCostsExportProportion(),
+                syEntranceFee.getTotalProportion(),syDeptManagerTotalProportion,retailStoreFee.getRetailStoreRadio(),taxRadio);
 
-        ExportFee syExportFee = costsCalcService.getExportFee("商业险",syEntranceFee,syDeptManagerFee,retailStoreFee,
-                feeOrderNewRecordVo.getFeeOrderNewVoNew().getExportFee().get(1).getSuperviseCosts());
 
-        ExportFee noExportFee = costsCalcService.getExportFee("非车险",noEntranceFee,noDeptManagerFee,retailStoreFee,
-                feeOrderNewRecordVo.getFeeOrderNewVoNew().getExportFee().get(0).getSuperviseCosts());
+        BigDecimal noDeptManagerTotalProportion = noDeptManagerFee.getDeptProportionLevelOne().add(noDeptManagerFee.getDeptProportionLevelTwo())
+                .add(noDeptManagerFee.getDeptProportionLevelThree()).add(noDeptManagerFee.getDeptProportionLevelFoure())
+                .add(noDeptManagerFee.getDeptProportionLevelFive());
+
+        //商业出口费用
+        FeeOrderNewVo.ExportFee noExportFee = feeRuleSchemeService.calcExportFee(insFeeOrderNew.getNoPremium(),insFeeOrderNew.getNoCostsExportProportion(),
+                noEntranceFee.getTotalProportion(),noDeptManagerTotalProportion,retailStoreFee.getRetailStoreRadio(),taxRadio);
+
 
         //转换输出的格式
         FeeOrderNewVo resultFeeOrderNewVo = new FeeOrderNewVo();
@@ -1068,6 +1113,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         insFeeOrderNewRecordService.save(record);
 
 
+        //ins_fee_order_new 保存新的费用
         insFeeOrderNew.setJqCostsProportion(jqEntranceFee.getTotalProportion());
         insFeeOrderNew.setJqCostsPremiums(jqEntranceFee.getTotalAmount());
         feeOrderNewVo.getEntranceFee().get(0).setPremium(insFeeOrderNew.getJqPremium());
@@ -1082,14 +1128,14 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         feeOrderNewVo.getEntranceFee().get(1).setTotalAmount(noEntranceFee.getTotalAmount());
 
         insFeeOrderNew.setJqSuperviseCostsProportion(jqEntranceFee.getSuperviseCosts());
-        insFeeOrderNew.setJqSuperviseCostsPremiums(jqEntranceFee.getSySuperviseCostsPremiums());
-        feeOrderNewVo.getEntranceFee().get(0).setSySuperviseCostsPremiums(jqEntranceFee.getSySuperviseCostsPremiums());
+        insFeeOrderNew.setJqSuperviseCostsPremiums(jqEntranceFee.getSuperviseCostsPremiums());
+        feeOrderNewVo.getEntranceFee().get(0).setSuperviseCostsPremiums(jqEntranceFee.getSuperviseCostsPremiums());
         insFeeOrderNew.setSySuperviseCostsProportion(syEntranceFee.getSuperviseCosts());
-        insFeeOrderNew.setSySuperviseCostsPremiums(syEntranceFee.getSySuperviseCostsPremiums());
-        feeOrderNewVo.getEntranceFee().get(1).setSySuperviseCostsPremiums(syEntranceFee.getSySuperviseCostsPremiums());
+        insFeeOrderNew.setSySuperviseCostsPremiums(syEntranceFee.getSuperviseCostsPremiums());
+        feeOrderNewVo.getEntranceFee().get(1).setSuperviseCostsPremiums(syEntranceFee.getSuperviseCostsPremiums());
         insFeeOrderNew.setNoSuperviseCostsProportion(noEntranceFee.getSuperviseCosts());
-        insFeeOrderNew.setNoSuperviseCostsPremiums(noEntranceFee.getSySuperviseCostsPremiums());
-        feeOrderNewVo.getEntranceFee().get(2).setSySuperviseCostsPremiums(noEntranceFee.getSySuperviseCostsPremiums());
+        insFeeOrderNew.setNoSuperviseCostsPremiums(noEntranceFee.getSuperviseCostsPremiums());
+        feeOrderNewVo.getEntranceFee().get(2).setSuperviseCostsPremiums(noEntranceFee.getSuperviseCostsPremiums());
 
         insFeeOrderNew.setJqOtherCostsProportion(jqEntranceFee.getOtherCostsProportion());
         insFeeOrderNew.setJqOtherCostsPremiums(jqEntranceFee.getOtherCostsPremiums());
@@ -1101,53 +1147,53 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         insFeeOrderNew.setNoOtherCostsPremiums(noEntranceFee.getOtherCostsPremiums());
         feeOrderNewVo.getEntranceFee().get(2).setOtherCostsPremiums(noEntranceFee.getOtherCostsPremiums());
 
-        insFeeOrderNew.setJqDeptProportionLevel1(jqDeptManagerFee.getDeptManagerRadioLevel1());
-        insFeeOrderNew.setJqDeptProportionLevel2(jqDeptManagerFee.getDeptManagerRadioLevel2());
-        insFeeOrderNew.setJqDeptProportionLevel3(jqDeptManagerFee.getDeptManagerRadioLevel3());
-        insFeeOrderNew.setJqDeptProportionLevel4(jqDeptManagerFee.getDeptManagerRadioLevel4());
-        insFeeOrderNew.setJqDeptProportionLevel5(jqDeptManagerFee.getDeptManagerRadioLevel5());
-        insFeeOrderNew.setJqDeptPremiumsLevel1(jqDeptManagerFee.getDeptManagerFeeLevel1());
-        insFeeOrderNew.setJqDeptPremiumsLevel2(jqDeptManagerFee.getDeptManagerFeeLevel2());
-        insFeeOrderNew.setJqDeptPremiumsLevel3(jqDeptManagerFee.getDeptManagerFeeLevel3());
-        insFeeOrderNew.setJqDeptPremiumsLevel4(jqDeptManagerFee.getDeptManagerFeeLevel4());
-        insFeeOrderNew.setJqDeptPremiumsLevel5(jqDeptManagerFee.getDeptManagerFeeLevel5());
-        feeOrderNewVo.getDeptManagerFee().get(0).setDeptPremiumsLevelOne(jqDeptManagerFee.getDeptManagerFeeLevel1());
-        feeOrderNewVo.getDeptManagerFee().get(0).setDeptPremiumsLevelTwo(jqDeptManagerFee.getDeptManagerFeeLevel2());
-        feeOrderNewVo.getDeptManagerFee().get(0).setDeptPremiumsLevelThree(jqDeptManagerFee.getDeptManagerFeeLevel3());
-        feeOrderNewVo.getDeptManagerFee().get(0).setDeptPremiumsLevelFoure(jqDeptManagerFee.getDeptManagerFeeLevel4());
-        feeOrderNewVo.getDeptManagerFee().get(0).setDeptPremiumsLevelFive(jqDeptManagerFee.getDeptManagerFeeLevel5());
-
-        insFeeOrderNew.setSyDeptProportionLevel1(syDeptManagerFee.getDeptManagerRadioLevel1());
-        insFeeOrderNew.setSyDeptProportionLevel2(syDeptManagerFee.getDeptManagerRadioLevel2());
-        insFeeOrderNew.setSyDeptProportionLevel3(syDeptManagerFee.getDeptManagerRadioLevel3());
-        insFeeOrderNew.setSyDeptProportionLevel4(syDeptManagerFee.getDeptManagerRadioLevel4());
-        insFeeOrderNew.setSyDeptProportionLevel5(syDeptManagerFee.getDeptManagerRadioLevel5());
-        insFeeOrderNew.setSyDeptPremiumsLevel1(syDeptManagerFee.getDeptManagerFeeLevel1());
-        insFeeOrderNew.setSyDeptPremiumsLevel2(syDeptManagerFee.getDeptManagerFeeLevel2());
-        insFeeOrderNew.setSyDeptPremiumsLevel3(syDeptManagerFee.getDeptManagerFeeLevel3());
-        insFeeOrderNew.setSyDeptPremiumsLevel4(syDeptManagerFee.getDeptManagerFeeLevel4());
-        insFeeOrderNew.setSyDeptPremiumsLevel5(syDeptManagerFee.getDeptManagerFeeLevel5());
-        feeOrderNewVo.getDeptManagerFee().get(1).setDeptPremiumsLevelOne(syDeptManagerFee.getDeptManagerFeeLevel1());
-        feeOrderNewVo.getDeptManagerFee().get(1).setDeptPremiumsLevelTwo(syDeptManagerFee.getDeptManagerFeeLevel2());
-        feeOrderNewVo.getDeptManagerFee().get(1).setDeptPremiumsLevelThree(syDeptManagerFee.getDeptManagerFeeLevel3());
-        feeOrderNewVo.getDeptManagerFee().get(1).setDeptPremiumsLevelFoure(syDeptManagerFee.getDeptManagerFeeLevel4());
-        feeOrderNewVo.getDeptManagerFee().get(1).setDeptPremiumsLevelFive(syDeptManagerFee.getDeptManagerFeeLevel5());
-
-        insFeeOrderNew.setNoDeptProportionLevel1(noDeptManagerFee.getDeptManagerRadioLevel1());
-        insFeeOrderNew.setNoDeptProportionLevel2(noDeptManagerFee.getDeptManagerRadioLevel2());
-        insFeeOrderNew.setNoDeptProportionLevel3(noDeptManagerFee.getDeptManagerRadioLevel3());
-        insFeeOrderNew.setNoDeptProportionLevel4(noDeptManagerFee.getDeptManagerRadioLevel4());
-        insFeeOrderNew.setNoDeptProportionLevel5(noDeptManagerFee.getDeptManagerRadioLevel5());
-        insFeeOrderNew.setNoDeptPremiumsLevel1(noDeptManagerFee.getDeptManagerFeeLevel1());
-        insFeeOrderNew.setNoDeptPremiumsLevel2(noDeptManagerFee.getDeptManagerFeeLevel2());
-        insFeeOrderNew.setNoDeptPremiumsLevel3(noDeptManagerFee.getDeptManagerFeeLevel3());
-        insFeeOrderNew.setNoDeptPremiumsLevel4(noDeptManagerFee.getDeptManagerFeeLevel4());
-        insFeeOrderNew.setNoDeptPremiumsLevel5(noDeptManagerFee.getDeptManagerFeeLevel5());
-        feeOrderNewVo.getDeptManagerFee().get(2).setDeptPremiumsLevelOne(noDeptManagerFee.getDeptManagerFeeLevel1());
-        feeOrderNewVo.getDeptManagerFee().get(2).setDeptPremiumsLevelTwo(noDeptManagerFee.getDeptManagerFeeLevel2());
-        feeOrderNewVo.getDeptManagerFee().get(2).setDeptPremiumsLevelThree(noDeptManagerFee.getDeptManagerFeeLevel3());
-        feeOrderNewVo.getDeptManagerFee().get(2).setDeptPremiumsLevelFoure(noDeptManagerFee.getDeptManagerFeeLevel4());
-        feeOrderNewVo.getDeptManagerFee().get(2).setDeptPremiumsLevelFive(noDeptManagerFee.getDeptManagerFeeLevel5());
+        insFeeOrderNew.setJqDeptProportionLevel1(jqDeptManagerFee.getDeptProportionLevelOne());
+        insFeeOrderNew.setJqDeptProportionLevel2(jqDeptManagerFee.getDeptProportionLevelTwo());
+        insFeeOrderNew.setJqDeptProportionLevel3(jqDeptManagerFee.getDeptProportionLevelThree());
+        insFeeOrderNew.setJqDeptProportionLevel4(jqDeptManagerFee.getDeptProportionLevelFoure());
+        insFeeOrderNew.setJqDeptProportionLevel5(jqDeptManagerFee.getDeptProportionLevelFive());
+        insFeeOrderNew.setJqDeptPremiumsLevel1(jqDeptManagerFee.getDeptPremiumsLevelOne());
+        insFeeOrderNew.setJqDeptPremiumsLevel2(jqDeptManagerFee.getDeptPremiumsLevelTwo());
+        insFeeOrderNew.setJqDeptPremiumsLevel3(jqDeptManagerFee.getDeptPremiumsLevelThree());
+        insFeeOrderNew.setJqDeptPremiumsLevel4(jqDeptManagerFee.getDeptPremiumsLevelFoure());
+        insFeeOrderNew.setJqDeptPremiumsLevel5(jqDeptManagerFee.getDeptPremiumsLevelFive());
+        feeOrderNewVo.getDeptManagerFee().get(0).setDeptPremiumsLevelOne(jqDeptManagerFee.getDeptPremiumsLevelOne());
+        feeOrderNewVo.getDeptManagerFee().get(0).setDeptPremiumsLevelTwo(jqDeptManagerFee.getDeptPremiumsLevelTwo());
+        feeOrderNewVo.getDeptManagerFee().get(0).setDeptPremiumsLevelThree(jqDeptManagerFee.getDeptPremiumsLevelThree());
+        feeOrderNewVo.getDeptManagerFee().get(0).setDeptPremiumsLevelFoure(jqDeptManagerFee.getDeptPremiumsLevelFoure());
+        feeOrderNewVo.getDeptManagerFee().get(0).setDeptPremiumsLevelFive(jqDeptManagerFee.getDeptPremiumsLevelFive());
+
+        insFeeOrderNew.setSyDeptProportionLevel1(syDeptManagerFee.getDeptProportionLevelOne());
+        insFeeOrderNew.setSyDeptProportionLevel2(syDeptManagerFee.getDeptProportionLevelTwo());
+        insFeeOrderNew.setSyDeptProportionLevel3(syDeptManagerFee.getDeptProportionLevelThree());
+        insFeeOrderNew.setSyDeptProportionLevel4(syDeptManagerFee.getDeptProportionLevelFoure());
+        insFeeOrderNew.setSyDeptProportionLevel5(syDeptManagerFee.getDeptProportionLevelFive());
+        insFeeOrderNew.setSyDeptPremiumsLevel1(syDeptManagerFee.getDeptPremiumsLevelOne());
+        insFeeOrderNew.setSyDeptPremiumsLevel2(syDeptManagerFee.getDeptPremiumsLevelTwo());
+        insFeeOrderNew.setSyDeptPremiumsLevel3(syDeptManagerFee.getDeptPremiumsLevelThree());
+        insFeeOrderNew.setSyDeptPremiumsLevel4(syDeptManagerFee.getDeptProportionLevelFive());
+        insFeeOrderNew.setSyDeptPremiumsLevel5(syDeptManagerFee.getDeptPremiumsLevelFive());
+        feeOrderNewVo.getDeptManagerFee().get(1).setDeptPremiumsLevelOne(syDeptManagerFee.getDeptPremiumsLevelOne());
+        feeOrderNewVo.getDeptManagerFee().get(1).setDeptPremiumsLevelTwo(syDeptManagerFee.getDeptPremiumsLevelTwo());
+        feeOrderNewVo.getDeptManagerFee().get(1).setDeptPremiumsLevelThree(syDeptManagerFee.getDeptPremiumsLevelThree());
+        feeOrderNewVo.getDeptManagerFee().get(1).setDeptPremiumsLevelFoure(syDeptManagerFee.getDeptPremiumsLevelFoure());
+        feeOrderNewVo.getDeptManagerFee().get(1).setDeptPremiumsLevelFive(syDeptManagerFee.getDeptPremiumsLevelFive());
+
+        insFeeOrderNew.setNoDeptProportionLevel1(noDeptManagerFee.getDeptProportionLevelOne());
+        insFeeOrderNew.setNoDeptProportionLevel2(noDeptManagerFee.getDeptProportionLevelTwo());
+        insFeeOrderNew.setNoDeptProportionLevel3(noDeptManagerFee.getDeptProportionLevelThree());
+        insFeeOrderNew.setNoDeptProportionLevel4(noDeptManagerFee.getDeptProportionLevelFoure());
+        insFeeOrderNew.setNoDeptProportionLevel5(noDeptManagerFee.getDeptProportionLevelFive());
+        insFeeOrderNew.setNoDeptPremiumsLevel1(noDeptManagerFee.getDeptPremiumsLevelOne());
+        insFeeOrderNew.setNoDeptPremiumsLevel2(noDeptManagerFee.getDeptPremiumsLevelTwo());
+        insFeeOrderNew.setNoDeptPremiumsLevel3(noDeptManagerFee.getDeptPremiumsLevelThree());
+        insFeeOrderNew.setNoDeptPremiumsLevel4(noDeptManagerFee.getDeptPremiumsLevelFoure());
+        insFeeOrderNew.setNoDeptPremiumsLevel5(noDeptManagerFee.getDeptPremiumsLevelFive());
+        feeOrderNewVo.getDeptManagerFee().get(2).setDeptPremiumsLevelOne(noDeptManagerFee.getDeptPremiumsLevelOne());
+        feeOrderNewVo.getDeptManagerFee().get(2).setDeptPremiumsLevelTwo(noDeptManagerFee.getDeptPremiumsLevelTwo());
+        feeOrderNewVo.getDeptManagerFee().get(2).setDeptPremiumsLevelThree(noDeptManagerFee.getDeptPremiumsLevelThree());
+        feeOrderNewVo.getDeptManagerFee().get(2).setDeptPremiumsLevelFoure(noDeptManagerFee.getDeptPremiumsLevelFoure());
+        feeOrderNewVo.getDeptManagerFee().get(2).setDeptPremiumsLevelFive(noDeptManagerFee.getDeptPremiumsLevelFive());
 
 
         //保存新的比例
@@ -1156,6 +1202,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
 
     }
 
+
     public Page<PtlAgreementProductCostsNew> getCostsAuditList(Page page, AgreementProductQueryVo agreementProductQueryVo){
         LambdaQueryWrapper<PtlAgreementProductCostsNew> ptlAgreementProductCostsNewLambdaQueryWrapper = new LambdaQueryWrapper<>();
 //        ptlAgreementProductCostsNewLambdaQueryWrapper.eq(PtlAgreementProductCostsNew::getAgreementId, agreementProductQueryVo.getAgreementId());