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

添加泰康 saveBasicInfo 接口

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

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

@@ -39,4 +39,5 @@ public interface HttpURL {
      */
     String carModelinfoCheckVehicleType = host + "/carSelfService/rest/car/modelinfo/checkVehicleType";
 
+    String saveBasicInfo = host + "/carSelfService/rest/save/basicInfo";
 }

+ 624 - 0
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/entity/SaveBasicInfoParam.java

@@ -0,0 +1,624 @@
+package com.jzg.quotation.taikang.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+@Setter
+@Getter
+public class SaveBasicInfoParam {
+
+    /**
+     * 渠道代码
+     */
+    private String channelCode;
+    /**
+     * 订单ID
+     */
+    private String orderID;
+    /**
+     * 预填标志
+     */
+    private String preFilledLastPolicyFlag;
+    /**
+     * 是否JG标志
+     */
+    private String isJgFlag;
+    /**
+     * 车辆信息
+     */
+    private CarInfo carInfoVo;
+    /**
+     * 车主信息
+     */
+    private CarOwner carOwnerVo;
+    /**
+     * 其他信息
+     */
+    private OtherInfo otherInfo;
+    /**
+     * 投保信息
+     */
+    private InsureInfo insureInfo;
+    /**
+     * 车税信息
+     */
+    private CarTax carTaxVo;
+    /**
+     * 平台ID
+     */
+    private String tplatformId;
+    /**
+     * 认证失败继续标志
+     */
+    private String authFailContinueFlag;
+    /**
+     * 来源ID
+     */
+    private String fromId;
+    /**
+     * 区域信息
+     */
+    private AreaInfo areaInfoVo;
+    /**
+     * 平台登录密钥
+     */
+    private String tplatLoginKey;
+
+
+    @Setter
+    @Getter
+    public static class CarInfo {
+        /**
+         * 燃料类型
+         */
+        private String fuelType;
+        /**
+         * 车型名称
+         */
+        private String modelName;
+        /**
+         * 吨位标志
+         */
+        private String tonnageFlag;
+        /**
+         * 车辆类型
+         */
+        private String carType;
+        /**
+         * 使用性质代码
+         */
+        private String useNatureCodeCode;
+        /**
+         * 车架号
+         */
+        private String vinNo;
+        /**
+         * 发动机号
+         */
+        private String engineNo;
+        /**
+         * 注册日期
+         */
+        private String enrollDate;
+        /**
+         * 开票日期
+         */
+        private String billDate;
+        /**
+         * 预约时间
+         */
+        private String carBookingTime;
+        /**
+         * 发票号
+         */
+        private String billNo;
+        /**
+         * 是否过户
+         */
+        private String chgOwnerFlag;
+        /**
+         * 过户日期
+         */
+        private String transferDate;
+        /**
+         * 座位数
+         */
+        private String selectedSeat;
+        /**
+         * 车牌类型
+         */
+        private String licenseType;
+        /**
+         * 车牌类型中文
+         */
+        private String licenseTypeChinese;
+        /**
+         * 车牌号
+         */
+        private String licenseNo;
+        /**
+         * 品牌名称
+         */
+        private String brandName;
+        /**
+         * 购买价格
+         */
+        private String purchasePrice;
+        /**
+         * 排量
+         */
+        private String exhaustScale;
+        /**
+         * 座位标志
+         */
+        private Integer seatFlag;
+        /**
+         * 车辆模型列表
+         */
+        private List<CarModel> carModel;
+    }
+
+    @Setter
+    @Getter
+    public static class CarModel {
+        /**
+         * 车辆重量
+         */
+        private Integer vehicleWeight;
+        /**
+         * 车辆信息
+         */
+        private VehicleJingyou vehicleJingyou;
+        /**
+         * 车牌号
+         */
+        private String licenseNo;
+        /**
+         * 市场年份
+         */
+        private String marketYear;
+        /**
+         * 品牌中文
+         */
+        private String brandCN;
+        /**
+         * 重置价值
+         */
+        private Integer replacementValue;
+        /**
+         * 车牌类型
+         */
+        private String licenseType;
+        /**
+         * 车型名称
+         */
+        private String modelName;
+        /**
+         * 燃料类型
+         */
+        private String fuelType;
+        /**
+         * 额定载客量
+         */
+        private Integer ratedPassengerCapacity;
+        /**
+         * 车型代码
+         */
+        private String modelCode;
+        /**
+         * 车系
+         */
+        private String series;
+        /**
+         * 安全气囊数量
+         */
+        private Integer airbagNum;
+        /**
+         * 吨位
+         */
+        private Integer tonnage;
+        /**
+         * 排量
+         */
+        private Integer displacement;
+        /**
+         * 行业车型名称
+         */
+        private String industryModelName;
+        /**
+         * 行业车型代码
+         */
+        private String industryModelCode;
+    }
+
+    @Setter
+    @Getter
+    public static class VehicleJingyou {
+        /**
+         * 工厂代码
+         */
+        private String factoryCode;
+        /**
+         * 车辆名称
+         */
+        private String vehicleName;
+        /**
+         * 备注
+         */
+        private String remark;
+        /**
+         * 最大座位数
+         */
+        private String seatMax;
+        /**
+         * HF名称
+         */
+        private String hfName;
+        /**
+         * 风险类型
+         */
+        private String riskType;
+        /**
+         * 价格
+         */
+        private String price;
+        /**
+         * 车系名称
+         */
+        private String familyName;
+        /**
+         * 进口标志
+         */
+        private String importFlag;
+        /**
+         * 排量
+         */
+        private String displacement;
+        /**
+         * 市场日期
+         */
+        private String marketDate;
+        /**
+         * 车辆分类代码
+         */
+        private String vehicleClassCode;
+        /**
+         * 吨位
+         */
+        private String tonnage;
+        /**
+         * 交强险分类名称
+         */
+        private String jqxClassName;
+        /**
+         * 功率
+         */
+        private String power;
+        /**
+         * 车辆别名
+         */
+        private String vehicleAlias;
+        /**
+         * 车辆行业代码
+         */
+        private String vehicleHyCode;
+        /**
+         * 商业险分类名称
+         */
+        private String syxClassName;
+        /**
+         * 最小座位数
+         */
+        private String seatMin;
+        /**
+         * 进口标志代码
+         */
+        private String importFlagCode;
+        /**
+         * 相关价格税
+         */
+        private Integer kindredPriceTax;
+        /**
+         * 品牌名称
+         */
+        private String brandName;
+        /**
+         * 车系代码
+         */
+        private String familyCode;
+        /**
+         * 交强险分类ID
+         */
+        private String jqxClassId;
+        /**
+         * 最大总重量
+         */
+        private String fullWeightMax;
+        /**
+         * 车辆代码
+         */
+        private String vehicleCode;
+        /**
+         * 工厂名称
+         */
+        private String factoryName;
+        /**
+         * 车辆分类名称
+         */
+        private String vehicleClassName;
+        /**
+         * 座位数
+         */
+        private String seat;
+        /**
+         * 车辆行业名称
+         */
+        private String vehicleHyName;
+        /**
+         * 动力类型代码
+         */
+        private String powerTypeCode;
+        /**
+         * 相关价格
+         */
+        private Integer kindredPrice;
+        /**
+         * 总重量
+         */
+        private String fullWeight;
+        /**
+         * 税价
+         */
+        private Integer taxPrice;
+        /**
+         * 商业险分类ID
+         */
+        private String syxClassId;
+        /**
+         * 最小总重量
+         */
+        private String fullWeightMin;
+        /**
+         * HF代码
+         */
+        private String hfCode;
+        /**
+         * 动力类型
+         */
+        private String powerType;
+    }
+
+    @Setter
+    @Getter
+    public static class CarOwner {
+        /**
+         * 车主性质
+         */
+        private String carOwnerNature;
+        /**
+         * 出生日期
+         */
+        private String birthDate;
+        /**
+         * 姓名
+         */
+        private String name;
+        /**
+         * 身份证号
+         */
+        private String id;
+        /**
+         * 证件类型
+         */
+        private String certificateType;
+        /**
+         * 序列号
+         */
+        private String serialno;
+        /**
+         * 性别
+         */
+        private Integer sex;
+        /**
+         * 投保地址
+         */
+        private String insuredAddress;
+    }
+
+    @Setter
+    @Getter
+    public static class OtherInfo {
+        /**
+         * 是否查询车辆标志
+         */
+        private Boolean isQueryVehicleFlag;
+        /**
+         * 显示发动机号标志
+         */
+        private String showEngineNoFlag;
+        /**
+         * 交强险查询标志
+         */
+        private Boolean jyQueryFlag;
+        /**
+         * OCR标志
+         */
+        private Integer ocrFlag;
+        /**
+         * 新车标志
+         */
+        private String newCarFlag;
+        /**
+         * 险种限制代码
+         */
+        private String kindLimitCode;
+        /**
+         * 追溯ID
+         */
+        private String retrospectId;
+    }
+
+    @Setter
+    @Getter
+    public static class InsureInfo {
+        /**
+         * 投保人信息
+         */
+        private AppliInfo appliInfo;
+        /**
+         * 联系人信息
+         */
+        private Contacts contacts;
+        /**
+         * 被保险人信息
+         */
+        private InsuredInfo insuredInfo;
+    }
+
+    @Setter
+    @Getter
+    public static class AppliInfo {
+        // 投保人信息字段
+    }
+
+    @Setter
+    @Getter
+    public static class Contacts {
+        // 联系人信息字段
+    }
+
+    @Setter
+    @Getter
+    public static class InsuredInfo {
+        // 被保险人信息字段
+    }
+
+    @Setter
+    @Getter
+    public static class CarTax {
+        /**
+         * 是否缴税
+         */
+        private String isPayTax;
+    }
+
+    @Setter
+    @Getter
+    public static class AreaInfo {
+        /**
+         * 代理人信息
+         */
+        private Agent agent;
+        /**
+         * 渠道代码
+         */
+        private String channelCode;
+        /**
+         * 订单ID
+         */
+        private String orderID;
+        /**
+         * 北京标志
+         */
+        private Integer bjFlag;
+        /**
+         * 车牌号
+         */
+        private String licenseNo;
+        /**
+         * 是否无牌新车
+         */
+        private Integer isNewCarWithoutLicense;
+        /**
+         * 省份名称
+         */
+        private String provinceName;
+        /**
+         * 省份代码
+         */
+        private String provinceCode;
+        /**
+         * 城市名称
+         */
+        private String cityName;
+        /**
+         * 城市代码
+         */
+        private String cityCode;
+        /**
+         * 区域标志
+         */
+        private String areaFlag;
+        /**
+         * 公司代码
+         */
+        private String comCode;
+        /**
+         * 客户端类型
+         */
+        private String clientType;
+        /**
+         * 来源ID
+         */
+        private String fromID;
+        /**
+         * 表单ID
+         */
+        private String formID;
+        /**
+         * 平台ID
+         */
+        private String tplatformId;
+        /**
+         * 线索ID
+         */
+        private String leadsId;
+    }
+
+    @Setter
+    @Getter
+    public static class Agent {
+        /**
+         * 公司代码
+         */
+        private String comCode;
+        /**
+         * 中介名称
+         */
+        private String intermediaryName;
+        /**
+         * 代理人代码
+         */
+        private String agentCode;
+        /**
+         * 代理人名称
+         */
+        private String agentName;
+        /**
+         * 机构名称
+         */
+        private String agencyName;
+        /**
+         * 机构代码
+         */
+        private String agencyCode;
+        /**
+         * 代理人电话
+         */
+        private String agentPhone;
+        /**
+         * 状态
+         */
+        private String status;
+        /**
+         * 中介代码
+         */
+        private String intermediaryCode;
+        /**
+         * 来源ID
+         */
+        private String fromID;
+    }
+}

+ 20 - 0
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/entity/SaveBasicInfoResult.java

@@ -0,0 +1,20 @@
+package com.jzg.quotation.taikang.entity;
+
+import com.jzg.quotation.taikang.client.BaseResponse;
+import lombok.Getter;
+import lombok.Setter;
+
+@Setter
+@Getter
+public class SaveBasicInfoResult {
+    public static final class Response extends BaseResponse<SaveBasicInfoResult> {}
+
+    /** 订单ID */
+    private String orderId;
+
+    /** 续费标志,0表示非续费 */
+    private String renewalFlag;
+
+    /** 业务性质 */
+    private String bussinessNature;
+}

+ 15 - 1
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/service/TaiKangHttpService.java

@@ -284,7 +284,7 @@ public class TaiKangHttpService {
     }
 
     /**
-     * 09 车型查询
+     * 09 交管车辆类型校验
      *
      * @return
      */
@@ -296,4 +296,18 @@ public class TaiKangHttpService {
 
         return response.getData();
     }
+
+    /**
+     * 10
+     *
+     * @return
+     */
+    public SaveBasicInfoResult saveBasicInfo(SaveBasicInfoParam param) {
+        HttpHeaders httpHeaders = new HttpHeaders();
+        httpHeaders.add("tkCarRequestToken", token());
+
+        SaveBasicInfoResult.Response response = client.requestUrl(HttpURL.saveBasicInfo, param, SaveBasicInfoResult.Response.class, httpHeaders);
+
+        return response.getData();
+    }
 }

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

@@ -4,16 +4,19 @@ package com.jzg.quotation.taikang.service;
 import com.alibaba.fastjson2.JSON;
 import com.jzg.quotation.commons.component.RequestComponent;
 import com.jzg.quotation.commons.config.WebClientConfig;
+import com.jzg.quotation.taikang.JsonUtil;
 import com.jzg.quotation.taikang.client.TaiKangHttpClient;
 import com.jzg.quotation.taikang.entity.*;
 import net.sf.cglib.beans.BeanCopier;
 import org.junit.jupiter.api.*;
 import org.springframework.web.reactive.function.client.WebClient;
 
+import java.util.Arrays;
 import java.util.LinkedList;
 import java.util.List;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 @TestMethodOrder(MethodOrderer.OrderAnnotation.class)
 public class TaiKangHttpServiceTest {
@@ -362,4 +365,173 @@ public class TaiKangHttpServiceTest {
         //System.out.println(JSON.toJSONString(carModelinfoCheckVehicleTypeResult));
     }
 
+
+    @Test
+    @Order(11)
+    public void saveBasicInfo() {
+        SaveBasicInfoParam.CarInfo carInfo = new SaveBasicInfoParam.CarInfo();
+        carInfo.setFuelType("0");
+        carInfo.setModelName("奥迪FV7251FBCBG轿车");
+        carInfo.setTonnageFlag("0");
+        carInfo.setCarType("A");
+        carInfo.setUseNatureCodeCode("8A");
+        carInfo.setVinNo("LFV5A24G2G3003652");
+        carInfo.setEngineNo("230596");
+        carInfo.setEnrollDate("2019-03-25");
+        carInfo.setBillDate("");
+        carInfo.setCarBookingTime("");
+        carInfo.setBillNo("");
+        carInfo.setChgOwnerFlag("0");
+        carInfo.setTransferDate("");
+        carInfo.setSelectedSeat("5");
+        carInfo.setLicenseType("02");
+        carInfo.setLicenseTypeChinese("小型汽车号牌");
+        carInfo.setLicenseNo("晋LEL232");
+        carInfo.setBrandName("奥迪FV7251FBCBG轿车");
+        carInfo.setPurchasePrice("380000");
+        carInfo.setExhaustScale("2498");
+        carInfo.setSeatFlag(1);
+
+        SaveBasicInfoParam.CarModel carModel = new SaveBasicInfoParam.CarModel();
+        carModel.setVehicleWeight(1800);
+        carModel.setLicenseNo("晋LEL232");
+        carModel.setMarketYear("201601");
+        carModel.setBrandCN("一汽奥迪");
+        carModel.setReplacementValue(380000);
+        carModel.setLicenseType("02");
+        carModel.setModelName("奥迪FV7251FBCBG轿车");
+        carModel.setFuelType("0");
+        carModel.setRatedPassengerCapacity(0);
+        carModel.setModelCode("ADAAFD0183");
+        carModel.setSeries("一汽奥迪A6");
+        carModel.setAirbagNum(0);
+        carModel.setTonnage(0);
+        carModel.setDisplacement(2498);
+        carModel.setIndustryModelName("奥迪FV7251FBCBG 舒适型");
+        carModel.setIndustryModelCode("BYQMAMUC0042");
+
+        SaveBasicInfoParam.VehicleJingyou vehicleJingyou = new SaveBasicInfoParam.VehicleJingyou();
+        vehicleJingyou.setFactoryCode("MK0887");
+        vehicleJingyou.setVehicleName("奥迪FV7251FBCBG轿车");
+        vehicleJingyou.setRemark("无级/手动一体式 舒适型 国Ⅴ");
+        vehicleJingyou.setSeatMax("5");
+        vehicleJingyou.setHfName("正常");
+        vehicleJingyou.setRiskType("正常车型");
+        vehicleJingyou.setPrice("380000.0");
+        vehicleJingyou.setFamilyName("一汽奥迪A6");
+        vehicleJingyou.setImportFlag("合资");
+        vehicleJingyou.setDisplacement("2.498");
+        vehicleJingyou.setMarketDate("201601");
+        vehicleJingyou.setVehicleClassCode("IC01");
+        vehicleJingyou.setTonnage("0.00");
+        vehicleJingyou.setJqxClassName("六座以下客车");
+        vehicleJingyou.setPower("150");
+        vehicleJingyou.setVehicleAlias("奥迪A6L 30FSI CVT舒适型");
+        vehicleJingyou.setVehicleHyCode("BYQMAMUC0042");
+        vehicleJingyou.setSyxClassName("六座以下客车");
+        vehicleJingyou.setSeatMin("5");
+        vehicleJingyou.setImportFlagCode("1");
+        vehicleJingyou.setKindredPriceTax(0);
+        vehicleJingyou.setBrandName("一汽奥迪");
+        vehicleJingyou.setFamilyCode("ADA1AF");
+        vehicleJingyou.setJqxClassId("KA");
+        vehicleJingyou.setFullWeightMax("1800.0");
+        vehicleJingyou.setVehicleCode("ADAAFD0183");
+        vehicleJingyou.setFactoryName("一汽-大众汽车有限公司");
+        vehicleJingyou.setVehicleClassName("轿车类");
+        vehicleJingyou.setSeat("5");
+        vehicleJingyou.setVehicleHyName("奥迪FV7251FBCBG 舒适型");
+        vehicleJingyou.setPowerTypeCode("D1");
+        vehicleJingyou.setKindredPrice(0);
+        vehicleJingyou.setFullWeight("1800");
+        vehicleJingyou.setTaxPrice(412479);
+        vehicleJingyou.setSyxClassId("KA");
+        vehicleJingyou.setFullWeightMin("1800.0");
+        vehicleJingyou.setHfCode("0");
+        vehicleJingyou.setPowerType("汽油");
+
+        carModel.setVehicleJingyou(vehicleJingyou);
+        carInfo.setCarModel(Arrays.asList(carModel));
+
+        SaveBasicInfoParam.CarOwner carOwner = new SaveBasicInfoParam.CarOwner();
+        carOwner.setCarOwnerNature("1");
+        carOwner.setBirthDate("1984-06-13");
+        carOwner.setName("马占君");
+        carOwner.setId("142625198406130411");
+        carOwner.setCertificateType("01");
+        carOwner.setSerialno("0");
+        carOwner.setSex(1);
+        carOwner.setInsuredAddress("");
+
+        SaveBasicInfoParam.OtherInfo otherInfo = new SaveBasicInfoParam.OtherInfo();
+        otherInfo.setIsQueryVehicleFlag(false);
+        otherInfo.setShowEngineNoFlag("0");
+        otherInfo.setJyQueryFlag(false);
+        otherInfo.setOcrFlag(2);
+        otherInfo.setNewCarFlag("0");
+        otherInfo.setKindLimitCode("1");
+        otherInfo.setRetrospectId("08293502-8eb2-449b-8c0b-7e04ae68c4eb");
+
+        SaveBasicInfoParam.InsureInfo insureInfo = new SaveBasicInfoParam.InsureInfo();
+
+        SaveBasicInfoParam.CarTax carTax = new SaveBasicInfoParam.CarTax();
+        carTax.setIsPayTax("1");
+
+        SaveBasicInfoParam.AreaInfo areaInfo = new SaveBasicInfoParam.AreaInfo();
+        areaInfo.setChannelCode("OffWeb");
+        areaInfo.setOrderID("WBPC202503061107430440000");
+        areaInfo.setBjFlag(0);
+        areaInfo.setLicenseNo("晋LEL232");
+        areaInfo.setIsNewCarWithoutLicense(0);
+        areaInfo.setProvinceName("山西省");
+        areaInfo.setProvinceCode("140000");
+        areaInfo.setCityName("太原市");
+        areaInfo.setCityCode("140100");
+        areaInfo.setAreaFlag("140100");
+        areaInfo.setComCode("0114");
+        areaInfo.setClientType("");
+        areaInfo.setFromID("67107");
+        areaInfo.setFormID("67107");
+        areaInfo.setTplatformId("feda77e829d4dedbbd8b4e236bacfac5");
+        areaInfo.setLeadsId("");
+
+        SaveBasicInfoParam.Agent agent = new SaveBasicInfoParam.Agent();
+        agent.setComCode("0114");
+        agent.setIntermediaryName("泰康人寿(个险)(64827)");
+        agent.setAgentCode("R35016546");
+        agent.setAgentName("褚友爱");
+        agent.setAgencyName("山西分公司");
+        agent.setAgencyCode("R10115");
+        agent.setAgentPhone("13613412686");
+        agent.setStatus("1");
+        agent.setIntermediaryCode("000000000004");
+        agent.setFromID("64827");
+        areaInfo.setAgent(agent);
+
+        SaveBasicInfoParam param = new SaveBasicInfoParam();
+        param.setChannelCode("OffWeb");
+        param.setOrderID("WBPC202503061106595800000");
+        param.setPreFilledLastPolicyFlag("");
+        param.setAreaInfoVo(areaInfo);
+        param.setIsJgFlag("");
+        param.setTplatLoginKey("5fb6bdba974e17ec0db8c8ad4faab1ba1");
+        param.setCarInfoVo(carInfo);
+        param.setCarOwnerVo(carOwner);
+        param.setOtherInfo(otherInfo);
+        param.setInsureInfo(insureInfo);
+        param.setCarTaxVo(carTax);
+        param.setTplatformId("feda77e829d4dedbbd8b4e236bacfac5");
+        param.setAuthFailContinueFlag("");
+        param.setFromId("67107");
+
+
+        SaveBasicInfoResult saveBasicInfoResult = taiKangHttpService.saveBasicInfo(param);
+
+
+        assertNotNull(saveBasicInfoResult);
+
+        System.out.println();
+        System.out.println(JSON.toJSONString(saveBasicInfoResult));
+    }
+
 }