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

[诚泰] feat(报价): hygeiaGet

wlq 1 год назад
Родитель
Сommit
2c73e7875a

+ 4 - 0
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/client/ChengTaiAPI.java

@@ -24,6 +24,7 @@ public enum ChengTaiAPI implements CrawlerRequestUrlStandard {
     GetPolicyModel("/api/vehicle/query/getPolicyModel", "获取详情"),
     Insure("/api/vehicle/query/payPageQuery/{uuid}/insure", "获取支付链接"),
     DownloadAddress("/api/vehicle/core/downloadAddress", "获取保单链接"),
+    HygeiaGet("/api/vehicle/core/hygeia/get", "获取意外险"),
 
     ;
 
@@ -56,4 +57,7 @@ public enum ChengTaiAPI implements CrawlerRequestUrlStandard {
         this.url = host + this.uri;
     }
 
+    static {
+        ChengTaiAPIHelper.initAPI("https://b2b.champion-ic.com");
+    }
 }

+ 146 - 0
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/model/entity/ChengTaiAccidentInsurance.java

@@ -0,0 +1,146 @@
+package com.jzg.quotation.chengtai.crawler.model.entity;
+
+import com.jzg.quotation.commons.utils.UnknownFieldEntity;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+@Setter
+@Getter
+public class ChengTaiAccidentInsurance extends UnknownFieldEntity {
+    /**
+     * 产品ID
+     */
+    private String id;
+
+    /**
+     * 创建时间
+     */
+    private String createTime;
+
+    /**
+     * 方案代码
+     */
+    private String planCode;
+
+    /**
+     * 险种代码
+     */
+    private String riskCode;
+
+    /**
+     * 保额(字符串类型存储double值)
+     */
+    private String amount;
+
+    /**
+     * 总保费(字符串类型存储double值)
+     */
+    private String totalPremium;
+
+    /**
+     * 公司代码
+     */
+    private String comCode;
+
+    /**
+     * 产品名称
+     */
+    private String name;
+
+    /**
+     * 产品详情
+     */
+    private String detail;
+
+    /**
+     * 座位数(字符串类型存储数值)
+     */
+    private String seat;
+
+    /**
+     * 手续费比例(字符串类型存储double值)
+     */
+    private String feePercent;
+
+    /**
+     * 特别约定条款
+     */
+    private String assumpsit;
+
+    /**
+     * 车辆种类代码
+     */
+    private String carKindCode;
+
+    /**
+     * 使用性质代码
+     */
+    private String useNatureCode;
+
+    /**
+     * 投保份数
+     */
+    private Integer insuredAmount;
+
+    /**
+     * 产品类型
+     */
+    private String type;
+
+    /**
+     * 保障责任列表
+     */
+    private List<Coverage> coverages;
+
+
+    @Getter
+    @Setter
+    public static class Coverage extends UnknownFieldEntity {
+        /**
+         * 责任ID
+         */
+        private String id;
+
+        /**
+         * 创建时间
+         */
+        private String createTime;
+
+        /**
+         * 责任代码
+         */
+        private String liabilityCode;
+
+        /**
+         * 责任保额(字符串类型存储double值)
+         */
+        private String amount;
+
+        /**
+         * 责任保费(字符串类型存储double值)
+         */
+        private String premium;
+
+        /**
+         * 责任总保费(字符串类型存储double值)
+         */
+        private String totalPremium;
+
+        /**
+         * 责任名称
+         */
+        private String name;
+
+        /**
+         * 关联产品ID
+         */
+        private String productId;
+
+        /**
+         * 责任代码
+         */
+        private String productCode;
+    }
+}

+ 34 - 0
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/model/param/ChengTaiHygeiaGetParam.java

@@ -0,0 +1,34 @@
+package com.jzg.quotation.chengtai.crawler.model.param;
+
+import com.jzg.quotation.commons.utils.UnknownFieldEntity;
+import lombok.Getter;
+import lombok.Setter;
+
+@Setter
+@Getter
+public class ChengTaiHygeiaGetParam extends UnknownFieldEntity {
+    /**
+     * 公司代码
+     */
+    private String comCode;
+
+    /**
+     * 座位数
+     */
+    private Integer seat;
+
+    /**
+     * 险种代码
+     */
+    private String riskCode;
+
+    /**
+     * 车辆种类代码
+     */
+    private String carKindCode;
+
+    /**
+     * 使用性质代码
+     */
+    private String useNatureCode;
+}

+ 16 - 0
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/model/result/ChengTaiHygeiaGetResult.java

@@ -0,0 +1,16 @@
+package com.jzg.quotation.chengtai.crawler.model.result;
+
+import com.jzg.quotation.chengtai.crawler.client.ChengTaiResponse;
+import com.jzg.quotation.chengtai.crawler.model.entity.ChengTaiAccidentInsurance;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+@Setter
+@Getter
+public class ChengTaiHygeiaGetResult {
+    public static class Response extends ChengTaiResponse<List<ChengTaiAccidentInsurance>> {
+
+    }
+}

+ 29 - 9
tenant/insurance/quotation-chengtai/src/main/java/com/jzg/quotation/chengtai/crawler/service/ChengTaiAPIService.java

@@ -4,14 +4,8 @@ import com.google.common.collect.Maps;
 import com.jzg.quotation.chengtai.crawler.JsonUtil;
 import com.jzg.quotation.chengtai.crawler.client.ChengTaiAPI;
 import com.jzg.quotation.chengtai.crawler.client.EncryptRSA;
-import com.jzg.quotation.chengtai.crawler.model.entity.ChengTaiApplicant;
-import com.jzg.quotation.chengtai.crawler.model.entity.ChengTaiDictionary;
-import com.jzg.quotation.chengtai.crawler.model.entity.ChengTaiJqxclassidDic;
-import com.jzg.quotation.chengtai.crawler.model.entity.ChengTaiJqxclassidDicExtData;
-import com.jzg.quotation.chengtai.crawler.model.param.ChengTaiDownloadAddressParam;
-import com.jzg.quotation.chengtai.crawler.model.param.ChengTaiFindSaleManVoByDeptCodeParam;
-import com.jzg.quotation.chengtai.crawler.model.param.ChengTaiImageUploadParam;
-import com.jzg.quotation.chengtai.crawler.model.param.ChengTaiPremiumcalParam;
+import com.jzg.quotation.chengtai.crawler.model.entity.*;
+import com.jzg.quotation.chengtai.crawler.model.param.*;
 import com.jzg.quotation.chengtai.crawler.model.result.*;
 import com.jzg.quotation.commons.component.RequestComponent;
 import jakarta.annotation.Resource;
@@ -25,7 +19,10 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.LinkedMultiValueMap;
 import org.springframework.util.MultiValueMap;
 
-import java.util.*;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
 
 @Service
 public class ChengTaiAPIService {
@@ -469,4 +466,27 @@ public class ChengTaiAPIService {
         return response.getBody();
 
     }
+
+    /**
+     * 获取意外险
+     *
+     * @param token
+     * @return
+     */
+    public List<ChengTaiAccidentInsurance> hygeiaGet(String token) {
+        ChengTaiHygeiaGetParam param = new ChengTaiHygeiaGetParam();
+        param.setComCode("0105");
+        param.setSeat(5);
+        param.setRiskCode("1158");
+        param.setCarKindCode("A0");
+        param.setUseNatureCode("8A");
+
+        HttpHeaders headers = new HttpHeaders();
+        headers.add("token", token);
+
+        ChengTaiHygeiaGetResult.Response response = post(ChengTaiAPI.HygeiaGet, param, ChengTaiHygeiaGetResult.Response.class, headers);
+
+        return response.getBody();
+
+    }
 }