Qchen 1 месяц назад
Родитель
Сommit
5c664666dd

+ 74 - 22
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/api/entity/request/CarModelQueryRequest.java

@@ -2,6 +2,8 @@ package com.jzg.quotation.chengtai.api.entity.request;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.jzg.commons.entity.quote.vo.CarInfoVo;
+import com.jzg.quotation.chengtai.api.entity.ChengTaiApiParameters;
+import com.jzg.quotation.commons.utils.SnowFlakeUtil;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
@@ -14,33 +16,83 @@ import lombok.NoArgsConstructor;
 @Data
 public class CarModelQueryRequest {
     /**
-     * 品牌型号
+     * 报文头信息(Head)
      */
-    @JsonProperty("brandName")
-    private String brandName;
+    @JsonProperty("head")
+    private head head;
 
     /**
-     * 当前页
+     * 基础信息(BasePart)
      */
-    @JsonProperty("nowPage")
-    private String nowPage;
+    @JsonProperty("body")
+    private body body;
+    @NoArgsConstructor
+    @Data
+    public static class head {
 
-    /**
-     * 每页条数
-     */
-    @JsonProperty("pageSize")
-    private String pageSize;
+        /**
+         * 用户名
+         */
+        @JsonProperty("userName")
+        private String userName;
 
-    /**
-     * 是否需要编码 前台页面直接请求,该字段不填;通过后台代码请求接口时该字段填:‘00000’
-     */
-    @JsonProperty("encode")
-    private String encode;
-
-    public CarModelQueryRequest(String brandName) {
-        this.brandName = brandName;
-        this.nowPage = "1";
-        this.pageSize = "20";
-        this.encode = "00000";
+        /**
+         * 密码
+         */
+        @JsonProperty("passWord")
+        private String passWord;
+
+        /**
+         * 外网提供的唯一标志
+         */
+        @JsonProperty("queryId")
+        private String queryId;
+
+        /**
+         * 合作伙伴代码
+         */
+        @JsonProperty("partnerCode")
+        private String partnerCode;
+
+        public head(ChengTaiApiParameters parameters) {
+            this.userName = parameters.getUserName();
+            this.passWord = parameters.getPassWord();
+            this.queryId = String.valueOf(new SnowFlakeUtil().nextId());
+            this.partnerCode = parameters.getPartnerCode();
+        }
+
+
+    }
+    @NoArgsConstructor
+    @Data
+    public static class body {
+        /**
+         * 品牌型号
+         */
+        @JsonProperty("brandName")
+        private String brandName;
+
+        /**
+         * 当前页
+         */
+        @JsonProperty("nowPage")
+        private String nowPage;
+
+        /**
+         * 每页条数
+         */
+        @JsonProperty("pageSize")
+        private String pageSize;
+        public body(String brandName) {
+            this.brandName = brandName;
+            this.nowPage = "1";
+            this.pageSize = "20";
+        }
+    }
+
+
+    public CarModelQueryRequest(ChengTaiApiParameters parameters,String brandName) {
+        this.head = new head(parameters);
+        this.body = new body(brandName);
     }
 }

+ 2 - 2
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/api/service/impl/ChengTaiApiRequestImpl.java

@@ -75,7 +75,7 @@ public class ChengTaiApiRequestImpl implements ChengTaiApiRequest {
                 attributionInformationVo.getConfigInfo());
         // 车型查询
         CarInfoVo carInfoVo = quoteVo.getCarInfoVo();
-        CarModelQueryRequest carInfoRequest = new CarModelQueryRequest(carInfoVo.getBrandName());
+        CarModelQueryRequest carInfoRequest = new CarModelQueryRequest(parameters,carInfoVo.getBrandName());
         CarModelQueryResponse carModelQueryResponse = chengTaiRequestApiComponent.carModelQuery(carInfoRequest,apiUrl);
         // 过滤车型
         CarModelQueryResponse.vehicle vehicle = CarModelsFilterUtils.to(carModelQueryResponse.getVehicleList(), carInfoVo);
@@ -373,7 +373,7 @@ public class ChengTaiApiRequestImpl implements ChengTaiApiRequest {
                 .getConfigInfo());
         // 车型
         CarInfoVo carInfoVo = new CarInfoVo(underwritingVo.getInsOrdersCarInfo());
-        CarModelQueryRequest carInfoRequest = new CarModelQueryRequest(underwritingVo.getInsOrdersCarInfo().getBrandName());
+        CarModelQueryRequest carInfoRequest = new CarModelQueryRequest(parameters,underwritingVo.getInsOrdersCarInfo().getBrandName());
         CarModelQueryResponse carModelQueryResponse = chengTaiRequestApiComponent.carModelQuery(carInfoRequest,apiUrl);
         // 过滤车型
         CarModelQueryResponse.vehicle vehicle = CarModelsFilterUtils.to(carModelQueryResponse.getVehicleList(), carInfoVo);