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

update
1.诚泰财险报价提交核保流程

wks 11 месяцев назад
Родитель
Сommit
a5e2d6d670
13 измененных файлов с 681 добавлено и 1251 удалено
  1. 23 0
      tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/build/ChengTaiCrawlerQuoteResultsVoBuild.java
  2. 45 0
      tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/component/ChengTaiCrawlerCacheComponent.java
  3. 38 5
      tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/component/ChengTaiRequestCrawlerComponent.java
  4. 62 1
      tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/entity/request/ChengTaiGetEngageListRequest.java
  5. 13 0
      tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/entity/request/ChengTaiImageUploadRequest.java
  6. 138 9
      tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/entity/request/ChengTaiPremiumcaRequest.java
  7. 75 1212
      tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/entity/request/ChengTaiUnderwritingRequest.java
  8. 89 0
      tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/entity/response/ChengTaiPremiumcaResponse.java
  9. 26 0
      tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/service/ChengTaiCrawlerQuoteProcessService.java
  10. 96 8
      tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/service/impl/ChengTaiCrawlerQuoteProcessServiceImpl.java
  11. 35 16
      tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/service/impl/ChengTaiCrawlerRequestImpl.java
  12. 33 0
      tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/utils/ZipImageExample.java
  13. 8 0
      tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/utils/TimeProcessing.java

+ 23 - 0
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/build/ChengTaiCrawlerQuoteResultsVoBuild.java

@@ -0,0 +1,23 @@
+package com.jzg.quotation.chengtai.crawler.build;
+
+
+import com.jzg.commons.entity.quote.vo.aggregated.QuoteResultsVo;
+import com.jzg.quotation.chengtai.crawler.entity.response.ChengTaiPremiumcaResponse;
+
+public final class ChengTaiCrawlerQuoteResultsVoBuild {
+
+
+    /**
+     * 构造报价信息
+     *
+     * @param ordersNo  订单号
+     * @param premiumca 报价返回信息
+     * @return
+     */
+    public static QuoteResultsVo buildQuoteResultsVo(String ordersNo, ChengTaiPremiumcaResponse premiumca) {
+        QuoteResultsVo quoteResultsVo = new QuoteResultsVo();
+
+
+        return quoteResultsVo;
+    }
+}

+ 45 - 0
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/component/ChengTaiCrawlerCacheComponent.java

@@ -0,0 +1,45 @@
+package com.jzg.quotation.chengtai.crawler.component;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.jzg.quotation.chengtai.crawler.entity.request.ChengTaiUnderwritingRequest;
+import lombok.RequiredArgsConstructor;
+import org.redisson.api.RBucket;
+import org.redisson.api.RedissonClient;
+import org.springframework.stereotype.Component;
+
+import java.time.Duration;
+
+@Component
+@RequiredArgsConstructor
+public class ChengTaiCrawlerCacheComponent {
+
+    private final RedissonClient redissonClient;
+
+    public static final String CHENGTAI_SAVE = "chengtai:save:";
+
+    public static final Duration CHENGTAISAVE_TIME = Duration.ofHours(3L);
+
+    /**
+     * 诚泰提核请求保存
+     *
+     * @param chengTaiUnderwritingRequest 诚泰提核请求
+     * @param ordersNo                    订单号
+     */
+    public void cacheChengTaiUnderwritingRequest(ChengTaiUnderwritingRequest chengTaiUnderwritingRequest, String ordersNo) {
+        String response = JSONObject.toJSONString(chengTaiUnderwritingRequest);
+        RBucket<String> bucket = redissonClient.getBucket(CHENGTAI_SAVE + ordersNo);
+        bucket.set(response, CHENGTAISAVE_TIME);
+    }
+
+    /**
+     * 获取诚泰财险订单保存数据
+     *
+     * @param ordersNo 订单号
+     */
+    public ChengTaiUnderwritingRequest getChengTaiUnderwritingRequest(String ordersNo) {
+        RBucket<String> bucket = redissonClient.getBucket(CHENGTAI_SAVE + ordersNo);
+        return JSON.parseObject(bucket.get(), ChengTaiUnderwritingRequest.class);
+    }
+
+}

+ 38 - 5
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/component/ChengTaiRequestCrawlerComponent.java

@@ -3,6 +3,7 @@ package com.jzg.quotation.chengtai.crawler.component;
 import com.jzg.commons.entity.quote.vo.CarInfoVo;
 import com.jzg.commons.entity.quote.vo.CustomerInfoVo;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
+import com.jzg.commons.entity.quote.vo.image.InsuranceImageVo;
 import com.jzg.commons.exception.SystemException;
 import com.jzg.quotation.chengtai.crawler.client.ChengTaiAPI;
 import com.jzg.quotation.chengtai.crawler.entity.bo.ChengTaiSaleInfoBo;
@@ -12,11 +13,15 @@ import com.jzg.quotation.chengtai.crawler.properties.ChengTaiCrawlerProperties;
 import com.jzg.quotation.chengtai.crawler.utils.CarDepreciationCalculator;
 import com.jzg.quotation.commons.component.RequestComponent;
 import com.jzg.quotation.commons.filter.CarModelsFilterUtils;
+import com.jzg.quotation.commons.utils.TimeProcessing;
 import lombok.RequiredArgsConstructor;
 import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.core.io.ByteArrayResource;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Component;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
 
 import java.text.MessageFormat;
 import java.util.List;
@@ -130,7 +135,7 @@ public class ChengTaiRequestCrawlerComponent {
         List<ChengTaiFindSaleManVoByDeptCodeResponse> response = requestPost(ChengTaiAPI.FIND_SALE_MAN_VO_BY_DEPT_CODE, request, new ParameterizedTypeReference<>() {
         }, httpHeaders);
         return response.stream()
-                .filter(x -> userCode.equals(x.getUserCode()))
+                .filter(deptCodeResponse -> userCode.equals(deptCodeResponse.getUserCode()))
                 .findFirst()
                 .orElseThrow(() -> new SystemException("获取归属机构下的业务员失败"));
     }
@@ -214,9 +219,13 @@ public class ChengTaiRequestCrawlerComponent {
      * @param httpHeaders 请求头
      * @return 获取特别约定响应
      */
-    public ChengTaiGetEngageListResponse getEngageList(ChengTaiGetEngageListRequest request, HttpHeaders httpHeaders) {
-        return requestPost(ChengTaiAPI.GET_ENGAGE_LIST, request, new ParameterizedTypeReference<>() {
+    public List<ChengTaiGetEngageListResponse.ResponseBodyDTO.EngageListDTO> getEngageList(ChengTaiGetEngageListRequest request, HttpHeaders httpHeaders) {
+        ChengTaiGetEngageListResponse response = requestPost(ChengTaiAPI.GET_ENGAGE_LIST, request, new ParameterizedTypeReference<>() {
         }, httpHeaders);
+        List<ChengTaiGetEngageListResponse.ResponseBodyDTO.EngageListDTO> engage = response.getResponseBody().getEngageList();
+        return engage.stream()
+                .filter(x -> "1".equals(x.getAutoInd()))
+                .toList();
     }
 
     /**
@@ -231,6 +240,31 @@ public class ChengTaiRequestCrawlerComponent {
         }, httpHeaders);
     }
 
+    /**
+     * 上传影像
+     *
+     * @param zipFile     zip字节
+     * @param list        图片列表
+     * @param httpHeaders 请求头
+     */
+    public ChengTaiImageUploadResponse imageUpload(byte[] zipFile, String businessNo, List<InsuranceImageVo.ImageDTO> list, HttpHeaders httpHeaders) {
+        MultiValueMap<String, Object> multiValueMap = new LinkedMultiValueMap<>();
+        // 添加二进制文件
+        ByteArrayResource fileResource = new ByteArrayResource(zipFile) {
+            @Override
+            public String getFilename() {
+                return TimeProcessing.nowDateTime() + ".zip"; // 必须重写此方法
+            }
+        };
+
+        multiValueMap.set("files", fileResource);
+        ChengTaiImageUploadRequest chengTaiImageUploadRequest = new ChengTaiImageUploadRequest(businessNo, list);
+        multiValueMap.set("uploadVo", chengTaiImageUploadRequest);
+
+        ResponseEntity<ChengTaiImageUploadResponse> chengTaiImageUploadResponseResponseEntity = requestComponent.formData(ChengTaiAPI.IMAGE_UPLOAD.getRequestUrl(chengTaiCrawlerProperties.getBaseUrl()), multiValueMap, ChengTaiImageUploadResponse.class, httpHeaders);
+        return chengTaiImageUploadResponseResponseEntity.getBody();
+    }
+
     /**
      * 提交核保
      *
@@ -261,8 +295,6 @@ public class ChengTaiRequestCrawlerComponent {
                 .orElseThrow(() -> new SystemException("支付链接获取失败"));
     }
 
-
-
     /**
      * 查询订单状态
      *
@@ -293,4 +325,5 @@ public class ChengTaiRequestCrawlerComponent {
         }, httpHeaders);
     }
 
+
 }

+ 62 - 1
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/entity/request/ChengTaiGetEngageListRequest.java

@@ -1,6 +1,8 @@
 package com.jzg.quotation.chengtai.crawler.entity.request;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.jzg.quotation.chengtai.crawler.entity.response.ChengTaiPremiumcaResponse;
+import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
@@ -35,67 +37,119 @@ public class ChengTaiGetEngageListRequest implements Serializable {
     @JsonProperty("deptCode")
     private String deptCode;
 
+    public ChengTaiGetEngageListRequest(ChengTaiPremiumcaRequest request) {
+        this.businessType = "1";
+        this.engageType = request.getInsuredObject().getPolicyCar().getEnergyTypes();
+        this.issueDate = request.getBusinessMain().getIssueDate();
+        this.submitDate = request.getBusinessMain().getIssueDate();
+        this.businessData = new BusinessDataDTO(request);
+        this.dynamicPlaceholder = new DynamicPlaceholderDTO();
+        this.deptCode = request.getInsuredObject().getPolicyCar().getDeptCode();
+    }
+
     @NoArgsConstructor
     @Data
     public static class BusinessDataDTO {
+
         @JsonProperty("main")
         private MainDTO main;
+
         @JsonProperty("insured")
         private InsuredDTO insured;
+
         @JsonProperty("carInfo")
         private CarInfoDTO carInfo;
 
-        @NoArgsConstructor
+        public BusinessDataDTO(ChengTaiPremiumcaRequest request) {
+            ChengTaiPremiumcaRequest.InsuredObjectDTO.PolicyCarDTO policyCar = request.getInsuredObject().getPolicyCar();
+            this.carInfo = new CarInfoDTO(policyCar.getNewCarSign(), policyCar.getPlateNo(), policyCar.getUseNatureCode(), policyCar.getCarKindCode(), policyCar.getLoanVehicleFlag(), policyCar.getApprovedPassengersCapacity());
+            this.insured = new InsuredDTO(request.getInsured().getIdentifyNumber(), request.getOwner().getIdentifyNumber());
+            this.main = new MainDTO();
+        }
+
+        @AllArgsConstructor
         @Data
         public static class MainDTO {
+
             @JsonProperty("companyCode")
             private String companyCode;
+
             @JsonProperty("riskCode")
             private String riskCode;
+
             @JsonProperty("systemCode")
             private String systemCode;
+
             @JsonProperty("combInd")
             private String combInd;
+
             @JsonProperty("periodInd")
             private Integer periodInd;
+
             @JsonProperty("isVehicleDamage")
             private Integer isVehicleDamage;
+
             @JsonProperty("isThirdParty")
             private Integer isThirdParty;
+
             @JsonProperty("isNewEquipment")
             private Integer isNewEquipment;
+
             @JsonProperty("isRoadRescue")
             private Integer isRoadRescue;
+
             @JsonProperty("isSafetyMonitoring")
             private Integer isSafetyMonitoring;
+
             @JsonProperty("isValetDriving")
             private Integer isValetDriving;
+
             @JsonProperty("isToInspection")
             private Integer isToInspection;
+
+            public MainDTO() {
+                this.isVehicleDamage = 0;
+                this.isThirdParty = 0;
+                this.isNewEquipment = 0;
+                this.isRoadRescue = 0;
+                this.isSafetyMonitoring = 0;
+                this.isValetDriving = 0;
+                this.isToInspection = 0;
+            }
         }
 
+        @AllArgsConstructor
         @NoArgsConstructor
         @Data
         public static class InsuredDTO {
+
             @JsonProperty("insuredIdentifyNo")
             private String insuredIdentifyNo;
+
             @JsonProperty("ownerIdentifyNo")
             private String ownerIdentifyNo;
         }
 
+        @AllArgsConstructor
         @NoArgsConstructor
         @Data
         public static class CarInfoDTO {
+
             @JsonProperty("isNew")
             private String isNew;
+
             @JsonProperty("licenseNo")
             private String licenseNo;
+
             @JsonProperty("useType")
             private String useType;
+
             @JsonProperty("carKindCode")
             private String carKindCode;
+
             @JsonProperty("isLoanVehicle")
             private String isLoanVehicle;
+
             @JsonProperty("capacity")
             private Integer capacity;
         }
@@ -104,18 +158,25 @@ public class ChengTaiGetEngageListRequest implements Serializable {
     @NoArgsConstructor
     @Data
     public static class DynamicPlaceholderDTO {
+
         @JsonProperty("startDate")
         private String startDate;
+
         @JsonProperty("endDate")
         private String endDate;
+
         @JsonProperty("premiumNoTax")
         private Double premiumNoTax;
+
         @JsonProperty("tax")
         private Double tax;
+
         @JsonProperty("owner")
         private String owner;
+
         @JsonProperty("relationWithCar")
         private String relationWithCar;
+
         @JsonProperty("realUseType")
         private String realUseType;
     }

+ 13 - 0
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/entity/request/ChengTaiImageUploadRequest.java

@@ -1,11 +1,13 @@
 package com.jzg.quotation.chengtai.crawler.entity.request;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.jzg.commons.entity.quote.vo.image.InsuranceImageVo;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
 import java.io.Serial;
 import java.io.Serializable;
+import java.util.ArrayList;
 import java.util.List;
 
 @NoArgsConstructor
@@ -26,4 +28,15 @@ public class ChengTaiImageUploadRequest implements Serializable {
 
     @JsonProperty("imgNames")
     private List<String> imgNames;
+
+    public ChengTaiImageUploadRequest(String businessNo, List<InsuranceImageVo.ImageDTO> list) {
+        this.businessNo = businessNo;
+        this.isCarNew = "0";
+        this.appCode = "CAR01";
+        this.imgNames = new ArrayList<>();
+        for (InsuranceImageVo.ImageDTO imageDTO : list) {
+            this.imgNames.add(imageDTO.getImageName());
+        }
+
+    }
 }

+ 138 - 9
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/entity/request/ChengTaiPremiumcaRequest.java

@@ -120,60 +120,105 @@ public class ChengTaiPremiumcaRequest implements Serializable {
     @NoArgsConstructor
     @Data
     public static class BusinessMainDTO {
+
         @JsonProperty("operatorCode")
         private String operatorCode;
+
         @JsonProperty("operatorName")
         private String operatorName;
+
         @JsonProperty("operateDate")
         private String operateDate;
+
         @JsonProperty("issueDate")
         private String issueDate;
+
         @JsonProperty("inputDate")
         private String inputDate;
+
         @JsonProperty("language")
         private String language;
+
         @JsonProperty("moneySuspiciousInd")
         private String moneySuspiciousInd;
+
         @JsonProperty("codInd")
         private String codInd;
+
         @JsonProperty("argueSolution")
         private String argueSolution;
+
         @JsonProperty("relateTradeType")
         private String relateTradeType;
+
         @JsonProperty("issueCompany")
         private String issueCompany;
+
         @JsonProperty("issueCompanyName")
         private String issueCompanyName;
+
         @JsonProperty("resourceType")
         private String resourceType;
+
         @JsonProperty("businessType")
         private String businessType;
+
         @JsonProperty("smsCheckFlag")
         private String smsCheckFlag;
+
         @JsonProperty("isTerror")
         private String isTerror;
+
         @JsonProperty("planCode")
         private String planCode;
+
         @JsonProperty("smsCodeFlag")
         private String smsCodeFlag;
+
         @JsonProperty("registerWay")
         private String registerWay;
+
         @JsonProperty("carmodel")
         private String carmodel;
+
         @JsonProperty("isCarReform")
         private String isCarReform;
+
         @JsonProperty("cashBusiness")
         private String cashBusiness;
+
         @JsonProperty("publicChanged")
         private Boolean publicChanged;
+
         @JsonProperty("biChanged")
         private Boolean biChanged;
+
         @JsonProperty("ciChanged")
         private Boolean ciChanged;
+
         @JsonProperty("carRegistFlag")
         private String carRegistFlag;
+
         @JsonProperty("biConfigAutoFlag")
         private String biConfigAutoFlag;
+        // start save 添加的字段
+        @JsonProperty("blackId")
+        private String blackId;
+
+        @JsonProperty("ocftId")
+        private String ocftId;
+        // end save
+
+        // start submit 添加的字段
+        @JsonProperty("uuid")
+        private String uuid;
+
+        @JsonProperty("id")
+        private String id;
+
+        @JsonProperty("paymentmark")
+        private String paymentmark;
+        // end submit
 
         public BusinessMainDTO(SaleInfoDTO saleInfoDTO, String planCode) {
             this.operatorCode = saleInfoDTO.getUserCode();
@@ -245,6 +290,15 @@ public class ChengTaiPremiumcaRequest implements Serializable {
         private String userCode;
         @JsonProperty("userName")
         private String userName;
+
+        // start submit 添加的参数
+        @JsonProperty("id")
+        private String id;
+        @JsonProperty("orderId")
+        private String orderId;
+        @JsonProperty("dateType")
+        private String dateType;
+        // end submit
     }
 
     @NoArgsConstructor
@@ -387,6 +441,22 @@ public class ChengTaiPremiumcaRequest implements Serializable {
             @JsonProperty("cimodelclass")
             private String cimodelclass;
 
+            // start save 添加的参数
+            @JsonProperty("ciCarKind")
+            private String ciCarKind;
+
+            @JsonProperty("highRiskHit")
+            private String highRiskHit;
+            // end save
+
+            // start submit 添加的参数
+            @JsonProperty("id")
+            private String id;
+
+            @JsonProperty("orderId")
+            private String orderId;
+            // end 参数
+
             public PolicyCarDTO(CarInfoVo carInfoVo, CarDepreciationCalculator.DepreciationResult depreciationResult, ChengTaiFindCarModelResponse.DataDTO carModel, ChengTaiGetCIModelCodeResponse ciModelCode) {
 
                 this.vhlInfoType = "1";
@@ -540,6 +610,14 @@ public class ChengTaiPremiumcaRequest implements Serializable {
         @JsonProperty("comCode")
         private String comCode;
 
+        // start submit 添加的参数
+        @JsonProperty("id")
+        private String id;
+
+        @JsonProperty("orderId")
+        private String orderId;
+        // end 参数
+
         public PersonnelDTO(ChengTaiClientIdentifyResponse policyHolder) {
             this.type = policyHolder.getType();
             this.role = policyHolder.getRole();
@@ -606,6 +684,14 @@ public class ChengTaiPremiumcaRequest implements Serializable {
         @JsonProperty("longTerm")
         private String longTerm;
 
+        // start submit 添加的参数
+        @JsonProperty("id")
+        private String id;
+
+        @JsonProperty("orderId")
+        private String orderId;
+        // end 参数
+
         public OwnerDTO(CustomerInfoVo ownersInfo) {
             this.type = "1";
             this.role = "3";
@@ -815,18 +901,18 @@ public class ChengTaiPremiumcaRequest implements Serializable {
 
             public TaxDTO(ChengTaiClientIdentifyResponse policyHolder) {
                 this.taxConditionCode = "1N";
-                this.taxStartDate = taxStartDate;
-                this.taxEndDate = taxEndDate;
+                TimeProcessing.TimeFrame yearRange = TimeProcessing.getYearRange();
+                this.taxStartDate = yearRange.getStartTime();
+                this.taxEndDate = yearRange.getEndTime();
                 this.calculateMode = "1";
-                this.taxPayerIdentityType = taxPayerIdentityType;
-                this.taxPayerIdentityNo = taxPayerIdentityNo;
-                this.taxPayerIdentificationCode = taxPayerIdentificationCode;
-                this.taxPayerName = taxPayerName;
-                this.lastPaidYear = lastPaidYear;
-                this.unladenMass = unladenMass;
+                this.taxPayerIdentityType = policyHolder.getType();
+                this.taxPayerIdentityNo = policyHolder.getIdentifyNumber();
+                this.taxPayerIdentificationCode = policyHolder.getIdentifyNumber();
+                this.taxPayerName = policyHolder.getName();
+                this.lastPaidYear = TimeProcessing.getLastYear();
+                this.unladenMass = "2025";
             }
 
-
         }
 
         @NoArgsConstructor
@@ -915,6 +1001,15 @@ public class ChengTaiPremiumcaRequest implements Serializable {
         @JsonProperty("type")
         private String type;
 
+        @JsonProperty("proposalNo")
+        private String proposalNo;
+
+        @JsonProperty("underWriteInd")
+        private String underWriteInd;
+
+        @JsonProperty("uuid")
+        private String uuid;
+
         @NoArgsConstructor
         @Data
         public static class CoveragesDTO {
@@ -991,6 +1086,30 @@ public class ChengTaiPremiumcaRequest implements Serializable {
         private String reinsuranceFlag;
         @JsonProperty("acciRelatedFlag")
         private String acciRelatedFlag;
+
+        @JsonProperty("sunlightId")
+        private String sunlightId;
+
+        @JsonProperty("uuid")
+        private String uuid;
+
+        @JsonProperty("contracts")
+        private List<String> contracts;
+
+        @JsonProperty("signStatus")
+        private String signStatus;
+
+        @JsonProperty("codInd")
+        private String codInd;
+
+        @JsonProperty("underWriteInd")
+        private String underWriteInd;
+
+        @JsonProperty("amlterrorFlag")
+        private String amlterrorFlag;
+
+        @JsonProperty("smscheckFlag")
+        private String smscheckFlag;
     }
 
     @NoArgsConstructor
@@ -1026,6 +1145,16 @@ public class ChengTaiPremiumcaRequest implements Serializable {
         private String cooperateSiteCode;
         @JsonProperty("cooperateSiteName")
         private String cooperateSiteName;
+
+        @JsonProperty("id")
+        private String id;
+
+        @JsonProperty("orderId")
+        private String orderId;
+
+        @JsonProperty("dateType")
+        private String dateType;
+
     }
 
 

+ 75 - 1212
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/entity/request/ChengTaiUnderwritingRequest.java

@@ -1,12 +1,20 @@
 package com.jzg.quotation.chengtai.crawler.entity.request;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.jzg.commons.util.ObjectUtil;
+import com.jzg.quotation.chengtai.crawler.entity.response.ChengTaiGetEngageListResponse;
+import com.jzg.quotation.chengtai.crawler.entity.response.ChengTaiPremiumcaResponse;
+import com.jzg.quotation.commons.utils.TimeProcessing;
 import lombok.Data;
 import lombok.NoArgsConstructor;
+import org.springframework.util.ObjectUtils;
 
 import java.io.Serial;
 import java.io.Serializable;
+import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+import java.util.Optional;
 
 @NoArgsConstructor
 @Data
@@ -22,1253 +30,108 @@ public class ChengTaiUnderwritingRequest implements Serializable {
     private ChengTaiPremiumcaRequest.FlagDTO flag;
 
     @JsonProperty("businessMain")
-    private BusinessMainDTO businessMain;
+    private ChengTaiPremiumcaRequest.BusinessMainDTO businessMain;
 
     @JsonProperty("saleInfo")
-    private SaleInfoDTO saleInfo;
+    private ChengTaiPremiumcaRequest.SaleInfoDTO saleInfo;
 
     @JsonProperty("insuredObject")
-    private InsuredObjectDTO insuredObject;
+    private ChengTaiPremiumcaRequest.InsuredObjectDTO insuredObject;
 
     @JsonProperty("applicant")
-    private ApplicantDTO applicant;
+    private ChengTaiPremiumcaRequest.PersonnelDTO applicant;
 
     @JsonProperty("insured")
-    private InsuredDTO insured;
+    private ChengTaiPremiumcaRequest.PersonnelDTO insured;
 
     @JsonProperty("owner")
-    private OwnerDTO owner;
+    private ChengTaiPremiumcaRequest.OwnerDTO owner;
 
     @JsonProperty("biContract")
-    private BiContractDTO biContract;
+    private ChengTaiPremiumcaResponse.BiContractDTO biContract;
 
     @JsonProperty("ciContract")
-    private CiContractDTO ciContract;
+    private ChengTaiPremiumcaResponse.CiContractDTO ciContract;
 
     @JsonProperty("accidentMain")
-    private AccidentMainDTO accidentMain;
+    private ChengTaiPremiumcaRequest.AccidentMainDTO accidentMain;
 
     @JsonProperty("accContract")
-    private AccContractDTO accContract;
+    private ChengTaiPremiumcaRequest.AccContractDTO accContract;
 
     @JsonProperty("submitReqBody")
-    private SubmitReqBodyDTO submitReqBody;
+    private ChengTaiPremiumcaRequest.SubmitReqBodyDTO submitReqBody;
 
     @JsonProperty("acciSaleInfo")
-    private AcciSaleInfoDTO acciSaleInfo;
+    private ChengTaiPremiumcaRequest.AcciSaleInfoDTO acciSaleInfo;
 
     @JsonProperty("sunlightId")
     private String sunlightId;
 
     @JsonProperty("yztScore")
-    private YztScoreDTO yztScore;
+    private ChengTaiPremiumcaResponse.YztScoreDTO yztScore;
 
     @JsonProperty("ocftId")
     private String ocftId;
 
-    @NoArgsConstructor
-    @Data
-    public static class BusinessMainDTO {
+    private List<ChengTaiPremiumcaResponse.EngageDTO> createAndPopulateEngageList(String riskCode, Map<String, List<ChengTaiGetEngageListResponse.ResponseBodyDTO.EngageListDTO>> engageMap) {
+        // 1. 从共享数据源获取原始列表
+        List<ChengTaiGetEngageListResponse.ResponseBodyDTO.EngageListDTO> engageListDTOS = engageMap.get(riskCode);
+        List<ChengTaiPremiumcaResponse.EngageDTO> engageDTOS = new ArrayList<>();
 
-        @JsonProperty("uuid")
-        private String uuid;
-
-        @JsonProperty("operatorCode")
-        private String operatorCode;
-
-        @JsonProperty("operatorName")
-        private String operatorName;
-
-        @JsonProperty("operateDate")
-        private String operateDate;
-
-        @JsonProperty("issueDate")
-        private String issueDate;
-
-        @JsonProperty("inputDate")
-        private String inputDate;
-
-        @JsonProperty("language")
-        private String language;
-
-        @JsonProperty("moneySuspiciousInd")
-        private String moneySuspiciousInd;
-
-        @JsonProperty("codInd")
-        private String codInd;
-
-        @JsonProperty("argueSolution")
-        private String argueSolution;
-
-        @JsonProperty("relateTradeType")
-        private String relateTradeType;
-
-        @JsonProperty("issueCompany")
-        private String issueCompany;
-
-        @JsonProperty("issueCompanyName")
-        private String issueCompanyName;
-
-        @JsonProperty("resourceType")
-        private String resourceType;
-
-        @JsonProperty("businessType")
-        private String businessType;
-
-        @JsonProperty("smsCheckFlag")
-        private String smsCheckFlag;
-
-        @JsonProperty("isTerror")
-        private String isTerror;
-
-        @JsonProperty("id")
-        private String id;
-
-        @JsonProperty("planCode")
-        private String planCode;
-
-        @JsonProperty("smsCodeFlag")
-        private String smsCodeFlag;
-
-        @JsonProperty("registerWay")
-        private String registerWay;
-
-        @JsonProperty("paymentmark")
-        private String paymentmark;
-
-        @JsonProperty("carmodel")
-        private String carmodel;
-
-        @JsonProperty("isCarReform")
-        private String isCarReform;
-
-        @JsonProperty("cashBusiness")
-        private String cashBusiness;
-
-        @JsonProperty("publicChanged")
-        private Boolean publicChanged;
-
-        @JsonProperty("biChanged")
-        private Boolean biChanged;
-
-        @JsonProperty("ciChanged")
-        private Boolean ciChanged;
-
-        @JsonProperty("carRegistFlag")
-        private String carRegistFlag;
-
-        @JsonProperty("rulesList")
-        private List<RulesListDTO> rulesList;
-
-        @JsonProperty("biConfigAutoFlag")
-        private String biConfigAutoFlag;
-        @JsonProperty("blackId")
-        private String blackId;
-        @JsonProperty("ocftId")
-        private String ocftId;
-
-        @NoArgsConstructor
-        @Data
-        public static class RulesListDTO {
-            @JsonProperty("authorityLevel")
-            private String authorityLevel;
-            @JsonProperty("dataType")
-            private String dataType;
-            @JsonProperty("reasondescription")
-            private String reasondescription;
-            @JsonProperty("ruleSetName")
-            private String ruleSetName;
-            @JsonProperty("riskCode")
-            private String riskCode;
-            @JsonProperty("finalRuleResult")
-            private String finalRuleResult;
+        int serialNumber = 1; // 变量名更语义化
+        // 2. 遍历转换每个对象并设置序列号
+        for (ChengTaiGetEngageListResponse.ResponseBodyDTO.EngageListDTO engageListDTO : engageListDTOS) {
+            ChengTaiPremiumcaResponse.EngageDTO engageDTO = new ChengTaiPremiumcaResponse.EngageDTO(engageListDTO);
+            engageDTO.setSerialNo(serialNumber);
+            serialNumber += 1; // 或 serialNumber++
+            engageDTOS.add(engageDTO);
         }
+        return engageDTOS;
     }
 
-    @NoArgsConstructor
-    @Data
-    public static class SaleInfoDTO {
-        @JsonProperty("businessMode")
-        private String businessMode;
-        @JsonProperty("businessSource")
-        private String businessSource;
-        @JsonProperty("comCode")
-        private String comCode;
-        @JsonProperty("comName")
-        private String comName;
-        @JsonProperty("channelType")
-        private String channelType;
-        @JsonProperty("agreementNo")
-        private String agreementNo;
-        @JsonProperty("agreementNoName")
-        private String agreementNoName;
-        @JsonProperty("agentCode")
-        private String agentCode;
-        @JsonProperty("agentName")
-        private String agentName;
-        @JsonProperty("solutionCode")
-        private String solutionCode;
-        @JsonProperty("permitNo")
-        private String permitNo;
-        @JsonProperty("channelTypeDetail")
-        private String channelTypeDetail;
-        @JsonProperty("handlerCode")
-        private String handlerCode;
-        @JsonProperty("handlerName")
-        private String handlerName;
-        @JsonProperty("cooperateSiteCode")
-        private String cooperateSiteCode;
-        @JsonProperty("cooperateSiteName")
-        private String cooperateSiteName;
-        @JsonProperty("id")
-        private String id;
-        @JsonProperty("orderId")
-        private String orderId;
-        @JsonProperty("userCode")
-        private String userCode;
-        @JsonProperty("userName")
-        private String userName;
-        @JsonProperty("dateType")
-        private String dateType;
+    public ChengTaiUnderwritingRequest(ChengTaiPremiumcaRequest request, ChengTaiPremiumcaResponse response,
+                                       Map<String, List<ChengTaiGetEngageListResponse.ResponseBodyDTO.EngageListDTO>> engageMap) {
+        this.combo = request.getCombo();
+        this.flag = request.getFlag();
+        // businessMain
+        this.businessMain = request.getBusinessMain();
+        this.businessMain.setIssueDate(TimeProcessing.nowDate());
+        this.businessMain.setBlackId(response.getBlackId());
+        this.businessMain.setOcftId(response.getOcftId());
+
+        this.saleInfo = request.getSaleInfo();
+        this.insuredObject = request.getInsuredObject();
+        this.insuredObject.getPolicyCar().setHighRiskHit(response.getRiskIdentifyInfo().getHighRiskHit());
+
+        if (!ObjectUtils.isEmpty(response.getCiContract())) {
+            this.insuredObject.getPolicyCar().setCiCarKind(response.getCiContract().getPlatFormMessage().getCiCarKind());
+        } else {
+            this.insuredObject.getPolicyCar().setCiCarKind(response.getBiContract().getPlatFormMessage().getCiCarKind());
+        }
+
+        this.applicant = request.getApplicant();
+        this.insured = request.getInsured();
+        this.owner = request.getOwner();
+        if (ObjectUtils.isEmpty(response.getBiContract())) {
+            this.biContract = response.getBiContract();
+            List<ChengTaiPremiumcaResponse.EngageDTO> engageBiDTOS = createAndPopulateEngageList(this.biContract.getContractMain().getRiskCode(), engageMap);
+            this.biContract.setEngage(engageBiDTOS);
+        }
+        if (ObjectUtils.isEmpty(response.getCiContract())) {
+            this.ciContract = response.getCiContract();
+            List<ChengTaiPremiumcaResponse.EngageDTO> engageCiDTOS = createAndPopulateEngageList(this.ciContract.getContractMain().getRiskCode(), engageMap);
+            this.ciContract.setEngage(engageCiDTOS);
+        }
+
+        this.accidentMain = request.getAccidentMain();
+        this.submitReqBody = request.getSubmitReqBody();
+        this.submitReqBody.setSunlightId(response.getSunlightId());
+
+        this.sunlightId = response.getSunlightId();
+        this.acciSaleInfo = request.getAcciSaleInfo();
+        this.yztScore = response.getYztScore();
+        this.ocftId = response.getOcftId();
     }
 
-    @NoArgsConstructor
-    @Data
-    public static class InsuredObjectDTO {
-        @JsonProperty("policyCar")
-        private PolicyCarDTO policyCar;
-
-        @NoArgsConstructor
-        @Data
-        public static class PolicyCarDTO {
-            @JsonProperty("vhlInfoType")
-            private String vhlInfoType;
-            @JsonProperty("plateNo")
-            private String plateNo;
-            @JsonProperty("vin")
-            private String vin;
-            @JsonProperty("engine")
-            private String engine;
-            @JsonProperty("noLicenseFlag")
-            private String noLicenseFlag;
-            @JsonProperty("brandName")
-            private String brandName;
-            @JsonProperty("modelCode")
-            private String modelCode;
-            @JsonProperty("printBrandName")
-            private String printBrandName;
-            @JsonProperty("registerDate")
-            private String registerDate;
-            @JsonProperty("issueDate")
-            private String issueDate;
-            @JsonProperty("enrollDate")
-            private String enrollDate;
-            @JsonProperty("transferMark")
-            private String transferMark;
-            @JsonProperty("carKindCode")
-            private String carKindCode;
-            @JsonProperty("carKindName")
-            private String carKindName;
-            @JsonProperty("useNatureCode")
-            private String useNatureCode;
-            @JsonProperty("useNatureName")
-            private String useNatureName;
-            @JsonProperty("attachNature")
-            private String attachNature;
-            @JsonProperty("attachNatureName")
-            private String attachNatureName;
-            @JsonProperty("purchasePrice")
-            private Integer purchasePrice;
-            @JsonProperty("orignPurchasePrice")
-            private Integer orignPurchasePrice;
-            @JsonProperty("actualValue")
-            private Integer actualValue;
-            @JsonProperty("consultValue")
-            private Integer consultValue;
-            @JsonProperty("plateType")
-            private String plateType;
-            @JsonProperty("plateTypeName")
-            private String plateTypeName;
-            @JsonProperty("vehicleType")
-            private String vehicleType;
-            @JsonProperty("vehicleTypeName")
-            private String vehicleTypeName;
-            @JsonProperty("energyTypes")
-            private String energyTypes;
-            @JsonProperty("carCheckStatus")
-            private String carCheckStatus;
-            @JsonProperty("carCheckReason")
-            private String carCheckReason;
-            @JsonProperty("carCheckReasonName")
-            private String carCheckReasonName;
-            @JsonProperty("approvedPassengersCapacity")
-            private Integer approvedPassengersCapacity;
-            @JsonProperty("approvedLoad")
-            private Integer approvedLoad;
-            @JsonProperty("power")
-            private Double power;
-            @JsonProperty("displacement")
-            private Integer displacement;
-            @JsonProperty("exhaustScaleUnit")
-            private String exhaustScaleUnit;
-            @JsonProperty("loanVehicleFlag")
-            private String loanVehicleFlag;
-            @JsonProperty("ecdemicVehicleFlag")
-            private String ecdemicVehicleFlag;
-            @JsonProperty("deptCode")
-            private String deptCode;
-            @JsonProperty("deptName")
-            private String deptName;
-            @JsonProperty("useYears")
-            private String useYears;
-            @JsonProperty("seriesCode")
-            private String seriesCode;
-            @JsonProperty("series")
-            private String series;
-            @JsonProperty("seriesType")
-            private String seriesType;
-            @JsonProperty("brandCode")
-            private String brandCode;
-            @JsonProperty("brand")
-            private String brand;
-            @JsonProperty("shortHandCode")
-            private String shortHandCode;
-            @JsonProperty("vehicleKindCode")
-            private String vehicleKindCode;
-            @JsonProperty("carName")
-            private String carName;
-            @JsonProperty("monthDepRate")
-            private Double monthDepRate;
-            @JsonProperty("matchCiModelCode")
-            private String matchCiModelCode;
-            @JsonProperty("unladenMass")
-            private String unladenMass;
-            @JsonProperty("ciModelCode")
-            private String ciModelCode;
-            @JsonProperty("noticeType")
-            private String noticeType;
-            @JsonProperty("ciCarKind")
-            private String ciCarKind;
-            @JsonProperty("newCarSign")
-            private String newCarSign;
-            @JsonProperty("runArea")
-            private String runArea;
-            @JsonProperty("runAreaName")
-            private String runAreaName;
-            @JsonProperty("factoryName")
-            private String factoryName;
-            @JsonProperty("carTypeCode")
-            private String carTypeCode;
-            @JsonProperty("countryNature")
-            private String countryNature;
-            @JsonProperty("id")
-            private String id;
-            @JsonProperty("orderId")
-            private String orderId;
-            @JsonProperty("isEnergy")
-            private String isEnergy;
-            @JsonProperty("fraud")
-            private String fraud;
-            @JsonProperty("endorTransferMark")
-            private String endorTransferMark;
-            @JsonProperty("highRiskHit")
-            private String highRiskHit;
-            @JsonProperty("cimodelclass")
-            private String cimodelclass;
-        }
-    }
-
-    @NoArgsConstructor
-    @Data
-    public static class ApplicantDTO {
-        @JsonProperty("type")
-        private String type;
-        @JsonProperty("role")
-        private String role;
-        @JsonProperty("isTerror")
-        private String isTerror;
-        @JsonProperty("customerId")
-        private String customerId;
-        @JsonProperty("name")
-        private String name;
-        @JsonProperty("identifyTypeCode")
-        private String identifyTypeCode;
-        @JsonProperty("identifyTypeName")
-        private String identifyTypeName;
-        @JsonProperty("identifyNumber")
-        private String identifyNumber;
-        @JsonProperty("province")
-        private String province;
-        @JsonProperty("city")
-        private String city;
-        @JsonProperty("district")
-        private String district;
-        @JsonProperty("provinceName")
-        private String provinceName;
-        @JsonProperty("cityName")
-        private String cityName;
-        @JsonProperty("districtName")
-        private String districtName;
-        @JsonProperty("addr")
-        private String addr;
-        @JsonProperty("completeAddress")
-        private String completeAddress;
-        @JsonProperty("mobile")
-        private String mobile;
-        @JsonProperty("specialClient")
-        private String specialClient;
-        @JsonProperty("identifyValidDate")
-        private String identifyValidDate;
-        @JsonProperty("identifyValidEndDate")
-        private String identifyValidEndDate;
-        @JsonProperty("sex")
-        private String sex;
-        @JsonProperty("birthday")
-        private String birthday;
-        @JsonProperty("operateFlag")
-        private String operateFlag;
-        @JsonProperty("id")
-        private String id;
-        @JsonProperty("longTerm")
-        private String longTerm;
-        @JsonProperty("terrorNationality")
-        private String terrorNationality;
-        @JsonProperty("terrorNationalityName")
-        private String terrorNationalityName;
-        @JsonProperty("isPolitics")
-        private String isPolitics;
-        @JsonProperty("individualBusinessInd")
-        private String individualBusinessInd;
-        @JsonProperty("microBusinessesInd")
-        private String microBusinessesInd;
-        @JsonProperty("signedbyOrig")
-        private String signedbyOrig;
-        @JsonProperty("comCode")
-        private String comCode;
-        @JsonProperty("orderId")
-        private String orderId;
-    }
-
-    @NoArgsConstructor
-    @Data
-    public static class InsuredDTO {
-        @JsonProperty("type")
-        private String type;
-        @JsonProperty("role")
-        private String role;
-        @JsonProperty("sameType")
-        private String sameType;
-        @JsonProperty("isTerror")
-        private String isTerror;
-        @JsonProperty("customerId")
-        private String customerId;
-        @JsonProperty("name")
-        private String name;
-        @JsonProperty("identifyTypeCode")
-        private String identifyTypeCode;
-        @JsonProperty("identifyTypeName")
-        private String identifyTypeName;
-        @JsonProperty("identifyNumber")
-        private String identifyNumber;
-        @JsonProperty("province")
-        private String province;
-        @JsonProperty("city")
-        private String city;
-        @JsonProperty("district")
-        private String district;
-        @JsonProperty("provinceName")
-        private String provinceName;
-        @JsonProperty("cityName")
-        private String cityName;
-        @JsonProperty("districtName")
-        private String districtName;
-        @JsonProperty("addr")
-        private String addr;
-        @JsonProperty("completeAddress")
-        private String completeAddress;
-        @JsonProperty("relationWithInsured")
-        private String relationWithInsured;
-        @JsonProperty("relationWithCar")
-        private String relationWithCar;
-        @JsonProperty("mobile")
-        private String mobile;
-        @JsonProperty("specialClient")
-        private String specialClient;
-        @JsonProperty("identifyValidDate")
-        private String identifyValidDate;
-        @JsonProperty("identifyValidEndDate")
-        private String identifyValidEndDate;
-        @JsonProperty("sex")
-        private String sex;
-        @JsonProperty("birthday")
-        private String birthday;
-        @JsonProperty("operateFlag")
-        private String operateFlag;
-        @JsonProperty("id")
-        private String id;
-        @JsonProperty("longTerm")
-        private String longTerm;
-        @JsonProperty("terrorNationality")
-        private String terrorNationality;
-        @JsonProperty("terrorNationalityName")
-        private String terrorNationalityName;
-        @JsonProperty("isPolitics")
-        private String isPolitics;
-        @JsonProperty("individualBusinessInd")
-        private String individualBusinessInd;
-        @JsonProperty("microBusinessesInd")
-        private String microBusinessesInd;
-        @JsonProperty("comCode")
-        private String comCode;
-        @JsonProperty("orderId")
-        private String orderId;
-    }
-
-    @NoArgsConstructor
-    @Data
-    public static class OwnerDTO {
-        @JsonProperty("type")
-        private String type;
-        @JsonProperty("role")
-        private String role;
-        @JsonProperty("sameType")
-        private String sameType;
-        @JsonProperty("name")
-        private String name;
-        @JsonProperty("identifyTypeCode")
-        private String identifyTypeCode;
-        @JsonProperty("identifyTypeName")
-        private String identifyTypeName;
-        @JsonProperty("identifyNumber")
-        private String identifyNumber;
-        @JsonProperty("sex")
-        private String sex;
-        @JsonProperty("age")
-        private Integer age;
-        @JsonProperty("birthday")
-        private String birthday;
-        @JsonProperty("id")
-        private String id;
-        @JsonProperty("identifyValidDate")
-        private String identifyValidDate;
-        @JsonProperty("identifyValidEndDate")
-        private String identifyValidEndDate;
-        @JsonProperty("longTerm")
-        private String longTerm;
-        @JsonProperty("orderId")
-        private String orderId;
-    }
-
-    @NoArgsConstructor
-    @Data
-    public static class BiContractDTO {
-        @JsonProperty("contractMain")
-        private ContractMainDTO contractMain;
-        @JsonProperty("coverage")
-        private List<CoverageDTO> coverage;
-        @JsonProperty("adjust")
-        private List<AdjustDTO> adjust;
-        @JsonProperty("discountInfo")
-        private DiscountInfoDTO discountInfo;
-        @JsonProperty("engage")
-        private List<EngageDTO> engage;
-        @JsonProperty("platFormMessage")
-        private PlatFormMessageDTO platFormMessage;
-
-        @NoArgsConstructor
-        @Data
-        public static class ContractMainDTO {
-            @JsonProperty("orderId")
-            private String orderId;
-            @JsonProperty("proposalNo")
-            private String proposalNo;
-            @JsonProperty("riskCode")
-            private String riskCode;
-            @JsonProperty("riskName")
-            private String riskName;
-            @JsonProperty("validAtOnce")
-            private String validAtOnce;
-            @JsonProperty("validDate")
-            private String validDate;
-            @JsonProperty("expiryDate")
-            private String expiryDate;
-            @JsonProperty("renewalFlag")
-            private String renewalFlag;
-            @JsonProperty("currency")
-            private String currency;
-            @JsonProperty("sumAmount")
-            private Integer sumAmount;
-            @JsonProperty("totalPremium")
-            private Double totalPremium;
-            @JsonProperty("noTaxPremium")
-            private Double noTaxPremium;
-            @JsonProperty("totalStandardPremium")
-            private Double totalStandardPremium;
-            @JsonProperty("totalRiskPremium")
-            private Double totalRiskPremium;
-            @JsonProperty("vat")
-            private Double vat;
-            @JsonProperty("discount")
-            private Double discount;
-            @JsonProperty("hopeDiscount")
-            private Double hopeDiscount;
-            @JsonProperty("querySequenceNo")
-            private String querySequenceNo;
-            @JsonProperty("querySeqExpireDate")
-            private String querySeqExpireDate;
-            @JsonProperty("underWriteInd")
-            private String underWriteInd;
-            @JsonProperty("othBusinessNo")
-            private String othBusinessNo;
-            @JsonProperty("hopeCoefficient")
-            private Double hopeCoefficient;
-            @JsonProperty("isCheckRepeated")
-            private String isCheckRepeated;
-            @JsonProperty("signStatus")
-            private String signStatus;
-            @JsonProperty("uuid")
-            private String uuid;
-        }
-
-        @NoArgsConstructor
-        @Data
-        public static class DiscountInfoDTO {
-            @JsonProperty("ctpCostPrem")
-            private Double ctpCostPrem;
-            @JsonProperty("entireExpDiscount")
-            private Double entireExpDiscount;
-            @JsonProperty("entireRecommenDiscount")
-            private Double entireRecommenDiscount;
-            @JsonProperty("entireUwritingDiscount")
-            private Integer entireUwritingDiscount;
-            @JsonProperty("billCtpElr")
-            private Double billCtpElr;
-            @JsonProperty("billComElr")
-            private Double billComElr;
-            @JsonProperty("billElr")
-            private Double billElr;
-            @JsonProperty("commissionFlag")
-            private String commissionFlag;
-            @JsonProperty("uwDiscFixed")
-            private String uwDiscFixed;
-            @JsonProperty("uwDiscLimit")
-            private String uwDiscLimit;
-            @JsonProperty("uwDiscFloor")
-            private String uwDiscFloor;
-            @JsonProperty("ctpCostPremFlag")
-            private String ctpCostPremFlag;
-            @JsonProperty("entireRawInitialDiscount")
-            private Double entireRawInitialDiscount;
-            @JsonProperty("entireInitialDiscount")
-            private Double entireInitialDiscount;
-            @JsonProperty("entireFloatDiscount")
-            private String entireFloatDiscount;
-            @JsonProperty("billComCommission")
-            private String billComCommission;
-            @JsonProperty("billComcor")
-            private String billComcor;
-            @JsonProperty("billCtpcor")
-            private String billCtpcor;
-            @JsonProperty("billCor")
-            private String billCor;
-            @JsonProperty("ncdBpremElr")
-            private String ncdBpremElr;
-            @JsonProperty("sunlightScore")
-            private String sunlightScore;
-            @JsonProperty("exceptionFlag")
-            private String exceptionFlag;
-            @JsonProperty("initialCtpElr")
-            private Double initialCtpElr;
-            @JsonProperty("initialComElr")
-            private Double initialComElr;
-            @JsonProperty("initialElr")
-            private Double initialElr;
-            @JsonProperty("effectInfoDTOList")
-            private List<EffectInfoDTOListDTO> effectInfoDTOList;
-            @JsonProperty("entireRecommenDiscount1")
-            private Integer entireRecommenDiscount1;
-            @JsonProperty("entireRecommenDiscount2")
-            private Integer entireRecommenDiscount2;
-            @JsonProperty("distributionDiscount")
-            private Double distributionDiscount;
-            @JsonProperty("distributionDiscount2")
-            private Double distributionDiscount2;
-            @JsonProperty("rawRecommenElr")
-            private Double rawRecommenElr;
-            @JsonProperty("rawRecommenElr1")
-            private Double rawRecommenElr1;
-            @JsonProperty("rawDistributionElr")
-            private Double rawDistributionElr;
-            @JsonProperty("rawDistributionElr1")
-            private Double rawDistributionElr1;
-            @JsonProperty("policyId")
-            private String policyId;
-            @JsonProperty("uwDiscount")
-            private String uwDiscount;
-
-            @NoArgsConstructor
-            @Data
-            public static class EffectInfoDTOListDTO {
-                @JsonProperty("effectName")
-                private String effectName;
-                @JsonProperty("effectValue")
-                private String effectValue;
-                @JsonProperty("effectinfo")
-                private String effectinfo;
-                @JsonProperty("effectCode")
-                private String effectCode;
-                @JsonProperty("id")
-                private String id;
-                @JsonProperty("policyId")
-                private String policyId;
-            }
-        }
-
-        @NoArgsConstructor
-        @Data
-        public static class PlatFormMessageDTO {
-            @JsonProperty("querySequenceNo")
-            private String querySequenceNo;
-            @JsonProperty("queryDate")
-            private String queryDate;
-            @JsonProperty("expireDate")
-            private String expireDate;
-            @JsonProperty("reinsuranceFlag")
-            private String reinsuranceFlag;
-            @JsonProperty("nonClaimAdjust")
-            private String nonClaimAdjust;
-            @JsonProperty("lastPolicyEffectiveDate")
-            private String lastPolicyEffectiveDate;
-            @JsonProperty("lastPolicyExpireDate")
-            private String lastPolicyExpireDate;
-            @JsonProperty("insureYears")
-            private String insureYears;
-            @JsonProperty("claimTimes")
-            private String claimTimes;
-            @JsonProperty("claimAdjustLevel")
-            private String claimAdjustLevel;
-            @JsonProperty("ciModelCode")
-            private String ciModelCode;
-            @JsonProperty("ciCarKind")
-            private String ciCarKind;
-            @JsonProperty("modelEnergyType")
-            private String modelEnergyType;
-            @JsonProperty("scoreCode")
-            private String scoreCode;
-            @JsonProperty("score")
-            private Integer score;
-            @JsonProperty("policyId")
-            private String policyId;
-        }
-
-        @NoArgsConstructor
-        @Data
-        public static class CoverageDTO {
-            @JsonProperty("amount")
-            private Integer amount;
-            @JsonProperty("basePremium")
-            private Double basePremium;
-            @JsonProperty("coveragePremium")
-            private Double coveragePremium;
-            @JsonProperty("calculateFlag")
-            private String calculateFlag;
-            @JsonProperty("ifMainKind")
-            private String ifMainKind;
-            @JsonProperty("kindCode")
-            private String kindCode;
-            @JsonProperty("kindFlag")
-            private Boolean kindFlag;
-            @JsonProperty("kindName")
-            private String kindName;
-            @JsonProperty("notDeductibleCalculateFlag")
-            private String notDeductibleCalculateFlag;
-            @JsonProperty("notDeductibleIfMainKind")
-            private String notDeductibleIfMainKind;
-            @JsonProperty("notDeductibleKindFlag")
-            private Boolean notDeductibleKindFlag;
-            @JsonProperty("relatedInd")
-            private String relatedInd;
-            @JsonProperty("validDate")
-            private String validDate;
-            @JsonProperty("expiryDate")
-            private String expiryDate;
-            @JsonProperty("currency")
-            private String currency;
-            @JsonProperty("coverageStandardPremium")
-            private Double coverageStandardPremium;
-            @JsonProperty("coveragePremiumNoTax")
-            private Double coveragePremiumNoTax;
-            @JsonProperty("coverageTax")
-            private Double coverageTax;
-            @JsonProperty("rate")
-            private Integer rate;
-            @JsonProperty("shortRate")
-            private Integer shortRate;
-            @JsonProperty("shortRateType")
-            private String shortRateType;
-            @JsonProperty("deductibleRate")
-            private Integer deductibleRate;
-            @JsonProperty("discount")
-            private Double discount;
-            @JsonProperty("costPrem")
-            private Double costPrem;
-            @JsonProperty("coverageRiskPremium")
-            private Double coverageRiskPremium;
-            @JsonProperty("show")
-            private Boolean show;
-            @JsonProperty("policyId")
-            private String policyId;
-            @JsonProperty("quantity")
-            private Integer quantity;
-            @JsonProperty("unitAmount")
-            private Integer unitAmount;
-        }
-
-        @NoArgsConstructor
-        @Data
-        public static class AdjustDTO {
-            @JsonProperty("adjustCode")
-            private String adjustCode;
-            @JsonProperty("adjustName")
-            private String adjustName;
-            @JsonProperty("adjustRate")
-            private Integer adjustRate;
-            @JsonProperty("maxRate")
-            private Integer maxRate;
-            @JsonProperty("minRate")
-            private Integer minRate;
-            @JsonProperty("policyId")
-            private String policyId;
-        }
-
-        @NoArgsConstructor
-        @Data
-        public static class EngageDTO {
-            @JsonProperty("engageCode")
-            private String engageCode;
-            @JsonProperty("engageTitle")
-            private String engageTitle;
-            @JsonProperty("engageDetail")
-            private String engageDetail;
-            @JsonProperty("modifyind")
-            private String modifyind;
-            @JsonProperty("chooseType")
-            private String chooseType;
-            @JsonProperty("deleteInd")
-            private String deleteInd;
-            @JsonProperty("serialNo")
-            private Integer serialNo;
-            @JsonProperty("policyId")
-            private String policyId;
-        }
-    }
-
-    @NoArgsConstructor
-    @Data
-    public static class CiContractDTO {
-        @JsonProperty("contractMain")
-        private ContractMainDTO contractMain;
-        @JsonProperty("coverage")
-        private List<CoverageDTO> coverage;
-        @JsonProperty("platFormMessage")
-        private PlatFormMessageDTO platFormMessage;
-        @JsonProperty("tax")
-        private TaxDTO tax;
-        @JsonProperty("engage")
-        private List<EngageDTO> engage;
-        @JsonProperty("adjust")
-        private List<AdjustDTO> adjust;
-
-        @NoArgsConstructor
-        @Data
-        public static class ContractMainDTO {
-            @JsonProperty("orderId")
-            private String orderId;
-            @JsonProperty("proposalNo")
-            private String proposalNo;
-            @JsonProperty("riskCode")
-            private String riskCode;
-            @JsonProperty("riskName")
-            private String riskName;
-            @JsonProperty("validAtOnce")
-            private String validAtOnce;
-            @JsonProperty("validDate")
-            private String validDate;
-            @JsonProperty("expiryDate")
-            private String expiryDate;
-            @JsonProperty("renewalFlag")
-            private String renewalFlag;
-            @JsonProperty("currency")
-            private String currency;
-            @JsonProperty("sumAmount")
-            private Integer sumAmount;
-            @JsonProperty("totalPremium")
-            private Integer totalPremium;
-            @JsonProperty("noTaxPremium")
-            private Double noTaxPremium;
-            @JsonProperty("totalStandardPremium")
-            private Integer totalStandardPremium;
-            @JsonProperty("totalRiskPremium")
-            private Integer totalRiskPremium;
-            @JsonProperty("vat")
-            private Double vat;
-            @JsonProperty("discount")
-            private Integer discount;
-            @JsonProperty("querySequenceNo")
-            private String querySequenceNo;
-            @JsonProperty("underWriteInd")
-            private String underWriteInd;
-            @JsonProperty("othBusinessNo")
-            private String othBusinessNo;
-            @JsonProperty("isCIFlag")
-            private String isCIFlag;
-            @JsonProperty("sumTax")
-            private Integer sumTax;
-            @JsonProperty("querySeqExpireDate")
-            private String querySeqExpireDate;
-            @JsonProperty("uuid")
-            private String uuid;
-            @JsonProperty("signStatus")
-            private String signStatus;
-        }
-
-        @NoArgsConstructor
-        @Data
-        public static class PlatFormMessageDTO {
-            @JsonProperty("querySequenceNo")
-            private String querySequenceNo;
-            @JsonProperty("expireDate")
-            private String expireDate;
-            @JsonProperty("reinsuranceFlag")
-            private String reinsuranceFlag;
-            @JsonProperty("lastPolicyEffectiveDate")
-            private String lastPolicyEffectiveDate;
-            @JsonProperty("lastPolicyExpireDate")
-            private String lastPolicyExpireDate;
-            @JsonProperty("ciCarKind")
-            private String ciCarKind;
-            @JsonProperty("claimaAdjustReason")
-            private String claimaAdjustReason;
-            @JsonProperty("claimaAdjustReasonName")
-            private String claimaAdjustReasonName;
-            @JsonProperty("policyId")
-            private String policyId;
-        }
-
-        @NoArgsConstructor
-        @Data
-        public static class TaxDTO {
-            @JsonProperty("taxConditionCode")
-            private String taxConditionCode;
-            @JsonProperty("taxStartDate")
-            private String taxStartDate;
-            @JsonProperty("taxEndDate")
-            private String taxEndDate;
-            @JsonProperty("taxItemCode")
-            private String taxItemCode;
-            @JsonProperty("taxItemName")
-            private String taxItemName;
-            @JsonProperty("calculateMode")
-            private String calculateMode;
-            @JsonProperty("taxPayerIdentityType")
-            private String taxPayerIdentityType;
-            @JsonProperty("taxPayerIdentityNo")
-            private String taxPayerIdentityNo;
-            @JsonProperty("taxPayerIdentificationCode")
-            private String taxPayerIdentificationCode;
-            @JsonProperty("taxPayerName")
-            private String taxPayerName;
-            @JsonProperty("lastPaidYear")
-            private Integer lastPaidYear;
-            @JsonProperty("annualTaxAmount")
-            private Integer annualTaxAmount;
-            @JsonProperty("annualTaxDue")
-            private Integer annualTaxDue;
-            @JsonProperty("sumTaxDefault")
-            private Integer sumTaxDefault;
-            @JsonProperty("sumOverdue")
-            private Integer sumOverdue;
-            @JsonProperty("sumTax")
-            private Integer sumTax;
-            @JsonProperty("unladenMass")
-            private String unladenMass;
-            @JsonProperty("policyId")
-            private String policyId;
-        }
-
-        @NoArgsConstructor
-        @Data
-        public static class CoverageDTO {
-            @JsonProperty("rate")
-            private Integer rate;
-            @JsonProperty("amount")
-            private Integer amount;
-            @JsonProperty("calculateFlag")
-            private String calculateFlag;
-            @JsonProperty("currency")
-            private String currency;
-            @JsonProperty("validDate")
-            private String validDate;
-            @JsonProperty("expiryDate")
-            private String expiryDate;
-            @JsonProperty("ifMainKind")
-            private String ifMainKind;
-            @JsonProperty("kindCode")
-            private String kindCode;
-            @JsonProperty("kindName")
-            private String kindName;
-            @JsonProperty("shortRate")
-            private Integer shortRate;
-            @JsonProperty("shortRateType")
-            private String shortRateType;
-            @JsonProperty("basePremium")
-            private Integer basePremium;
-            @JsonProperty("coverageStandardPremium")
-            private Integer coverageStandardPremium;
-            @JsonProperty("coveragePremium")
-            private Integer coveragePremium;
-            @JsonProperty("coveragePremiumNoTax")
-            private Double coveragePremiumNoTax;
-            @JsonProperty("coverageTax")
-            private Double coverageTax;
-            @JsonProperty("discount")
-            private Integer discount;
-            @JsonProperty("costPrem")
-            private Double costPrem;
-            @JsonProperty("coverageRiskPremium")
-            private Integer coverageRiskPremium;
-            @JsonProperty("policyId")
-            private String policyId;
-        }
-
-        @NoArgsConstructor
-        @Data
-        public static class EngageDTO {
-            @JsonProperty("engageCode")
-            private String engageCode;
-            @JsonProperty("engageTitle")
-            private String engageTitle;
-            @JsonProperty("engageDetail")
-            private String engageDetail;
-            @JsonProperty("modifyind")
-            private String modifyind;
-            @JsonProperty("chooseType")
-            private String chooseType;
-            @JsonProperty("deleteInd")
-            private String deleteInd;
-            @JsonProperty("serialNo")
-            private Integer serialNo;
-            @JsonProperty("policyId")
-            private String policyId;
-        }
-
-        @NoArgsConstructor
-        @Data
-        public static class AdjustDTO {
-            @JsonProperty("adjustCode")
-            private String adjustCode;
-            @JsonProperty("adjustName")
-            private String adjustName;
-            @JsonProperty("adjustRate")
-            private Integer adjustRate;
-            @JsonProperty("policyId")
-            private String policyId;
-        }
-    }
-
-    @NoArgsConstructor
-    @Data
-    public static class AccidentMainDTO {
-        @JsonProperty("id")
-        private String id;
-        @JsonProperty("planCode")
-        private String planCode;
-        @JsonProperty("comCode")
-        private String comCode;
-        @JsonProperty("totalPremium")
-        private Integer totalPremium;
-        @JsonProperty("coverages")
-        private List<CoveragesDTO> coverages;
-        @JsonProperty("validDate")
-        private String validDate;
-        @JsonProperty("expiryDate")
-        private String expiryDate;
-        @JsonProperty("riskCode")
-        private String riskCode;
-        @JsonProperty("amount")
-        private Integer amount;
-        @JsonProperty("premium")
-        private Integer premium;
-        @JsonProperty("name")
-        private String name;
-        @JsonProperty("detail")
-        private String detail;
-        @JsonProperty("seat")
-        private Integer seat;
-        @JsonProperty("feePercent")
-        private Integer feePercent;
-        @JsonProperty("assumpsit")
-        private String assumpsit;
-        @JsonProperty("carKindCode")
-        private String carKindCode;
-        @JsonProperty("useNatureCode")
-        private String useNatureCode;
-        @JsonProperty("type")
-        private String type;
-        @JsonProperty("proposalNo")
-        private String proposalNo;
-        @JsonProperty("underWriteInd")
-        private String underWriteInd;
-        @JsonProperty("uuid")
-        private String uuid;
-
-        @NoArgsConstructor
-        @Data
-        public static class CoveragesDTO {
-            @JsonProperty("id")
-            private String id;
-            @JsonProperty("createTime")
-            private String createTime;
-            @JsonProperty("liabilityCode")
-            private String liabilityCode;
-            @JsonProperty("amount")
-            private Integer amount;
-            @JsonProperty("premium")
-            private Integer premium;
-            @JsonProperty("name")
-            private String name;
-            @JsonProperty("productId")
-            private String productId;
-            @JsonProperty("productCode")
-            private String productCode;
-        }
-    }
-
-    @NoArgsConstructor
-    @Data
-    public static class AccContractDTO {
-        @JsonProperty("contractMain")
-        private ContractMainDTO contractMain;
-        @JsonProperty("coverage")
-        private List<CoverageDTO> coverage;
-
-        @NoArgsConstructor
-        @Data
-        public static class ContractMainDTO {
-            @JsonProperty("schemeName")
-            private String schemeName;
-            @JsonProperty("riskCode")
-            private String riskCode;
-            @JsonProperty("validDate")
-            private String validDate;
-            @JsonProperty("expiryDate")
-            private String expiryDate;
-            @JsonProperty("totalPremium")
-            private Integer totalPremium;
-        }
-
-        @NoArgsConstructor
-        @Data
-        public static class CoverageDTO {
-            @JsonProperty("kindCode")
-            private String kindCode;
-            @JsonProperty("kindName")
-            private String kindName;
-            @JsonProperty("validDate")
-            private String validDate;
-            @JsonProperty("expiryDate")
-            private String expiryDate;
-            @JsonProperty("amount")
-            private Integer amount;
-            @JsonProperty("coveragePremium")
-            private Integer coveragePremium;
-        }
-    }
-
-    @NoArgsConstructor
-    @Data
-    public static class SubmitReqBodyDTO {
-        @JsonProperty("uuid")
-        private String uuid;
-        @JsonProperty("businessType")
-        private String businessType;
-        @JsonProperty("contracts")
-        private List<String> contracts;
-        @JsonProperty("mandatoryReviewFlag")
-        private Boolean mandatoryReviewFlag;
-        @JsonProperty("reinsuranceFlag")
-        private String reinsuranceFlag;
-        @JsonProperty("signStatus")
-        private String signStatus;
-        @JsonProperty("acciRelatedFlag")
-        private String acciRelatedFlag;
-        @JsonProperty("codInd")
-        private String codInd;
-        @JsonProperty("sunlightId")
-        private String sunlightId;
-        @JsonProperty("underWriteInd")
-        private String underWriteInd;
-        @JsonProperty("amlterrorFlag")
-        private String amlterrorFlag;
-        @JsonProperty("smscheckFlag")
-        private String smscheckFlag;
-    }
-
-    @NoArgsConstructor
-    @Data
-    public static class AcciSaleInfoDTO {
-        @JsonProperty("comCode")
-        private String comCode;
-        @JsonProperty("comName")
-        private String comName;
-        @JsonProperty("handlerCode")
-        private String handlerCode;
-        @JsonProperty("handlerName")
-        private String handlerName;
-        @JsonProperty("agreementNo")
-        private String agreementNo;
-        @JsonProperty("agentCode")
-        private String agentCode;
-        @JsonProperty("agentName")
-        private String agentName;
-        @JsonProperty("solutionCode")
-        private String solutionCode;
-        @JsonProperty("permitNo")
-        private String permitNo;
-        @JsonProperty("businessMode")
-        private String businessMode;
-        @JsonProperty("businessSource")
-        private String businessSource;
-        @JsonProperty("channelType")
-        private String channelType;
-        @JsonProperty("channelTypeDetail")
-        private String channelTypeDetail;
-        @JsonProperty("cooperateSiteCode")
-        private String cooperateSiteCode;
-        @JsonProperty("cooperateSiteName")
-        private String cooperateSiteName;
-        @JsonProperty("id")
-        private String id;
-        @JsonProperty("orderId")
-        private String orderId;
-        @JsonProperty("dateType")
-        private String dateType;
-    }
-
-    @NoArgsConstructor
-    @Data
-    public static class YztScoreDTO {
-        @JsonProperty("scoreId")
-        private String scoreId;
-        @JsonProperty("centile")
-        private Integer centile;
-        @JsonProperty("commercialPureLost")
-        private Double commercialPureLost;
-        @JsonProperty("finalLossrationRate")
-        private Double finalLossrationRate;
-        @JsonProperty("forcePureLost")
-        private Double forcePureLost;
-        @JsonProperty("targetPureLost")
-        private Double targetPureLost;
-    }
 }

+ 89 - 0
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/entity/response/ChengTaiPremiumcaResponse.java

@@ -70,17 +70,25 @@ public class ChengTaiPremiumcaResponse implements Serializable {
     @NoArgsConstructor
     @Data
     public static class CiContractDTO {
+
         @JsonProperty("contractMain")
         private ContractMainDTO contractMain;
+
         @JsonProperty("coverage")
         private List<CoverageDTO> coverage;
+
         @JsonProperty("platFormMessage")
         private PlatFormMessageDTO platFormMessage;
+
         @JsonProperty("adjust")
         private List<AdjustDTO> adjust;
+
         @JsonProperty("tax")
         private TaxDTO tax;
 
+        @JsonProperty("engage")
+        private List<EngageDTO> engage;
+
         @NoArgsConstructor
         @Data
         public static class ContractMainDTO {
@@ -234,23 +242,73 @@ public class ChengTaiPremiumcaResponse implements Serializable {
             private String adjustName;
             @JsonProperty("adjustRate")
             private Double adjustRate;
+
+            @JsonProperty("policyId")
+            private String policyId;
+        }
+    }
+
+    @NoArgsConstructor
+    @Data
+    public static class EngageDTO {
+
+        @JsonProperty("id")
+        private String id;
+
+        @JsonProperty("policyId")
+        private String policyId;
+
+        @JsonProperty("serialNo")
+        private Integer serialNo;
+
+        @JsonProperty("engageCode")
+        private String engageCode;
+
+        @JsonProperty("engageTitle")
+        private String engageTitle;
+
+        @JsonProperty("engageDetail")
+        private String engageDetail;
+
+        @JsonProperty("modifyind")
+        private String modifyind;
+
+        @JsonProperty("chooseType")
+        private String chooseType;
+
+
+        public EngageDTO(ChengTaiGetEngageListResponse.ResponseBodyDTO.EngageListDTO engageListDTO) {
+            this.engageCode = engageListDTO.getEngageCode();
+            this.engageTitle = engageListDTO.getEngageName();
+            this.engageDetail = engageListDTO.getEngageDesc();
+            this.modifyind = "4";
+            this.chooseType = "1";
+
         }
     }
 
     @NoArgsConstructor
     @Data
     public static class BiContractDTO {
+
         @JsonProperty("contractMain")
         private ContractMainDTO contractMain;
+
         @JsonProperty("coverage")
         private List<CoverageDTO> coverage;
+
         @JsonProperty("platFormMessage")
         private PlatFormMessageDTO platFormMessage;
+
         @JsonProperty("discountInfo")
         private DiscountInfoDTO discountInfo;
+
         @JsonProperty("adjust")
         private List<AdjustDTO> adjust;
 
+        @JsonProperty("engage")
+        private List<EngageDTO> engage;
+
         @NoArgsConstructor
         @Data
         public static class ContractMainDTO {
@@ -292,6 +350,20 @@ public class ChengTaiPremiumcaResponse implements Serializable {
             private Double hopeCoefficient;
             @JsonProperty("isCheckRepeated")
             private String isCheckRepeated;
+
+            // start submit 添加的参数
+            @JsonProperty("orderId")
+            private String orderId;
+
+            @JsonProperty("othBusinessNo")
+            private String othBusinessNo;
+
+            @JsonProperty("signStatus")
+            private String signStatus;
+
+            @JsonProperty("uuid")
+            private String uuid;
+            // end submit
         }
 
         @NoArgsConstructor
@@ -401,6 +473,12 @@ public class ChengTaiPremiumcaResponse implements Serializable {
             @JsonProperty("rawDistributionElr1")
             private Double rawDistributionElr1;
 
+            @JsonProperty("policyId")
+            private String policyId;
+
+            @JsonProperty("uwDiscount")
+            private String uwDiscount;
+
             @NoArgsConstructor
             @Data
             public static class EffectInfoDTOListDTO {
@@ -412,6 +490,12 @@ public class ChengTaiPremiumcaResponse implements Serializable {
                 private String effectinfo;
                 @JsonProperty("effectCode")
                 private String effectCode;
+
+                @JsonProperty("id")
+                private String id;
+
+                @JsonProperty("policyId")
+                private String policyId;
             }
         }
 
@@ -462,6 +546,9 @@ public class ChengTaiPremiumcaResponse implements Serializable {
             private Integer quantity;
             @JsonProperty("unitAmount")
             private Integer unitAmount;
+
+            @JsonProperty("policyId")
+            private String policyId;
         }
 
         @NoArgsConstructor
@@ -477,6 +564,8 @@ public class ChengTaiPremiumcaResponse implements Serializable {
             private Double maxRate;
             @JsonProperty("minRate")
             private Double minRate;
+            @JsonProperty("policyId")
+            private String policyId;
         }
     }
 

+ 26 - 0
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/service/ChengTaiCrawlerQuoteProcessService.java

@@ -4,9 +4,17 @@ import com.jzg.commons.entity.quote.vo.AttributionInformationVo;
 import com.jzg.commons.entity.quote.vo.CarInfoVo;
 import com.jzg.quotation.chengtai.crawler.entity.ChengTaiCrawlerConfigureParameters;
 import com.jzg.quotation.chengtai.crawler.entity.bo.ChengTaiSaleInfoBo;
+import com.jzg.quotation.chengtai.crawler.entity.request.ChengTaiPremiumcaRequest;
+import com.jzg.quotation.chengtai.crawler.entity.request.ChengTaiUnderwritingRequest;
+import com.jzg.quotation.chengtai.crawler.entity.response.ChengTaiGetEngageListResponse;
+import com.jzg.quotation.chengtai.crawler.entity.response.ChengTaiPremiumcaResponse;
+import com.jzg.quotation.chengtai.crawler.entity.response.ChengTaiSaveResponse;
 import com.jzg.quotation.chengtai.crawler.utils.CarDepreciationCalculator;
 import org.springframework.http.HttpHeaders;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * @ClassName ChengTaiCrawlerQuoteProcessService
  * @Description 诚泰财险报价过程需要的接口
@@ -50,4 +58,22 @@ public interface ChengTaiCrawlerQuoteProcessService {
      * @return 新车实际价格
      */
     CarDepreciationCalculator.DepreciationResult generateClaimableValue(CarInfoVo carInfoVo, String purchasePrice);
+
+    /**
+     * 构造提交核保的参数并保存到redis中
+     *
+     * @param chengTaiUnderwritingRequest 保存参数
+     * @param chengTaiSaveResponse        保存返回的参数
+     * @return 核保提交的参数
+     */
+    void buildSubmitResponse(ChengTaiUnderwritingRequest chengTaiUnderwritingRequest, ChengTaiSaveResponse chengTaiSaveResponse);
+
+    /**
+     * 获取特别约定
+     *
+     * @param request   报价请求
+     * @param premiumca 报价响应
+     * @return 险种对应的保险公司
+     */
+    Map<String, List<ChengTaiGetEngageListResponse.ResponseBodyDTO.EngageListDTO>> getEngageList(ChengTaiPremiumcaRequest request, ChengTaiPremiumcaResponse premiumca,  HttpHeaders httpHeaders);
 }

+ 96 - 8
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/service/impl/ChengTaiCrawlerQuoteProcessServiceImpl.java

@@ -5,12 +5,13 @@ import com.jzg.commons.constants.quote.enums.base.ExpenseRequestUrl;
 import com.jzg.commons.entity.quote.vo.AttributionInformationVo;
 import com.jzg.commons.entity.quote.vo.CarInfoVo;
 import com.jzg.commons.entity.quote.vo.identify.SliderCaptchaVo;
+import com.jzg.commons.util.StringUtils;
+import com.jzg.quotation.chengtai.api.entity.constants.enums.RiskCodeEnum;
+import com.jzg.quotation.chengtai.crawler.component.ChengTaiCrawlerCacheComponent;
 import com.jzg.quotation.chengtai.crawler.component.ChengTaiRequestCrawlerComponent;
 import com.jzg.quotation.chengtai.crawler.entity.ChengTaiCrawlerConfigureParameters;
 import com.jzg.quotation.chengtai.crawler.entity.bo.ChengTaiSaleInfoBo;
-import com.jzg.quotation.chengtai.crawler.entity.request.ChengTaiCheckCaptchaRequest;
-import com.jzg.quotation.chengtai.crawler.entity.request.ChengTaiGetCaptchaRequest;
-import com.jzg.quotation.chengtai.crawler.entity.request.ChengTaiLoginRequest;
+import com.jzg.quotation.chengtai.crawler.entity.request.*;
 import com.jzg.quotation.chengtai.crawler.entity.response.*;
 import com.jzg.quotation.chengtai.crawler.repository.ChengTaiCrawlerOrderRepository;
 import com.jzg.quotation.chengtai.crawler.service.ChengTaiCrawlerQuoteProcessService;
@@ -21,14 +22,18 @@ import com.jzg.quotation.commons.service.ExteriorUtilsRequest;
 import com.jzg.quotation.commons.utils.Base64ImageUtils;
 import com.jzg.quotation.commons.utils.TimeProcessing;
 import lombok.RequiredArgsConstructor;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.BeanWrapper;
+import org.springframework.beans.BeanWrapperImpl;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 
+import java.beans.PropertyDescriptor;
 import java.math.BigDecimal;
 import java.time.LocalDate;
-import java.util.List;
-import java.util.Optional;
+import java.util.*;
+import java.util.stream.Collectors;
 
 @Service
 @RequiredArgsConstructor
@@ -38,7 +43,7 @@ public class ChengTaiCrawlerQuoteProcessServiceImpl implements ChengTaiCrawlerQu
 
     private final ExteriorUtilsRequest exteriorUtilsRequest;
 
-    private final ChengTaiCrawlerOrderRepository chengTaiCrawlerOrderRepository;
+    private final ChengTaiCrawlerCacheComponent chengTaiCrawlerCacheComponent;
 
     @Override
     public void login(String username, String password) throws Exception {
@@ -75,7 +80,7 @@ public class ChengTaiCrawlerQuoteProcessServiceImpl implements ChengTaiCrawlerQu
     @Override
     public HttpHeaders getTokenHeaders(String username, String password) {
         HttpHeaders httpHeaders = new HttpHeaders();
-        httpHeaders.set("token", "eyJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE3NTg2OTYyNTcsImV4cCI6MTc1ODcwNzA1NywicGF5bG9hZCI6IldkeHJsN3BjSjBYLWtObU9ZTGpxV2pQNjJaQk5ZLTl4eFNMT3pONExzY1Y5UzI0VXliS3E0ZzU3VGdQdi1vaWlGRFdiUXRmcFhNUTlNQjJYbEZoamJtdlBqLUxnLUUzMHA2UU9PNXdrWEFtUUNsLXAxMHVLN0dMMHFVSDA3MTJsdGhJakpuQjhqSFl5ajM0VXJwTFpKSFZWenRhMzNBY0VkaHVSdFFqMW5ONzQzMDVKN29tUWZuWi1iTzJQQnhmWDBId0c2NXdXcnNaS3lxQXdZRUVtQjg1aEM5V3dmWm91c2V6bkhVZjZSOHJHVEU2THNPMExLR3hnMDMwdU1nRUlyVFE2SmJIRjF0NW1fQXdNUmdMeDJhaW5zNDBoQzNGdFpieGh0UWtoRjlPeDFYWjBpcXRxZjF6TVdKSnlLTEFBX3J2dEJVWlNXMFdFeUtsRy1Gc0Z2LXlkX19jQmYwTGZBS1BnemhRcXBOSUtwa3IzUVhvWjRDUGtYaDVGbkE4UENUWjcwZWxzeUtreTZUZzNCWm5DYnI3UjFhNzFjWVE5aVQ5c1Z1YnpTWEhySkRUVzExYk9pOENiY3Q1SzdJN1JRdzJiazBBdHk0X2dRd3lFN3VHUTFnIn0.kIL67R-1I4-nj38HTg8ztvOlH3Juz6mfY1NAgItJkjoSlOJo9LZoy_QWs2RAdb30a9F3ZYVR5J3j9sF0USMPPQ");
+        httpHeaders.set("token", "eyJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE3NTkyMTQyNTgsImV4cCI6MTc1OTIyNTA1OCwicGF5bG9hZCI6IldkeHJsN3BjSjBYLWtObU9ZTGpxV2pQNjJaQk5ZLTl4eFNMT3pONExzY1Y5UzI0VXliS3E0ZzU3VGdQdi1vaWlGRFdiUXRmcFhNUTlNQjJYbEZoamJtdlBqLUxnLUUzMHA2UU9PNXdrWEFtUUNsLXAxMHVLN0dMMHFVSDA3MTJsdGhJakpuQjhqSFl5ajM0VXJwTFpKSFZWenRhMzNBY0VkaHVSdFFqMW5ONmpnZW5hSVl0NVdQZXpXMVFOVjBoWDl1TzdhMTdLVjg1bkpYd1F4aEJ0eFV3MDFoNk5KNy1TWGpHX2ttYkhSdm1KX29DSHZpT1RRV3hrcllPbWpORkF4eGtHQmNvSGR4X1hkdDdueDl2bFhLaW5zNDBoQzNGdFpieGh0UWtoRjlPeDFYWjBpcXRxZjF6TVdKSnlLTEFBaTRzSEJfMVpFX01ZMHVYNGwwR2MzSGh1R0Fkc21vTi1iLTdlY1kxcldpbFl2QXhqQWlGZFVkdmRvTXdWeFRrRTZ3aFBnY0dvY0FZU2NXbUZHUXBLTVlmWlNSM25kLWFGR2hEaW51djlWaldKX29DSHZpT1RRV3hrcllPbWpORkFJeXotX3VwV1NnNkFlNHl6YVhpdTNBIn0.ObZ6BWMDtbsDgEaVFmSVUbhti_HTPAoGngPQ07xll8R6jeu-l2c_ktFgkMpfiruTeHZ-ELmAjtk5siOlXVqyTA");
         return httpHeaders;
     }
 
@@ -100,11 +105,94 @@ public class ChengTaiCrawlerQuoteProcessServiceImpl implements ChengTaiCrawlerQu
         policyCar.setApprovedPassengersCapacity(Integer.parseInt(carInfoVo.getSeatCount()));
         policyCar.setPurchasePrice(new BigDecimal(purchasePrice));
         policyCar.setRegisterDate(TimeProcessing.parseDate(carInfoVo.getRegisterDate()));
-        policyCar.setEnergyTypes("2");
+        policyCar.setEnergyTypes(carInfoVo.getEnergyTypeCode());
         policyCar.setVehicleKindCode("V");
         policyCar.setNewEnergy(carInfoVo.isNewEnergyMark());
         // 计算当前价值
         return CarDepreciationCalculator.calculateCurrentValue(policyCar);
     }
 
+    public static String[] getNullPropertyNames(Object source) {
+        final BeanWrapper src = new BeanWrapperImpl(source);
+        PropertyDescriptor[] pds = src.getPropertyDescriptors();
+
+        Set<String> emptyNames = new HashSet<>();
+        for (PropertyDescriptor pd : pds) {
+            Object srcValue = src.getPropertyValue(pd.getName());
+            if (srcValue == null) {
+                emptyNames.add(pd.getName());
+            }
+        }
+        String[] result = new String[emptyNames.size()];
+        return emptyNames.toArray(result);
+    }
+
+    @Override
+    public void buildSubmitResponse(ChengTaiUnderwritingRequest chengTaiUnderwritingRequest, ChengTaiSaveResponse chengTaiSaveResponse) {
+        BeanUtils.copyProperties(chengTaiSaveResponse, chengTaiUnderwritingRequest, getNullPropertyNames(chengTaiSaveResponse));
+        chengTaiUnderwritingRequest.getSubmitReqBody().setUuid(chengTaiSaveResponse.getSaveResult().getUuid());
+        chengTaiUnderwritingRequest.getSubmitReqBody().setMandatoryReviewFlag(false);
+        chengTaiUnderwritingRequest.getSubmitReqBody().setCodInd("Y");
+        chengTaiUnderwritingRequest.getSubmitReqBody().setSignStatus("2");
+        chengTaiUnderwritingRequest.getSubmitReqBody().setSunlightId(chengTaiSaveResponse.getModel().getSunlightId());
+        chengTaiUnderwritingRequest.getSubmitReqBody().setUnderWriteInd("z1");
+        chengTaiUnderwritingRequest.getSubmitReqBody().setAmlterrorFlag("0");
+        chengTaiUnderwritingRequest.getSubmitReqBody().setSmscheckFlag("2");
+        List<String> list = new ArrayList<>();
+        if (StringUtils.hasText(chengTaiSaveResponse.getSaveResult().getContractNoBI())) {
+            list.add(chengTaiSaveResponse.getSaveResult().getContractNoBI());
+        }
+        if (StringUtils.hasText(chengTaiSaveResponse.getSaveResult().getContractNoCI())) {
+            list.add(chengTaiSaveResponse.getSaveResult().getContractNoCI());
+        }
+        chengTaiUnderwritingRequest.getSubmitReqBody().setContracts(list);
+        chengTaiCrawlerCacheComponent.cacheChengTaiUnderwritingRequest(chengTaiUnderwritingRequest, "");
+    }
+
+    @Override
+    public Map<String, List<ChengTaiGetEngageListResponse.ResponseBodyDTO.EngageListDTO>> getEngageList(ChengTaiPremiumcaRequest request, ChengTaiPremiumcaResponse premiumca, HttpHeaders httpHeaders) {
+        ChengTaiGetEngageListRequest getEngageList = new ChengTaiGetEngageListRequest(request);
+        Map<String, List<ChengTaiGetEngageListResponse.ResponseBodyDTO.EngageListDTO>> engageHash = new HashMap<>();
+        // 交强险
+        String riskCiCode = premiumca.getCiContract().getContractMain().getRiskCode();
+        ChengTaiGetEngageListRequest.BusinessDataDTO.MainDTO mainDTOCi = getEngageList.getBusinessData().getMain();
+        mainDTOCi.setCombInd("3");
+        mainDTOCi.setRiskCode(riskCiCode);
+        mainDTOCi.setSystemCode(request.getSaleInfo().getComCode());
+        mainDTOCi.setSystemCode(request.getBusinessMain().getResourceType());
+        List<ChengTaiGetEngageListResponse.ResponseBodyDTO.EngageListDTO> engageList = chengTaiRequestCrawlerComponent.getEngageList(getEngageList, httpHeaders);
+        engageHash.put(riskCiCode, engageList);
+
+        // 商业险
+        String riskBiCode = premiumca.getBiContract().getContractMain().getRiskCode();
+        ChengTaiGetEngageListRequest.BusinessDataDTO.MainDTO mainDTOBi = getEngageList.getBusinessData().getMain();
+        mainDTOBi.setRiskCode(riskCiCode);
+        for (ChengTaiPremiumcaRequest.BiContractDTO.CoverageDTO coverageDTO : request.getBiContract().getCoverage()) {
+            if("A".equals(coverageDTO.getKindCode())){
+                mainDTOBi.setIsVehicleDamage(1);
+            }
+            if("B".equals(coverageDTO.getKindCode())){
+                mainDTOBi.setIsThirdParty(1);
+            }
+            if("X".equals(coverageDTO.getKindCode())){
+                mainDTOBi.setIsNewEquipment(1);
+            }
+            if("S1".equals(coverageDTO.getKindCode())){
+                mainDTOBi.setIsRoadRescue(1);
+            }
+            if("S2".equals(coverageDTO.getKindCode())){
+                mainDTOBi.setIsSafetyMonitoring(1);
+            }
+            if("S3".equals(coverageDTO.getKindCode())){
+                mainDTOBi.setIsValetDriving(1);
+            }
+            if("S4".equals(coverageDTO.getKindCode())){
+                mainDTOBi.setIsToInspection(1);
+            }
+        }
+        List<ChengTaiGetEngageListResponse.ResponseBodyDTO.EngageListDTO> engageList1 = chengTaiRequestCrawlerComponent.getEngageList(getEngageList, httpHeaders);
+        engageHash.put(riskBiCode, engageList1);
+        return engageHash;
+    }
+
 }

+ 35 - 16
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/service/impl/ChengTaiCrawlerRequestImpl.java

@@ -5,23 +5,29 @@ import com.jzg.commons.entity.quote.vo.CustomerInfoVo;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
 import com.jzg.commons.entity.quote.vo.aggregated.*;
 import com.jzg.commons.entity.quote.vo.base.LoginBase;
+import com.jzg.commons.entity.quote.vo.image.InsuranceImageVo;
 import com.jzg.commons.exception.SystemException;
+import com.jzg.quotation.chengtai.crawler.build.ChengTaiCrawlerQuoteResultsVoBuild;
+import com.jzg.quotation.chengtai.crawler.component.ChengTaiCrawlerCacheComponent;
 import com.jzg.quotation.chengtai.crawler.component.ChengTaiRequestCrawlerComponent;
 import com.jzg.quotation.chengtai.crawler.entity.ChengTaiCrawlerConfigureParameters;
 import com.jzg.quotation.chengtai.crawler.entity.bo.ChengTaiSaleInfoBo;
-import com.jzg.quotation.chengtai.crawler.entity.request.ChengTaiPolicyListRequest;
 import com.jzg.quotation.chengtai.crawler.entity.request.ChengTaiPremiumcaRequest;
+import com.jzg.quotation.chengtai.crawler.entity.request.ChengTaiUnderwritingRequest;
 import com.jzg.quotation.chengtai.crawler.entity.response.*;
 import com.jzg.quotation.chengtai.crawler.service.ChengTaiCrawlerQuoteProcessService;
 import com.jzg.quotation.chengtai.crawler.service.ChengTaiCrawlerRequest;
 import com.jzg.quotation.chengtai.crawler.utils.CarDepreciationCalculator;
+import com.jzg.quotation.chengtai.crawler.utils.ZipImageExample;
 import com.jzg.quotation.commons.annotation.QuoteCrawlerService;
 import com.jzg.quotation.commons.constant.InsuranceCode;
 import com.jzg.quotation.commons.standard.conversion.ConfigureParametersConversion;
+import com.jzg.quotation.commons.utils.TimeProcessing;
 import lombok.RequiredArgsConstructor;
 import org.springframework.http.HttpHeaders;
 
 import java.util.List;
+import java.util.Map;
 
 @QuoteCrawlerService(value = InsuranceCode.INSURANCE_CHAC)
 @RequiredArgsConstructor
@@ -31,6 +37,8 @@ public class ChengTaiCrawlerRequestImpl implements ChengTaiCrawlerRequest {
 
     private final ChengTaiRequestCrawlerComponent chengTaiRequestCrawlerComponent;
 
+    private final ChengTaiCrawlerCacheComponent chengTaiCrawlerCacheComponent;
+
     @Override
     public void login(LoginBase loginBase) {
         try {
@@ -67,20 +75,26 @@ public class ChengTaiCrawlerRequestImpl implements ChengTaiCrawlerRequest {
         // 步骤五 报价
         ChengTaiPremiumcaRequest request = new ChengTaiPremiumcaRequest(quoteVo, carModel, policyHolder, insuredPerson, saleInfoBo, ciModelCode, depreciationResult);
         ChengTaiPremiumcaResponse premiumca = chengTaiRequestCrawlerComponent.premiumca(request, httpHeaders);
-        // 步骤六 保存订单
-
-        // 步骤七 保存订单信息到mangodb
-
-        return null;
+        // 步骤六 获取特别约定
+        Map<String, List<ChengTaiGetEngageListResponse.ResponseBodyDTO.EngageListDTO>> engageMap = chengTaiCrawlerQuoteProcessService.getEngageList(request, premiumca, httpHeaders);
+        // 步骤七 保存订单
+        ChengTaiUnderwritingRequest chengTaiUnderwritingRequest = new ChengTaiUnderwritingRequest(request, premiumca, engageMap);
+        ChengTaiSaveResponse save = chengTaiRequestCrawlerComponent.save(chengTaiUnderwritingRequest, httpHeaders);
+        // 步骤八 构造提交核保的参数并保存到redis中
+        chengTaiCrawlerQuoteProcessService.buildSubmitResponse(chengTaiUnderwritingRequest, save);
+        // 步骤九 构造报价返回信息
+        return ChengTaiCrawlerQuoteResultsVoBuild.buildQuoteResultsVo(quoteVo.getOrder().getOrdersNo(), premiumca);
     }
 
     @Override
     public UnderwritingResultsVo underwriting(UnderwritingVo underwritingVo) throws Exception {
         HttpHeaders httpHeaders = chengTaiCrawlerQuoteProcessService.getTokenHeaders(underwritingVo.getOrder().getAttributionInformationVo().getUsername(), underwritingVo.getOrder().getAttributionInformationVo().getPassword());
+        ChengTaiUnderwritingRequest chengTaiUnderwritingRequest = chengTaiCrawlerCacheComponent.getChengTaiUnderwritingRequest("");
+        chengTaiUnderwritingRequest.getBusinessMain().setIssueDate(TimeProcessing.nowDate());
+        // 提交核保
+        ChengTaiSubmitResponse submit = chengTaiRequestCrawlerComponent.submit(chengTaiUnderwritingRequest, httpHeaders);
 
-
-
-        return null;
+        return new UnderwritingResultsVo();
     }
 
     @Override
@@ -88,12 +102,21 @@ public class ChengTaiCrawlerRequestImpl implements ChengTaiCrawlerRequest {
         HttpHeaders httpHeaders = chengTaiCrawlerQuoteProcessService.getTokenHeaders(paymentLinkVo.getOrder().getAttributionInformationVo().getUsername(), paymentLinkVo.getOrder().getAttributionInformationVo().getPassword());
         // 获取支付链接
         String pay = chengTaiRequestCrawlerComponent.pay("", httpHeaders);
-
-        return null;
+        PaymentLinkResultsVo paymentLinkResultsVo = new PaymentLinkResultsVo();
+        paymentLinkResultsVo.setPayLinkStatus(true);
+        paymentLinkResultsVo.setPaymentLink(pay);
+        return paymentLinkResultsVo;
     }
 
     @Override
     public void uploadImage(InsuranceUploadImageVo insuranceUploadImageVo) {
+        HttpHeaders httpHeaders = chengTaiCrawlerQuoteProcessService.getTokenHeaders(insuranceUploadImageVo.getOrder().getAttributionInformationVo().getUsername(), insuranceUploadImageVo.getOrder().getAttributionInformationVo().getPassword());
+        List<InsuranceImageVo.ImageDTO> list = insuranceUploadImageVo.getImageVoList()
+                .stream()
+                .flatMap(imageVo -> imageVo.getImageBase64List().stream())
+                .toList();
+        byte[] zipFile = ZipImageExample.createZipFile(list);
+        chengTaiRequestCrawlerComponent.imageUpload(zipFile, "", list, httpHeaders);
 
     }
 
@@ -101,10 +124,8 @@ public class ChengTaiCrawlerRequestImpl implements ChengTaiCrawlerRequest {
     public DownloadPolicyResultVo downloadPolicy(DownloadPolicyVo downloadPolicyVo) {
         HttpHeaders httpHeaders = chengTaiCrawlerQuoteProcessService.getTokenHeaders(downloadPolicyVo.getOrder().getAttributionInformationVo().getUsername(), downloadPolicyVo.getOrder().getAttributionInformationVo().getPassword());
         List<ChengTaiDownloadAddressResponse> chengTaiDownloadAddressResponse = chengTaiRequestCrawlerComponent.downloadAddress("", "", "", httpHeaders);
-        chengTaiDownloadAddressResponse.forEach(x -> {
-
+        chengTaiDownloadAddressResponse.forEach(response -> {
         });
-
         return new DownloadPolicyResultVo();
     }
 
@@ -113,8 +134,6 @@ public class ChengTaiCrawlerRequestImpl implements ChengTaiCrawlerRequest {
         HttpHeaders httpHeaders = chengTaiCrawlerQuoteProcessService.getTokenHeaders(orderStatusVo.getOrder().getAttributionInformationVo().getUsername(), orderStatusVo.getOrder().getAttributionInformationVo().getPassword());
         List<ChengTaiPolicyListResponse> chengTaiPolicyListRequest = chengTaiRequestCrawlerComponent.policyList("", "", "", httpHeaders);
 
-
-
         return new OrderStatusResultVo();
     }
 }

+ 33 - 0
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/utils/ZipImageExample.java

@@ -1,8 +1,41 @@
 package com.jzg.quotation.chengtai.crawler.utils;
 
 
+import com.jzg.commons.entity.quote.vo.image.InsuranceImageVo;
+
+import java.io.ByteArrayOutputStream;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.List;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
 
 public final class ZipImageExample {
 
+    public static byte[] createZipFile(List<InsuranceImageVo.ImageDTO> imageDTOList) {
+        // 使用 ByteArrayOutputStream 在内存中构建数据,而不是写入磁盘文件
+        try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+             ZipOutputStream zipOutputStream = new ZipOutputStream(byteArrayOutputStream)) {
+
+            for (InsuranceImageVo.ImageDTO imageDTO : imageDTOList) {
+                // 为每张图片创建一个新的ZIP条目(即压缩包内的一个文件)
+                ZipEntry zipEntry = new ZipEntry(imageDTO.getImageName());
+                zipOutputStream.putNextEntry(zipEntry);
+                // 将图片的字节数据写入当前条目
+                zipOutputStream.write(imageDTO.getImageByte());
+                // 关闭当前条目,准备写入下一个
+                zipOutputStream.closeEntry();
+            }
+            // 关键步骤:在关闭流之前,确保所有数据都已从缓冲区刷新到 ByteArrayOutputStream
+            zipOutputStream.finish();
+            // 返回整个ZIP文件的字节数组
+            return byteArrayOutputStream.toByteArray();
+
+        } catch (IOException ioException) {
+            // 发生异常时返回空数组,调用方应根据情况处理
+            return new byte[0];
+        }
+    }
 
 }

+ 8 - 0
tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/utils/TimeProcessing.java

@@ -203,6 +203,14 @@ public final class TimeProcessing {
         return between.getYears();
     }
 
+    /**
+     * 获取去年的年份
+     * @return 去年的 年
+     */
+    public static int getLastYear(){
+         return LocalDate.now().minusYears(1).getYear();
+    }
+
 
     @Data
     @AllArgsConstructor