소스 검색

处理人保的新能源车报价问题

wanghao 1 개월 전
부모
커밋
fde72d6157

+ 17 - 30
tenant/insurance/quotation-renbaonew/src/main/java/com/jzg/quotation/renbaonew/crawler/service/impl/RenBaoNewCrawlerRequestBuilder.java

@@ -3510,37 +3510,24 @@ public class RenBaoNewCrawlerRequestBuilder {
      */
     private String calculateEnergyTypePlat(String fuelType) {
         if (fuelType == null || fuelType.isEmpty()) {
-            return "0";  // 默认为燃油
-        }
-        // 只取第一个字符进行匹配(如D1取D,B1取B)
-        String baseType = fuelType.substring(0, 1);
-
-        switch (baseType) {
-            case "A":  // 汽油
-            case "B":  // 柴油
-            case "C":  // 电/汽油(增程式)
-            case "D":  // 电/柴油
-            case "E":  // 天然气
-            case "F":  // 液化石油气
-            case "G":  // 电/天然气
-            case "H":  // 电/液化石油气
-            case "I":  // 其他
-            case "J":  // 无
-            case "K":  // 乙醇
-            case "L":  // 太阳能
-            case "M":  // 电/太阳能
-            case "N":  // 电/其他
-                return "0";  // 传统燃油或非新能源
-            case "O":  // 纯电动
-                return "1";
-            case "P":  // 燃料电池
-                return "2";
-            case "Q":  // 插电式混合动力
-                return "3";
-            case "R":  // 其他混合动力(非插电)
-                return "4";
+            return "9";  // 默认其他
+        }
+        // 根据完整 fuelType 编码匹配能源类型
+        switch (fuelType) {
+            case "D1":   // 燃油
+            case "D2":   // 燃油
+            case "D13":  // 燃油
+                return "0";  // 燃油
+            case "D6":   // 纯电动
+                return "1";  // 纯电动
+            case "D8":   // 燃料电池
+                return "2";  // 燃料电池
+            case "D5":   // 其他混合动力
+                return "4";  // 其他混合动力
+            case "D12":  // 插电式混合动力
+                return "3";  // 插电式混合动力
             default:
-                return "0";  // 未知类型默认燃油
+                return "9";  // 其他
         }
     }