Przeglądaj źródła

添加泰康 preciseInit 接口

wlq 1 rok temu
rodzic
commit
cdd3228d08

+ 2 - 0
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/client/HttpURL.java

@@ -42,4 +42,6 @@ public interface HttpURL {
     String saveBasicInfo = host + "/carSelfService/rest/save/basicInfo";
 
     String initQuote = host + "/carSelfService/rest/init/quote";
+
+    String preciseInit = host + "/carSelfService/rest/precise/init";
 }

+ 5 - 0
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/entity/InitQuoteParam.java

@@ -3,6 +3,11 @@ package com.jzg.quotation.taikang.entity;
 import lombok.Getter;
 import lombok.Setter;
 
+/**
+ *
+ * {"channelCode":"OffWeb","orderID":"WBPC202503061106595800000","tplatformId":"feda77e829d4dedbbd8b4e236bacfac5","tplatLoginKey":"5fb6bdba974e17ec0db8c8ad4faab1ba1"}
+ *
+ */
 @Setter
 @Getter
 public class InitQuoteParam {

+ 38 - 0
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/entity/PreciseInitParam.java

@@ -0,0 +1,38 @@
+package com.jzg.quotation.taikang.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ *
+ * {"channelCode":"OffWeb","orderID":"WBPC202503061106595800000","initFlag":"init","tplatformId":"feda77e829d4dedbbd8b4e236bacfac5","tplatLoginKey":"5fb6bdba974e17ec0db8c8ad4faab1ba1"}
+ *
+ */
+@Setter
+@Getter
+public class PreciseInitParam {
+    /**
+     * 渠道代码,标识订单的来源渠道
+     */
+    private String channelCode;
+
+    /**
+     * 订单ID,唯一标识一个订单
+     */
+    private String orderID;
+
+    /**
+     * 初始化标志,标识订单是否处于初始化状态
+     */
+    private String initFlag;
+
+    /**
+     * t平台ID,标识订单所属的平台
+     */
+    private String tplatformId;
+
+    /**
+     * t平台登录密钥,用于登录t平台的认证信息
+     */
+    private String tplatLoginKey;
+}

+ 124 - 0
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/entity/PreciseInitResult.java

@@ -0,0 +1,124 @@
+package com.jzg.quotation.taikang.entity;
+
+import com.jzg.quotation.taikang.client.BaseResponse;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+
+@Setter
+@Getter
+public class PreciseInitResult {
+    public static final class Response extends BaseResponse<PreciseInitResult> {}
+
+    /**
+     * 商业险折扣
+     */
+    private BigDecimal bzDisCount;
+
+    /**
+     * 交强险折扣
+     */
+    private BigDecimal ciDisCount;
+
+    /**
+     * 费率调整系数
+     */
+    private BigDecimal elr;
+
+    /**
+     * 整单优惠金额
+     */
+    private BigDecimal entireExpDiscount;
+
+    /**
+     * 整单推荐优惠金额
+     */
+    private BigDecimal entireRecommenDiscount;
+
+    /**
+     * 标志对象
+     */
+    private Flag flag;
+
+    /**
+     * 新车优惠比例
+     */
+    private BigDecimal goodStartDiscount;
+
+    /**
+     * 其他信息对象
+     */
+    private Other other;
+
+    /**
+     * 风险评分
+     */
+    private BigDecimal riskScore;
+
+    // 内部类 Flag
+    @Setter
+    @Getter
+    public static class Flag {
+        /**
+         * 预期显示标志
+         */
+        private Boolean expectShowFlag;
+    }
+
+    // 内部类 Other
+    @Setter
+    @Getter
+    public static class Other {
+        /**
+         * 实际价值
+         */
+        private BigDecimal actualValue;
+
+        /**
+         * 车主变更标志
+         */
+        private String chgOwnerFlag;
+
+        /**
+         * 折扣月数
+         */
+        private Integer discountMonths;
+
+        /**
+         * 购车价格
+         */
+        private BigDecimal purchasePrice;
+
+        /**
+         * 报价类型
+         */
+        private String quotationType;
+
+        /**
+         * 座位数
+         */
+        private Integer seats;
+
+        /**
+         * 特殊车辆标志
+         */
+        private String specialCarFlag;
+
+        /**
+         * 使用年限
+         */
+        private Integer useYear;
+
+        /**
+         * 车主信息提示
+         */
+        private String vehicleOwnerMessage;
+
+        /**
+         * 车主信息提示类型
+         */
+        private String vehicleOwnerMessageType;
+    }
+
+}

+ 21 - 0
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/service/TaiKangHttpService.java

@@ -330,4 +330,25 @@ public class TaiKangHttpService {
 
         return response.getData();
     }
+
+    /**
+     * 12
+     *
+     * @return
+     */
+    public PreciseInitResult preciseInit(String tplatformId, String orderId) {
+        PreciseInitParam param = new PreciseInitParam();
+        param.setChannelCode("OffWeb");
+        param.setOrderID(orderId);
+        param.setTplatformId(tplatformId);
+        param.setInitFlag("init");
+        param.setTplatLoginKey("5fb6bdba974e17ec0db8c8ad4faab1ba1");
+
+        HttpHeaders httpHeaders = new HttpHeaders();
+        httpHeaders.add("tkCarRequestToken", token());
+
+        PreciseInitResult.Response response = client.requestUrl(HttpURL.preciseInit, param, PreciseInitResult.Response.class, httpHeaders);
+
+        return response.getData();
+    }
 }

+ 11 - 0
tenant/insurance/quotation-taikang/src/test/java/com/jzg/quotation/taikang/service/TaiKangHttpServiceTest.java

@@ -545,4 +545,15 @@ public class TaiKangHttpServiceTest {
         System.out.println(JSON.toJSONString(initQuoteResult));
     }
 
+    @Test
+    @Order(13)
+    public void preciseInit() {
+        PreciseInitResult preciseInitResult = taiKangHttpService.preciseInit("feda77e829d4dedbbd8b4e236bacfac5", "WBPC202503061106595800000");
+
+        assertNotNull(preciseInitResult);
+
+        System.out.println();
+        System.out.println(JSON.toJSONString(preciseInitResult));
+    }
+
 }