wks 2 år sedan
förälder
incheckning
8b55a2d01c

+ 9 - 14
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceImpl.java

@@ -2,10 +2,7 @@ package com.ydtech.modules.fee.service.impl;
 
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.admin.model.SysUser;
-import com.ydtech.modules.admin.service.SysDeptService;
 import com.ydtech.modules.admin.service.SysUserService;
-import com.ydtech.modules.esm.service.EsmRetailService;
-import com.ydtech.modules.esm.service.EsmUserReferrerService;
 import com.ydtech.modules.fee.dto.FeeFactorInfoDto;
 import com.ydtech.modules.fee.dto.FeeSchemeReqDto;
 import com.ydtech.modules.fee.dto.FeeSchemeResDto;
@@ -16,10 +13,8 @@ import com.ydtech.modules.ins.model.vo.QuoteRespVo;
 import com.ydtech.modules.order.entity.InsCopyFeeOrder;
 import com.ydtech.modules.order.entity.InsFeeOrder;
 import com.ydtech.modules.order.entity.vo.*;
-import com.ydtech.modules.order.service.InsAreaCompanyService;
 import com.ydtech.modules.order.service.InsCopyFeeOrderService;
 import com.ydtech.modules.order.service.InsFeeOrderService;
-import com.ydtech.modules.order.service.InsOrdersService;
 import com.ydtech.modules.protocol.entity.po.*;
 import com.ydtech.modules.protocol.service.*;
 import com.ydtech.modules.protocols.entity.po.InsFeeOrderNew;
@@ -2728,7 +2723,7 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         entranceFee.setOtherCostsProportion(otherCostsProportion);
         //总费用比例
         BigDecimal totalCostsProportion = superviseCostsProportion.add(otherCostsProportion);
-        entranceFee.setTotalAmount(premium.multiply(totalCostsProportion.divide(new BigDecimal(100))).setScale(5,BigDecimal.ROUND_DOWN));
+        entranceFee.setTotalAmount(entranceFee.getSuperviseCostsPremiums().add(entranceFee.getOtherCostsPremiums()));
         entranceFee.setTotalProportion(totalCostsProportion);
         return entranceFee;
     }
@@ -2747,19 +2742,19 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
                                                            BigDecimal level3Proportion,BigDecimal level4Proportion,BigDecimal level5Proportion){
         FeeOrderNewVo.DeptManagerFee deptManagerFee = new FeeOrderNewVo.DeptManagerFee();
         //一级管理费
-        deptManagerFee.setDeptPremiumsLevelOne(premium.multiply(level1Proportion.divide(new BigDecimal(100))).setScale(5,BigDecimal.ROUND_DOWN));
+        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(5,BigDecimal.ROUND_DOWN));
+        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(5,BigDecimal.ROUND_DOWN));
+        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(5,BigDecimal.ROUND_DOWN));
+        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(5,BigDecimal.ROUND_DOWN));
+        deptManagerFee.setDeptPremiumsLevelFive(premium.multiply(level5Proportion.divide(new BigDecimal(100))).setScale(2,BigDecimal.ROUND_DOWN));
         deptManagerFee.setDeptProportionLevelFive(level5Proportion);
         return deptManagerFee;
     }
@@ -2797,9 +2792,9 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
             exportFee.setOtherCostsProportion(exportTotalProportion.subtract(superviseCostsProportion));
             exportFee.setSuperviseCosts(superviseCostsProportion);
         }
-        exportFee.setSuperviseCostsPremiums(premium.multiply(exportFee.getSuperviseCosts().divide(new BigDecimal(100))).setScale(5,BigDecimal.ROUND_DOWN));
-        exportFee.setOtherCostsPremiums(premium.multiply(exportFee.getOtherCostsProportion().divide(new BigDecimal(100))).setScale(5,BigDecimal.ROUND_DOWN));
-        exportFee.setTotalAmount(premium.multiply(exportFee.getTotalProportion().divide(new BigDecimal(100))).setScale(5,BigDecimal.ROUND_DOWN));
+        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;
     }

+ 6 - 7
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceNewImpl.java

@@ -207,34 +207,33 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
                 new BigDecimal(ptlAgreementProductCostsNew.getJqCarCostsProportion()),
                 new BigDecimal(ptlAgreementProductCostsNew.getJqCarOtherCostsProportion()), taxRadio);
         insFeeOrderNew.setJqCostsProportion(jqEntranceFee.getTotalProportion());
-        insFeeOrderNew.setJqCostsPremiums(twoPeople(jqEntranceFee.getTotalAmount()));
         insFeeOrderNew.setJqSuperviseCostsProportion(jqEntranceFee.getSuperviseCosts());
         insFeeOrderNew.setJqSuperviseCostsPremiums(twoPeople(jqEntranceFee.getSuperviseCostsPremiums()));
         insFeeOrderNew.setJqOtherCostsProportion(jqEntranceFee.getOtherCostsProportion());
         insFeeOrderNew.setJqOtherCostsPremiums(twoPeople(jqEntranceFee.getOtherCostsPremiums()));
+        insFeeOrderNew.setJqCostsPremiums(insFeeOrderNew.getJqSuperviseCostsPremiums().add(insFeeOrderNew.getJqOtherCostsPremiums()));
 
         //商业入口信息
         FeeOrderNewVo.EntranceFee syEntranceFee = feeRuleSchemeService.calcEntranceFee(insFeeOrderNew.getSyPremium(),
                 new BigDecimal(ptlAgreementProductCostsNew.getSyCarCostsProportion()),
                 new BigDecimal(ptlAgreementProductCostsNew.getSyCarOtherCostsProportion()), taxRadio);
         insFeeOrderNew.setSyCostsProportion(syEntranceFee.getTotalProportion());
-        insFeeOrderNew.setSyCostsPremiums(twoPeople(syEntranceFee.getTotalAmount()));
         insFeeOrderNew.setSySuperviseCostsProportion(syEntranceFee.getSuperviseCosts());
         insFeeOrderNew.setSySuperviseCostsPremiums(twoPeople(syEntranceFee.getSuperviseCostsPremiums()));
         insFeeOrderNew.setSyOtherCostsProportion(syEntranceFee.getOtherCostsProportion());
         insFeeOrderNew.setSyOtherCostsPremiums(twoPeople(syEntranceFee.getOtherCostsPremiums()));
+        insFeeOrderNew.setSyCostsPremiums(insFeeOrderNew.getSySuperviseCostsPremiums().add(insFeeOrderNew.getSyOtherCostsPremiums()));
 
         //非车入口信息
         FeeOrderNewVo.EntranceFee noEntranceFee = feeRuleSchemeService.calcEntranceFee(insFeeOrderNew.getNoPremium(),
                 new BigDecimal(ptlAgreementProductCostsNew.getNoCarCostsProportion()),
                 new BigDecimal(ptlAgreementProductCostsNew.getNoCarOtherCostsProportion()), taxRadio);
         insFeeOrderNew.setNoCostsProportion(noEntranceFee.getTotalProportion());
-        insFeeOrderNew.setNoCostsPremiums(twoPeople(noEntranceFee.getTotalAmount()));
         insFeeOrderNew.setNoSuperviseCostsProportion(noEntranceFee.getSuperviseCosts());
         insFeeOrderNew.setNoSuperviseCostsPremiums(twoPeople(noEntranceFee.getSuperviseCostsPremiums()));
         insFeeOrderNew.setNoOtherCostsProportion(noEntranceFee.getOtherCostsProportion());
         insFeeOrderNew.setNoOtherCostsPremiums(twoPeople(noEntranceFee.getOtherCostsPremiums()));
-
+        insFeeOrderNew.setNoCostsPremiums(insFeeOrderNew.getNoSuperviseCostsPremiums().add(insFeeOrderNew.getNoOtherCostsPremiums()));
         //endregion
 
         //region 计算分销费用
@@ -392,7 +391,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
         //分销非车费用
         BigDecimal noFenXiao = insFeeOrderNew.getNoPremium().multiply(retailRadio.divide(new BigDecimal(100)));
 
-        BigDecimal jqDifference = insFeeOrderNew.getJqCostsPremiums().subtract(
+        BigDecimal jqDifference = jqEntranceFee.getTotalAmount().subtract(
                 (jqExportFee.getSuperviseCostsPremiums().add(jqExportFee.getOtherCostsPremiums())))
                 .subtract(
                 (jqDeptManagerFee.getDeptPremiumsLevelOne().add(jqDeptManagerFee.getDeptPremiumsLevelTwo().add(jqDeptManagerFee.getDeptPremiumsLevelThree()).add(jqDeptManagerFee.getDeptPremiumsLevelFoure()).add(jqDeptManagerFee.getDeptPremiumsLevelFive())))
@@ -400,7 +399,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
                 .subtract(jqFenXiao).setScale(5, BigDecimal.ROUND_HALF_DOWN);
         insFeeOrderNew.setJqProfitMarginPremiums(jqDifference);
 
-        BigDecimal syDifference = insFeeOrderNew.getSyCostsPremiums().subtract(
+        BigDecimal syDifference = syEntranceFee.getTotalAmount().subtract(
                 (syExportFee.getSuperviseCostsPremiums().add(syExportFee.getOtherCostsPremiums())))
                 .subtract(
                 (syDeptManagerFee.getDeptPremiumsLevelOne().add(syDeptManagerFee.getDeptPremiumsLevelTwo().add(syDeptManagerFee.getDeptPremiumsLevelThree()).add(syDeptManagerFee.getDeptPremiumsLevelFoure()).add(syDeptManagerFee.getDeptPremiumsLevelFive())))
@@ -409,7 +408,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
         insFeeOrderNew.setSyProfitMarginPremiums(syDifference);
 
 
-        BigDecimal noDifference = insFeeOrderNew.getNoCostsPremiums().subtract(
+        BigDecimal noDifference = noEntranceFee.getTotalAmount().subtract(
                 (noExportFee.getSuperviseCostsPremiums().add(noExportFee.getOtherCostsPremiums())))
                 .subtract(
                 (noDeptManagerFee.getDeptPremiumsLevelOne().add(noDeptManagerFee.getDeptPremiumsLevelTwo().add(noDeptManagerFee.getDeptPremiumsLevelThree()).add(noDeptManagerFee.getDeptPremiumsLevelFoure()).add(noDeptManagerFee.getDeptPremiumsLevelFive())))