Просмотр исходного кода

中煤评分根据数字或字母进行判断过滤费用因子

Qchen 1 месяц назад
Родитель
Сommit
c709377836

+ 13 - 5
tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/build/ZmCrawlerQuoteResultVoBuild.java

@@ -228,11 +228,19 @@ public final class ZmCrawlerQuoteResultVoBuild {
             }
         }
 
-        if (apQtnResultXom.getGusunlightresultmainDto() != null) {
-            scoreJson.add(new JSONObject()
-                    .fluentPut("scoreName", "中煤分")
-                    .fluentPut("scoreKey","zmScore")
-                    .fluentPut("score", apQtnResultXom.getGusunlightresultmainDto().getZmScoreTranche()));
+        if (apQtnResultXom != null && apQtnResultXom.getGusunlightresultmainDto() != null) {
+            String zmScore = apQtnResultXom.getGusunlightresultmainDto().getZmScoreTranche();
+            if (zmScore != null && zmScore.matches("\\d+")) {  // 判断是否全为数字
+                scoreJson.add(new JSONObject()
+                        .fluentPut("scoreName", "中煤数字分")
+                        .fluentPut("scoreKey", "zmScoreNumber")
+                        .fluentPut("score", zmScore));
+            } else {
+                scoreJson.add(new JSONObject()
+                        .fluentPut("scoreName", "中煤字母分")
+                        .fluentPut("scoreKey", "zmScoreAlphabet")
+                        .fluentPut("score", zmScore));
+            }
         }
         if (quotedPriceResponse != null) {
             scoreJson.add(new JSONObject()