Browse Source

1. 注释 python 交叉销售

wks 3 năm trước cách đây
mục cha
commit
b590df0306

+ 2 - 2
src/main/java/com/ydtech/modules/order/entity/api/zj/constants/enums/FileTypeEnum.java

@@ -23,8 +23,8 @@ public enum FileTypeEnum {
     FT_9("9", "其他", new String[]{}),
     FT_19("19", "实名缴费证明", new String[]{}),
     FT_51("51", "银行卡", new String[]{}),
-    FT_52("52", "驾驶证", new String[]{"C01"}),
-    FT_53("53", "身份证", new String[]{"C02", "C03", "C04"}),
+    FT_52("52", "驾驶证", new String[]{"C01", "D01"}),
+    FT_53("53", "身份证", new String[]{"C02", "D02", "C03", "D03", "C04", "D04"}),
     FT_54("54", "增值税发票", new String[]{}),
     FT_55("55", "车辆合格证", new String[]{}),
     FT_56("56", "行驶证", new String[]{}),

+ 13 - 22
src/main/java/com/ydtech/modules/order/entity/api/zj/request/UploadFileRequest.java

@@ -1,6 +1,7 @@
 package com.ydtech.modules.order.entity.api.zj.request;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ydtech.constants.InsuranceImageEnum;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.order.entity.api.zj.constants.enums.FileTypeEnum;
 import com.ydtech.modules.order.entity.po.InsTaskImagesBase64;
@@ -9,6 +10,7 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import java.io.Serializable;
+import java.util.Arrays;
 
 
 /**
@@ -40,30 +42,19 @@ public class UploadFileRequest implements Serializable {
         this.orderNo = orderNo;
         String name = insTaskImagesBase64.getFileName();
         String suffix = name.substring(name.lastIndexOf("."));
-        switch (insTaskImagesBase64.getImageType()) {
-            case "C01":
-                this.fileName = "车辆影像" + suffix;
-                this.fileType = FileTypeEnum.FT_52.getCode();
-                break;
-            case "C02":
-                this.fileName = "车主身份证" + suffix;
-                this.fileType = FileTypeEnum.FT_53.getCode();
-                break;
-            case "C03":
-                this.fileName = "投保人身份证" + suffix;
-                this.fileType = FileTypeEnum.FT_53.getCode();
-                break;
-            case "C04":
-                this.fileName = "被保人身份证" + suffix;
-                this.fileType = FileTypeEnum.FT_53.getCode();
-                break;
-            case "C05":
-                this.fileName = "验车照" + suffix;
-                this.fileType = FileTypeEnum.FT_1.getCode();
+
+        String imageType = insTaskImagesBase64.getImageType();
+        InsuranceImageEnum insuranceImageEnum = Enum.valueOf(InsuranceImageEnum.class, imageType);
+        this.fileName = insuranceImageEnum.getDesc() + suffix;
+
+        for (FileTypeEnum fileTypeEnum : FileTypeEnum.values()) {
+            boolean contains = Arrays.asList(fileTypeEnum.getImagesType()).contains(insuranceImageEnum.getCode());
+            if(contains){
+                this.fileType = fileTypeEnum.getCode();
                 break;
-            default:
-                throw new SystemException("没有此类型");
+            }
         }
+
         this.fileBase64 = insTaskImagesBase64.getBase64String();
     }
 }

+ 50 - 45
src/main/java/com/ydtech/modules/order/entity/crawler/response/CrawlerAuditResponse.java

@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
 import lombok.NoArgsConstructor;
 
 import java.io.Serializable;
+import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -27,11 +28,11 @@ public class CrawlerAuditResponse extends CrawlerBaseResponse {
      */
     @JsonProperty("JQ_Policy")
     private String jqPolicy;
-    /**
-     * 驾意险
-     */
-    @JsonProperty("drivingInsurances")
-    private List<DrivingInsurance> drivingInsurances;
+//    /**
+//     * 驾意险
+//     */
+//    @JsonProperty("drivingInsurances")
+//    private List<DrivingInsurance> drivingInsurances;
     /**
      * 商业险保单号
      */
@@ -49,46 +50,50 @@ public class CrawlerAuditResponse extends CrawlerBaseResponse {
     @JsonProperty("pay_url")
     private String payUrl;
 
-
-    public List<DrivingInsuranceDto> getDrivingInsuranceDto(){
-        return drivingInsurances.stream().map(DrivingInsurance::toDrivingInsuranceDto).collect(Collectors.toList());
-    }
-
-    @Data
-    public static class DrivingInsurance implements Serializable {
-
-        private static final long serialVersionUID = -1316826976645101919L;
-        /**
-         * 驾意险投保单号
-         */
-        @JsonProperty("policy")
-        private String policy;
-        /**
-         * 驾意险保单号
-         */
-        @JsonProperty("application")
-        private String application;
-        /**
-         * 驾意险名称
-         */
-        @JsonProperty("name")
-        private String name;
-        /**
-         * 驾意险编号
-         */
-        @JsonProperty("code")
-        private String code;
-
-        private DrivingInsuranceDto toDrivingInsuranceDto() {
-            DrivingInsuranceDto drivingInsuranceDto = new DrivingInsuranceDto();
-            drivingInsuranceDto.setCode(code);
-            drivingInsuranceDto.setName(name);
-            drivingInsuranceDto.setPolicyNumber(policy);
-            drivingInsuranceDto.setApplicationNumber(application);
-            return drivingInsuranceDto;
-        }
-
-    }
+//
+//    public List<DrivingInsuranceDto> getDrivingInsuranceDto() {
+//        if (drivingInsurances == null) {
+//            return Collections.emptyList();
+//        }
+//
+//        return drivingInsurances.stream().map(DrivingInsurance::toDrivingInsuranceDto).collect(Collectors.toList());
+//    }
+//
+//    @Data
+//    public static class DrivingInsurance implements Serializable {
+//
+//        private static final long serialVersionUID = -1316826976645101919L;
+//        /**
+//         * 驾意险投保单号
+//         */
+//        @JsonProperty("policy")
+//        private String policy;
+//        /**
+//         * 驾意险保单号
+//         */
+//        @JsonProperty("application")
+//        private String application;
+//        /**
+//         * 驾意险名称
+//         */
+//        @JsonProperty("name")
+//        private String name;
+//        /**
+//         * 驾意险编号
+//         */
+//        @JsonProperty("code")
+//        private String code;
+//
+//        private DrivingInsuranceDto toDrivingInsuranceDto() {
+//            DrivingInsuranceDto drivingInsuranceDto = new DrivingInsuranceDto();
+//            drivingInsuranceDto.setCode(code);
+//            drivingInsuranceDto.setName(name);
+//            drivingInsuranceDto.setPolicyNumber(policy);
+//            drivingInsuranceDto.setApplicationNumber(application);
+//            return drivingInsuranceDto;
+//        }
+//
+//    }
 
 
 }

+ 2 - 2
src/main/java/com/ydtech/modules/order/service/impl/InsCrawlerOrderServiceImpl.java

@@ -123,8 +123,8 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
         insAreaCompany.setSyapplyno(crawlerAuditResponse.getSyPolicy());
 
         // 交叉销售
-        List<DrivingInsuranceDto> drivingInsuranceDto = crawlerAuditResponse.getDrivingInsuranceDto();
-        insAreaCompany.setCrossInsurance(JSON.parseArray(JSON.toJSONString(drivingInsuranceDto)));
+//        List<DrivingInsuranceDto> drivingInsuranceDto = crawlerAuditResponse.getDrivingInsuranceDto();
+//        insAreaCompany.setCrossInsurance(JSON.parseArray(JSON.toJSONString(drivingInsuranceDto)));
 
         // 保单号
         insAreaCompany.setJqpolicyno(crawlerAuditResponse.getJqApplication());