|
@@ -7,6 +7,7 @@ import com.jzg.commons.constants.quote.enums.quote.KindCode;
|
|
|
import com.jzg.commons.entity.quote.vo.KindInfoVo;
|
|
import com.jzg.commons.entity.quote.vo.KindInfoVo;
|
|
|
import com.jzg.commons.entity.quote.vo.QuoteVo;
|
|
import com.jzg.commons.entity.quote.vo.QuoteVo;
|
|
|
import com.jzg.commons.entity.quote.vo.aggregated.QuoteResultsVo;
|
|
import com.jzg.commons.entity.quote.vo.aggregated.QuoteResultsVo;
|
|
|
|
|
+import com.jzg.quotation.guoren.crawler.entity.dto.CiInsureDemandDTO;
|
|
|
import com.jzg.quotation.guoren.crawler.entity.response.GuoRenCrawlerBaseResponse;
|
|
import com.jzg.quotation.guoren.crawler.entity.response.GuoRenCrawlerBaseResponse;
|
|
|
import com.jzg.quotation.guoren.crawler.entity.response.GuoRenCrawlerCalculationPremiumData;
|
|
import com.jzg.quotation.guoren.crawler.entity.response.GuoRenCrawlerCalculationPremiumData;
|
|
|
import com.jzg.quotation.guoren.crawler.entity.response.GuoRenCrawlerProposalNoSaveData;
|
|
import com.jzg.quotation.guoren.crawler.entity.response.GuoRenCrawlerProposalNoSaveData;
|
|
@@ -72,26 +73,74 @@ public final class GuoRenCrawlerQuoteResultsVoBuild {
|
|
|
|
|
|
|
|
|
|
|
|
|
QuoteResultsVo.ScoreVo scoreVo = new QuoteResultsVo.ScoreVo();
|
|
QuoteResultsVo.ScoreVo scoreVo = new QuoteResultsVo.ScoreVo();
|
|
|
- scoreVo.setLossRation(calculationPremium.getBc().getAutoPriceOutputXOMRespVo().getStrBillELR2());
|
|
|
|
|
- scoreVo.setJqLossRation(calculationPremium.getBc().getAutoPriceOutputXOMRespVo().getStrBillCTPELR2());
|
|
|
|
|
- scoreVo.setSyLossRation(calculationPremium.getBc().getAutoPriceOutputXOMRespVo().getStrBillCOMELR2());
|
|
|
|
|
- scoreVo.setJqRenewal(Integer.parseInt(calculationPremium.getBc().getPrpTitemCar().getOriginalRouteRenewalFlagci()) + 1 + "");
|
|
|
|
|
- scoreVo.setSyRenewal(Integer.parseInt(calculationPremium.getBc().getPrpTitemCar().getOriginalRouteRenewalFlagbi()) + 1 + "");
|
|
|
|
|
|
|
+ // 赔付率(总/交强/商业)
|
|
|
|
|
+ Optional.ofNullable(calculationPremium.getBc())
|
|
|
|
|
+ .map(GuoRenCrawlerCalculationPremiumData.BcDTO::getAutoPriceOutputXOMRespVo)
|
|
|
|
|
+ .ifPresent(autoPriceOutputXOMRespVo -> {
|
|
|
|
|
+ scoreVo.setLossRation(autoPriceOutputXOMRespVo.getStrBillELR2());
|
|
|
|
|
+ scoreVo.setJqLossRation(autoPriceOutputXOMRespVo.getStrBillCTPELR2());
|
|
|
|
|
+ scoreVo.setSyLossRation(autoPriceOutputXOMRespVo.getStrBillCOMELR2());
|
|
|
|
|
+ });
|
|
|
|
|
+ // 续保/转保标志
|
|
|
|
|
+ Optional.ofNullable(calculationPremium.getBc())
|
|
|
|
|
+ .map(GuoRenCrawlerCalculationPremiumData.BcDTO::getPrpTitemCar)
|
|
|
|
|
+ .ifPresent(prpTitemCar -> {
|
|
|
|
|
+ scoreVo.setJqRenewal(Integer.parseInt(prpTitemCar.getOriginalRouteRenewalFlagci()) + 1 + "");
|
|
|
|
|
+ scoreVo.setSyRenewal(Integer.parseInt(prpTitemCar.getOriginalRouteRenewalFlagbi()) + 1 + "");
|
|
|
|
|
+ });
|
|
|
|
|
+ // 交强险出险次数
|
|
|
|
|
+ Optional.ofNullable(calculationPremium.getCi())
|
|
|
|
|
+ .map(GuoRenCrawlerCalculationPremiumData.CiDTO::getCiInsureDemand)
|
|
|
|
|
+ .map(CiInsureDemandDTO::getClaimTimes)
|
|
|
|
|
+ .ifPresent(scoreVo::setCiClaims);
|
|
|
|
|
+ // 商业险出险次数
|
|
|
|
|
+ Optional.ofNullable(calculationPremium.getBi())
|
|
|
|
|
+ .map(GuoRenCrawlerCalculationPremiumData.BiDTO::getCiInsureDemand)
|
|
|
|
|
+ .map(CiInsureDemandDTO::getClaimTimes)
|
|
|
|
|
+ .ifPresent(scoreVo::setBiClaims);
|
|
|
|
|
|
|
|
// 保司评分
|
|
// 保司评分
|
|
|
JSONArray scoreJson = new JSONArray();
|
|
JSONArray scoreJson = new JSONArray();
|
|
|
//光博评分
|
|
//光博评分
|
|
|
- scoreJson.add(new JSONObject()
|
|
|
|
|
- .fluentPut("scoreName", "交强光博分")
|
|
|
|
|
- .fluentPut("scoreKey", "jqScore")
|
|
|
|
|
- .fluentPut("score", calculationPremium.getCi().getPrpTmainRate().getBillcomeGroup()));
|
|
|
|
|
-
|
|
|
|
|
- if (calculationPremium.getBi().getPrpTmainRate() != null) {
|
|
|
|
|
|
|
+ Optional.ofNullable(calculationPremium.getCi())
|
|
|
|
|
+ .map(GuoRenCrawlerCalculationPremiumData.CiDTO::getPrpTmainRate)
|
|
|
|
|
+ .map(GuoRenCrawlerCalculationPremiumData.CiDTO.PrpTmainRateDTO::getBillcomeGroup)
|
|
|
|
|
+ .ifPresent(billcomeGroup -> scoreJson.add(new JSONObject()
|
|
|
|
|
+ .fluentPut("scoreName", "交强光博分")
|
|
|
|
|
+ .fluentPut("scoreKey", "jqScore")
|
|
|
|
|
+ .fluentPut("score", billcomeGroup)));
|
|
|
|
|
+
|
|
|
|
|
+ if (calculationPremium.getBi() != null && calculationPremium.getBi().getPrpTmainRate() != null) {
|
|
|
scoreJson.add(new JSONObject()
|
|
scoreJson.add(new JSONObject()
|
|
|
.fluentPut("scoreName", "商业光博分")
|
|
.fluentPut("scoreName", "商业光博分")
|
|
|
.fluentPut("scoreKey", "syScore")
|
|
.fluentPut("scoreKey", "syScore")
|
|
|
.fluentPut("score", calculationPremium.getBi().getPrpTmainRate().getBillcomeGroup()));
|
|
.fluentPut("score", calculationPremium.getBi().getPrpTmainRate().getBillcomeGroup()));
|
|
|
}
|
|
}
|
|
|
|
|
+ // 保司评分(阳光评分/全保评分/责任险评分/交强险评分/推荐折扣评分)
|
|
|
|
|
+ Optional.ofNullable(calculationPremium.getBc())
|
|
|
|
|
+ .map(GuoRenCrawlerCalculationPremiumData.BcDTO::getAutoPriceOutputXOMRespVo)
|
|
|
|
|
+ .ifPresent(autoPriceOutputXOMRespVo -> {
|
|
|
|
|
+ scoreJson.add(new JSONObject()
|
|
|
|
|
+ .fluentPut("scoreName", "阳光评分")
|
|
|
|
|
+ .fluentPut("scoreKey", "sunlightScore")
|
|
|
|
|
+ .fluentPut("score", autoPriceOutputXOMRespVo.getSunlightScore()));
|
|
|
|
|
+ scoreJson.add(new JSONObject()
|
|
|
|
|
+ .fluentPut("scoreName", "全保评分")
|
|
|
|
|
+ .fluentPut("scoreKey", "fullCoverageScore")
|
|
|
|
|
+ .fluentPut("score", autoPriceOutputXOMRespVo.getFullCoverageScore()));
|
|
|
|
|
+ scoreJson.add(new JSONObject()
|
|
|
|
|
+ .fluentPut("scoreName", "责任险评分")
|
|
|
|
|
+ .fluentPut("scoreKey", "liabilityOnlyScore")
|
|
|
|
|
+ .fluentPut("score", autoPriceOutputXOMRespVo.getLiabilityOnlyScore()));
|
|
|
|
|
+ scoreJson.add(new JSONObject()
|
|
|
|
|
+ .fluentPut("scoreName", "交强险评分")
|
|
|
|
|
+ .fluentPut("scoreKey", "ctpOnlyScore")
|
|
|
|
|
+ .fluentPut("score", autoPriceOutputXOMRespVo.getCtpOnlyScore()));
|
|
|
|
|
+ scoreJson.add(new JSONObject()
|
|
|
|
|
+ .fluentPut("scoreName", "推荐折扣评分")
|
|
|
|
|
+ .fluentPut("scoreKey", "recommenDiscountScore")
|
|
|
|
|
+ .fluentPut("score", autoPriceOutputXOMRespVo.getRecommenDiscountScore()));
|
|
|
|
|
+ });
|
|
|
// 重试成功时,将提前记录的重复投保信息放入评分字段
|
|
// 重试成功时,将提前记录的重复投保信息放入评分字段
|
|
|
if (duplicateMessage != null) {
|
|
if (duplicateMessage != null) {
|
|
|
scoreJson.add(new JSONObject()
|
|
scoreJson.add(new JSONObject()
|