فهرست منبع

泰山完善 续保标志

wangguoqiang 3 ماه پیش
والد
کامیت
5832d0b6f6

+ 31 - 0
tenant/insurance/quotation-taishan/src/main/java/com/jzg/quotation/taishan/crawler/build/TaiShanCrawlerQuoteResultsVoBuild.java

@@ -8,6 +8,7 @@ import com.jzg.commons.entity.quote.vo.KindInfoVo;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
 import com.jzg.commons.entity.quote.vo.RiskInfoVo;
 import com.jzg.commons.entity.quote.vo.aggregated.QuoteResultsVo;
+import com.jzg.commons.util.StringUtils;
 import com.jzg.quotation.taishan.crawler.entity.response.TaiShanCrawlerQuotationSaveResponse;
 import com.jzg.quotation.taishan.crawler.entity.response.TaiShanCrawlerRiskManagementResponse;
 import lombok.extern.slf4j.Slf4j;
@@ -68,6 +69,24 @@ public class TaiShanCrawlerQuoteResultsVoBuild {
         }
 
         if(riskResponse != null && riskResponse.getResult() != null){
+            // 续保标识逻辑:renewalClass不为空时jq_renewalflag=1,否则=0;sy_renewalflag始终为空
+            String renewalClass = riskResponse.getResult().getRenewalClass();
+            String jqRenewalflag = (renewalClass != null && !renewalClass.isEmpty()) ? "1" : "0";
+            String syRenewalflag = "";
+//            scoreJson.add(new JSONObject()
+//                    .fluentPut("scoreName","交强续保标识")
+//                    .fluentPut("scoreKey","jq_renewalflag")
+//                    .fluentPut("jq_renewalflag", jqRenewalflag));
+//            scoreJson.add(new JSONObject()
+//                    .fluentPut("scoreName","商业续保标识")
+//                    .fluentPut("scoreKey","sy_renewalflag")
+//                    .fluentPut("sy_renewalflag", syRenewalflag));
+
+            // 交强续保
+            quoteResultsVo.getScoreVo().setJqRenewal(convertRenewalFlag(jqRenewalflag));
+            // 商业续保
+            quoteResultsVo.getScoreVo().setSyRenewal(convertRenewalFlag(syRenewalflag));
+
             scoreJson.add(new JSONObject()
                     .fluentPut("scoreName","泰山分")
                     .fluentPut("scoreKey","ctsScore")
@@ -186,4 +205,16 @@ public class TaiShanCrawlerQuoteResultsVoBuild {
 //            quoteResultsVo.getCosts().setNiPremium(unAutoPremium.getPremium());
 //        }
     }
+
+    private static String convertRenewalFlag(String renewalFlag) {
+        if (!StringUtils.hasText(renewalFlag)) {
+            return null;
+        }
+        // RenewalEnum 枚举值
+        if (renewalFlag.equals("0")) {
+            return "2";
+        } else {
+            return "3";
+        }
+    }
 }