Forráskód Böngészése

修改费用显示问题

wks 1 éve
szülő
commit
65c38b076b

+ 18 - 21
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceImpl.java

@@ -15,6 +15,7 @@ import com.ydtech.modules.fee.service.FeeRuleSchemeService;
 import com.ydtech.modules.ins.model.vo.CarInfoVo;
 import com.ydtech.modules.ins.model.vo.KindInfoVo;
 import com.ydtech.modules.ins.model.vo.QuoteRespVo;
+import com.ydtech.modules.order.constants.BusinessConstant;
 import com.ydtech.modules.order.entity.InsCopyFeeOrder;
 import com.ydtech.modules.order.entity.InsFeeOrder;
 import com.ydtech.modules.order.entity.vo.*;
@@ -48,27 +49,26 @@ import java.util.stream.Collectors;
  */
 @Service
 public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
+
     @Resource
     private PtlAgreementProductCostsService ptlAgreementProductCostsService;
 
     @Resource
     private InsFeeOrderService insFeeOrderService;
+
     @Resource
     private InsCopyFeeOrderService insCopyFeeOrderService;
+
     @Resource
     private SysUserService sysUserService;
 
-    @Resource
-    private PtlAgreementService ptlAgreementService;
     @Resource
     private PtlNewCarJudgeRulesService ptlNewCarJudgeRulesService;
     @Resource
     private PtlAgreementAttributionService ptlAgreementAttributionService;
-    @Resource
-    private PtlAgreementUndwrtRulesService ptlAgreementUndwrtRulesService;
 
     @Resource
-    private InsFeeOrderNewService insFeeOrderNewService;
+    private PtlAgreementUndwrtRulesService ptlAgreementUndwrtRulesService;
 
     @Resource
     private SysUserRoleService sysUserRoleService;
@@ -2647,7 +2647,7 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
 
         //region 入口费用
         //交强
-        FeeOrderNewVo.EntranceFee jqEntranceFee = this.assignEntranceFee("交强险", insFeeOrderNew.getJqPremium(),
+        FeeOrderNewVo.EntranceFee jqEntranceFee = this.assignEntranceFee(BusinessConstant.FEE_INSURANCE_TYPE_1, insFeeOrderNew.getJqPremium(),
                 insFeeOrderNew.getJqSuperviseCostsProportion(),
                 insFeeOrderNew.getJqOtherCostsProportion(), insFeeOrderNew.getJqCostsProportion(),
                 insFeeOrderNew.getJqSuperviseCostsPremiums(),
@@ -2655,7 +2655,7 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         entranceFeeList.add(jqEntranceFee);
 
         //商业
-        FeeOrderNewVo.EntranceFee syEntranceFee = this.assignEntranceFee("商业险", insFeeOrderNew.getSyPremium(),
+        FeeOrderNewVo.EntranceFee syEntranceFee = this.assignEntranceFee(BusinessConstant.FEE_INSURANCE_TYPE_2, insFeeOrderNew.getSyPremium(),
                 insFeeOrderNew.getSySuperviseCostsProportion(),
                 insFeeOrderNew.getSyOtherCostsProportion(), insFeeOrderNew.getSyCostsProportion(),
                 insFeeOrderNew.getSySuperviseCostsPremiums(),
@@ -2663,7 +2663,7 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         entranceFeeList.add(syEntranceFee);
 
         //非车
-        FeeOrderNewVo.EntranceFee noEntranceFee = this.assignEntranceFee("非车险", insFeeOrderNew.getNoPremium(),
+        FeeOrderNewVo.EntranceFee noEntranceFee = this.assignEntranceFee(BusinessConstant.FEE_INSURANCE_TYPE_3, insFeeOrderNew.getNoPremium(),
                 insFeeOrderNew.getNoSuperviseCostsProportion(),
                 insFeeOrderNew.getNoOtherCostsProportion(), insFeeOrderNew.getNoCostsProportion(),
                 insFeeOrderNew.getNoSuperviseCostsPremiums(),
@@ -2679,7 +2679,7 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         //region 机构管理对象
 
         //交强
-        FeeOrderNewVo.DeptManagerFee jqDeptManagerFee = this.assignDeptFee("交强险",
+        FeeOrderNewVo.DeptManagerFee jqDeptManagerFee = this.assignDeptFee(BusinessConstant.FEE_INSURANCE_TYPE_1,
                 insFeeOrderNew.getJqDeptProportionLevel1(), insFeeOrderNew.getJqDeptPremiumsLevel1(),
                 insFeeOrderNew.getJqDeptProportionLevel2(), insFeeOrderNew.getJqDeptPremiumsLevel2(),
                 insFeeOrderNew.getJqDeptProportionLevel3(), insFeeOrderNew.getJqDeptPremiumsLevel3(),
@@ -2693,7 +2693,7 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         deptManagerFeeList.add(jqDeptManagerFee);
 
         //商业
-        FeeOrderNewVo.DeptManagerFee syDeptManagerFee = this.assignDeptFee("商业险",
+        FeeOrderNewVo.DeptManagerFee syDeptManagerFee = this.assignDeptFee(BusinessConstant.FEE_INSURANCE_TYPE_2,
                 insFeeOrderNew.getSyDeptProportionLevel1(), insFeeOrderNew.getSyDeptPremiumsLevel1(),
                 insFeeOrderNew.getSyDeptProportionLevel2(), insFeeOrderNew.getSyDeptPremiumsLevel2(),
                 insFeeOrderNew.getSyDeptProportionLevel3(), insFeeOrderNew.getSyDeptPremiumsLevel3(),
@@ -2706,7 +2706,7 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         deptManagerFeeList.add(syDeptManagerFee);
 
         //非车
-        FeeOrderNewVo.DeptManagerFee noDeptManagerFee = this.assignDeptFee("非车险",
+        FeeOrderNewVo.DeptManagerFee noDeptManagerFee = this.assignDeptFee(BusinessConstant.FEE_INSURANCE_TYPE_3,
                 insFeeOrderNew.getNoDeptProportionLevel1(), insFeeOrderNew.getNoDeptPremiumsLevel1(),
                 insFeeOrderNew.getNoDeptProportionLevel2(), insFeeOrderNew.getNoDeptPremiumsLevel2(),
                 insFeeOrderNew.getNoDeptProportionLevel3(), insFeeOrderNew.getNoDeptPremiumsLevel3(),
@@ -2767,11 +2767,9 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         retailFeeList.add(retailFeeLevel3);
 
         //endregion
-
-
         //region 出口费用
         //交强
-        FeeOrderNewVo.ExportFee jqExportFee = this.assignExportFee("交强险",
+        FeeOrderNewVo.ExportFee jqExportFee = this.assignExportFee(BusinessConstant.FEE_INSURANCE_TYPE_1,
                 insFeeOrderNew.getJqPremium(), insFeeOrderNew.getJqCostsExportProportion(),
                 insFeeOrderNew.getJqExportOtherCostsProportion(),
                 insFeeOrderNew.getJqExportSuperviseCostsPremiums(), insFeeOrderNew.getJqExportOtherCostsPremiums()
@@ -2779,23 +2777,22 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         //exportFeeList.add(jqExportFee);
 
         //交强
-        FeeOrderNewVo.ExportFee syExportFee = this.assignExportFee("商业险",
+        FeeOrderNewVo.ExportFee syExportFee = this.assignExportFee(BusinessConstant.FEE_INSURANCE_TYPE_2,
                 insFeeOrderNew.getSyPremium(), insFeeOrderNew.getSyCostsExportProportion(),
                 insFeeOrderNew.getSyExportOtherCostsProportion(),
                 insFeeOrderNew.getSyExportSuperviseCostsPremiums(), insFeeOrderNew.getSyExportOtherCostsPremiums()
         );
         //exportFeeList.add(syExportFee);
 
-
         //交强
-        FeeOrderNewVo.ExportFee noExportFee = this.assignExportFee("非车险",
+        FeeOrderNewVo.ExportFee noExportFee = this.assignExportFee(BusinessConstant.FEE_INSURANCE_TYPE_3,
                 insFeeOrderNew.getNoPremium(), insFeeOrderNew.getNoCostsExportProportion(),
                 insFeeOrderNew.getNoExportOtherCostsProportion(),
                 insFeeOrderNew.getNoExportSuperviseCostsPremiums(), insFeeOrderNew.getNoExportOtherCostsPremiums());
 
         // exportFeeList.add(noExportFee);
         //add  by  hxl   添加出单员不能查看优惠的限制    2024-07-11
-        String userId = new BaseController().getUserId();
+        String userId = BaseController.getUserId();
         SysUserRole sysUserRole = sysUserRoleService.selectByUserId(userId);
         if (sysUserRole != null && sysUserRole.getRoleId() == 19) {
             jqExportFee.setTotalAmount(BigDecimal.ZERO);
@@ -2822,7 +2819,7 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
 
     private FeeOrderNewVo.ExportFee assignExportFeeTotal(List<FeeOrderNewVo.ExportFee> exportFeeList) {
         FeeOrderNewVo.ExportFee exportFee = new FeeOrderNewVo.ExportFee();
-        exportFee.setInsuranceType("合计");
+        exportFee.setInsuranceType(BusinessConstant.FEE_INSURANCE_TYPE_4);
         //保费合计
         BigDecimal premium = exportFeeList.stream().map(FeeOrderNewVo.ExportFee::getPremium).reduce(BigDecimal.ZERO, BigDecimal::add);
         exportFee.setPremium(Optional.of(premium).orElse(BigDecimal.ZERO));
@@ -2840,7 +2837,7 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
 
     private static FeeOrderNewVo.EntranceFee assignEntranceFeeTotal(List<FeeOrderNewVo.EntranceFee> entranceFeeList) {
         FeeOrderNewVo.EntranceFee entranceFeeTotal = new FeeOrderNewVo.EntranceFee();
-        entranceFeeTotal.setInsuranceType("合计");
+        entranceFeeTotal.setInsuranceType(BusinessConstant.FEE_INSURANCE_TYPE_4);
         //保费合计
         BigDecimal premium = entranceFeeList.stream().map(FeeOrderNewVo.EntranceFee::getPremium).reduce(BigDecimal.ZERO, BigDecimal::add);
         entranceFeeTotal.setPremium(Optional.of(premium).orElse(BigDecimal.ZERO));
@@ -2944,7 +2941,7 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
 
         // 外部
         exportFee.setExternalProportion(enterProportion);
-        exportFee.setExternalPremiums(premium.multiply(enterProportion.divide(new BigDecimal(100))).setScale(2,  RoundingMode.DOWN));
+        exportFee.setExternalPremiums(premium.multiply(enterProportion.divide(new BigDecimal(100))).setScale(2, RoundingMode.DOWN));
 
         if (exportTotalProportion.compareTo(BigDecimal.ZERO) < 0 && premium.compareTo(BigDecimal.ZERO) == 0) {
             //出口比例为负数了

+ 12 - 0
src/main/java/com/ydtech/modules/order/constants/BusinessConstant.java

@@ -0,0 +1,12 @@
+package com.ydtech.modules.order.constants;
+
+public class BusinessConstant {
+
+    // 费用险种类别
+    public static final String FEE_INSURANCE_TYPE_1 = "交强险";
+    public static final String FEE_INSURANCE_TYPE_2 = "商业险";
+    public static final String FEE_INSURANCE_TYPE_3 = "非车险";
+    public static final String FEE_INSURANCE_TYPE_4 = "合计";
+
+
+}

+ 0 - 1
src/main/java/com/ydtech/modules/order/entity/InsOrders.java

@@ -513,7 +513,6 @@ public class InsOrders implements Serializable {
         orderStatus0 = subOrderCountDTO.get(orderno + InsOrderStatusEnum.QUOTE_ING.getCode());
         orderStatus1 = subOrderCountDTO.get(orderno + InsOrderStatusEnum.WAIT_AUDIT.getCode());
         orderStatus2 = subOrderCountDTO.get(orderno + InsOrderStatusEnum.WAIT_PAY.getCode());
-        orderStatus3 = subOrderCountDTO.get(orderno + InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
         orderStatus4 = subOrderCountDTO.get(orderno + InsOrderStatusEnum.TO_BACK.getCode());
     }
 

+ 2 - 0
src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java

@@ -45,6 +45,7 @@ import com.ydtech.modules.ins.model.ya.CarModelDTO;
 import com.ydtech.modules.ins.model.ya.ExtendInfoDto;
 import com.ydtech.modules.ins.model.ya.ResponseDataC2;
 import com.ydtech.modules.inv.utils.EasyExcelUtils;
+import com.ydtech.modules.order.constants.BusinessConstant;
 import com.ydtech.modules.order.constants.JqInsuranceType;
 import com.ydtech.modules.order.dao.InsOrdersMapper;
 import com.ydtech.modules.order.entity.*;
@@ -1415,6 +1416,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
 
             BigDecimal sum = feeOrderNewVo.getExportFee()
                     .stream()
+                    .filter(x-> BusinessConstant.FEE_INSURANCE_TYPE_4.equals(x.getInsuranceType()))
                     .map(FeeOrderNewVo.ExportFee::getTotalAmount)
                     .reduce(BigDecimal.ZERO, BigDecimal::add);
             orderAndAreaCompany.setSumFee(sum.toString());