Qchen 8 месяцев назад
Родитель
Сommit
b6b60925f0

+ 47 - 0
tenant/insurance/quotation-dajia/src/main/java/com/jzg/quotation/dajia/crawler/build/DaJiaCrawlerQuoteResultsVoBuild.java

@@ -1,5 +1,7 @@
 package com.jzg.quotation.dajia.crawler.build;
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.jzg.commons.constants.dict.InsOrderStatusEnum;
 import com.jzg.commons.entity.quote.vo.ExpenseFactor;
 import com.jzg.commons.entity.quote.vo.KindInfoVo;
@@ -56,6 +58,8 @@ public final class DaJiaCrawlerQuoteResultsVoBuild {
         List<ExpenseFactor> expenseFactors = buildExpenseFactor();
         quoteResultsVo.setExpenseFactors(expenseFactors);
         quoteResultsVo.setQuoteStatusEnum(InsOrderStatusEnum.WAIT_AUDIT);
+        // 评分
+        quoteResultsVo.setScoreVo(buildScoreVo(daJiaCrawlerSaveResponse));
         // 非车费用
         quoteResultsVo.getCosts().setNiPremium(daJiaCrawlerSaveResponse.getDriveInsurance().getProductInfo().getPremium().equals("") ? "0.00" : daJiaCrawlerSaveResponse.getDriveInsurance().getProductInfo().getPremium());
         // 交强保费 车船税 商业保费
@@ -138,4 +142,47 @@ public final class DaJiaCrawlerQuoteResultsVoBuild {
         return List.of();
     }
 
+    // 构建评分
+    private static QuoteResultsVo.ScoreVo buildScoreVo(DaJiaCrawlerSaveResponse daJiaCrawlerSaveResponse) {
+        QuoteResultsVo.ScoreVo scoreVo = new QuoteResultsVo.ScoreVo();
+        CompulsoryInsuranceDTO compulsoryInsurance = daJiaCrawlerSaveResponse.getCompulsoryInsurance(); // 交强险
+        BusinessInsuranceDTO businessInsurance = daJiaCrawlerSaveResponse.getBusinessInsurance(); // 商业险
+        if (!ObjectUtils.isEmpty(compulsoryInsurance)) {
+            scoreVo.setJqLossRation(compulsoryInsurance.getCoefficientInfo().getLossRatioCi());
+        }
+        if (!ObjectUtils.isEmpty(businessInsurance)) {
+            scoreVo.setSyLossRation(businessInsurance.getCoefficientInfo().getLossRatioBi());
+        }
+        // 总赔付率 违章评分 高速风险分
+        String carIllegalScore;
+        String highwayScore;
+        if (!daJiaCrawlerSaveResponse.getCompulsoryInsurance().getCoefficientInfo().getTotalRatio().equals("")) {
+            scoreVo.setLossRation(daJiaCrawlerSaveResponse.getCompulsoryInsurance().getCoefficientInfo().getTotalRatio());
+            carIllegalScore = daJiaCrawlerSaveResponse.getCompulsoryInsurance().getCoefficientInfo().getCarIllegalScore();
+            highwayScore = daJiaCrawlerSaveResponse.getCompulsoryInsurance().getCoefficientInfo().getHighwayScore();
+        } else {
+            scoreVo.setLossRation(daJiaCrawlerSaveResponse.getBusinessInsurance().getCoefficientInfo().getTotalRatio());
+            carIllegalScore = daJiaCrawlerSaveResponse.getBusinessInsurance().getCoefficientInfo().getCarIllegalScore();
+            highwayScore = daJiaCrawlerSaveResponse.getBusinessInsurance().getCoefficientInfo().getHighwayScore();
+        }
+        JSONArray scoreArray = new JSONArray();
+        scoreArray.add(new JSONObject()
+                .fluentPut("storeName","交强定价评分")
+                .fluentPut("storeKey","jqPubScores")
+                .fluentPut("score",compulsoryInsurance.getCoefficientInfo().getLossRatioCi()));
+        scoreArray.add(new JSONObject()
+                .fluentPut("storeName","商业定价评分")
+                .fluentPut("storeKey","syPubScores")
+                .fluentPut("score",businessInsurance.getCoefficientInfo().getLossRatioBi()));
+        scoreArray.add(new JSONObject()
+                .fluentPut("storeName","违章评分")
+                .fluentPut("storeKey","carIllegalScore")
+                .fluentPut("score",carIllegalScore));
+        scoreArray.add(new JSONObject()
+                .fluentPut("storeName","高速风险分")
+                .fluentPut("storeKey","highwayScore")
+                .fluentPut("score",highwayScore));
+        scoreVo.setScoreJson(scoreArray);
+        return scoreVo;
+    }
 }

+ 2 - 0
tenant/insurance/quotation-dajia/src/main/java/com/jzg/quotation/dajia/crawler/entity/request/quote/BusinessInsuranceDTO.java

@@ -369,6 +369,8 @@ public class BusinessInsuranceDTO implements Serializable {
         private String pingAnBillCTPELR;
         @JsonProperty("pingAnBillELR")
         private String pingAnBillELR;
+        @JsonProperty("highwayScore")
+        private String highwayScore;
     }
 
     @NoArgsConstructor

+ 3 - 0
tenant/insurance/quotation-dajia/src/main/java/com/jzg/quotation/dajia/crawler/entity/request/quote/CompulsoryInsuranceDTO.java

@@ -596,6 +596,8 @@ public class CompulsoryInsuranceDTO {
         private String pingAnBillCTPELR;
         @JsonProperty("pingAnBillELR")
         private String pingAnBillELR;
+        @JsonProperty("highwayScore")
+        private String highwayScore;
 
         public CoefficientInfoDTO() {
             this.proposalNo = "";
@@ -669,6 +671,7 @@ public class CompulsoryInsuranceDTO {
             this.pingAnBillCOMELR = "";
             this.pingAnBillCTPELR = "";
             this.pingAnBillELR = "";
+            this.highwayScore = "";
         }
     }
 

+ 1 - 1
tenant/insurance/quotation-dajia/src/main/java/com/jzg/quotation/dajia/crawler/entity/response/DaJiaCrawlerGenerateResponse.java

@@ -37,7 +37,7 @@ public class DaJiaCrawlerGenerateResponse implements Serializable {
     private GenerateDTO syGenerate;
 
     @JsonProperty("jyGenerate")
-    private String jyGenerate;
+    private GenerateDTO jyGenerate;
 
     @JsonProperty("jsGenerate")
     private String jsGenerate;

+ 2 - 2
tenant/insurance/quotation-dajia/src/main/java/com/jzg/quotation/dajia/crawler/service/impl/DaJiaCrawlerRequestImpl.java

@@ -14,6 +14,7 @@ import com.jzg.quotation.commons.filter.CarModelsFilterUtils;
 import com.jzg.quotation.commons.standard.conversion.ConfigureParametersConversion;
 import com.jzg.quotation.commons.utils.TimeProcessing;
 import com.jzg.quotation.dajia.crawler.build.DaJiaCrawlerQuoteResultsVoBuild;
+import com.jzg.quotation.dajia.crawler.build.DajiaCrawlerAuditResultsVoBuild;
 import com.jzg.quotation.dajia.crawler.component.BuildingAttributionInformation;
 import com.jzg.quotation.dajia.crawler.component.DaJiaCrawlerCacheComponent;
 import com.jzg.quotation.dajia.crawler.component.DaJiaCrawlerRequestComponent;
@@ -193,8 +194,7 @@ public class DaJiaCrawlerRequestImpl implements DaJiaCrawlerRequest {
         DaJiaCrawlerSaveResponse daJiaCrawlerSaveResponse = daJiaCrawlerCacheComponent.getDaJiaCrawlerSaveResponse(daJiaCrawlerOrder.getOrdersNo());
         // 提交核保申请
         DaJiaCrawlerGenerateResponse response = daJiaCrawlerRequestComponent.generate(daJiaCrawlerSaveResponse, headers);
-
-        return new UnderwritingResultsVo();
+        return DajiaCrawlerAuditResultsVoBuild.buildUnderwritingResultsVo(daJiaCrawlerOrder.getOrdersNo(), response);
     }
 
     /**

+ 3 - 3
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/controller/UnifyOrderManager.java

@@ -237,12 +237,12 @@ public class UnifyOrderManager {
                 .getCompanyCode(), quoteVo.getOrder()
                 .getApiType(), sysQuoteConfigService, sysQuoteRedisService, platformClient, baseController);
 
-        // 添加车辆没有的参数: 车辆明细、
-        QuoteInfoParameterFilling.setParameterSettings(quoteVo, esmInsCompanyHttpResult.getData().getCompanyCode());
-
         // 生成主订单及子订单  返回子订单id
         String ordersNo = insOrdersService.generateOrders(quoteVo, companyName);
 
+        // 添加车辆没有的参数: 车辆明细、
+        QuoteInfoParameterFilling.setParameterSettings(quoteVo, esmInsCompanyHttpResult.getData().getCompanyCode());
+
         QuoteResultsVo quoteResultsVo = null;
         // 报价
         try {