Jelajahi Sumber

调整费用修改

785834757 2 tahun lalu
induk
melakukan
f69c10db31

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

@@ -22,13 +22,13 @@ public class FeeOrderNewVo implements Serializable {
     private String feeId;
 
     @ApiModelProperty("入口费用")
-    private List<EntranceFee> entranceFee;
+    private List<FeeOrderNewVo.EntranceFee> entranceFee;
 
     @ApiModelProperty("出口费用")
-    private List<ExportFee> exportFee;
+    private List<FeeOrderNewVo.ExportFee> exportFee;
 
     @ApiModelProperty("部门管理费用")
-    private List<DeptManagerFee> deptManagerFee;
+    private List<FeeOrderNewVo.DeptManagerFee> deptManagerFee;
 
     /**
      * 入口费用

+ 227 - 245
src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java

@@ -1086,9 +1086,30 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
     @Transactional
     @Override
     public FeeOrderNewVo costsAdjust(FeeOrderNewRecordVo feeOrderNewRecordVo) {
+        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("非车入口费用不匹配,调整费用失败!");
+        }
+
+        //添加历史记录
+        if(!modifyCostsHistory(feeOrderNewRecordVo)){
+            throw new SystemException("调整费用失败");
+        }
         String feeId = feeOrderNewRecordVo.getFeeId();
         InsFeeOrderNew insFeeOrderNew = insFeeOrderNewService.getById(feeId);
 
+
+
         //查询协议是否包含税
         PtlAgreement ptlAgreement = ptlAgreementService.getById(insFeeOrderNew.getAgreementId());
         BigDecimal taxRadio = new BigDecimal("1.00");
@@ -1096,46 +1117,44 @@ 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("非车入口费用不匹配,调整费用失败!");
-        }
-        //调整后的费用计算
+        List<FeeOrderNewVo.EntranceFee> entranceFeeList = new ArrayList<>();
+        List<FeeOrderNewVo.DeptManagerFee> deptManagerFeeList = new ArrayList<>();
+        List<FeeOrderNewVo.ExportFee> exportFeeList = new ArrayList<>();
 
+        //region 入口费用
         //交强入口费用
         FeeOrderNewVo.EntranceFee jqEntranceFee = feeRuleSchemeService.calcEntranceFee(insFeeOrderNew.getJqPremium(),
                 feeOrderNewVo.getEntranceFee().get(0).getSuperviseCosts(),
                 feeOrderNewVo.getEntranceFee().get(0).getOtherCostsProportion(), taxRadio);
+        jqEntranceFee.setInsuranceType("交强险");
+        entranceFeeList.add(jqEntranceFee);
 
         //商业入口费用
         FeeOrderNewVo.EntranceFee syEntranceFee = feeRuleSchemeService.calcEntranceFee(insFeeOrderNew.getSyPremium(),
                 feeOrderNewVo.getEntranceFee().get(1).getSuperviseCosts(),
                 feeOrderNewVo.getEntranceFee().get(1).getOtherCostsProportion(), taxRadio);
+        syEntranceFee.setInsuranceType("商业险");
+        entranceFeeList.add(syEntranceFee);
 
         //非车入口费用
         FeeOrderNewVo.EntranceFee noEntranceFee = feeRuleSchemeService.calcEntranceFee(insFeeOrderNew.getNoPremium(),
                 feeOrderNewVo.getEntranceFee().get(2).getSuperviseCosts(),
                 feeOrderNewVo.getEntranceFee().get(2).getOtherCostsProportion(), taxRadio);
+        noEntranceFee.setInsuranceType("非车险");
+        entranceFeeList.add(noEntranceFee);
+
+        //endregion
+
 
+        //region 部门管理费用
         //交强部门管理费用
         FeeOrderNewVo.DeptManagerFee jqDeptManagerFee = feeRuleSchemeService.calcDeptManagerFee(insFeeOrderNew.getJqPremium(),
                 feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelOne(),
@@ -1143,6 +1162,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelThree(),
                 feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelFoure(),
                 feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelFive());
+        deptManagerFeeList.add(jqDeptManagerFee);
 
         //商业部门管理费用
         FeeOrderNewVo.DeptManagerFee syDeptManagerFee = feeRuleSchemeService.calcDeptManagerFee(insFeeOrderNew.getSyPremium(),
@@ -1151,6 +1171,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 feeOrderNewVo.getDeptManagerFee().get(1).getDeptProportionLevelThree(),
                 feeOrderNewVo.getDeptManagerFee().get(1).getDeptProportionLevelFoure(),
                 feeOrderNewVo.getDeptManagerFee().get(1).getDeptProportionLevelFive());
+        deptManagerFeeList.add(syDeptManagerFee);
 
         //非车部门管理费用
         FeeOrderNewVo.DeptManagerFee noDeptManagerFee = feeRuleSchemeService.calcDeptManagerFee(insFeeOrderNew.getNoPremium(),
@@ -1159,289 +1180,250 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 feeOrderNewVo.getDeptManagerFee().get(2).getDeptProportionLevelThree(),
                 feeOrderNewVo.getDeptManagerFee().get(2).getDeptProportionLevelFoure(),
                 feeOrderNewVo.getDeptManagerFee().get(2).getDeptProportionLevelFive());
+        deptManagerFeeList.add(noDeptManagerFee);
 
 
         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);
-
-
         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);
+        //endregion
 
 
-        //转换输出的格式
-        FeeOrderNewVo resultFeeOrderNewVo = new FeeOrderNewVo();
-        List<FeeOrderNewVo.EntranceFee> entranceFeeList = new ArrayList<>();
-        List<FeeOrderNewVo.DeptManagerFee> deptManagerFeeList = new ArrayList<>();
-        List<FeeOrderNewVo.ExportFee> exportFeeList = new ArrayList<>();
+        //region 出口费用
+        //交强出口费用
+        FeeOrderNewVo.ExportFee jqExportFee = feeRuleSchemeService.calcExportFee(insFeeOrderNew.getJqPremium(), feeOrderNewVo.getExportFee().get(0).getSuperviseCosts(),
+                feeOrderNewVo.getEntranceFee().get(0).getTotalProportion(), jqDeptManagerTotalProportion, retailStoreFee.getRetailStoreRadio(), taxRadio);
+        exportFeeList.add(jqExportFee);
 
 
-        FeeOrderNewVo.EntranceFee jqEntranceFeeConv = new FeeOrderNewVo.EntranceFee();
-        BeanUtils.copyProperties(jqEntranceFee, jqEntranceFeeConv);
-        entranceFeeList.add(jqEntranceFeeConv);
+        //商业出口费用
+        FeeOrderNewVo.ExportFee syExportFee = feeRuleSchemeService.calcExportFee(insFeeOrderNew.getSyPremium(), feeOrderNewVo.getExportFee().get(1).getSuperviseCosts(),
+                feeOrderNewVo.getEntranceFee().get(1).getTotalProportion(), syDeptManagerTotalProportion, retailStoreFee.getRetailStoreRadio(), taxRadio);
+        exportFeeList.add(syExportFee);
 
-        FeeOrderNewVo.EntranceFee syEntranceFeeConv = new FeeOrderNewVo.EntranceFee();
-        BeanUtils.copyProperties(syEntranceFee, syEntranceFeeConv);
-        entranceFeeList.add(syEntranceFeeConv);
 
-        FeeOrderNewVo.EntranceFee noEntranceFeeConv = new FeeOrderNewVo.EntranceFee();
-        BeanUtils.copyProperties(noEntranceFee, noEntranceFeeConv);
-        entranceFeeList.add(noEntranceFeeConv);
+        //非车出口费用
+        FeeOrderNewVo.ExportFee noExportFee = feeRuleSchemeService.calcExportFee(insFeeOrderNew.getNoPremium(), feeOrderNewVo.getExportFee().get(2).getSuperviseCosts(),
+                feeOrderNewVo.getEntranceFee().get(2).getTotalProportion(), noDeptManagerTotalProportion, retailStoreFee.getRetailStoreRadio(), taxRadio);
+        exportFeeList.add(noExportFee);
 
-        resultFeeOrderNewVo.setEntranceFee(entranceFeeList);
+        //endregion
 
 
-        FeeOrderNewVo.DeptManagerFee jqDeptManagerFeeConv = new FeeOrderNewVo.DeptManagerFee();
-        BeanUtils.copyProperties(jqDeptManagerFee, jqDeptManagerFeeConv);
-        deptManagerFeeList.add(jqDeptManagerFeeConv);
 
-        FeeOrderNewVo.DeptManagerFee syDeptManagerFeeConv = new FeeOrderNewVo.DeptManagerFee();
-        BeanUtils.copyProperties(syDeptManagerFee, syDeptManagerFeeConv);
-        deptManagerFeeList.add(syDeptManagerFeeConv);
 
-        FeeOrderNewVo.DeptManagerFee noDeptManagerFeeConv = new FeeOrderNewVo.DeptManagerFee();
-        BeanUtils.copyProperties(noDeptManagerFee, noDeptManagerFeeConv);
-        deptManagerFeeList.add(noDeptManagerFeeConv);
 
+        FeeOrderNewVo resultFeeOrderNewVo = new FeeOrderNewVo();
+        resultFeeOrderNewVo.setEntranceFee(entranceFeeList);
         resultFeeOrderNewVo.setDeptManagerFee(deptManagerFeeList);
+        resultFeeOrderNewVo.setExportFee(exportFeeList);
 
-        feeOrderNewVo.getExportFee().clear();
 
-        FeeOrderNewVo.ExportFee jqExportFeeConv = new FeeOrderNewVo.ExportFee();
-        BeanUtils.copyProperties(jqExportFee, jqExportFeeConv);
-        jqExportFeeConv.setInsuranceType("交强险");
-        feeOrderNewVo.getExportFee().add(jqExportFeeConv);
 
-        FeeOrderNewVo.ExportFee syExportFeeConv = new FeeOrderNewVo.ExportFee();
-        BeanUtils.copyProperties(syExportFee, syExportFeeConv);
-        syExportFeeConv.setInsuranceType("商业险");
-        feeOrderNewVo.getExportFee().add(syExportFeeConv);
+        //ins_fee_order_new 保存新的费用
+        insFeeOrderNew.setJqCostsProportion(entranceFeeList.get(0).getTotalProportion());
+        insFeeOrderNew.setJqCostsPremiums(entranceFeeList.get(0).getTotalAmount());
+        insFeeOrderNew.setJqSuperviseCostsProportion(entranceFeeList.get(0).getSuperviseCosts());
+        insFeeOrderNew.setJqSuperviseCostsPremiums(entranceFeeList.get(0).getSuperviseCostsPremiums());
+        insFeeOrderNew.setJqOtherCostsProportion(entranceFeeList.get(0).getOtherCostsProportion());
+        insFeeOrderNew.setJqOtherCostsPremiums(entranceFeeList.get(0).getOtherCostsPremiums());
+
+        insFeeOrderNew.setSyCostsProportion(entranceFeeList.get(1).getTotalProportion());
+        insFeeOrderNew.setSyCostsPremiums(entranceFeeList.get(1).getTotalAmount());
+        insFeeOrderNew.setSySuperviseCostsProportion(entranceFeeList.get(1).getSuperviseCosts());
+        insFeeOrderNew.setSySuperviseCostsPremiums(entranceFeeList.get(1).getSuperviseCostsPremiums());
+        insFeeOrderNew.setSyOtherCostsProportion(entranceFeeList.get(1).getOtherCostsProportion());
+        insFeeOrderNew.setSyOtherCostsPremiums(entranceFeeList.get(1).getOtherCostsPremiums());
+
+        insFeeOrderNew.setNoCostsProportion(entranceFeeList.get(2).getTotalProportion());
+        insFeeOrderNew.setNoCostsPremiums(entranceFeeList.get(2).getTotalAmount());
+        insFeeOrderNew.setNoSuperviseCostsProportion(entranceFeeList.get(2).getSuperviseCosts());
+        insFeeOrderNew.setNoSuperviseCostsPremiums(entranceFeeList.get(2).getSuperviseCostsPremiums());
+        insFeeOrderNew.setNoOtherCostsProportion(entranceFeeList.get(2).getOtherCostsProportion());
+        insFeeOrderNew.setNoOtherCostsPremiums(entranceFeeList.get(2).getOtherCostsPremiums());
+
+        //交强机构
+        insFeeOrderNew.setJqDeptProportionLevel1(deptManagerFeeList.get(0).getDeptProportionLevelOne());
+        insFeeOrderNew.setJqDeptProportionLevel2(deptManagerFeeList.get(0).getDeptProportionLevelTwo());
+        insFeeOrderNew.setJqDeptProportionLevel3(deptManagerFeeList.get(0).getDeptProportionLevelThree());
+        insFeeOrderNew.setJqDeptProportionLevel4(deptManagerFeeList.get(0).getDeptProportionLevelFoure());
+        insFeeOrderNew.setJqDeptProportionLevel5(deptManagerFeeList.get(0).getDeptProportionLevelFive());
+        insFeeOrderNew.setJqDeptPremiumsLevel1(deptManagerFeeList.get(0).getDeptPremiumsLevelOne());
+        insFeeOrderNew.setJqDeptPremiumsLevel2(deptManagerFeeList.get(0).getDeptPremiumsLevelTwo());
+        insFeeOrderNew.setJqDeptPremiumsLevel3(deptManagerFeeList.get(0).getDeptPremiumsLevelThree());
+        insFeeOrderNew.setJqDeptPremiumsLevel4(deptManagerFeeList.get(0).getDeptPremiumsLevelFoure());
+        insFeeOrderNew.setJqDeptPremiumsLevel5(deptManagerFeeList.get(0).getDeptPremiumsLevelFive());
+
+        insFeeOrderNew.setSyDeptProportionLevel1(deptManagerFeeList.get(1).getDeptProportionLevelOne());
+        insFeeOrderNew.setSyDeptProportionLevel2(deptManagerFeeList.get(1).getDeptProportionLevelTwo());
+        insFeeOrderNew.setSyDeptProportionLevel3(deptManagerFeeList.get(1).getDeptProportionLevelThree());
+        insFeeOrderNew.setSyDeptProportionLevel4(deptManagerFeeList.get(1).getDeptProportionLevelFoure());
+        insFeeOrderNew.setSyDeptProportionLevel5(deptManagerFeeList.get(1).getDeptProportionLevelFive());
+        insFeeOrderNew.setSyDeptPremiumsLevel1(deptManagerFeeList.get(1).getDeptPremiumsLevelOne());
+        insFeeOrderNew.setSyDeptPremiumsLevel2(deptManagerFeeList.get(1).getDeptPremiumsLevelTwo());
+        insFeeOrderNew.setSyDeptPremiumsLevel3(deptManagerFeeList.get(1).getDeptPremiumsLevelThree());
+        insFeeOrderNew.setSyDeptPremiumsLevel4(deptManagerFeeList.get(1).getDeptPremiumsLevelFoure());
+        insFeeOrderNew.setSyDeptPremiumsLevel5(deptManagerFeeList.get(1).getDeptPremiumsLevelFive());
+
+
+        insFeeOrderNew.setNoDeptProportionLevel1(deptManagerFeeList.get(2).getDeptProportionLevelOne());
+        insFeeOrderNew.setNoDeptProportionLevel2(deptManagerFeeList.get(2).getDeptProportionLevelTwo());
+        insFeeOrderNew.setNoDeptProportionLevel3(deptManagerFeeList.get(2).getDeptProportionLevelThree());
+        insFeeOrderNew.setNoDeptProportionLevel4(deptManagerFeeList.get(2).getDeptProportionLevelFoure());
+        insFeeOrderNew.setNoDeptProportionLevel5(deptManagerFeeList.get(2).getDeptProportionLevelFive());
+        insFeeOrderNew.setNoDeptPremiumsLevel1(deptManagerFeeList.get(2).getDeptPremiumsLevelOne());
+        insFeeOrderNew.setNoDeptPremiumsLevel2(deptManagerFeeList.get(2).getDeptPremiumsLevelTwo());
+        insFeeOrderNew.setNoDeptPremiumsLevel3(deptManagerFeeList.get(2).getDeptPremiumsLevelThree());
+        insFeeOrderNew.setNoDeptPremiumsLevel4(deptManagerFeeList.get(2).getDeptPremiumsLevelFoure());
+        insFeeOrderNew.setNoDeptPremiumsLevel5(deptManagerFeeList.get(2).getDeptPremiumsLevelFive());
+
+        //出口费用
+        insFeeOrderNew.setJqCostsExportProportion(exportFeeList.get(0).getSuperviseCosts());
+        insFeeOrderNew.setJqExportSuperviseCostsPremiums(exportFeeList.get(0).getSuperviseCostsPremiums());
+        insFeeOrderNew.setJqExportOtherCostsProportion(exportFeeList.get(0).getOtherCostsProportion());
+        insFeeOrderNew.setJqExportOtherCostsPremiums(exportFeeList.get(0).getOtherCostsPremiums());
+
+        insFeeOrderNew.setSyCostsExportProportion(exportFeeList.get(1).getSuperviseCosts());
+        insFeeOrderNew.setSyExportSuperviseCostsPremiums(exportFeeList.get(1).getSuperviseCostsPremiums());
+        insFeeOrderNew.setSyExportOtherCostsProportion(exportFeeList.get(1).getOtherCostsProportion());
+        insFeeOrderNew.setSyExportOtherCostsPremiums(exportFeeList.get(1).getOtherCostsPremiums());
+
+        insFeeOrderNew.setNoCostsExportProportion(exportFeeList.get(2).getSuperviseCosts());
+        insFeeOrderNew.setNoExportSuperviseCostsPremiums(exportFeeList.get(2).getSuperviseCostsPremiums());
+        insFeeOrderNew.setNoExportOtherCostsProportion(exportFeeList.get(2).getOtherCostsProportion());
+        insFeeOrderNew.setNoExportOtherCostsPremiums(exportFeeList.get(2).getOtherCostsPremiums());
+
+        //region 重新计算一级机构管理费
+        //入口 - 出口 - 机构管理费 2-4级 - 分销费  = 差值  + 一级管理费
+
+        //分销交强费用
+        BigDecimal jqFenXiao = insFeeOrderNew.getJqPremium().multiply(retailStoreFee.getRetailStoreRadio().divide(new BigDecimal(100)));
+        //分销商业费用
+        BigDecimal syFenXiao = insFeeOrderNew.getSyPremium().multiply(retailStoreFee.getRetailStoreRadio().divide(new BigDecimal(100)));
+        //分销非车费用
+        BigDecimal noFenXiao = insFeeOrderNew.getNoPremium().multiply(retailStoreFee.getRetailStoreRadio().divide(new BigDecimal(100)));
+
+        BigDecimal jqDifference = insFeeOrderNew.getJqCostsPremiums().subtract(
+                        (insFeeOrderNew.getJqExportSuperviseCostsPremiums().add(insFeeOrderNew.getJqExportOtherCostsPremiums())))
+                .subtract(
+                        (insFeeOrderNew.getJqDeptPremiumsLevel2().add(insFeeOrderNew.getJqDeptPremiumsLevel3()).add(insFeeOrderNew.getJqDeptPremiumsLevel4()).add(insFeeOrderNew.getJqDeptPremiumsLevel5()))
+                )
+                .subtract(jqFenXiao);
+        insFeeOrderNew.setJqDeptPremiumsLevel1(jqDifference);
+        deptManagerFeeList.get(0).setDeptPremiumsLevelOne(jqDifference);
+
+
+        BigDecimal syDifference = insFeeOrderNew.getSyCostsPremiums().subtract(
+                        (insFeeOrderNew.getSyExportSuperviseCostsPremiums().add(insFeeOrderNew.getSyExportOtherCostsPremiums())))
+                .subtract(
+                        (insFeeOrderNew.getSyDeptPremiumsLevel2().add(insFeeOrderNew.getSyDeptPremiumsLevel3()).add(insFeeOrderNew.getSyDeptPremiumsLevel4()).add(insFeeOrderNew.getSyDeptPremiumsLevel5()))
+                )
+                .subtract(syFenXiao);
+        insFeeOrderNew.setSyDeptPremiumsLevel1(syDifference);
+        deptManagerFeeList.get(1).setDeptPremiumsLevelOne(syDifference);
+
+        BigDecimal noDifference = insFeeOrderNew.getNoCostsPremiums().subtract(
+                        (insFeeOrderNew.getNoExportSuperviseCostsPremiums().add(insFeeOrderNew.getNoExportOtherCostsPremiums())))
+                .subtract(
+                        (insFeeOrderNew.getNoDeptPremiumsLevel2().add(insFeeOrderNew.getNoDeptPremiumsLevel3()).add(insFeeOrderNew.getNoDeptPremiumsLevel4()).add(insFeeOrderNew.getNoDeptPremiumsLevel5()))
+                )
+                .subtract(noFenXiao);
+
+        insFeeOrderNew.setNoDeptPremiumsLevel1(noDifference);
+        deptManagerFeeList.get(2).setDeptPremiumsLevelOne(noDifference);
+        //endregion
 
-        FeeOrderNewVo.ExportFee noExportFeeConv = new FeeOrderNewVo.ExportFee();
-        BeanUtils.copyProperties(noExportFee, noExportFeeConv);
-        noExportFeeConv.setInsuranceType("非车险");
-        feeOrderNewVo.getExportFee().add(noExportFeeConv);
 
+        //保存新的比例
+        insFeeOrderNewService.updateById(insFeeOrderNew);
+        return resultFeeOrderNewVo;
 
-        //入口
+    }
+
+    /**
+     * 修改费用历史记录
+     * @return
+     */
+    private boolean modifyCostsHistory(FeeOrderNewRecordVo feeOrderNewRecordVo){
+        InsFeeOrderNewRecord record = new InsFeeOrderNewRecord();
+        FeeOrderNewVo feeOrderNewVoOld = feeOrderNewRecordVo.getFeeOrderNewVoOld();
+        FeeOrderNewVo feeOrderNewVoNew = feeOrderNewRecordVo.getFeeOrderNewVoNew();
+        record.setId(IdGenerate.nextId());
+        record.setFeeOrderId(feeOrderNewRecordVo.getFeeId());
+        record.setCostsId(feeOrderNewRecordVo.getCostsId());
+        //入口 历史
         record.setJqCostsProportionOld(feeOrderNewVoOld.getEntranceFee().get(0).getTotalProportion());
-        record.setSyCostsProportionOld(feeOrderNewVoOld.getEntranceFee().get(1).getTotalProportion());
-        record.setNoCostsProportionOld(feeOrderNewVoOld.getEntranceFee().get(2).getTotalProportion());
         record.setJqSuperviseCostsProportionOld(feeOrderNewVoOld.getEntranceFee().get(0).getSuperviseCosts());
-        record.setSySuperviseCostsProportionOld(feeOrderNewVoOld.getEntranceFee().get(1).getSuperviseCosts());
-        record.setNoSuperviseCostsProportionOld(feeOrderNewVoOld.getEntranceFee().get(2).getSuperviseCosts());
         record.setJqOtherCostsProportionOld(feeOrderNewVoOld.getEntranceFee().get(0).getOtherCostsProportion());
+        record.setSyCostsProportionOld(feeOrderNewVoOld.getEntranceFee().get(1).getTotalProportion());
+        record.setSySuperviseCostsProportionOld(feeOrderNewVoOld.getEntranceFee().get(1).getSuperviseCosts());
         record.setSyOtherCostsProportionOld(feeOrderNewVoOld.getEntranceFee().get(1).getOtherCostsProportion());
+        record.setNoCostsProportionOld(feeOrderNewVoOld.getEntranceFee().get(2).getTotalProportion());
+        record.setNoSuperviseCostsProportionOld(feeOrderNewVoOld.getEntranceFee().get(2).getSuperviseCosts());
         record.setNoOtherCostsProportionOld(feeOrderNewVoOld.getEntranceFee().get(2).getOtherCostsProportion());
 
-        record.setJqCostsProportion(feeOrderNewVo.getEntranceFee().get(0).getTotalProportion());
-        record.setSyCostsProportion(feeOrderNewVo.getEntranceFee().get(1).getTotalProportion());
-        record.setNoCostsProportion(feeOrderNewVo.getEntranceFee().get(2).getTotalProportion());
-        record.setJqSuperviseCostsProportion(feeOrderNewVo.getEntranceFee().get(0).getSuperviseCosts());
-        record.setSySuperviseCostsProportion(feeOrderNewVo.getEntranceFee().get(1).getSuperviseCosts());
-        record.setNoSuperviseCostsProportion(feeOrderNewVo.getEntranceFee().get(2).getSuperviseCosts());
-        record.setJqOtherCostsProportion(feeOrderNewVo.getEntranceFee().get(0).getOtherCostsProportion());
-        record.setSyOtherCostsProportion(feeOrderNewVo.getEntranceFee().get(1).getOtherCostsProportion());
-        record.setNoOtherCostsProportion(feeOrderNewVo.getEntranceFee().get(2).getOtherCostsProportion());
-
-
-        //出口
-        record.setJqCostsExportProportionOld(feeOrderNewVoOld.getExportFee().get(0).getTotalProportion());
-        record.setSyCostsExportProportionOld(feeOrderNewVoOld.getExportFee().get(1).getTotalProportion());
-        record.setNoCostsExportProportionOld(feeOrderNewVoOld.getExportFee().get(2).getTotalProportion());
-
-        record.setJqCostsExportProportion(feeOrderNewVo.getExportFee().get(0).getTotalProportion());
-        record.setSyCostsExportProportion(feeOrderNewVo.getExportFee().get(1).getTotalProportion());
-        record.setNoCostsExportProportion(feeOrderNewVo.getExportFee().get(2).getTotalProportion());
-
-        //机构管理费 (交强)
-        //old
+        //机构管理历史
+        //交强
         record.setJqDeptProportionLevel1Old(feeOrderNewVoOld.getDeptManagerFee().get(0).getDeptProportionLevelOne());
         record.setJqDeptProportionLevel2Old(feeOrderNewVoOld.getDeptManagerFee().get(0).getDeptProportionLevelTwo());
         record.setJqDeptProportionLevel3Old(feeOrderNewVoOld.getDeptManagerFee().get(0).getDeptProportionLevelThree());
         record.setJqDeptProportionLevel4Old(feeOrderNewVoOld.getDeptManagerFee().get(0).getDeptProportionLevelFoure());
         record.setJqDeptProportionLevel5Old(feeOrderNewVoOld.getDeptManagerFee().get(0).getDeptProportionLevelFive());
-
-        //new
-        record.setJqDeptProportionLevel1(feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelOne());
-        record.setJqDeptProportionLevel2(feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelTwo());
-        record.setJqDeptProportionLevel3(feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelThree());
-        record.setJqDeptProportionLevel4(feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelFoure());
-        record.setJqDeptProportionLevel5(feeOrderNewVo.getDeptManagerFee().get(0).getDeptProportionLevelFive());
-
-
-        //机构管理费 (商业)
-        //old
+        //商业
         record.setSyDeptProportionLevel1Old(feeOrderNewVoOld.getDeptManagerFee().get(1).getDeptProportionLevelOne());
         record.setSyDeptProportionLevel2Old(feeOrderNewVoOld.getDeptManagerFee().get(1).getDeptProportionLevelTwo());
         record.setSyDeptProportionLevel3Old(feeOrderNewVoOld.getDeptManagerFee().get(1).getDeptProportionLevelThree());
         record.setSyDeptProportionLevel4Old(feeOrderNewVoOld.getDeptManagerFee().get(1).getDeptProportionLevelFoure());
         record.setSyDeptProportionLevel5Old(feeOrderNewVoOld.getDeptManagerFee().get(1).getDeptProportionLevelFive());
-
-        //new
-        record.setSyDeptProportionLevel1(feeOrderNewVo.getDeptManagerFee().get(1).getDeptProportionLevelOne());
-        record.setSyDeptProportionLevel2(feeOrderNewVo.getDeptManagerFee().get(1).getDeptProportionLevelTwo());
-        record.setSyDeptProportionLevel3(feeOrderNewVo.getDeptManagerFee().get(1).getDeptProportionLevelThree());
-        record.setSyDeptProportionLevel4(feeOrderNewVo.getDeptManagerFee().get(1).getDeptProportionLevelFoure());
-        record.setSyDeptProportionLevel5(feeOrderNewVo.getDeptManagerFee().get(1).getDeptProportionLevelFive());
-
-
-        //机构管理费 (非车)
-        //old
+        //非车
         record.setNoDeptProportionLevel1Old(feeOrderNewVoOld.getDeptManagerFee().get(2).getDeptProportionLevelOne());
         record.setNoDeptProportionLevel2Old(feeOrderNewVoOld.getDeptManagerFee().get(2).getDeptProportionLevelTwo());
         record.setNoDeptProportionLevel3Old(feeOrderNewVoOld.getDeptManagerFee().get(2).getDeptProportionLevelThree());
         record.setNoDeptProportionLevel4Old(feeOrderNewVoOld.getDeptManagerFee().get(2).getDeptProportionLevelFoure());
         record.setNoDeptProportionLevel5Old(feeOrderNewVoOld.getDeptManagerFee().get(2).getDeptProportionLevelFive());
 
-        //new
-        record.setNoDeptProportionLevel1(feeOrderNewVo.getDeptManagerFee().get(2).getDeptProportionLevelOne());
-        record.setNoDeptProportionLevel2(feeOrderNewVo.getDeptManagerFee().get(2).getDeptProportionLevelTwo());
-        record.setNoDeptProportionLevel3(feeOrderNewVo.getDeptManagerFee().get(2).getDeptProportionLevelThree());
-        record.setNoDeptProportionLevel4(feeOrderNewVo.getDeptManagerFee().get(2).getDeptProportionLevelFoure());
-        record.setNoDeptProportionLevel5(feeOrderNewVo.getDeptManagerFee().get(2).getDeptProportionLevelFive());
-
-        //保存历史记录
-        record.setFeeOrderId(feeId);
-        insFeeOrderNewRecordService.save(record);
-
-
-        //ins_fee_order_new 保存新的费用
-        insFeeOrderNew.setJqCostsProportion(jqEntranceFee.getTotalProportion());
-        insFeeOrderNew.setJqCostsPremiums(jqEntranceFee.getTotalAmount());
-        feeOrderNewVo.getEntranceFee().get(0).setPremium(insFeeOrderNew.getJqPremium());
-        feeOrderNewVo.getEntranceFee().get(0).setTotalAmount(jqEntranceFee.getTotalAmount());
-        insFeeOrderNew.setSyCostsProportion(syEntranceFee.getTotalProportion());
-        insFeeOrderNew.setSyCostsPremiums(syEntranceFee.getTotalAmount());
-        feeOrderNewVo.getEntranceFee().get(1).setPremium(insFeeOrderNew.getSyPremium());
-        feeOrderNewVo.getEntranceFee().get(1).setTotalAmount(syEntranceFee.getTotalAmount());
-        insFeeOrderNew.setNoCostsProportion(noEntranceFee.getTotalProportion());
-        insFeeOrderNew.setNoCostsPremiums(noEntranceFee.getTotalAmount());
-        feeOrderNewVo.getEntranceFee().get(2).setPremium(insFeeOrderNew.getNoPremium());
-        feeOrderNewVo.getEntranceFee().get(1).setTotalAmount(noEntranceFee.getTotalAmount());
-
-        insFeeOrderNew.setJqSuperviseCostsProportion(jqEntranceFee.getSuperviseCosts());
-        insFeeOrderNew.setJqSuperviseCostsPremiums(jqEntranceFee.getSuperviseCostsPremiums());
-        feeOrderNewVo.getEntranceFee().get(0).setSuperviseCostsPremiums(jqEntranceFee.getSuperviseCostsPremiums());
-        insFeeOrderNew.setSySuperviseCostsProportion(syEntranceFee.getSuperviseCosts());
-        insFeeOrderNew.setSySuperviseCostsPremiums(syEntranceFee.getSuperviseCostsPremiums());
-        feeOrderNewVo.getEntranceFee().get(1).setSuperviseCostsPremiums(syEntranceFee.getSuperviseCostsPremiums());
-        insFeeOrderNew.setNoSuperviseCostsProportion(noEntranceFee.getSuperviseCosts());
-        insFeeOrderNew.setNoSuperviseCostsPremiums(noEntranceFee.getSuperviseCostsPremiums());
-        feeOrderNewVo.getEntranceFee().get(2).setSuperviseCostsPremiums(noEntranceFee.getSuperviseCostsPremiums());
-
-        insFeeOrderNew.setJqOtherCostsProportion(jqEntranceFee.getOtherCostsProportion());
-        insFeeOrderNew.setJqOtherCostsPremiums(jqEntranceFee.getOtherCostsPremiums());
-        feeOrderNewVo.getEntranceFee().get(0).setOtherCostsPremiums(jqEntranceFee.getOtherCostsPremiums());
-        insFeeOrderNew.setSyOtherCostsProportion(syEntranceFee.getOtherCostsProportion());
-        insFeeOrderNew.setSyOtherCostsPremiums(syEntranceFee.getOtherCostsPremiums());
-        feeOrderNewVo.getEntranceFee().get(1).setOtherCostsPremiums(syEntranceFee.getOtherCostsPremiums());
-        insFeeOrderNew.setNoOtherCostsProportion(noEntranceFee.getOtherCostsProportion());
-        insFeeOrderNew.setNoOtherCostsPremiums(noEntranceFee.getOtherCostsPremiums());
-        feeOrderNewVo.getEntranceFee().get(2).setOtherCostsPremiums(noEntranceFee.getOtherCostsPremiums());
-
-        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());
-
-
-        //处理交强一级机构管理费
-        feeOrderNewVo.getDeptManagerFee().get(0).setDeptPremiumsLevelOne(feeOrderNewVo.getEntranceFee().get(0).getTotalAmount().subtract(
-                feeOrderNewVo.getExportFee().get(0).getTotalAmount().add(feeOrderNewVo.getDeptManagerFee().get(0).getDeptPremiumsLevelTwo())
-                        .add(feeOrderNewVo.getDeptManagerFee().get(0).getDeptPremiumsLevelThree())
-                        .add(feeOrderNewVo.getDeptManagerFee().get(0).getDeptPremiumsLevelFoure())
-                        .add(feeOrderNewVo.getDeptManagerFee().get(0).getDeptPremiumsLevelFive()
-                                .add(retailStoreFee.getRetailStoreFeeLevel1())
-                                .add(retailStoreFee.getRetailStoreFeeLevel2())
-                                .add(retailStoreFee.getRetailStoreFeeLevel3()))
-        ));
-
-        //处理商业一级机构管理费
-        feeOrderNewVo.getDeptManagerFee().get(1).setDeptPremiumsLevelOne(feeOrderNewVo.getEntranceFee().get(1).getTotalAmount().subtract(
-                feeOrderNewVo.getExportFee().get(1).getTotalAmount().add(feeOrderNewVo.getDeptManagerFee().get(1).getDeptPremiumsLevelTwo())
-                        .add(feeOrderNewVo.getDeptManagerFee().get(1).getDeptPremiumsLevelThree())
-                        .add(feeOrderNewVo.getDeptManagerFee().get(1).getDeptPremiumsLevelFoure())
-                        .add(feeOrderNewVo.getDeptManagerFee().get(1).getDeptPremiumsLevelFive())
-        ));
-
-        //处理非车一级机构管理费
-        feeOrderNewVo.getDeptManagerFee().get(2).setDeptPremiumsLevelOne(feeOrderNewVo.getEntranceFee().get(2).getTotalAmount().subtract(
-                feeOrderNewVo.getExportFee().get(2).getTotalAmount().add(feeOrderNewVo.getDeptManagerFee().get(2).getDeptPremiumsLevelTwo())
-                        .add(feeOrderNewVo.getDeptManagerFee().get(2).getDeptPremiumsLevelThree())
-                        .add(feeOrderNewVo.getDeptManagerFee().get(2).getDeptPremiumsLevelFoure())
-                        .add(feeOrderNewVo.getDeptManagerFee().get(2).getDeptPremiumsLevelFive())
-        ));
-
-        insFeeOrderNew.setJqDeptPremiumsLevel1(feeOrderNewVo.getDeptManagerFee().get(0).getDeptPremiumsLevelOne());
-        insFeeOrderNew.setSyDeptPremiumsLevel1(feeOrderNewVo.getDeptManagerFee().get(1).getDeptPremiumsLevelOne());
-        insFeeOrderNew.setNoDeptPremiumsLevel1(feeOrderNewVo.getDeptManagerFee().get(2).getDeptPremiumsLevelOne());
-
-        //保存新的比例
-        insFeeOrderNewService.updateById(insFeeOrderNew);
-        return feeOrderNewVo;
-
+        //修改后的费用比例
+        //入口
+        record.setJqCostsProportion(feeOrderNewVoNew.getEntranceFee().get(0).getTotalProportion());
+        record.setJqSuperviseCostsProportion(feeOrderNewVoNew.getEntranceFee().get(0).getSuperviseCosts());
+        record.setJqOtherCostsProportion(feeOrderNewVoNew.getEntranceFee().get(0).getOtherCostsProportion());
+        record.setSyCostsProportion(feeOrderNewVoNew.getEntranceFee().get(1).getTotalProportion());
+        record.setSySuperviseCostsProportion(feeOrderNewVoNew.getEntranceFee().get(1).getSuperviseCosts());
+        record.setSyOtherCostsProportion(feeOrderNewVoNew.getEntranceFee().get(1).getOtherCostsProportion());
+        record.setNoCostsProportion(feeOrderNewVoNew.getEntranceFee().get(2).getTotalProportion());
+        record.setNoSuperviseCostsProportion(feeOrderNewVoNew.getEntranceFee().get(2).getSuperviseCosts());
+        record.setNoOtherCostsProportion(feeOrderNewVoNew.getEntranceFee().get(2).getOtherCostsProportion());
+
+        //机构管理费
+        //交强
+        record.setJqDeptProportionLevel1(feeOrderNewVoNew.getDeptManagerFee().get(0).getDeptProportionLevelOne());
+        record.setJqDeptProportionLevel2(feeOrderNewVoNew.getDeptManagerFee().get(0).getDeptProportionLevelTwo());
+        record.setJqDeptProportionLevel3(feeOrderNewVoNew.getDeptManagerFee().get(0).getDeptProportionLevelThree());
+        record.setJqDeptProportionLevel4(feeOrderNewVoNew.getDeptManagerFee().get(0).getDeptProportionLevelFoure());
+        record.setJqDeptProportionLevel5(feeOrderNewVoNew.getDeptManagerFee().get(0).getDeptProportionLevelFive());
+        //商业
+        record.setSyDeptProportionLevel1(feeOrderNewVoNew.getDeptManagerFee().get(1).getDeptProportionLevelOne());
+        record.setSyDeptProportionLevel2(feeOrderNewVoNew.getDeptManagerFee().get(1).getDeptProportionLevelTwo());
+        record.setSyDeptProportionLevel3(feeOrderNewVoNew.getDeptManagerFee().get(1).getDeptProportionLevelThree());
+        record.setSyDeptProportionLevel4(feeOrderNewVoNew.getDeptManagerFee().get(1).getDeptProportionLevelFoure());
+        record.setSyDeptProportionLevel5(feeOrderNewVoNew.getDeptManagerFee().get(1).getDeptProportionLevelFive());
+        //非车
+        record.setNoDeptProportionLevel1(feeOrderNewVoNew.getDeptManagerFee().get(2).getDeptProportionLevelOne());
+        record.setNoDeptProportionLevel2(feeOrderNewVoNew.getDeptManagerFee().get(2).getDeptProportionLevelTwo());
+        record.setNoDeptProportionLevel3(feeOrderNewVoNew.getDeptManagerFee().get(2).getDeptProportionLevelThree());
+        record.setNoDeptProportionLevel4(feeOrderNewVoNew.getDeptManagerFee().get(2).getDeptProportionLevelFoure());
+        record.setNoDeptProportionLevel5(feeOrderNewVoNew.getDeptManagerFee().get(2).getDeptProportionLevelFive());
+
+        return insFeeOrderNewRecordService.save(record);
     }