Ver código fonte

Merge remote-tracking branch 'origin/test' into test

haoyu 2 anos atrás
pai
commit
f0f85925d7
19 arquivos alterados com 389 adições e 171 exclusões
  1. 1 1
      src/main/java/com/ydtech/modules/fee/dto/vo/RuleAttrMappingVo.java
  2. 86 74
      src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceImpl.java
  3. 26 10
      src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceNewImpl.java
  4. 6 1
      src/main/java/com/ydtech/modules/fnc/controller/CarSettleController.java
  5. 4 0
      src/main/java/com/ydtech/modules/ins/model/vo/QuoteRespVo.java
  6. 7 0
      src/main/java/com/ydtech/modules/order/dao/InsAreaCompanyMapper.java
  7. 6 0
      src/main/java/com/ydtech/modules/order/entity/InsAreaCompany.java
  8. 6 0
      src/main/java/com/ydtech/modules/order/entity/InsOrders.java
  9. 8 1
      src/main/java/com/ydtech/modules/order/entity/vo/InsOrdersEditingVo.java
  10. 8 0
      src/main/java/com/ydtech/modules/order/entity/vo/OrderQueryVo.java
  11. 6 0
      src/main/java/com/ydtech/modules/order/entity/vo/OrderVo.java
  12. 9 0
      src/main/java/com/ydtech/modules/order/service/InsAreaCompanyService.java
  13. 40 6
      src/main/java/com/ydtech/modules/order/service/impl/IdentifyServiceImpl.java
  14. 8 0
      src/main/java/com/ydtech/modules/order/service/impl/InsAreaCompanyServiceImpl.java
  15. 111 74
      src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java
  16. 10 0
      src/main/java/com/ydtech/modules/order/service/impl/ZijinOrderApiServiceImpl.java
  17. 11 1
      src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java
  18. 31 1
      src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml
  19. 5 2
      src/main/resources/mapper/modules/order/InsOrdersMapper.xml

+ 1 - 1
src/main/java/com/ydtech/modules/fee/dto/vo/RuleAttrMappingVo.java

@@ -70,7 +70,7 @@ public class RuleAttrMappingVo {
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("TransferVehicle", carInfo.isTransferFlag() ? "1" : "0"));
         //是否新车
         //使用注册日期算出自然月 然后判断是否是新旧车
-        LocalDate registrationDate = LocalDate.parse(carInfo.getIssueDate());
+        LocalDate registrationDate = LocalDate.parse(carInfo.getRegisterDate());
         LocalDate currentDate = LocalDate.now();
         PtlAgreementUndwrtRulesAttr ptlAgreementUndwrtRulesAttr = undwrtRulesAttrList.stream().filter(x -> x.getAttrCode().equals("NewAndOldCars")).findFirst().get();
         boolean isNoLicenseFlag = false;

+ 86 - 74
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceImpl.java

@@ -2631,39 +2631,13 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         jqEntranceFee.setInsuranceType("交强险");  // 险种
         jqEntranceFee.setPremium(insFeeOrderNew.getJqPremium());  //保费
         jqEntranceFee.setTotalAmount(insFeeOrderNew.getJqCostsPremiums());   //总费用
-        jqEntranceFee.setTotalProportion(insFeeOrderNew.getJqCostsProportion()); //总保费
+        jqEntranceFee.setTotalProportion(insFeeOrderNew.getJqCostsProportion()); //总比例
         jqEntranceFee.setSySuperviseCostsPremiums(insFeeOrderNew.getJqSuperviseCostsPremiums());   //手续费
         jqEntranceFee.setOtherCostsProportion(insFeeOrderNew.getJqOtherCostsProportion());   // 跟单比例
         jqEntranceFee.setOtherCostsPremiums(insFeeOrderNew.getJqOtherCostsPremiums());      // 跟单费
         jqEntranceFee.setSuperviseCosts(insFeeOrderNew.getJqSuperviseCostsProportion());  // 手续费比例
         entranceFeeList.add(jqEntranceFee);
 
-        //出口费用
-        jqExportFee.setInsuranceType("交强险");  // 险种
-        BigDecimal sumJqDeptPremiums = insFeeOrderNew.getJqDeptPremiumsLevel1()
-                .add(insFeeOrderNew.getJqDeptPremiumsLevel2())
-                .add(insFeeOrderNew.getJqDeptPremiumsLevel3())
-                .add(insFeeOrderNew.getJqDeptPremiumsLevel4())
-                .add(insFeeOrderNew.getJqDeptPremiumsLevel5());
-        BigDecimal jqProportion = insFeeOrderNew.getJqDeptProportionLevel1()
-                .add(insFeeOrderNew.getJqDeptProportionLevel2())
-                .add(insFeeOrderNew.getJqDeptProportionLevel3())
-                .add(insFeeOrderNew.getJqDeptProportionLevel4())
-                .add(insFeeOrderNew.getJqDeptProportionLevel5());
-        jqExportFee.setTotalAmount(sumJqDeptPremiums);
-        jqExportFee.setTotalProportion(jqProportion);
-        if(sumJqDeptPremiums.compareTo(new BigDecimal(4)) > 0) {
-            jqExportFee.setSuperviseCosts(new BigDecimal(4));
-            jqExportFee.setSuperviseCostsPremiums(insFeeOrderNew.getJqPremium().multiply(new BigDecimal(4).divide(new BigDecimal(100))));
-            jqExportFee.setOtherCostsProportion(jqProportion.subtract(new BigDecimal(4)));
-            jqExportFee.setOtherCostsPremiums(sumJqDeptPremiums.subtract(jqExportFee.getSuperviseCostsPremiums()));
-        }else{
-            jqExportFee.setSuperviseCosts(jqProportion);
-            jqExportFee.setSuperviseCostsPremiums(sumJqDeptPremiums);
-            jqExportFee.setOtherCostsProportion(new BigDecimal(0));
-            jqExportFee.setOtherCostsPremiums(new BigDecimal(0));
-        }
-        exportFeeList.add(jqExportFee);
 
         // 机构管理费
         jqDeptManagerFee.setInsuranceType("交强险");
@@ -2679,6 +2653,35 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         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());
+
+        //交强总出口费比例
+        BigDecimal jqExportTotalProportion = jqEntranceFee.getTotalProportion().subtract(sumJqDeptProportion);
+
+        //交强出口手续费比例
+        BigDecimal jqExportSuperviseCosts =
+                jqExportTotalProportion.compareTo(jqEntranceFee.getSuperviseCosts()) > 0 ? jqEntranceFee.getSuperviseCosts() : jqExportTotalProportion;
+
+        //交强出口其他费比例
+        BigDecimal jqOtherCostsProportion =
+                jqExportTotalProportion.compareTo(jqEntranceFee.getSuperviseCosts()) > 0 ? jqExportTotalProportion.subtract(jqExportSuperviseCosts) : new BigDecimal(0);
+
+        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(jqExportFee.getSuperviseCosts().add(jqExportFee.getOtherCostsProportion()));
+        jqExportFee.setTotalAmount(jqExportFee.getSuperviseCostsPremiums().add(jqExportFee.getOtherCostsPremiums()));
+        exportFeeList.add(jqExportFee);
+
+
+
 
         //商业入口
         syEntranceFee.setInsuranceType("商业险");  // 险种
@@ -2691,30 +2694,6 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         syEntranceFee.setSuperviseCosts(insFeeOrderNew.getSySuperviseCostsProportion());  // 手续费比例
         entranceFeeList.add(syEntranceFee);
 
-        //商业出口
-        syExportFee.setInsuranceType("商业险");  // 险种
-        BigDecimal sumSyDeptPremiums = insFeeOrderNew.getSyDeptPremiumsLevel1()
-                .add(insFeeOrderNew.getSyDeptPremiumsLevel2())
-                .add(insFeeOrderNew.getSyDeptPremiumsLevel3())
-                .add(insFeeOrderNew.getSyDeptPremiumsLevel4())
-                .add(insFeeOrderNew.getSyDeptPremiumsLevel5());
-        BigDecimal syProportion = insFeeOrderNew.getSyPremium().multiply(sumSyDeptPremiums);
-        syExportFee.setTotalAmount(sumSyDeptPremiums);
-        syExportFee.setTotalProportion(syProportion);
-        if(sumSyDeptPremiums.compareTo(new BigDecimal(4)) > 0) {
-            syExportFee.setSuperviseCosts(new BigDecimal(4));
-            syExportFee.setSuperviseCostsPremiums(insFeeOrderNew.getSyPremium().multiply(new BigDecimal(4).divide(new BigDecimal(100))));
-            syExportFee.setOtherCostsProportion(syProportion.subtract(new BigDecimal(4)));
-            syExportFee.setOtherCostsPremiums(sumSyDeptPremiums.subtract(syExportFee.getSuperviseCostsPremiums()));
-        }else{
-            syExportFee.setSuperviseCosts(syProportion);
-            syExportFee.setSuperviseCostsPremiums(sumSyDeptPremiums);
-            syExportFee.setOtherCostsProportion(syProportion.subtract(new BigDecimal(0)));
-            syExportFee.setOtherCostsPremiums(sumSyDeptPremiums.subtract(new BigDecimal(0)));
-        }
-        exportFeeList.add(syExportFee);
-
-
         // 商业管理费
         syDeptManagerFee.setInsuranceType("商业险");
         syDeptManagerFee.setDeptProportionLevelOne(insFeeOrderNew.getSyDeptProportionLevel1());
@@ -2729,6 +2708,35 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         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 = syEntranceFee.getTotalProportion().subtract(sumSyDeptProportion);
+
+        //商业出口手续费比例
+        BigDecimal syExportSuperviseCosts =
+                syExportTotalProportion.compareTo(syEntranceFee.getSuperviseCosts()) > 0 ? syEntranceFee.getSuperviseCosts() : syExportTotalProportion;
+
+        //商业出口其他费比例
+        BigDecimal syOtherCostsProportion =
+                syExportTotalProportion.compareTo(syEntranceFee.getSuperviseCosts()) > 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));
+        syExportFee.setTotalProportion(syExportFee.getSuperviseCosts().add(syExportFee.getOtherCostsProportion()));
+        syExportFee.setTotalAmount(syExportFee.getSuperviseCostsPremiums().add(syExportFee.getOtherCostsPremiums()));
+        exportFeeList.add(syExportFee);
+
+
+
 
         //非车入口
         nonEntranceFee.setInsuranceType("非车险");  // 险种
@@ -2741,29 +2749,6 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         nonEntranceFee.setSuperviseCosts(insFeeOrderNew.getNoSuperviseCostsProportion());  // 手续费比例
         entranceFeeList.add(nonEntranceFee);
 
-        //非车出口
-        nonExportFee.setInsuranceType("非车险");  // 险种
-        BigDecimal sumNonDeptPremiums = insFeeOrderNew.getNoDeptPremiumsLevel1()
-                .add(insFeeOrderNew.getNoDeptPremiumsLevel2())
-                .add(insFeeOrderNew.getNoDeptPremiumsLevel3())
-                .add(insFeeOrderNew.getNoDeptPremiumsLevel4())
-                .add(insFeeOrderNew.getNoDeptPremiumsLevel5());
-        BigDecimal nonProportion = insFeeOrderNew.getNoPremium().multiply(sumNonDeptPremiums);
-        nonExportFee.setTotalAmount(sumNonDeptPremiums);
-        nonExportFee.setTotalProportion(nonProportion);
-        if(sumNonDeptPremiums.compareTo(new BigDecimal(4)) > 0) {
-            nonExportFee.setSuperviseCosts(new BigDecimal(4));
-            nonExportFee.setSuperviseCostsPremiums(insFeeOrderNew.getNoPremium().multiply(new BigDecimal(4).divide(new BigDecimal(100))));
-            nonExportFee.setOtherCostsProportion(nonProportion.subtract(new BigDecimal(4)));
-            nonExportFee.setOtherCostsPremiums(sumNonDeptPremiums.subtract(nonExportFee.getSuperviseCostsPremiums()));
-        }else{
-            nonExportFee.setSuperviseCosts(nonProportion);
-            nonExportFee.setSuperviseCostsPremiums(sumNonDeptPremiums);
-            nonExportFee.setOtherCostsProportion(new BigDecimal(0));
-            nonExportFee.setOtherCostsPremiums(new BigDecimal(0));
-        }
-        exportFeeList.add(nonExportFee);
-
         // 五级管理费
         nonDeptManagerFee.setInsuranceType("非车险");
         nonDeptManagerFee.setDeptProportionLevelOne(insFeeOrderNew.getNoDeptProportionLevel1());
@@ -2779,6 +2764,33 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
         deptManagerFeeList.add(nonDeptManagerFee);
 
 
+        //出口费用
+        nonExportFee.setInsuranceType("非车险");  // 险种
+        BigDecimal sumNonDeptProportion = insFeeOrderNew.getNoDeptProportionLevel1()
+                .add(insFeeOrderNew.getNoDeptProportionLevel2())
+                .add(insFeeOrderNew.getNoDeptProportionLevel3())
+                .add(insFeeOrderNew.getNoDeptProportionLevel4())
+                .add(insFeeOrderNew.getNoDeptProportionLevel5());
+
+        //非车总出口费比例
+        BigDecimal nonExportTotalProportion = nonEntranceFee.getTotalProportion().subtract(sumNonDeptProportion);
+
+        //非车出口手续费比例
+        BigDecimal nonExportSuperviseCosts =
+                nonExportTotalProportion.compareTo(nonEntranceFee.getSuperviseCosts()) > 0 ? nonEntranceFee.getSuperviseCosts() : nonExportTotalProportion;
+
+        //非车出口其他费比例
+        BigDecimal nonOtherCostsProportion =
+                nonExportTotalProportion.compareTo(nonEntranceFee.getSuperviseCosts()) > 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(nonExportFee.getSuperviseCosts().add(nonExportFee.getOtherCostsProportion()));
+        nonExportFee.setTotalAmount(nonExportFee.getSuperviseCostsPremiums().add(nonExportFee.getOtherCostsPremiums()));
+        exportFeeList.add(nonExportFee);
+
         feeOrderNewVo.setEntranceFee(entranceFeeList);
         feeOrderNewVo.setExportFee(exportFeeList);
         feeOrderNewVo.setDeptManagerFee(deptManagerFeeList);

+ 26 - 10
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceNewImpl.java

@@ -19,7 +19,9 @@ import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.vo.*;
 import com.ydtech.modules.order.service.InsOrdersService;
+import com.ydtech.modules.protocol.entity.po.PtlAgreement;
 import com.ydtech.modules.protocol.entity.po.PtlNewCarJudgeRules;
+import com.ydtech.modules.protocol.service.PtlAgreementService;
 import com.ydtech.modules.protocol.service.PtlNewCarJudgeRulesService;
 import com.ydtech.modules.protocols.entity.po.*;
 import com.ydtech.modules.protocols.entity.vo.AgreementProductCosts;
@@ -77,6 +79,9 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
     @Autowired
     private PtlNewCarJudgeRulesService ptlNewCarJudgeRulesService;
 
+    @Autowired
+    private PtlAgreementService ptlAgreementService;
+
 
     @Override
     public QueryOrderFeeVo queryFeeOrderInfo(String companyId) {
@@ -118,7 +123,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
             String costsId = verificationCosts(agreementProductCosts, insAreaCompany, insOrders);
             if(costsId != null) {
                 calcCosts(costsId, insAreaCompany);
-                log.debug("费用因子校验通过,子订单id:" + insAreaCompany.getId() + ",费用id:" + costsId);
+                System.out.printf("费用因子校验通过,子订单id:" + insAreaCompany.getId() + ",费用id:" + costsId);
             }
         }
     }
@@ -143,8 +148,13 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
      */
     @Override
     public void calcCosts(String costsId,InsAreaCompany insAreaCompany) {
+        //获取协议信息
+        PtlAgreement ptlAgreement = ptlAgreementService.getById(insAreaCompany.getAgreementId());
+        BigDecimal taxRadio = new BigDecimal("1.00");
+        if(ptlAgreement.getWithTax().equals("是")){
+            taxRadio = new BigDecimal("1.06");
+        }
         //税比例 固定1.06
-        BigDecimal taxRadio = new BigDecimal("1.06");
         //查找入口与出口费用比例
         //入口配置
         PtlAgreementProductCostsNew ptlAgreementProductCostsNew = ptlAgreementProductCostsNewService.getById(costsId);
@@ -246,6 +256,10 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
         ));
 
 
+        //设置出口费用
+
+
+
         //设置出口费用
         //每级的加投费用为 计算出每级管理费的占比   *   加投费用
         //(一级管理费比例 / 总费用比例) * 加投费用
@@ -277,7 +291,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
         }
 
 
-        //交强出口比例
+        //交强管理比例
         insFeeOrderNew.setJqDeptProportionLevel1(ptlAgreementProductCostsExport.getJqExportRadioLevel1());
         insFeeOrderNew.setJqDeptPremiumsLevel1(
                 insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getJqDeptProportionLevel1()).divide(new BigDecimal("100")).add(jqInvestmentCostsLevel1)
@@ -308,7 +322,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
                 insFeeOrderNew.getJqPremium().multiply(insFeeOrderNew.getJqExportInvestmentProportion()).divide(new BigDecimal("100"))
         );
 
-        //商业出口比例
+        //商业管理比例
         insFeeOrderNew.setSyDeptProportionLevel1(ptlAgreementProductCostsExport.getSyExportRadioLevel1());
         insFeeOrderNew.setSyDeptPremiumsLevel1(
                 insFeeOrderNew.getSyPremium().multiply(insFeeOrderNew.getSyDeptProportionLevel1()).divide(new BigDecimal("100")).add(syInvestmentCostsLevel1)
@@ -341,7 +355,7 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
         );
 
 
-        //非车出口比例
+        //非车管理比例
         insFeeOrderNew.setNoDeptProportionLevel1(ptlAgreementProductCostsExport.getNoCarExportRadioLevel1());
         insFeeOrderNew.setNoDeptPremiumsLevel1(
                 insFeeOrderNew.getNoPremium().multiply(insFeeOrderNew.getNoDeptProportionLevel1()).divide(new BigDecimal("100"))
@@ -481,6 +495,8 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
 //        }
         for (int i = 0; i < agreementProductCosts.size(); i++) {
             //判断是否匹配
+            System.out.printf("费用因子匹配开始:" + agreementProductCosts.get(i).getId() + "\n");
+            System.out.printf("费用因子备注:" + agreementProductCosts.get(i).getCostsDescription() + "\n");
             if (judgements(agreementProductCosts.get(i).getCostsAttrLinks(), undwrtRulesAttrList, ruleAttrMappingVoList)) {
                 //返回 费用id   如果需要匹配非车的情况  将返回值返回list 后赛选
                 return agreementProductCosts.get(i).getId();
@@ -532,8 +548,8 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
 
             //如果查找不到 传值属性 直接费用对比失败
             if(ruleAttrMappingVo == null){
-                log.debug("规则匹配失败:" + ptlAgreementProductCostsAttrLinks.get(i).getAttrCode());
-                log.debug("传入的值找不到该属性:" + ptlAgreementProductCostsAttrLinks.get(finalI).getAttrCode());
+                System.out.printf("规则匹配失败:" + ptlAgreementProductCostsAttrLinks.get(i).getAttrCode()  + "\n");
+                System.out.printf("传入的值找不到该属性:" + ptlAgreementProductCostsAttrLinks.get(finalI).getAttrCode()  + "\n");
                 return false;
             }
 
@@ -542,9 +558,9 @@ public class FeeRuleSchemeServiceNewImpl implements FeeRuleSchemeNewService {
 
             useFlag = attrEqual(ptlAgreementProductCostsAttrLinks.get(i), ptlAgreementUndwrtRulesAttr, ruleAttrMappingVo.getValue());
             if(!useFlag){
-                log.debug("规则匹配失败:" + ptlAgreementProductCostsAttrLinks.get(i).getAttrCode());
-                log.debug("检验的值:" + ptlAgreementProductCostsAttrLinks.get(i).getMin());
-                log.debug("传入的值:" + ruleAttrMappingVo.getValue());
+                System.out.printf("规则匹配失败:" + ptlAgreementProductCostsAttrLinks.get(i).getAttrCode() + "\n");
+                System.out.printf("检验的值:" + ptlAgreementProductCostsAttrLinks.get(i).getMin() + "\n");
+                System.out.printf("传入的值:" + ruleAttrMappingVo.getValue() + "\n");
                 return false;
             }
 

+ 6 - 1
src/main/java/com/ydtech/modules/fnc/controller/CarSettleController.java

@@ -63,7 +63,12 @@ public class CarSettleController extends BaseController {
         //查询已承保的子订单号
         List<InsAreaCompany> areaList =insAreaCompanyService.query()
                 .eq(StringUtils.isNotEmpty(orderNo),"orderno",orderNo)
-                .eq("orderstatus","3").list();//3已承保
+                .eq("orderstatus","2").list();//3已承保
+
+//        List<InsAreaCompany> areaList = insAreaCompanyService.query()
+//                .eq("orderno", orderNo)
+//                .and(wrapper -> wrapper.eq("orderstatus", "3").or().eq("orderstatus", "2"))
+//                .list();//3已承保
         if(areaList!=null && areaList.size()>0){
             return insOrdersService.getByCompanyId(areaList.get(0).getId(),"accountingUser");
         }else{

+ 4 - 0
src/main/java/com/ydtech/modules/ins/model/vo/QuoteRespVo.java

@@ -127,6 +127,10 @@ public class QuoteRespVo {
     @ApiModelProperty("核心返回车型")
     private CoreModelsVo coreModels;
 
+
+    //add by hxl 添加紫金能源车返回的鼎然-车辆风险评分
+    @ApiModelProperty("紫金能源车(鼎然-车辆风险评分)")
+    private String ubiPredictedInfoScore;
     /**
      * 预核保信息
      */

+ 7 - 0
src/main/java/com/ydtech/modules/order/dao/InsAreaCompanyMapper.java

@@ -1,8 +1,11 @@
 package com.ydtech.modules.order.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.modules.order.entity.InsAreaCompany;
+import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.dto.InsAreaCompanyQueryDto;
+import com.ydtech.modules.order.entity.vo.OrderQueryVo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -43,6 +46,10 @@ public interface InsAreaCompanyMapper extends BaseMapper<InsAreaCompany> {
 
     List<InsAreaCompany> getorDerIds();
 
+    /**
+     * 获取待审核的订单
+     */
+    Page<InsOrders> getPendingAuditOrders(Page page, @Param("params") OrderQueryVo orderQueryVo);
 
 }
 

+ 6 - 0
src/main/java/com/ydtech/modules/order/entity/InsAreaCompany.java

@@ -362,6 +362,12 @@ public class InsAreaCompany implements Serializable {
     @TableField(exist = false)
     private static final long serialVersionUID = 1L;
 
+    /**
+     * 紫金能源车(鼎然-车辆风险评分  add by hxl 2024-04-09
+     */
+    @TableField(exist = false)
+    private String ubiPredictedInfoScore;
+
     public InsAreaCompany(QuoteRespVo quoteRespVo, PtlAgreementAttribution ptlAgreementAttribution) {
         this.id = IdGenerate.nextId();
         this.orderno = quoteRespVo.getOrderno();

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

@@ -213,6 +213,12 @@ public class InsOrders implements Serializable {
     @TableField(exist = false)
     private static final long serialVersionUID = 1L;
 
+    /**
+     * 紫金能源车(鼎然-车辆风险评分  add by hxl 2024-04-09
+     */
+    @TableField(value = "ubi_predicted_info_score")
+    private String ubiPredictedInfoScore;
+
     public InsOrders(SysUser user, SysDept dept, BaseQuoteInfoVo quoteInfoVo) {
         // 2. 组装订单
         this.setQuoteno(String.valueOf(quoteInfoVo.getQuoteno()));

+ 8 - 1
src/main/java/com/ydtech/modules/order/entity/vo/InsOrdersEditingVo.java

@@ -1,10 +1,10 @@
 package com.ydtech.modules.order.entity.vo;
 
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.ydtech.modules.ins.model.vo.AccidentResponseVo;
 import com.ydtech.modules.ins.model.vo.QuoteKindRespVo;
 import com.ydtech.modules.ins.model.vo.QuoteRiskRespVo;
-import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.TaxArrears;
 import com.ydtech.modules.order.entity.dto.InsAreaCompanyQueryDto;
@@ -133,6 +133,13 @@ public class InsOrdersEditingVo extends InsOrders implements Serializable {
         @ApiModelProperty("商业赔付率")
         private double syLossRation;
 
+
+        /**
+         * 紫金能源车(鼎然-车辆风险评分  add by hxl 2024-04-09
+         */
+        @TableField(value = "紫金能源车(鼎然-车辆风险评分)")
+        private String ubiPredictedInfoScore;
+
         public InsAreaCompanyEditingDto(InsAreaCompanyQueryDto insAreaCompany) {
             this.orderno = insAreaCompany.getOrderno();
             this.orderstatus = insAreaCompany.getOrderstatus();

+ 8 - 0
src/main/java/com/ydtech/modules/order/entity/vo/OrderQueryVo.java

@@ -1,6 +1,7 @@
 package com.ydtech.modules.order.entity.vo;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ydtech.core.page.PageRequest;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -68,4 +69,11 @@ public class OrderQueryVo {
         }
         return endDate.plusDays(1);
     }
+
+    public PageRequest getPageRequest() {
+        PageRequest pageRequest = new PageRequest();
+        pageRequest.setPageNum(pageNum);
+        pageRequest.setPageSize(pageSize);
+        return pageRequest;
+    }
 }

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

@@ -360,4 +360,10 @@ public class OrderVo implements Serializable {
      */
     private List<DistributionLevelVo>  distributionLevelVoList;
 
+    /**
+     * 紫金能源车(鼎然-车辆风险评分  add by hxl 2024-04-09
+     */
+    @TableField(value = "ubi_predicted_info_score")
+    private String ubiPredictedInfoScore;
+
 }

+ 9 - 0
src/main/java/com/ydtech/modules/order/service/InsAreaCompanyService.java

@@ -1,8 +1,11 @@
 package com.ydtech.modules.order.service;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.modules.order.entity.InsAreaCompany;
+import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.dto.InsAreaCompanyQueryDto;
+import com.ydtech.modules.order.entity.vo.OrderQueryVo;
 
 import java.util.List;
 
@@ -69,5 +72,11 @@ public interface InsAreaCompanyService extends IService<InsAreaCompany> {
 
     List<InsAreaCompany> getorDerIds();
 
+    /**
+     * 查询待审核的订单
+     * @return
+     */
+    Page<InsOrders> getPendingAuditOrders(Page page, OrderQueryVo orderQueryVo);
+
 
 }

+ 40 - 6
src/main/java/com/ydtech/modules/order/service/impl/IdentifyServiceImpl.java

@@ -1,5 +1,8 @@
 package com.ydtech.modules.order.service.impl;
 
+import com.ydtech.config.DictEnumConfig;
+import com.ydtech.constants.enums.dict.DictionaryData;
+import com.ydtech.constants.enums.dict.DictionaryManagement;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.ins.model.CardUserInfo;
@@ -22,10 +25,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import java.io.IOException;
-import java.util.Base64;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
 import java.util.concurrent.TimeUnit;
 
 import static com.ydtech.modules.order.constants.OrderCacheConstant.IMAGE_IDENTIFY_KEY;
@@ -99,7 +99,6 @@ public class IdentifyServiceImpl implements IdentifyService {
                 CardUserInfo cardUserInfo1 = new CardUserInfo();
                 BeanUtils.copyProperties(Objects.requireNonNull(redisTemplate.opsForValue().get(s1Key)), cardUserInfo1);
                 MultiObjectDetect.conversionFront(cardUserInfo, cardUserInfo1);
-
             } else {
                 //行驶证正面识别
                 MultiObjectDetect.drivingPermitFront(s1, cardUserInfo);
@@ -126,9 +125,44 @@ public class IdentifyServiceImpl implements IdentifyService {
         }
 
         AssertionUtils.isEmpty(cardUserInfo, "行驶证正面识别失败");
-        map.put("carInfo", cardUserInfo);
+        //add by hxl   处理营运和非营运
+        cardUserInfo = convertUseNatureCode(cardUserInfo);
+        map.put("carInfo",cardUserInfo);
         return HttpResult.ok("success", map);
     }
+    /**
+    * @Description  将车辆的性质做字典转换
+    * @Author  hxl
+    * @Date   2024/4/10 11:07
+    * @Param
+    * @Return
+    * @Exception
+    *
+    */
+    private CardUserInfo  convertUseNatureCode(CardUserInfo cardUserInfo) {
+        String useNature = cardUserInfo.getUseNature();
+        if(useNature!=null && !"".equals(useNature)){
+            if("营运".equals(useNature)){
+                useNature="营业";
+            }else if("非营运".equals(useNature)){
+                useNature="非营业";
+            }else{
+                useNature="";
+            }
+        }
+        Map<String, String> enumMap= new HashMap<>();
+        Map<String, DictionaryManagement> m = DictEnumConfig.getDmMap();
+        DictionaryManagement natureOfVehicleUse = m.get("natureOfVehicleUse");
+        List<DictionaryData> ddList = natureOfVehicleUse.getDdList();
+        if(ddList!=null && ddList.size()>0){
+            for (DictionaryData dictionaryData : ddList) {
+                enumMap.put(dictionaryData.getDictTag(),dictionaryData.getDictValue());
+            }
+        }
+        String useNaturekey = enumMap.get(useNature);
+        cardUserInfo.setUseNature(useNaturekey==null?"":useNaturekey);
+        return cardUserInfo;
+    }
 
 
     @Override

+ 8 - 0
src/main/java/com/ydtech/modules/order/service/impl/InsAreaCompanyServiceImpl.java

@@ -1,11 +1,14 @@
 package com.ydtech.modules.order.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.order.dao.InsAreaCompanyMapper;
 import com.ydtech.modules.order.entity.InsAreaCompany;
+import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.dto.InsAreaCompanyQueryDto;
+import com.ydtech.modules.order.entity.vo.OrderQueryVo;
 import com.ydtech.modules.order.service.InsAreaCompanyService;
 import com.ydtech.modules.order.service.InsOrdersService;
 import com.ydtech.modules.order.service.InsOrdersTrackService;
@@ -99,6 +102,11 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
         return  baseMapper.getorDerIds();
     }
 
+    @Override
+    public Page<InsOrders> getPendingAuditOrders(Page page, OrderQueryVo orderQueryVo) {
+        return baseMapper.getPendingAuditOrders(page,orderQueryVo);
+    }
+
 }
 
 

+ 111 - 74
src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java

@@ -14,6 +14,7 @@ import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
 import com.ydtech.constants.enums.dict.insurance.NatureOfVehicleUse;
 import com.ydtech.constants.sys.SystemConstant;
 import com.ydtech.core.page.HttpResult;
+import com.ydtech.core.page.PageRequest;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.admin.constants.RoleConstants;
 import com.ydtech.modules.admin.model.SysDept;
@@ -174,7 +175,10 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             if (InsOrderStatusEnum.ACCEPT_INSURANCE.getCode().equals(insOrders.getOrderstatus())) {
                 return;
             }
-
+            //add by hxl  2024-04-09  添加赋值紫金能源车 鼎然-车辆风险评分
+            if (insAreaCompany.getUbiPredictedInfoScore()!=null && !"".equals(insAreaCompany.getUbiPredictedInfoScore())) {
+                insOrders.setUbiPredictedInfoScore(insAreaCompany.getUbiPredictedInfoScore());
+            }
             insOrders.setOrderstatus(orderStatus);
             LambdaQueryWrapper<InsOrders> insOrdersLambdaQueryWrapper = new LambdaQueryWrapper<>();
             insOrdersLambdaQueryWrapper.ne(InsOrders::getOrderstatus, InsOrderStatusEnum.ACCEPT_INSURANCE.getCode());
@@ -348,82 +352,109 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             }
 
         }
+        Page<InsAreaCompany> page = PageRequest.buildPageRequest(orderQueryVo.getPageRequest());
+        Page<InsOrders> pendingAuditOrders = insAreaCompanyService.getPendingAuditOrders(page,orderQueryVo);
 
-        // 构造查询条件
-        LambdaQueryWrapper<InsOrders> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(StringUtils.isNotEmpty(orderQueryVo.getOrderNo()), InsOrders::getOrderno, orderQueryVo.getOrderNo())
-                .likeRight(StringUtils.isNotEmpty(orderQueryVo.getDeptId()) && isTeamLeader, InsOrders::getDeptid,
-                        orderQueryVo.getDeptId())
-                .eq(StringUtils.isNotEmpty(orderQueryVo.getOrderStatus()), InsOrders::getOrderstatus,
-                        orderQueryVo.getOrderStatus())
-                .likeRight(StringUtils.isNotEmpty(orderQueryVo.getFrameNo()), InsOrders::getFrameno,
-                        orderQueryVo.getFrameNo())
-                .likeRight(StringUtils.isNotEmpty(orderQueryVo.getLicenseNo()), InsOrders::getLicenseno,
-                        orderQueryVo.getLicenseNo())
-                .likeRight(StringUtils.isNotEmpty(orderQueryVo.getInsuredName()), InsOrders::getInsuredname,
-                        orderQueryVo.getInsuredName())
-                .between(!ObjectUtils.isEmpty(orderQueryVo.getStartDate()) && !ObjectUtils.isEmpty(orderQueryVo.getEndDate()),
-                        InsOrders::getCreatetime, orderQueryVo.getStartDate(), orderQueryVo.getEndDatePlusOneDay())
-                .orderBy(true, false, InsOrders::getCreatetime);
-
-
-        if (isCdy) {//如果是出单员查询时,只查自己的  与代客录单一致,查operatorid (手机前端userid传过来是出单用户,直接用该字段查询查operatorid)
-            wrapper.eq(StringUtils.isNotEmpty(orderQueryVo.getUserId()), InsOrders::getOperatorid,
-                    orderQueryVo.getUserId());
-        } else {
-            wrapper.eq(!isTeamLeader && StringUtils.isNotEmpty(orderQueryVo.getUserId()), InsOrders::getUserid,
-                    orderQueryVo.getUserId());
-        }
-
-        Page<InsOrders> page = new Page<>(orderQueryVo.getPageNum(), orderQueryVo.getPageSize());
-
-        if (StringUtils.isNotEmpty(orderQueryVo.getCompanyId())) {
-            List<InsAreaCompany> list = insAreaCompanyService.query().select("DISTINCT orderno").eq("company_id",
-                    orderQueryVo.getCompanyId()).list();
-            List<String> collect =
-                    list.stream().map(InsAreaCompany::getOrderno).distinct().collect(Collectors.toList());
-            if (!collect.isEmpty()) {
-                wrapper.in(InsOrders::getOrderno, collect);
-            }
-
-        }
-
-        if (StringUtils.isNotEmpty(orderQueryVo.getAuditStatus()) && orderQueryVo.getAuditStatus().equals("1")) {
-            List<InsFeeAudit> list = insFeeAuditService.query().select("DISTINCT orderno").eq("auditstatus",
-                    orderQueryVo.getAuditStatus()).list();
-            List<String> collect = list.stream().map(InsFeeAudit::getOrderno).distinct().collect(Collectors.toList());
-            collect.add("");
-            wrapper.in(InsOrders::getOrderno, collect);
-        }
-
-        if (StringUtils.isNotEmpty(orderQueryVo.getAuditStatus()) && orderQueryVo.getAuditStatus().equals("0")) {
-            List<InsFeeAudit> list =
-                    insFeeAuditService.query().select("DISTINCT orderno").eq("auditstatus", "1").list();
-            List<String> collect = list.stream().map(InsFeeAudit::getOrderno).distinct().collect(Collectors.toList());
-
-            if (!collect.isEmpty()) {
-                wrapper.notIn(InsOrders::getOrderno, collect);
-            }
-        }
-
-        //查出报价状态为 3
-        List<InsAreaCompany> insAreaCompanies = insAreaCompanyService.getorDerIds();
-//      新的费用订单表
-        if (insAreaCompanies.size() > 0) {
-            List<String> collect =
-                    insAreaCompanies.stream().map(insAreaCompany -> insAreaCompany.getOrderno()).collect(Collectors.toList());
-            if (!collect.isEmpty()) {
-                wrapper.in(InsOrders::getOrderno, collect);
-            }
-        }
-
-        Page<InsOrders> insOrdersPage = page(page, wrapper);
-
-        return new BasePageResult<>(orderQueryVo.getPageNum(), page.getSize(), insOrdersPage.getTotal(),
-                page.getPages(),
-                insOrdersPage.getRecords());
+        return new BasePageResult<>(pendingAuditOrders.getCurrent(), page.getSize(), pendingAuditOrders.getTotal(),
+                pendingAuditOrders.getPages(),
+                pendingAuditOrders.getRecords());
     }
 
+//    @Override
+//    public BasePageResult<InsOrders> queryPageOrder(OrderQueryVo orderQueryVo) {
+//        // 领导标志
+//        boolean isTeamLeader = false;
+//        //是否出单员标志
+//        boolean isCdy = false;
+//        if (StringUtils.isNotEmpty(orderQueryVo.getUserId())) {
+//            SysUserRole userRole = sysUserRoleService.selectByUserId(orderQueryVo.getUserId());
+//
+//            if (Arrays.asList(SystemConstant.getSysRoleTeamLeader()).contains(userRole.getRoleId().toString())) {
+//                //团队长可查询下面所有人员订单
+//                isTeamLeader = true;
+//            }
+//
+//            if (19 == userRole.getRoleId()) {
+//                isCdy = true;
+//            }
+//
+//        }
+//
+//        // 构造查询条件
+//        LambdaQueryWrapper<InsOrders> wrapper = new LambdaQueryWrapper<>();
+//        wrapper.eq(StringUtils.isNotEmpty(orderQueryVo.getOrderNo()), InsOrders::getOrderno, orderQueryVo.getOrderNo())
+//                .likeRight(StringUtils.isNotEmpty(orderQueryVo.getDeptId()) && isTeamLeader, InsOrders::getDeptid,
+//                        orderQueryVo.getDeptId())
+//                .eq(StringUtils.isNotEmpty(orderQueryVo.getOrderStatus()), InsOrders::getOrderstatus,
+//                        orderQueryVo.getOrderStatus())
+//                .likeRight(StringUtils.isNotEmpty(orderQueryVo.getFrameNo()), InsOrders::getFrameno,
+//                        orderQueryVo.getFrameNo())
+//                .likeRight(StringUtils.isNotEmpty(orderQueryVo.getLicenseNo()), InsOrders::getLicenseno,
+//                        orderQueryVo.getLicenseNo())
+//                .likeRight(StringUtils.isNotEmpty(orderQueryVo.getInsuredName()), InsOrders::getInsuredname,
+//                        orderQueryVo.getInsuredName())
+//                .between(!ObjectUtils.isEmpty(orderQueryVo.getStartDate()) && !ObjectUtils.isEmpty(orderQueryVo.getEndDate()),
+//                        InsOrders::getCreatetime, orderQueryVo.getStartDate(), orderQueryVo.getEndDatePlusOneDay())
+//                .orderBy(true, false, InsOrders::getCreatetime);
+//
+//
+//        if (isCdy) {//如果是出单员查询时,只查自己的  与代客录单一致,查operatorid (手机前端userid传过来是出单用户,直接用该字段查询查operatorid)
+//            wrapper.eq(StringUtils.isNotEmpty(orderQueryVo.getUserId()), InsOrders::getOperatorid,
+//                    orderQueryVo.getUserId());
+//        } else {
+//            wrapper.eq(!isTeamLeader && StringUtils.isNotEmpty(orderQueryVo.getUserId()), InsOrders::getUserid,
+//                    orderQueryVo.getUserId());
+//        }
+//
+//        Page<InsOrders> page = new Page<>(orderQueryVo.getPageNum(), orderQueryVo.getPageSize());
+//
+//        if (StringUtils.isNotEmpty(orderQueryVo.getCompanyId())) {
+//            List<InsAreaCompany> list = insAreaCompanyService.query().select("DISTINCT orderno").eq("company_id",
+//                    orderQueryVo.getCompanyId()).list();
+//            List<String> collect =
+//                    list.stream().map(InsAreaCompany::getOrderno).distinct().collect(Collectors.toList());
+//            if (!collect.isEmpty()) {
+//                wrapper.in(InsOrders::getOrderno, collect);
+//            }
+//
+//        }
+//
+//        if (StringUtils.isNotEmpty(orderQueryVo.getAuditStatus()) && orderQueryVo.getAuditStatus().equals("1")) {
+//            List<InsFeeAudit> list = insFeeAuditService.query().select("DISTINCT orderno").eq("auditstatus",
+//                    orderQueryVo.getAuditStatus()).list();
+//            List<String> collect = list.stream().map(InsFeeAudit::getOrderno).distinct().collect(Collectors.toList());
+//            collect.add("");
+//            wrapper.in(InsOrders::getOrderno, collect);
+//        }
+//
+//        if (StringUtils.isNotEmpty(orderQueryVo.getAuditStatus()) && orderQueryVo.getAuditStatus().equals("0")) {
+//            List<InsFeeAudit> list =
+//                    insFeeAuditService.query().select("DISTINCT orderno").eq("auditstatus", "1").list();
+//            List<String> collect = list.stream().map(InsFeeAudit::getOrderno).distinct().collect(Collectors.toList());
+//
+//            if (!collect.isEmpty()) {
+//                wrapper.notIn(InsOrders::getOrderno, collect);
+//            }
+//        }
+//
+//        //查出报价状态为 3
+//        List<InsAreaCompany> insAreaCompanies = insAreaCompanyService.getorDerIds();
+////      新的费用订单表
+//        if (insAreaCompanies.size() > 0) {
+//            List<String> collect =
+//                    insAreaCompanies.stream().map(insAreaCompany -> insAreaCompany.getOrderno()).collect(Collectors.toList());
+//            if (!collect.isEmpty()) {
+//                wrapper.in(InsOrders::getOrderno, collect);
+//            }
+//        }
+//
+//        Page<InsOrders> insOrdersPage = page(page, wrapper);
+//
+//        return new BasePageResult<>(orderQueryVo.getPageNum(), page.getSize(), insOrdersPage.getTotal(),
+//                page.getPages(),
+//                insOrdersPage.getRecords());
+//    }
+
     /**
      * 订单信息导出excel
      *
@@ -645,6 +676,12 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         List<InsAreaCompanyQueryDto> insAreaCompanyQueryDtos = insAreaCompanyService.getByOrderNo(orderNo);
         List<InsOrdersEditingVo.InsAreaCompanyEditingDto> insAreaCompanyEditingDtos =
                 insAreaCompanyQueryDtos.stream().map(InsOrdersEditingVo.InsAreaCompanyEditingDto::new).collect(Collectors.toList());
+        //订单回显添加 紫金能源车(鼎然-车辆风险评分)
+        if(insAreaCompanyEditingDtos!=null && insAreaCompanyEditingDtos.size()>0){
+            for (InsOrdersEditingVo.InsAreaCompanyEditingDto insAreaCompanyEditingDto : insAreaCompanyEditingDtos) {
+                insAreaCompanyEditingDto.setUbiPredictedInfoScore(insOrders.getUbiPredictedInfoScore());
+            }
+        }
         insOrdersEditingVo.setInsAreaCompanyEditingDtos(insAreaCompanyEditingDtos);
         return insOrdersEditingVo;
     }

+ 10 - 0
src/main/java/com/ydtech/modules/order/service/impl/ZijinOrderApiServiceImpl.java

@@ -574,6 +574,16 @@ public class ZijinOrderApiServiceImpl implements ZijinOrderApiService {
                 Double.parseDouble(carShipTax.getLateFee()));
         List<TaxArrears> taxArrearsList = Collections.singletonList(taxArrears);
         insAreaCompany.setTaxArrears(JSON.parseArray(JSON.toJSONString(taxArrearsList)));
+        //add by hxl 2024-04-08 添加紫荆能源车的鼎然-车辆风险评分 返回前台
+        List<CalculatePremiumResponse.PriceInfoListDTO> priceInfoList = calculatePremiumResponse.getPriceInfoList();
+        if(priceInfoList!=null && priceInfoList.size()>0){
+            CalculatePremiumResponse.PriceInfoListDTO priceInfoListDTO = priceInfoList.get(0);
+            if(priceInfoListDTO.getUbiPredictedInfo()!=null && priceInfoListDTO.getUbiPredictedInfo().getScore()!=null &&  !"".equals(priceInfoListDTO.getUbiPredictedInfo().getScore())){
+                String score = priceInfoListDTO.getUbiPredictedInfo().getScore();
+                quoteRespVo.setUbiPredictedInfoScore(score);
+                insAreaCompany.setUbiPredictedInfoScore(score);
+            }
+        }
         insAreaCompanyService.insertCompanyAndOrders(insAreaCompany);
         quoteRespVo.setCompanyId(orderNo);
         //添加调用费用匹配功能

+ 11 - 1
src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java

@@ -3,6 +3,7 @@ package com.ydtech.modules.protocols.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.exception.SystemException;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.protocol.entity.po.PtlAreaLicense;
 import com.ydtech.modules.protocol.service.PtlAreaLicenseService;
@@ -11,7 +12,6 @@ import com.ydtech.modules.protocols.entity.po.*;
 import com.ydtech.modules.protocols.entity.vo.AgreementProductCosts;
 import com.ydtech.modules.protocols.entity.vo.AgreementProductCostsSave;
 import com.ydtech.modules.protocols.service.*;
-import com.ydtech.utils.idgen.IdGenerate;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -279,6 +279,16 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
     @Transactional
     @Override
     public boolean costsAdd(AgreementProductCosts agreementProductCosts) {
+        //校验非车信息是否存在
+        PtlAgreementProductCostsAttrLink nonMotorInsurance = agreementProductCosts.getCostsAttrLinks().stream().filter(x -> x.getAttrCode().equals("NonMotorInsurance")).findFirst().get();
+        if (nonMotorInsurance != null) {
+            if((!nonMotorInsurance.getMin().equals("0") || !nonMotorInsurance.getMax().equals("0"))) {
+                if((agreementProductCosts.getNoCostsProportion() == null || agreementProductCosts.getNoCostsProportion().equals("0"))){
+                    throw new SystemException("检测到存在非车费用因子,请填写非车费用!");
+                }
+            }
+        }
+
         //添加费用主表信息
         PtlAgreementProductCostsNew ptlAgreementProductCostsNew = new PtlAgreementProductCostsNew();
         BeanUtils.copyProperties(agreementProductCosts, ptlAgreementProductCostsNew);

+ 31 - 1
src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

@@ -128,9 +128,39 @@
             ins_area_company a
                 LEFT JOIN ins_fee_order_new b ON  a.id =b.ins_order_no
         WHERE
-            a.orderstatus = '3'
+            a.orderstatus = '3' or a.orderstatus = '2'
             and  b.id is not  null
     </select>
 
+    <select id="getPendingAuditOrders" resultType="com.ydtech.modules.order.entity.InsOrders">
+        SELECT
+            *
+        FROM
+            ins_orders
+        WHERE
+            orderno IN (
+            SELECT
+                orderno
+            FROM
+                ins_area_company
+            WHERE
+                    id IN ( SELECT ins_order_no FROM ins_fee_order_new WHERE ins_order_no IN ( SELECT id FROM ins_area_company WHERE orderstatus = 2 OR orderstatus = 3 ) UNION SELECT ins_order_no FROM ins_fee_audit )
+        )
+        <if test="params.orderNo != null and params.orderNo != ''">
+            AND orderno = #{params.orderNo}
+        </if>
+        <if test="params.licenseNo != null and params.licenseNo != ''">
+            AND license_no = #{params.licenseNo}
+        </if>
+        <if test="params.frameNo != null and params.frameNo != ''">
+            AND frame_no = #{params.frameNo}
+        </if>
+        <if test="params.insuredname != null and params.insuredname != ''">
+            AND insuredname = #{params.insuredname}
+        </if>
+        <if test="params.startDate != null and params.startDate != ''">
+            BETWEEN createtime = #{params.startDate} and #{params.endDate}
+        </if>
+    </select>
 
 </mapper>

+ 5 - 2
src/main/resources/mapper/modules/order/InsOrdersMapper.xml

@@ -179,6 +179,7 @@
                o.licenseno,
                o.insuredname,
                o.vehicle_and_vessel_tax,
+               o.ubi_predicted_info_score,
                iac.jq_start_date as jqstartdate,
                iac.jq_end_date   as jqenddate,
                iac.sy_start_date as systartdate,
@@ -246,7 +247,8 @@
                syenddate,
                risk,
                king,
-               vehicle_and_vessel_tax
+               vehicle_and_vessel_tax,
+               ubi_predicted_info_score
         from ins_orders
         where userid = #{userId, jdbcType=VARCHAR}
           and licenseno = #{licenseNo, jdbcType=VARCHAR}
@@ -384,7 +386,8 @@
         b.kindinfo,
         b.pay_date,
         b.signing_time,
-        b.cross_insurance
+        b.cross_insurance,
+        a.ubi_predicted_info_score
         FROM ins_orders a LEFT JOIN ins_area_company b on a.orderno = b.orderno
         WHERE
         1 = 1