wks пре 3 година
родитељ
комит
bb3a2ae2ea

+ 6 - 0
src/main/java/com/ydtech/constants/enums/InsuranceRisk.java

@@ -19,6 +19,12 @@ public enum InsuranceRisk {
 
     ACCIDENT("0513", "意外险");
 
+    public static final String TRAFFIC_CODE = "0507";
+
+    public static final String BUSINESS_CODE = "0510";
+
+    public static final String ACCIDENT_CODE = "0513";
+
     private final String code;
 
     private final String desc;

+ 1 - 1
src/main/java/com/ydtech/modules/order/entity/crawler/response/CrawlerBaseResponse.java

@@ -16,7 +16,7 @@ public class CrawlerBaseResponse implements Serializable {
     @JsonProperty("code")
     private Integer code;
     /**
-     * 核保返回信息
+     * 返回信息
      */
     @JsonProperty("message")
     private String message;

+ 20 - 13
src/main/java/com/ydtech/modules/order/service/impl/ZijinOrderApiServiceImpl.java

@@ -231,21 +231,28 @@ public class ZijinOrderApiServiceImpl implements ZijinOrderApiService {
         String busType;
         String identifyNo = customerInfoVo.getIdentifyNumber();
 
-        if (InsuranceRisk.TRAFFIC.getCode().equals(policyPrintVo.getRiskCode())) {
-            busNo = insAreaCompany.getJqpolicyno();
-            if ("1".equals(policyPrintVo.getType())) {
-                busType = "2";
-            } else {
-                busType = "1";
-            }
-        } else if (InsuranceRisk.ACCIDENT.getCode().equals(policyPrintVo.getRiskCode())) {
-            busNo = insAreaCompany.getSypolicyno();
-            busType = "3";
-        } else {
-            busNo = policyPrintVo.getPolicyNumber();
-            busType = "3";
+        switch (policyPrintVo.getRiskCode()) {
+            case InsuranceRisk.TRAFFIC_CODE:
+                busNo = insAreaCompany.getJqpolicyno();
+                if ("1".equals(policyPrintVo.getType())) {
+                    busType = "2";
+                } else {
+                    busType = "1";
+                }
+                break;
+            case InsuranceRisk.BUSINESS_CODE:
+                busNo = insAreaCompany.getSypolicyno();
+                busType = "3";
+                break;
+            case InsuranceRisk.ACCIDENT_CODE:
+                busNo = policyPrintVo.getPolicyNumber();
+                busType = "4";
+                break;
+            default:
+                throw new SystemException("保险编号异常");
         }
 
+
         String url = zijinRequestApiComponents.getDownLoadDocumentUrl(busNo, busType, identifyNo);
         return HttpResult.ok("生成成功", url);
     }