|
|
@@ -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();
|