Forráskód Böngészése

车辆查询参数

helixiao 1 éve
szülő
commit
0314841003

+ 1 - 1
tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/client/OrgClient.java

@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
-@FeignClient(name="jzg-organization",url = "http://192.168.0.250:8084/")
+@FeignClient(name="jzg-organization",url = "http://localhost:8084/")
 public interface OrgClient {
 
     /**

+ 21 - 45
tenant/insurance/quotation-huatai/src/main/java/com/jzg/quotation/huatai/crawler/component/HtCrawlerRequestComponent.java

@@ -118,8 +118,6 @@ public class HtCrawlerRequestComponent {
 
             // 获取响应码
             int responseCode = connection.getResponseCode();
-//            Map<String, List<String>> requestProperties = connection.getRequestProperties();
-//            String cookie1 = connection.getRequestProperty("Cookie");
             System.out.println("响应码: " + responseCode);
 
             // 获取所有响应头
@@ -145,48 +143,6 @@ public class HtCrawlerRequestComponent {
             System.err.println("请求过程中发生错误: " + e.getMessage());
             e.printStackTrace();
         }
-
-        // 创建WebClient实例
-//        WebClient webClient = WebClient.create();
-//
-//        // 发送GET请求,获取完整响应(包括响应头)
-//        Mono<ClientResponse> responseMono = webClient.get()
-//                .uri("http://127.0.0.1/ht")
-//                .header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7")
-//                .header("Accept-Language", "zh-CN,zh;q=0.9,en;q=0.8")
-//                .header("Cache-Control", "no-cache")
-//                .header("Connection", "keep-alive")
-//                .header("Pragma", "no-cache")
-//                .header("Upgrade-Insecure-Requests", "1")
-//                .header("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36")
-//                .exchangeToMono(response -> Mono.just(response));
-//
-//        // 阻塞获取完整响应
-//        ClientResponse response = responseMono.block();
-//
-//        if (response != null) {
-//            // 获取响应状态码
-//            System.out.println("响应状态码: " + response.statusCode());
-//
-//            // 获取响应头中的Cookie
-//            HttpHeaders headers = response.headers().asHttpHeaders();
-//            List<String> cookies = headers.get("Set-Cookie");
-//
-//            if (cookies != null && !cookies.isEmpty()) {
-//                System.out.println("获取到的Cookie:");
-//                for (String cookie : cookies) {
-//                    System.out.println(cookie);
-//                }
-//                return cookies;
-//            } else {
-//                System.out.println("响应头中没有Cookie");
-//            }
-//
-//            // 读取响应体
-//            String responseBody = response.bodyToMono(String.class).block();
-//            System.out.println("\n响应体内容: " + responseBody);
-//        }
-
         return null;
     }
 
@@ -206,7 +162,27 @@ public class HtCrawlerRequestComponent {
         headers.add("Cache-Control", "no-cache");
         headers.add("Connection","keep-alive");
         headers.add("Content-Type", "application/x-www-form-urlencoded");
-        headers.add("Origin", "http://172.16.100.27:9000");
+        headers.add("Origin", "http://172.16.100.37:9999");
+        headers.add("Pragma", "no-cache");
+        headers.add("Upgrade-Insecure-Requests", "1");
+        headers.add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36");
+
+        return headers;
+    }
+
+    public HttpHeaders getHeaders1() {
+        String cookie = getCookie();
+        if (cookie.isEmpty()) {
+            cookie = getHaTaiCookie(RequestUrl.NE_COOKIE.getRequestUrl(huaTaiCrawlerProperties.getBaseUrl()));
+        }
+        HttpHeaders headers = new HttpHeaders();
+        headers.add(HtRequestConstant.COOKIE, cookie);
+        headers.add("Accept", "application/json, text/javascript, */*; q=0.01");
+        headers.add("Accept-Language","zh-CN,zh;q=0.9,en;q=0.8");
+        headers.add("Cache-Control", "no-cache");
+        headers.add("Connection","keep-alive");
+        headers.add("Content-Type", "application/x-www-form-urlencoded");
+        headers.add("Origin", "http://172.16.100.37:9999");
         headers.add("Pragma", "no-cache");
         headers.add("Upgrade-Insecure-Requests", "1");
         headers.add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36");

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

@@ -18,7 +18,7 @@ public enum RequestUrl implements CrawlerRequestUrlStandard {
 
     NE_SESSION_KEEP("sessionKeep", "session连接"),
 
-    SESSION_KEEP("http://172.16.100.27:9000/htcsp/ShakeHandsAction.do?cmd=contentInit", "session连接"),
+    SESSION_KEEP("http://172.16.100.37:9999/htcsp/ShakeHandsAction.do?cmd=contentInit", "session连接"),
 
     NE_AUTHENTICATE("/login", "登录"),
 

+ 23 - 2
tenant/insurance/quotation-huatai/src/main/java/com/jzg/quotation/huatai/crawler/entity/Request/HtCrawlerCarQueryRequest.java

@@ -2,6 +2,7 @@ package com.jzg.quotation.huatai.crawler.entity.Request;
 
 
 import com.alibaba.fastjson.JSON;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import com.jzg.commons.entity.quote.vo.CarInfoVo;
 import com.jzg.commons.exception.SystemException;
 import com.jzg.quotation.huatai.crawler.util.HuaTaiCryptUtil;
@@ -40,11 +41,14 @@ public class HtCrawlerCarQueryRequest implements Serializable {
             throw new SystemException(e.getMessage());
         }
     }
-
+    @JsonProperty("sourceCode")
     private String sourceCode = "8";
+    @JsonProperty("accessToken")
     private String accessToken;
+    @JsonProperty("data")
     private String data;
-    private String insuredCode;
+    @JsonProperty("insuredCode")
+    private String insuredCode = "";
 
     /**
      * {
@@ -71,22 +75,39 @@ public class HtCrawlerCarQueryRequest implements Serializable {
     public static class DataDTO implements Serializable {
         @Serial
         private static final long serialVersionUID = -921901450062929380L;
+        @JsonProperty("vehicleModel")
         private String vehicleModel;
+        @JsonProperty("motortypecode")
         private String motortypecode;
+        @JsonProperty("motorusagetypecode")
         private String motorusagetypecode;
+        @JsonProperty("EACSP_MODEL_CODE_QUERY_new")
         private String EACSP_MODEL_CODE_QUERY_new;
+        @JsonProperty("EACSP_MODEL_CODE_QUERY_old")
         private String EACSP_MODEL_CODE_QUERY_old;
+        @JsonProperty("licenseplateno")
         private String licenseplateno;
+        @JsonProperty("engineno")
         private String engineno;
+        @JsonProperty("vin")
         private String vin;
+        @JsonProperty("pageno")
         private String pageno = "1";
+        @JsonProperty("rowsperpage")
         private String rowsperpage = "10";
+        @JsonProperty("reformRisk")
         private String reformRisk;
+        @JsonProperty("modelcodexh")
         private String modelcodexh;
+        @JsonProperty("checkno")
         private String checkno;
+        @JsonProperty("modelflag")
         private String modelflag = "1";
+        @JsonProperty("checkcode")
         private String checkcode;
+        @JsonProperty("gdjgvehiclecheckflag")
         private String gdjgvehiclecheckflag;
+        @JsonProperty("jLlxVehicleList")
         private List<String> jLlxVehicleList;
     }
 }

+ 17 - 1
tenant/insurance/quotation-huatai/src/main/java/com/jzg/quotation/huatai/crawler/entity/Request/HtCrawlerLoginRequest.java

@@ -1,5 +1,6 @@
 package com.jzg.quotation.huatai.crawler.entity.Request;
 
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 import java.io.Serial;
@@ -20,21 +21,36 @@ public class HtCrawlerLoginRequest implements Serializable {
         this.password = password;
         this.comcode = comcode;
     }
-
+    @JsonProperty("username")
     private String username;
+    @JsonProperty("password")
     private String password;
+    @JsonProperty("comcode")
     private String comcode;
+    @JsonProperty("verificationCode")
     private String verificationCode;
+    @JsonProperty("yanzhengtupianflag")
     private String yanzhengtupianflag;
+    @JsonProperty("brownVerb")
     private String brownVerb = "122.0.0.0";
+    @JsonProperty("brownVern")
     private String brownVern = "Chrome";
+    @JsonProperty("bindflag")
     private String bindflag;
+    @JsonProperty("customerIp")
     private String customerIp = "127.0.0.1";
+    @JsonProperty("customerCity")
     private String customerCity = "未知";
+    @JsonProperty("userIsNowFlag")
     private String userIsNowFlag;
+    @JsonProperty("sendNecessityIpt")
     private String sendNecessityIpt = "X";
+    @JsonProperty("wwaUserCode")
     private String wwaUserCode;
+    @JsonProperty("weChatFlag")
     private String weChatFlag;
+    @JsonProperty("isVpn")
     private String isVpn = "1";
+    @JsonProperty("validStatus")
     private String validStatus = "1";
 }

+ 1 - 1
tenant/insurance/quotation-huatai/src/main/java/com/jzg/quotation/huatai/crawler/service/Impl/HuaTaiCrawlerRequestImpl.java

@@ -94,7 +94,7 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
         AttributionInformationVo attributionInformationVo = quoteVo.getOrder().getAttributionInformationVo();
         //获取配置信息
         HtCrawlerConfigureParameters parameters = ConfigureParametersConversion.conversionEntity(HtCrawlerConfigureParameters.class, attributionInformationVo.getConfigInfo());
-        HttpHeaders headers = htCrawlerRequestComponent.getHeaders();
+        HttpHeaders headers = htCrawlerRequestComponent.getHeaders1();
         HtCrawlerCarQueryRequest carQueryRequest = new HtCrawlerCarQueryRequest(carInfoVo);
         HtCrawlerCarQueryResponse.DataDTO dataDTO = null;
         try {