|
|
@@ -1,6 +1,7 @@
|
|
|
package com.jzg.quotation.chengtai.api.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.KindInfoVo;
|
|
|
import com.jzg.commons.entity.quote.vo.RiskInfoVo;
|
|
|
@@ -96,7 +97,12 @@ public final class ChengTaiAPIQuoteResultsVoBuild {
|
|
|
private static QuoteResultsVo.ScoreVo buildScoreVo(PremiumCalculationResponse premiumCalculationResponse) {
|
|
|
QuoteResultsVo.ScoreVo scoreVo = new QuoteResultsVo.ScoreVo();
|
|
|
if (null != premiumCalculationResponse.getCompRisk() && null != premiumCalculationResponse.getCompRisk().getBasePart()){
|
|
|
- scoreVo.setJqRenewal(premiumCalculationResponse.getCompRisk().getBasePart().getRenewalFlag());
|
|
|
+ String jqRenewal = premiumCalculationResponse.getCompRisk().getBasePart().getRenewalFlag();
|
|
|
+ switch (jqRenewal) {
|
|
|
+ case "-1" -> scoreVo.setJqRenewal("3");
|
|
|
+ case "0" -> scoreVo.setJqRenewal("1");
|
|
|
+ case "2" -> scoreVo.setJqRenewal("2");
|
|
|
+ }
|
|
|
scoreVo.setCiClaims(premiumCalculationResponse.getCompRisk().getBasePart().getClaimsNum());
|
|
|
if (null != premiumCalculationResponse.getCompRisk().getBasePart().getDiscount()) {
|
|
|
scoreVo.setJqAdjustRate(premiumCalculationResponse.getCompRisk().getBasePart().getDiscount().toString());
|
|
|
@@ -104,14 +110,32 @@ public final class ChengTaiAPIQuoteResultsVoBuild {
|
|
|
}
|
|
|
}
|
|
|
if (null != premiumCalculationResponse.getCommRisk() && null != premiumCalculationResponse.getCommRisk().getBasePart()) {
|
|
|
+ String syRenewal = premiumCalculationResponse.getCommRisk().getBasePart().getRenewalFlag();
|
|
|
+ switch (syRenewal) {
|
|
|
+ case "-1" -> scoreVo.setSyRenewal("3");
|
|
|
+ case "0" -> scoreVo.setSyRenewal("1");
|
|
|
+ case "2" -> scoreVo.setSyRenewal("2");
|
|
|
+ }
|
|
|
scoreVo.setBiClaims(premiumCalculationResponse.getCommRisk().getBasePart().getClaimsNum());
|
|
|
- scoreVo.setSyRenewal(premiumCalculationResponse.getCommRisk().getBasePart().getRenewalFlag());
|
|
|
if (null != premiumCalculationResponse.getCommRisk().getBasePart().getDiscount()){
|
|
|
scoreVo.setSyAdjustRate(premiumCalculationResponse.getCommRisk().getBasePart().getDiscount().toString());
|
|
|
scoreVo.setBiClaims(premiumCalculationResponse.getCommRisk().getBasePart().getClaimsNum());
|
|
|
}
|
|
|
}
|
|
|
scoreVo.setLossRation(premiumCalculationResponse.getYztScore().getCentile().toString());
|
|
|
+ JSONArray scoreJson = new JSONArray();
|
|
|
+ if (premiumCalculationResponse.getOcftInfo().getCoefficientList().size() > 0) {
|
|
|
+ BigDecimal coefficientVal = premiumCalculationResponse.getOcftInfo().getCoefficientList().stream()
|
|
|
+ .filter(item -> "BI".equals(item.getDataType()))
|
|
|
+ .map(PremiumCalculationResponse.OcftInfo.Coefficient::getCoefficient)
|
|
|
+ .findFirst()
|
|
|
+ .orElse(null);
|
|
|
+ scoreJson.add(new JSONObject()
|
|
|
+ .fluentPut("scoreName", "自主定价系数")
|
|
|
+ .fluentPut("scoreKey","coefficient")
|
|
|
+ .fluentPut("score", coefficientVal));
|
|
|
+ }
|
|
|
+ scoreVo.setScoreJson(scoreJson);
|
|
|
return scoreVo;
|
|
|
}
|
|
|
|