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

Merge remote-tracking branch 'origin/master'

Qchen 1 год назад
Родитель
Сommit
c962a831e9
38 измененных файлов с 215 добавлено и 97 удалено
  1. 5 5
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/build/AnShengCrawlerQuoteResultsVoBuild.java
  2. 2 2
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/component/AnShengCrawlerCacheComponent.java
  3. 37 23
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/component/AnShengCrawlerRequestComponent.java
  4. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/constant/AnShengCrawlerSystemConstant.java
  5. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/constant/enums/RequestUrl.java
  6. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/constant/enums/RiskCodeInfo.java
  7. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/po/AnShengCrawlerOrder.java
  8. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerApplyApplicationRequest.java
  9. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerAutoSpecialPromiseRequest.java
  10. 2 2
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerCalculatePremiumApplyMessage.java
  11. 2 2
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerCheckLoginRequest.java
  12. 4 4
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerCheckVerificationRequest.java
  13. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerFileUploadRequest.java
  14. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerPaymentRequest.java
  15. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerQueryDocumentsInformationRequest.java
  16. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerQueryPrintPdfRequest.java
  17. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerSearchVehicleByVinRequest.java
  18. 2 2
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerVerifyRequest.java
  19. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/response/AnShengCrawlerApplyApplicationResponse.java
  20. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/response/AnShengCrawlerAutoSpecialPromiseResponse.java
  21. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/response/AnShengCrawlerCalculatePremiumApplyResponse.java
  22. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/response/AnShengCrawlerFileUploadResponse.java
  23. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/response/AnShengCrawlerGetUserDetailResponse.java
  24. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/response/AnShengCrawlerPaymentResponse.java
  25. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/response/AnShengCrawlerQueryDocumentsInformationResponse.java
  26. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/response/AnShengCrawlerSearchVehicleByVinResponse.java
  27. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/response/AnShengCrawlerVerifyResponse.java
  28. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/properties/AnShengCrawlerProperties.java
  29. 2 2
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/repository/AnShengCrawlerOrderRepository.java
  30. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/service/AnShengCrawlerLoginService.java
  31. 2 2
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/service/AnShengCrawlerOrderService.java
  32. 1 1
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/service/AnShengCrawlerRequest.java
  33. 14 12
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/service/impl/AnShengCrawlerLoginServiceImpl.java
  34. 4 4
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/service/impl/AnShengCrawlerOrderServiceImpl.java
  35. 14 12
      tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/service/impl/AnShengCrawlerRequestImpl.java
  36. 87 0
      tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/utils/CookieParseUtils.java
  37. 6 0
      tenant/insurance/quotation-summary/pom.xml
  38. 9 2
      tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/converter/QuoteInfoConverter.java

+ 5 - 5
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/build/AnShengCrawlerQuoteResultsVoBuild.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/build/AnShengCrawlerQuoteResultsVoBuild.java

@@ -1,13 +1,13 @@
-package com.jzg.ansheng.crawler.build;
+package com.jzg.quotation.ansheng.crawler.build;
 
 
-import com.jzg.ansheng.crawler.constant.enums.RiskCodeInfo;
-import com.jzg.ansheng.crawler.entity.response.AnShengCrawlerCalculatePremiumApplyResponse;
 import com.jzg.commons.entity.quote.vo.KindInfoVo;
+import com.jzg.commons.entity.quote.vo.QuoteVo;
 import com.jzg.commons.entity.quote.vo.RiskInfoVo;
-import com.jzg.quotation.commons.component.ConversionOfQuoteInformation;
 import com.jzg.commons.entity.quote.vo.aggregated.QuoteResultsVo;
-import com.jzg.commons.entity.quote.vo.QuoteVo;
+import com.jzg.quotation.ansheng.crawler.constant.enums.RiskCodeInfo;
+import com.jzg.quotation.ansheng.crawler.entity.response.AnShengCrawlerCalculatePremiumApplyResponse;
+import com.jzg.quotation.commons.component.ConversionOfQuoteInformation;
 
 import java.util.List;
 

+ 2 - 2
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/component/AnShengCrawlerCacheComponent.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/component/AnShengCrawlerCacheComponent.java

@@ -1,9 +1,9 @@
-package com.jzg.ansheng.crawler.component;
+package com.jzg.quotation.ansheng.crawler.component;
 
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
-import com.jzg.ansheng.crawler.entity.request.AnShengCrawlerCalculatePremiumApplyMessage;
+import com.jzg.quotation.ansheng.crawler.entity.request.AnShengCrawlerCalculatePremiumApplyMessage;
 import lombok.RequiredArgsConstructor;
 import org.redisson.api.RedissonClient;
 import org.springframework.stereotype.Component;

+ 37 - 23
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/component/AnShengCrawlerRequestComponent.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/component/AnShengCrawlerRequestComponent.java

@@ -1,28 +1,26 @@
-package com.jzg.ansheng.crawler.component;
+package com.jzg.quotation.ansheng.crawler.component;
 
 
 import com.alibaba.fastjson.JSON;
-import com.jzg.ansheng.crawler.constant.enums.RequestUrl;
-import com.jzg.ansheng.crawler.entity.request.*;
-import com.jzg.ansheng.crawler.entity.response.*;
-import com.jzg.ansheng.crawler.properties.AnShengCrawlerProperties;
 import com.jzg.commons.exception.SystemException;
+import com.jzg.quotation.ansheng.crawler.constant.enums.RequestUrl;
+import com.jzg.quotation.ansheng.crawler.entity.request.*;
+import com.jzg.quotation.ansheng.crawler.entity.response.*;
+import com.jzg.quotation.ansheng.crawler.properties.AnShengCrawlerProperties;
 import com.jzg.quotation.commons.component.RequestComponent;
+import com.jzg.quotation.commons.utils.CookieParseUtils;
 import com.jzg.quotation.commons.utils.RequestObjectConversion;
 import lombok.RequiredArgsConstructor;
+import org.jetbrains.annotations.NotNull;
 import org.springframework.core.io.FileSystemResource;
 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 org.springframework.util.ObjectUtils;
 
 import java.io.File;
-import java.util.Base64;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
+import java.util.*;
 
 /**
  * @description: 安盛天平 爬虫 请求
@@ -37,13 +35,6 @@ public class AnShengCrawlerRequestComponent {
 
     private final AnShengCrawlerProperties anShengCrawlerProperties;
 
-    public <Response> Response request(RequestUrl requestUrl, Object body, Class<Response> responseClass, HttpHeaders headers) {
-        if (ObjectUtils.isEmpty(headers)) {
-            headers = new HttpHeaders();
-        }
-        ResponseEntity<Response> responseResponseEntity = requestComponent.objectPost(requestUrl.getRequestUrl(anShengCrawlerProperties.getUrl()), body, responseClass, headers);
-        return responseResponseEntity.getBody();
-    }
 
     public <Response> Response post(RequestUrl requestUrl, Object body, Class<Response> responseClass, HttpHeaders headers) {
         Map<String, String> message = Map.of("message", JSON.toJSONString(body));
@@ -57,9 +48,12 @@ public class AnShengCrawlerRequestComponent {
      * @param request 获取验证码参数
      * @return 验证码参数
      */
-    public AnShengCrawlerVerifyResponse.DataDTO crawlerVerify(AnShengCrawlerVerifyRequest request) {
-        AnShengCrawlerVerifyResponse response = request(RequestUrl.MFA_VERIFY, request, AnShengCrawlerVerifyResponse.class, null);
-        return response.getData();
+    public AnShengCrawlerVerifyResponse.DataDTO crawlerVerify(AnShengCrawlerVerifyRequest request, final HttpHeaders headers) {
+        ResponseEntity<AnShengCrawlerVerifyResponse> verifyRequest = requestComponent.objectPost(RequestUrl.MFA_VERIFY.getRequestUrl(anShengCrawlerProperties.getUrl()), request, AnShengCrawlerVerifyResponse.class, headers);
+        List<String> strings = verifyRequest.getHeaders().get(CookieParseUtils.SET_COOKIE);
+        String cookie = CookieParseUtils.listToStrCookie(strings);
+        headers.set(CookieParseUtils.COOKIE, cookie);
+        return verifyRequest.getBody().getData();
     }
 
     /**
@@ -80,10 +74,24 @@ public class AnShengCrawlerRequestComponent {
      * @param request 登录请求
      * @param headers 请求头
      */
-    public HttpHeaders login(AnShengCrawlerCheckLoginRequest request, HttpHeaders headers) {
+    public void login(AnShengCrawlerCheckLoginRequest request, HttpHeaders headers) {
         MultiValueMap<String, Object> multiValueMap = RequestObjectConversion.convertMultiValueMap(request);
         ResponseEntity<String> response = requestComponent.formData(RequestUrl.LOGIN.getRequestUrl(anShengCrawlerProperties.getUrl()), multiValueMap, String.class, headers);
-        return response.getHeaders();
+        conversionCookies(headers, response, CookieParseUtils.JSESSIONID);
+    }
+
+    private static void conversionCookies(HttpHeaders headers, ResponseEntity<String> response, String cookieName) {
+        List<String> strings = response.getHeaders().get(CookieParseUtils.SET_COOKIE);
+        Map<String, String> loginCookie = CookieParseUtils.parseCookie(strings);
+        Map<String, String> rawCookie = CookieParseUtils.parseCookie(Objects.requireNonNull(headers.get(CookieParseUtils.COOKIE)).get(0));
+
+        if(CookieParseUtils.AUTHORIZATION.equals(cookieName)){
+            rawCookie.put(cookieName, CookieParseUtils.BEARER + loginCookie.get(cookieName));
+        }else {
+            rawCookie.put(cookieName, loginCookie.get(cookieName));
+        }
+        String cookie = CookieParseUtils.toStringCookie(rawCookie);
+        headers.set(CookieParseUtils.COOKIE, cookie);
     }
 
     /**
@@ -92,9 +100,15 @@ public class AnShengCrawlerRequestComponent {
      * @param headers 请求头
      */
     public void authorize(HttpHeaders headers) {
-        requestComponent.baseGet(RequestUrl.OAUTH_AUTHORIZE.getRequestUrl(anShengCrawlerProperties.getUrl()), new LinkedMultiValueMap<>(), String.class, headers);
+        LinkedMultiValueMap<String, String> map = new LinkedMultiValueMap<>();
+        map.put("client_id", List.of("ast-prod"));
+        map.put("response_type", List.of("code"));
+
+        ResponseEntity<String> response = requestComponent.baseGet(RequestUrl.OAUTH_AUTHORIZE.getRequestUrl(anShengCrawlerProperties.getUrl()), new LinkedMultiValueMap<>(), String.class, headers);
+        conversionCookies(headers, response, CookieParseUtils.AUTHORIZATION);
     }
 
+
     /**
      * 获取归属信息
      *

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/constant/AnShengCrawlerSystemConstant.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/constant/AnShengCrawlerSystemConstant.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.constant;
+package com.jzg.quotation.ansheng.crawler.constant;
 
 /**
  * @description: 安盛财险爬虫系统常量

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/constant/enums/RequestUrl.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/constant/enums/RequestUrl.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.constant.enums;
+package com.jzg.quotation.ansheng.crawler.constant.enums;
 
 import com.jzg.quotation.commons.standard.CrawlerRequestUrlStandard;
 import lombok.AllArgsConstructor;

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/constant/enums/RiskCodeInfo.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/constant/enums/RiskCodeInfo.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.constant.enums;
+package com.jzg.quotation.ansheng.crawler.constant.enums;
 
 import lombok.AllArgsConstructor;
 import lombok.Getter;

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/po/AnShengCrawlerOrder.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/po/AnShengCrawlerOrder.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.entity.po;
+package com.jzg.quotation.ansheng.crawler.entity.po;
 
 import lombok.AllArgsConstructor;
 import lombok.Data;

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/request/AnShengCrawlerApplyApplicationRequest.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerApplyApplicationRequest.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.entity.request;
+package com.jzg.quotation.ansheng.crawler.entity.request;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.jzg.quotation.commons.utils.TimeProcessing;

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/request/AnShengCrawlerAutoSpecialPromiseRequest.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerAutoSpecialPromiseRequest.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.entity.request;
+package com.jzg.quotation.ansheng.crawler.entity.request;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;

+ 2 - 2
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/request/AnShengCrawlerCalculatePremiumApplyMessage.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerCalculatePremiumApplyMessage.java

@@ -1,12 +1,12 @@
-package com.jzg.ansheng.crawler.entity.request;
+package com.jzg.quotation.ansheng.crawler.entity.request;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.google.common.collect.Lists;
-import com.jzg.ansheng.crawler.entity.response.AnShengCrawlerSearchVehicleByVinResponse;
 import com.jzg.commons.entity.quote.vo.CarInfoVo;
 import com.jzg.commons.entity.quote.vo.CustomerInfoVo;
 import com.jzg.commons.entity.quote.vo.KindInfoVo;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
+import com.jzg.quotation.ansheng.crawler.entity.response.AnShengCrawlerSearchVehicleByVinResponse;
 import com.jzg.quotation.commons.utils.TimeProcessing;
 import lombok.AllArgsConstructor;
 import lombok.Data;

+ 2 - 2
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/request/AnShengCrawlerCheckLoginRequest.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerCheckLoginRequest.java

@@ -1,7 +1,7 @@
-package com.jzg.ansheng.crawler.entity.request;
+package com.jzg.quotation.ansheng.crawler.entity.request;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.jzg.ansheng.crawler.constant.AnShengCrawlerSystemConstant;
+import com.jzg.quotation.ansheng.crawler.constant.AnShengCrawlerSystemConstant;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 

+ 4 - 4
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/request/AnShengCrawlerCheckVerificationRequest.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerCheckVerificationRequest.java

@@ -1,7 +1,7 @@
-package com.jzg.ansheng.crawler.entity.request;
+package com.jzg.quotation.ansheng.crawler.entity.request;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.jzg.ansheng.crawler.constant.AnShengCrawlerSystemConstant;
+import com.jzg.quotation.ansheng.crawler.constant.AnShengCrawlerSystemConstant;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
@@ -26,7 +26,7 @@ public class AnShengCrawlerCheckVerificationRequest {
     private String key;
 
     @JsonProperty("acountName")
-    private String accountName;
+    private String acountName;
 
     @JsonProperty("clientId")
     private String clientId;
@@ -38,7 +38,7 @@ public class AnShengCrawlerCheckVerificationRequest {
         this.x = x;
         this.y = y;
         this.key = key;
-        this.accountName = accountName;
+        this.acountName = accountName;
         this.clientId = AnShengCrawlerSystemConstant.CLIENT_ID;
         this.accountType = AnShengCrawlerSystemConstant.ACCOUNT_TYPE;
     }

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/request/AnShengCrawlerFileUploadRequest.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerFileUploadRequest.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.entity.request;
+package com.jzg.quotation.ansheng.crawler.entity.request;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.AllArgsConstructor;

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/request/AnShengCrawlerPaymentRequest.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerPaymentRequest.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.entity.request;
+package com.jzg.quotation.ansheng.crawler.entity.request;
 
 
 import com.fasterxml.jackson.annotation.JsonProperty;

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/request/AnShengCrawlerQueryDocumentsInformationRequest.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerQueryDocumentsInformationRequest.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.entity.request;
+package com.jzg.quotation.ansheng.crawler.entity.request;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.jzg.quotation.commons.utils.TimeProcessing;

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/request/AnShengCrawlerQueryPrintPdfRequest.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerQueryPrintPdfRequest.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.entity.request;
+package com.jzg.quotation.ansheng.crawler.entity.request;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.AllArgsConstructor;

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/request/AnShengCrawlerSearchVehicleByVinRequest.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerSearchVehicleByVinRequest.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.entity.request;
+package com.jzg.quotation.ansheng.crawler.entity.request;
 
 
 import com.fasterxml.jackson.annotation.JsonProperty;

+ 2 - 2
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/request/AnShengCrawlerVerifyRequest.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/request/AnShengCrawlerVerifyRequest.java

@@ -1,7 +1,7 @@
-package com.jzg.ansheng.crawler.entity.request;
+package com.jzg.quotation.ansheng.crawler.entity.request;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.jzg.ansheng.crawler.constant.AnShengCrawlerSystemConstant;
+import com.jzg.quotation.ansheng.crawler.constant.AnShengCrawlerSystemConstant;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/response/AnShengCrawlerApplyApplicationResponse.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/response/AnShengCrawlerApplyApplicationResponse.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.entity.response;
+package com.jzg.quotation.ansheng.crawler.entity.response;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/response/AnShengCrawlerAutoSpecialPromiseResponse.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/response/AnShengCrawlerAutoSpecialPromiseResponse.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.entity.response;
+package com.jzg.quotation.ansheng.crawler.entity.response;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/response/AnShengCrawlerCalculatePremiumApplyResponse.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/response/AnShengCrawlerCalculatePremiumApplyResponse.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.entity.response;
+package com.jzg.quotation.ansheng.crawler.entity.response;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/response/AnShengCrawlerFileUploadResponse.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/response/AnShengCrawlerFileUploadResponse.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.entity.response;
+package com.jzg.quotation.ansheng.crawler.entity.response;
 
 
 import com.fasterxml.jackson.annotation.JsonProperty;

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/response/AnShengCrawlerGetUserDetailResponse.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/response/AnShengCrawlerGetUserDetailResponse.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.entity.response;
+package com.jzg.quotation.ansheng.crawler.entity.response;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/response/AnShengCrawlerPaymentResponse.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/response/AnShengCrawlerPaymentResponse.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.entity.response;
+package com.jzg.quotation.ansheng.crawler.entity.response;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/response/AnShengCrawlerQueryDocumentsInformationResponse.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/response/AnShengCrawlerQueryDocumentsInformationResponse.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.entity.response;
+package com.jzg.quotation.ansheng.crawler.entity.response;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/response/AnShengCrawlerSearchVehicleByVinResponse.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/response/AnShengCrawlerSearchVehicleByVinResponse.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.entity.response;
+package com.jzg.quotation.ansheng.crawler.entity.response;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.jzg.quotation.commons.filter.CarModelsFilter;

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/entity/response/AnShengCrawlerVerifyResponse.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/entity/response/AnShengCrawlerVerifyResponse.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.entity.response;
+package com.jzg.quotation.ansheng.crawler.entity.response;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/properties/AnShengCrawlerProperties.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/properties/AnShengCrawlerProperties.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.properties;
+package com.jzg.quotation.ansheng.crawler.properties;
 
 
 import lombok.Data;

+ 2 - 2
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/repository/AnShengCrawlerOrderRepository.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/repository/AnShengCrawlerOrderRepository.java

@@ -1,6 +1,6 @@
-package com.jzg.ansheng.crawler.repository;
+package com.jzg.quotation.ansheng.crawler.repository;
 
-import com.jzg.ansheng.crawler.entity.po.AnShengCrawlerOrder;
+import com.jzg.quotation.ansheng.crawler.entity.po.AnShengCrawlerOrder;
 import com.jzg.quotation.commons.repository.BaseRepository;
 import org.springframework.stereotype.Repository;
 

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/service/AnShengCrawlerLoginService.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/service/AnShengCrawlerLoginService.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.service;
+package com.jzg.quotation.ansheng.crawler.service;
 
 public interface AnShengCrawlerLoginService {
 

+ 2 - 2
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/service/AnShengCrawlerOrderService.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/service/AnShengCrawlerOrderService.java

@@ -1,6 +1,6 @@
-package com.jzg.ansheng.crawler.service;
+package com.jzg.quotation.ansheng.crawler.service;
 
-import com.jzg.ansheng.crawler.entity.po.AnShengCrawlerOrder;
+import com.jzg.quotation.ansheng.crawler.entity.po.AnShengCrawlerOrder;
 
 public interface AnShengCrawlerOrderService {
 

+ 1 - 1
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/service/AnShengCrawlerRequest.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/service/AnShengCrawlerRequest.java

@@ -1,4 +1,4 @@
-package com.jzg.ansheng.crawler.service;
+package com.jzg.quotation.ansheng.crawler.service;
 
 import com.jzg.quotation.commons.service.QuotationCrawlerBaseService;
 

+ 14 - 12
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/service/impl/AnShengCrawlerLoginServiceImpl.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/service/impl/AnShengCrawlerLoginServiceImpl.java

@@ -1,12 +1,12 @@
-package com.jzg.ansheng.crawler.service.impl;
-
-import com.jzg.ansheng.crawler.component.AnShengCrawlerRequestComponent;
-import com.jzg.ansheng.crawler.entity.request.AnShengCrawlerCheckLoginRequest;
-import com.jzg.ansheng.crawler.entity.request.AnShengCrawlerCheckVerificationRequest;
-import com.jzg.ansheng.crawler.entity.request.AnShengCrawlerVerifyRequest;
-import com.jzg.ansheng.crawler.entity.response.AnShengCrawlerVerifyResponse;
-import com.jzg.ansheng.crawler.service.AnShengCrawlerLoginService;
+package com.jzg.quotation.ansheng.crawler.service.impl;
+
 import com.jzg.commons.entity.quote.vo.identify.SliderCaptchaVo;
+import com.jzg.quotation.ansheng.crawler.component.AnShengCrawlerRequestComponent;
+import com.jzg.quotation.ansheng.crawler.entity.request.AnShengCrawlerCheckLoginRequest;
+import com.jzg.quotation.ansheng.crawler.entity.request.AnShengCrawlerCheckVerificationRequest;
+import com.jzg.quotation.ansheng.crawler.entity.request.AnShengCrawlerVerifyRequest;
+import com.jzg.quotation.ansheng.crawler.entity.response.AnShengCrawlerVerifyResponse;
+import com.jzg.quotation.ansheng.crawler.service.AnShengCrawlerLoginService;
 import com.jzg.quotation.commons.service.ExteriorUtilsRequest;
 import lombok.RequiredArgsConstructor;
 import org.springframework.http.HttpHeaders;
@@ -30,7 +30,7 @@ public class AnShengCrawlerLoginServiceImpl implements AnShengCrawlerLoginServic
         // 获取验证码
         for (int i = 0; i < LOGIN_NUMBER; i++) {
             AnShengCrawlerVerifyRequest anShengCrawlerVerifyRequest = new AnShengCrawlerVerifyRequest(username, password);
-            AnShengCrawlerVerifyResponse.DataDTO dataDTO = anShengCrawlerRequestComponent.crawlerVerify(anShengCrawlerVerifyRequest);
+            AnShengCrawlerVerifyResponse.DataDTO dataDTO = anShengCrawlerRequestComponent.crawlerVerify(anShengCrawlerVerifyRequest, httpHeaders);
 
             AnShengCrawlerVerifyResponse.DataDTO.ImageVerificationDTO imageVerification = dataDTO.getImageVerification();
             // 滑块验证码识别
@@ -39,10 +39,12 @@ public class AnShengCrawlerLoginServiceImpl implements AnShengCrawlerLoginServic
             AnShengCrawlerCheckVerificationRequest anShengCrawlerCheckVerificationRequest = new AnShengCrawlerCheckVerificationRequest(integers.get(0)
                     .toString(), integers.get(1).toString(), imageVerification.getUserFlag(), username);
             boolean b = anShengCrawlerRequestComponent.checkVerification(anShengCrawlerCheckVerificationRequest, httpHeaders);
-            // 登录
-            AnShengCrawlerCheckLoginRequest anShengCrawlerCheckLoginRequest = new AnShengCrawlerCheckLoginRequest(imageVerification.getUserFlag(), username, password);
-            HttpHeaders login = anShengCrawlerRequestComponent.login(anShengCrawlerCheckLoginRequest, httpHeaders);
             if (b) {
+                // 登录
+                AnShengCrawlerCheckLoginRequest anShengCrawlerCheckLoginRequest = new AnShengCrawlerCheckLoginRequest(imageVerification.getUserFlag(), username, password);
+                anShengCrawlerRequestComponent.login(anShengCrawlerCheckLoginRequest, httpHeaders);
+                //  授权
+                anShengCrawlerRequestComponent.authorize(httpHeaders);
                 break;
             }
         }

+ 4 - 4
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/service/impl/AnShengCrawlerOrderServiceImpl.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/service/impl/AnShengCrawlerOrderServiceImpl.java

@@ -1,9 +1,9 @@
-package com.jzg.ansheng.crawler.service.impl;
+package com.jzg.quotation.ansheng.crawler.service.impl;
 
 
-import com.jzg.ansheng.crawler.entity.po.AnShengCrawlerOrder;
-import com.jzg.ansheng.crawler.repository.AnShengCrawlerOrderRepository;
-import com.jzg.ansheng.crawler.service.AnShengCrawlerOrderService;
+import com.jzg.quotation.ansheng.crawler.entity.po.AnShengCrawlerOrder;
+import com.jzg.quotation.ansheng.crawler.repository.AnShengCrawlerOrderRepository;
+import com.jzg.quotation.ansheng.crawler.service.AnShengCrawlerOrderService;
 import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
 

+ 14 - 12
tenant/insurance/quotation-ansheng/src/main/java/com/jzg/ansheng/crawler/service/impl/AnShengCrawlerRequestImpl.java → tenant/insurance/quotation-ansheng/src/main/java/com/jzg/quotation/ansheng/crawler/service/impl/AnShengCrawlerRequestImpl.java

@@ -1,21 +1,21 @@
-package com.jzg.ansheng.crawler.service.impl;
+package com.jzg.quotation.ansheng.crawler.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.bean.copier.CopyOptions;
-import com.jzg.ansheng.crawler.build.AnShengCrawlerQuoteResultsVoBuild;
-import com.jzg.ansheng.crawler.component.AnShengCrawlerCacheComponent;
-import com.jzg.ansheng.crawler.component.AnShengCrawlerRequestComponent;
-import com.jzg.ansheng.crawler.entity.po.AnShengCrawlerOrder;
-import com.jzg.ansheng.crawler.entity.request.*;
-import com.jzg.ansheng.crawler.entity.response.*;
-import com.jzg.ansheng.crawler.service.AnShengCrawlerLoginService;
-import com.jzg.ansheng.crawler.service.AnShengCrawlerOrderService;
-import com.jzg.ansheng.crawler.service.AnShengCrawlerRequest;
 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.quotation.ansheng.crawler.build.AnShengCrawlerQuoteResultsVoBuild;
+import com.jzg.quotation.ansheng.crawler.component.AnShengCrawlerCacheComponent;
+import com.jzg.quotation.ansheng.crawler.component.AnShengCrawlerRequestComponent;
+import com.jzg.quotation.ansheng.crawler.entity.po.AnShengCrawlerOrder;
+import com.jzg.quotation.ansheng.crawler.entity.request.*;
+import com.jzg.quotation.ansheng.crawler.entity.response.*;
+import com.jzg.quotation.ansheng.crawler.service.AnShengCrawlerLoginService;
+import com.jzg.quotation.ansheng.crawler.service.AnShengCrawlerOrderService;
+import com.jzg.quotation.ansheng.crawler.service.AnShengCrawlerRequest;
 import com.jzg.quotation.commons.annotation.QuoteCrawlerService;
 import com.jzg.quotation.commons.constant.InsuranceCode;
-import com.jzg.commons.entity.quote.vo.base.LoginBase;
 import com.jzg.quotation.commons.filter.CarModelsFilterUtils;
 import lombok.RequiredArgsConstructor;
 import org.springframework.http.HttpHeaders;
@@ -28,7 +28,7 @@ import java.util.Map;
 import java.util.Optional;
 import java.util.stream.Collectors;
 
-@QuoteCrawlerService(InsuranceCode.INSURANCE_TPBX)
+@QuoteCrawlerService(value = InsuranceCode.INSURANCE_TPBX)
 @RequiredArgsConstructor
 public class AnShengCrawlerRequestImpl implements AnShengCrawlerRequest {
 
@@ -58,6 +58,8 @@ public class AnShengCrawlerRequestImpl implements AnShengCrawlerRequest {
         // 订单号
         final String ordersNo = quoteVo.getOrder().getOrdersNo();
 
+        anShengCrawlerLoginService.login(quoteVo.getOrder().getAttributionInformationVo().getUsername(), quoteVo.getOrder().getAttributionInformationVo().getPassword());
+
         HttpHeaders httpHeaders = new HttpHeaders();
         // 车架号查询
         AnShengCrawlerSearchVehicleByVinRequest anShengCrawlerSearchVehicleByVinRequest = new AnShengCrawlerSearchVehicleByVinRequest();

+ 87 - 0
tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/utils/CookieParseUtils.java

@@ -0,0 +1,87 @@
+package com.jzg.quotation.commons.utils;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+public final class CookieParseUtils {
+
+    public CookieParseUtils() {
+        throw new IllegalStateException("Utility class");
+    }
+
+    public static final String KEY = "name";
+
+    public static final String VALUE = "value";
+
+    public static final String COOKIE = "Cookie";
+
+    public static final String SET_COOKIE = "Set-Cookie";
+
+    public static final String JSESSIONID = "JSESSIONID";
+
+    public static final String AUTHORIZATION = "Authorization";
+
+    public static final String BEARER = "Bearer ";
+
+    public static Map<String, String> parseSetCookie(String setCookie) {
+        Map<String, String> cookieMap = new HashMap<>();
+        String[] parts = setCookie.split(";\\s*");
+
+        // 第一部分总是 name=value
+        if (parts.length > 0) {
+            String[] nameValue = parts[0].split("=", 2);
+            if (nameValue.length == 2) {
+                cookieMap.put(KEY, nameValue[0].trim());
+                cookieMap.put(VALUE, nameValue[1].trim());
+            }
+        }
+
+        // 处理其他属性
+        for (int i = 1; i < parts.length; i++) {
+            String[] keyValue = parts[i].split("=", 2);
+            String key = keyValue[0].trim().toLowerCase();
+            String value = keyValue.length > 1 ? keyValue[1].trim() : null;
+
+            if ("expires".equals(key) || "max-age".equals(key) || "domain".equals(key) || "path".equals(key) || "samesite".equals(key)) {
+                cookieMap.put(key, value);
+            } else if ("secure".equals(key) || "httponly".equals(key)) {
+                cookieMap.put(key, "true"); // 标志属性
+            }
+        }
+        return cookieMap;
+    }
+
+    public static Map<String, String> parseCookie(List<String> cookies) {
+        return Optional.ofNullable(cookies)
+                .orElse(new ArrayList<>())
+                .stream()
+                .map(CookieParseUtils::parseSetCookie)
+                .collect(Collectors.toMap(x -> x.get(KEY), y -> y.get(VALUE)));
+    }
+
+
+    public static Map<String, String> parseCookie(String cookies) {
+        return parseCookie(Arrays.stream(cookies.split("; "))
+                .filter(s -> !s.isEmpty())
+                .map(x -> x + "; ")
+                .collect(Collectors.toList()));
+    }
+
+
+    public static String listToStrCookie(List<String> cookies) {
+        Map<String, String> cookieMap = parseCookie(cookies);
+        return toStringCookie(cookieMap);
+    }
+
+    public static String toStringCookie(Map<String, String> cookieMap) {
+        StringBuilder stringBuilder = new StringBuilder();
+        for (String s : cookieMap.keySet()) {
+            stringBuilder.append(s).append("=").append(cookieMap.get(s)).append("; ");
+        }
+        return stringBuilder.toString();
+    }
+
+
+}
+
+

+ 6 - 0
tenant/insurance/quotation-summary/pom.xml

@@ -102,6 +102,12 @@
             <scope>compile</scope>
         </dependency>
 
+        <dependency>
+            <groupId>com.jzg</groupId>
+            <artifactId>quotation-ansheng</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+
         <!-- thymeleaf 模版类 -->
         <dependency>
             <groupId>org.springframework.boot</groupId>

+ 9 - 2
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/converter/QuoteInfoConverter.java

@@ -6,9 +6,12 @@ import com.jzg.commons.entity.quote.vo.KindInfoVo;
 import com.jzg.commons.constants.quote.enums.base.QuoteRuleGroup;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
 import com.jzg.quotation.summary.entity.po.QuoteRuleMapping;
+import org.checkerframework.checker.units.qual.A;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 import java.util.stream.Collectors;
 
 /**
@@ -25,7 +28,9 @@ public class QuoteInfoConverter {
      * @param quoteRuleMappingList 报价规则映射
      */
     public static void converterCarInfoVo(QuoteVo quoteVo, List<QuoteRuleMapping> quoteRuleMappingList) {
-        Map<String, Map<String, QuoteRuleMapping>> groupCodeMap = quoteRuleMappingList.stream()
+        Map<String, Map<String, QuoteRuleMapping>> groupCodeMap = Optional.ofNullable(quoteRuleMappingList)
+                .orElse(new ArrayList<>())
+                .stream()
                 .collect(Collectors.groupingBy(QuoteRuleMapping::getGroupCode, Collectors.toMap(QuoteRuleMapping::getPlatformCode, quoteRuleMapping -> quoteRuleMapping)));
         QuoteRuleConverter quoteRuleConverter = new QuoteRuleConverter(groupCodeMap);
         vehicleInformation(quoteRuleConverter, quoteVo.getCarInfoVo());
@@ -83,7 +88,9 @@ public class QuoteInfoConverter {
 
         String groupCode = carInfoVo.getEnergyTypeCode()
                 .equals("0") ? QuoteRuleGroup.BUS_KIND.getCode() : QuoteRuleGroup.NEW_ENERGY_KIND.getCode();
-        Map<String, QuoteRuleMapping> ruleMappingMap = quoteRuleMappingList.stream()
+        Map<String, QuoteRuleMapping> ruleMappingMap = Optional.ofNullable(quoteRuleMappingList)
+                .orElse(new ArrayList<>())
+                .stream()
                 .filter(x -> x.getGroupCode().equals(groupCode))
                 .collect(Collectors.toMap(QuoteRuleMapping::getPlatformCode, x -> x));
         kindInfoVo.forEach(kind -> {