|
|
@@ -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;
|
|
|
+ }
|
|
|
}
|