helixiao 1 год назад
Родитель
Сommit
9db90e09d4
13 измененных файлов с 298 добавлено и 31 удалено
  1. 1 1
      gateway/src/main/resources/application-dev.yml
  2. 1 1
      tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/constant/InsuranceCode.java
  3. 1 0
      tenant/insurance/quotation-summary/src/test/java/com/jzg/quotation/taikang/crawler/service/TKQuotationBaseServiceImplTest.java
  4. 2 0
      tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/model/api/CarModelinfoQueryParam.java
  5. 7 0
      tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/model/api/CarModelinfoQueryResult.java
  6. 2 0
      tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/model/api/SaveBasicInfoResult.java
  7. 2 0
      tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/model/entity/TKCarModel.java
  8. 62 0
      tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/model/entity/TKCarQueryInfo.java
  9. 169 6
      tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/service/TKHttpAPIService.java
  10. 8 0
      tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/service/TKQuotationBaseService.java
  11. 17 11
      tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/service/TKSimpleService.java
  12. 19 5
      tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/service/impl/TKQuotationBaseServiceImpl.java
  13. 7 7
      tenant/insurance/quotation-taikang/src/test/java/com/jzg/quotation/taikang/crawler/TKHttpAPIServiceTest1.java

+ 1 - 1
gateway/src/main/resources/application-dev.yml

@@ -28,7 +28,7 @@ spring:
         - id: platform_route
           uri: http://localhost:8083/
           predicates:
-            - Path=/userRole/**,/system/**,/file/**,/user/**,/esmInsCompany/**,/jyxConfig/**,/qrBarcode/**,/sysDept/**,/manager/**
+            - Path=/userRole/**,/system/**,/file/**,/user/**,/esmInsCompany/**,/jyxConfig/**,/qrBarcode/**,/sysDept/**,/manager/attribution/**
 
         - id: tenant_route
           uri: http://localhost:8084/

+ 1 - 1
tenant/insurance/quotation-commons/src/main/java/com/jzg/quotation/commons/constant/InsuranceCode.java

@@ -97,5 +97,5 @@ public class InsuranceCode {
     // 诚泰财产保险股份有限公司
     public static final String INSURANCE_CHAC = "CHAC";
     // 大家财产保险股份有限公司
-    public static final String INSURANCE_DJPC = "DJPC";
+    public static final String  INSURANCE_DJPC = "DJPC";
 }

+ 1 - 0
tenant/insurance/quotation-summary/src/test/java/com/jzg/quotation/taikang/crawler/service/TKQuotationBaseServiceImplTest.java

@@ -6,6 +6,7 @@ import com.jzg.commons.constants.quote.enums.quote.CarKindCode;
 import com.jzg.commons.entity.quote.vo.aggregated.QuoteResultsVo;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
 import com.jzg.quotation.summary.SummaryQuotationApplication;
+import com.jzg.quotation.taikang.crawler.service.impl.TKQuotationBaseServiceImpl;
 import jakarta.annotation.Resource;
 import org.junit.jupiter.api.Test;
 import org.springframework.boot.test.context.SpringBootTest;

+ 2 - 0
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/model/api/CarModelinfoQueryParam.java

@@ -1,5 +1,6 @@
 package com.jzg.quotation.taikang.crawler.model.api;
 
+import com.fasterxml.jackson.annotation.JsonProperty;
 import com.jzg.quotation.taikang.crawler.client.OrderRequest;
 import com.jzg.quotation.taikang.crawler.model.entity.TKAreaInfoVo;
 import com.jzg.quotation.taikang.crawler.model.entity.TKCarInfoVo;
@@ -14,6 +15,7 @@ public class CarModelinfoQueryParam extends OrderRequest {
     /**
      * 车辆信息对象,包含车辆的详细信息
      */
+    @JsonProperty("carInfoVo")
     private TKCarInfoVo carInfoVo;
 
     /**

+ 7 - 0
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/model/api/CarModelinfoQueryResult.java

@@ -130,6 +130,13 @@ public class CarModelinfoQueryResult extends UnknownFieldEntity {
          * 注册日期
          */
         private String registerDate;
+
+        /**
+         * 自动查询汽车标志
+         */
+        private String autoQueryCarFlag;
+
+        private String transferDate;
     }
 
     @Setter

+ 2 - 0
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/model/api/SaveBasicInfoResult.java

@@ -18,4 +18,6 @@ public class SaveBasicInfoResult extends UnknownFieldEntity {
 
     /** 业务性质 */
     private String bussinessNature;
+
+    private String needModelSearchFlag;
 }

+ 2 - 0
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/model/entity/TKCarModel.java

@@ -110,6 +110,8 @@ public class TKCarModel extends UnknownFieldEntity implements CarModelsFilter {
      */
     private String industryModelCode;
 
+    private String vehicleStyleUniqueId;
+
     @Override
     protected void addChildUnknownFields() {
         addChildUnknownField("vehicleJingyou", vehicleJingyou);

+ 62 - 0
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/model/entity/TKCarQueryInfo.java

@@ -0,0 +1,62 @@
+package com.jzg.quotation.taikang.crawler.model.entity;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@NoArgsConstructor
+@Data
+public class TKCarQueryInfo {
+
+
+    @JSONField(name = "data")
+    private DataDTO data;
+    @JSONField(name = "isDirectSaleFlag")
+    private String isDirectSaleFlag;
+    @JSONField(name = "responseFlag")
+    private String responseFlag;
+    @JSONField(name = "status")
+    private String status;
+
+    @NoArgsConstructor
+    @Data
+    public static class DataDTO {
+        @JSONField(name = "orderID")
+        private String orderID;
+        @JSONField(name = "kindLimitFlag")
+        private Boolean kindLimitFlag;
+        @JSONField(name = "carInfoDto")
+        private CarInfoDtoDTO carInfoDto;
+        @JSONField(name = "carModel")
+        private List<?> carModel;
+
+        @NoArgsConstructor
+        @Data
+        public static class CarInfoDtoDTO {
+            @JSONField(name = "autoQueryCarFlag")
+            private String autoQueryCarFlag;
+            @JSONField(name = "ratedCapacity")
+            private Double ratedCapacity;
+            @JSONField(name = "engineNo")
+            private String engineNo;
+            @JSONField(name = "totalMassTraction")
+            private Double totalMassTraction;
+            @JSONField(name = "vinCode")
+            private String vinCode;
+            @JSONField(name = "engineNumber")
+            private String engineNumber;
+            @JSONField(name = "curbWeight")
+            private Double curbWeight;
+            @JSONField(name = "ratedLoad")
+            private Double ratedLoad;
+            @JSONField(name = "displacement")
+            private Double displacement;
+            @JSONField(name = "power")
+            private Double power;
+            @JSONField(name = "registerDate")
+            private String registerDate;
+        }
+    }
+}

+ 169 - 6
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/service/TKHttpAPIService.java

@@ -1,11 +1,18 @@
 package com.jzg.quotation.taikang.crawler.service;
 
+import cn.hutool.core.bean.BeanUtil;
+import com.jzg.commons.constants.quote.enums.quote.CarKindCode;
+import com.jzg.commons.constants.quote.enums.quote.VehicleUseCode;
+import com.jzg.commons.entity.quote.vo.CarInfoVo;
+import com.jzg.commons.entity.quote.vo.CustomerInfoVo;
+import com.jzg.commons.entity.quote.vo.QuoteVo;
+import com.jzg.quotation.commons.filter.CarModelsFilterUtils;
+import com.jzg.quotation.taikang.crawler.CodeUtil;
 import com.jzg.quotation.taikang.crawler.JsonUtil;
 import com.jzg.quotation.taikang.crawler.client.*;
+import com.jzg.quotation.taikang.crawler.model.TKLoginSession;
 import com.jzg.quotation.taikang.crawler.model.api.*;
-import com.jzg.quotation.taikang.crawler.model.entity.TKAgentFuzzy;
-import com.jzg.quotation.taikang.crawler.model.entity.TKChgOwnerInfo;
-import com.jzg.quotation.taikang.crawler.model.entity.TKInsureInfo;
+import com.jzg.quotation.taikang.crawler.model.entity.*;
 import jakarta.annotation.Resource;
 import lombok.Setter;
 import org.slf4j.Logger;
@@ -16,6 +23,8 @@ import org.springframework.util.LinkedMultiValueMap;
 import org.springframework.util.MultiValueMap;
 
 import java.io.File;
+import java.math.BigDecimal;
+import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 
@@ -422,17 +431,169 @@ public class TKHttpAPIService {
      *
      * @return
      */
-    public String carModelinfoCheckVehicleType(String token, CarModelinfoCheckVehicleTypeParam param) {
+    public String carModelinfoCheckVehicleType(TKLoginSession session, QuoteVo commonQuoteVo, String mainOrderId, CarModelinfoQueryResult carModelinfoQueryResult) {
+        CarModelinfoCheckVehicleTypeParam carModelinfoCheckVehicleTypeParam = new CarModelinfoCheckVehicleTypeParam();
+        carModelinfoCheckVehicleTypeParam.setChannelCode("OffWeb");
+        carModelinfoCheckVehicleTypeParam.setOrderId(mainOrderId);
+        TKCarModel tkCarModel = CarModelsFilterUtils.to(carModelinfoQueryResult.getCarModel(), commonQuoteVo.getCarInfoVo());
+        tkCarModel.setVehicleStyleUniqueId("");
+        CarModelinfoQueryResult.CarInfoDto carInfoDto = carModelinfoQueryResult.getCarInfoDto();
+
+        // 车辆所有人信息
+        TKCarOwnerVo carOwnerVo = new TKCarOwnerVo();
+
+        CustomerInfoVo commonCustomersInfo = commonQuoteVo.getOwnersInfo();
+
+        if (commonCustomersInfo != null) {
+            carOwnerVo.setCarOwnerNature("1"); // todo
+            carOwnerVo.setCertificateType("01");  // 身份证
+            carOwnerVo.setId(commonCustomersInfo.getIdentifyNumber());
+            carOwnerVo.setName(commonCustomersInfo.getName());
+            carOwnerVo.setBirthDate(commonCustomersInfo.getBirthday());
+            carOwnerVo.setSerialno(BigDecimal.ZERO);
+            carOwnerVo.setSex(commonCustomersInfo.getGender()); // todo
+            carOwnerVo.setInsuredAddress("");
+        }
+
+
+
+        // 投保人信息
+        SaveBasicInfoParam.InsureInfo insureInfo = new SaveBasicInfoParam.InsureInfo();
+        insureInfo.setAppliInfo(new SaveBasicInfoParam.AppliInfo());
+        insureInfo.setInsuredInfo(new SaveBasicInfoParam.InsuredInfo());
+        insureInfo.setContacts(new SaveBasicInfoParam.Contacts());
+
+        // 车辆信息
+        TKCar car = new TKCar();
+        car.setFuelType(tkCarModel.getFuelType()); // todo 燃油类型
+        car.setModelName(tkCarModel.getModelName()); // todo
+        car.setBillDate(""); // 页面上没有输入框,可能是北京地区才用到
+        car.setCarBookingTime(""); // 页面上没有输入框,原注释为“上海地区开具发票日期”,但感觉是车辆时间。
+        car.setBillNo(""); // 页面上没有输入框,发票号
+
+        CarInfoVo commonCarInfoVo = commonQuoteVo.getCarInfoVo();
+
+        if (commonCarInfoVo != null) {
+            // 车辆大类
+            String carKindCode = commonCarInfoVo.getCarKindCode();
+
+            if (carKindCode.equals(CarKindCode.CAR_KIND_CODE_A0.getCode())) {
+                car.setCarType("A");
+            } else if (carKindCode.equals(CarKindCode.CAR_KIND_CODE_A1.getCode())) {
+                car.setCarType("D");
+            } else {
+                throw new RuntimeException("未知车辆大类:" + carKindCode);
+            }
+
+            CodeUtil.autoSetter(car::setLicenseNo, commonCarInfoVo::getLicenseNo, tkCarModel::getLicenseNo);
+            CodeUtil.autoSetter(car::setVinNo, commonCarInfoVo::getVinNo, carInfoDto::getVinCode);
+            CodeUtil.autoSetter(car::setEngineNo, commonCarInfoVo::getEngineNo, carInfoDto::getEngineNo);  // 发动机号
+            CodeUtil.autoSetter(car::setEnrollDate, commonCarInfoVo::getRegisterDate, carInfoDto::getRegisterDate);  // 初登日期
+            CodeUtil.autoSetter(car::setTransferDate, commonCarInfoVo::getTransferDate, null);
+            CodeUtil.autoSetter(car::setPurchasePrice, commonCarInfoVo::getPurchasePrice, tkCarModel::getReplacementValue);
+            CodeUtil.autoSetter(car::setSelectedSeat, commonCarInfoVo::getSeatCount, () -> tkCarModel.getVehicleJingyou().getSeat());
+            CodeUtil.autoSetter(car::setExhaustScale, commonCarInfoVo::getDisplacement, tkCarModel::getDisplacement);  // 排量
+            CodeUtil.autoSetter(car::setBrandName, commonCarInfoVo::getBrandName, tkCarModel::getModelName); // todo 与 tkCarModel.getModelName() 重复
+
+            car.setSeatFlag("1"); // todo
+            car.setExhaustScale(tkCarModel.getDisplacement().substring(0,tkCarModel.getDisplacement().indexOf(".")));
+            car.setPurchasePrice(tkCarModel.getPurchasePrice().substring(0,tkCarModel.getPurchasePrice().indexOf(".")));
+
+
+            Double tonCount = commonCarInfoVo.getTonCountDouble();
+            if (tonCount != null && tonCount > 2) {
+                // 好像主要是货车使用此字段
+                car.setTonnageFlag("1");
+            } else {
+                car.setTonnageFlag("0");
+            }
+
+            if (commonCarInfoVo.isTransfer()) {
+                car.setChgOwnerFlag("1"); // 是过户
+                car.setTransferDate(commonCarInfoVo.getTransferDate()); // 过户时间
+            } else {
+                car.setChgOwnerFlag("0"); // 不是过户
+                car.setTransferDate("");
+            }
+
+            String vehicleUseCode = commonCarInfoVo.getVehicleUseCode();
+
+            if (vehicleUseCode.equals(VehicleUseCode.VEHICLE_USE_CODE_05.getCode())) {
+                // 05 家庭自用 = 8A 家庭自用
+                car.setUseNatureCodeCode("8A"); // 页面上选择的家庭自用、非营业企业、、、、
+            } else if (vehicleUseCode.equals(VehicleUseCode.VEHICLE_USE_CODE_06.getCode())) {
+                // 06 非营业企业 = 8C 非营业党政机关事业团体
+                car.setUseNatureCodeCode("8C");
+            } else if (vehicleUseCode.equals(VehicleUseCode.VEHICLE_USE_CODE_07.getCode())) {
+                // 07 非营业企业 = 8B 非营业企业
+                car.setUseNatureCodeCode("8B");
+            } else if (vehicleUseCode.equals(VehicleUseCode.VEHICLE_USE_CODE_01.getCode())) {
+                // 01 营业出租租赁 = 9 营业
+                car.setUseNatureCodeCode("9");
+            }  else if (vehicleUseCode.equals(VehicleUseCode.VEHICLE_USE_CODE_02.getCode())) {
+                // 02 营业城市公交 = 9 营业
+                car.setUseNatureCodeCode("9");
+            }  else if (vehicleUseCode.equals(VehicleUseCode.VEHICLE_USE_CODE_03.getCode())) {
+                // 03 营业公路客运 = 9 营业
+                car.setUseNatureCodeCode("9");
+            }  else if (vehicleUseCode.equals(VehicleUseCode.VEHICLE_USE_CODE_04.getCode())) {
+                // 04 营业货运 = 9 营业
+                car.setUseNatureCodeCode("9");
+            } else {
+                // 默认 8B 非营业企业
+                car.setUseNatureCodeCode("8B");
+            }
+
+            TKSimpleService.setLicenseTypeByLicenseNo(car, car.getLicenseNo());
+        }
+
+        String passengerSeat = this.carTypePassengerSeat(session.getToken(), session.getTplatformId(), session.getFromid(), session.getComCode());
+
+        String carType = carType(passengerSeat, car.getCarType(), carOwnerVo.getCarOwnerNature());
+
+        if (carType != null) {
+            car.setCarType(carType);
+        }
+        car.setCarModel(Arrays.asList(tkCarModel));
+        car.setBrandName(tkCarModel.getModelName());
+        CarModelinfoCheckVehicleTypeParam.CarInfoVo carInfoVo = BeanUtil.copyProperties(car, CarModelinfoCheckVehicleTypeParam.CarInfoVo.class);
+        carModelinfoCheckVehicleTypeParam.setCarInfoVo(carInfoVo);
+
+
+
         HttpHeaders httpHeaders = new HttpHeaders();
-        httpHeaders.add("tkCarRequestToken", token);
+        httpHeaders.add("tkCarRequestToken", session.getToken());
 
-        StringResponse response = client.request(HttpURL.carModelinfoCheckVehicleType, param, httpHeaders, StringResponse.class);
+        StringResponse response = client.request(HttpURL.carModelinfoCheckVehicleType, carModelinfoCheckVehicleTypeParam, httpHeaders, StringResponse.class);
 
         checkResponseUnknownField(response);
 
         return response.getData();
     }
 
+    public String carType(String passengerSeat, String carType, String carOwnerNature) {
+        if (passengerSeat == null || carType == null || carOwnerNature == null) {
+            return carType;
+        }
+
+        if (!passengerSeat.equals("1")) {
+            if (carType.equals("A")) {
+                if (carOwnerNature.equals("1")) {
+                    // 个人客车
+                    carType = "A";
+                } else if (carOwnerNature.equals("2")) {
+                    // 机关团体客车
+                    carType = "C";
+                } else if (carOwnerNature.equals("3")) {
+                    // 企业客车
+                    carType = "B";
+                }
+            }
+        }
+
+        return carType;
+    }
+
     /**
      * 10
      *
@@ -821,6 +982,8 @@ public class TKHttpAPIService {
         }
 
         String data = response.getData();
+//        String data = "501d2faf0e619845ab4f7199aa72a07a2b41e9b50808a138082179f3b5b72bb81cb95f3a4a2c5a6e9db1d8f9ce6c0ba66a569ff9fe8332825173adefba99b30cb1e5d060200cf374a24b5e0e7014daa1d5187ce8314bc8cdb7d35dc9232f507dda98753109a579e1b9681d88b6d2e98ce59493807ac18c77f0085efd47fb8d0ba3640d2962679596311861bf477aa746f59033098be8eb65c7f739ada72cb4ed6e22dd7b050dbd0b9e32851525fd197ad4d9c00cd641f5a2de90926829520bc54e0ccb905141e2ca7565a1e07135ec236bd74f1e442b39180b7f03962f71ca5e325f27e518cf40cf849f59ace456f310004d55fe1452384859e1e7bd70e680dc038e71041262e1afcb4d5128079833dea89ea5cabf740a89c8aac9f32a58e0235900b3e6f2c912e3a9e23c9aefc2627848648e7beb481a49efd234291d06771add181e49c09de7d23d6600467c12f1a8eb779091ab4e71c66120eb1c362cce4532b30a08db125e4dacf20d3e02fc3267982741cfae98af3179fbb8d0ce74b0bf17ee08441f2222db0779c683d3ff4670";
+//        String data = "501d2faf0e619845ab4f7199aa72a07a2b41e9b50808a138082179f3b5b72bb844fa7180f1936a19ae21994798f72f70ac7356eacf72aa5a7425a26e586a40ab3dd841865d5fab7cf9a1ac268907d1a8ead449d3bc95998f1ca0a7afa241ec8125e37cd104ceb7a05efe800b0f7e15b812b24ebf1b79e360dfeaf103d73ea2f9eb464d379f91f9d8d02b92b1c85facad7ff8aa5f092cfa4694988e3a84e2efa4699e7e61f9a070127e0594f72de3e4f9631c361afb91b3b6d9ca49f7383c508086527f891d4eeab32f8fa80dc937c5874103e9e979fb7333657fa9acd16b05b87a7e471bf1e20a9c29b122db24c5c94884227b3f4d4e9d2a7b6e53783519a78205185518523d08622e9a089a872626cb64ce6d74551dcaa2d9ab0407b7767cfea9a5ca032401a38100b1094ad2798fb1530ed11f4b352e44c20165d9fe84f70835910f6aa4f39d288cf1fc8995387d808f5a063f106f73647f9fe7ca595eefca4c64f65ed19aacfd39627125123b66c79f6b3c4d9ca6d701f73e1401ab352ccfb5e5d25317b2fed5505d429441fdfe9f";
 
         if (data == null || data.isBlank()) {
             return null;

+ 8 - 0
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/service/TKQuotationBaseService.java

@@ -0,0 +1,8 @@
+package com.jzg.quotation.taikang.crawler.service;
+
+import com.jzg.quotation.commons.service.QuotationBaseService;
+import com.jzg.quotation.commons.service.QuotationCrawlerBaseService;
+
+public interface TKQuotationBaseService extends QuotationCrawlerBaseService {
+
+}

+ 17 - 11
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/service/TKSimpleService.java

@@ -14,10 +14,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @Service
 public class TKSimpleService {
@@ -387,6 +384,7 @@ public class TKSimpleService {
         CarModelinfoQueryParam carModelinfoQueryParam = new CarModelinfoQueryParam();
         carModelinfoQueryParam.setTplatformId(session.getTplatformId());
         carModelinfoQueryParam.setFromId(session.getFromid());
+        carModelinfoQueryParam.setTplatLoginKey(session.getTplatLoginKey());
         carModelinfoQueryParam.setOrderID(mainOrderId);
         carModelinfoQueryParam.setChannelCode("OffWeb");
         carModelinfoQueryParam.setAreaInfoVo(area);
@@ -419,6 +417,10 @@ public class TKSimpleService {
 
             tkCarModels = CarModelinfoQueryResult.hasModel(carModelinfoQueryResult);
         }
+        // 使用车架号的方式
+//        CarModelinfoQueryResult carModelinfoQueryResult = queryCarModelsByVinNo(session, mainOrderId, commonCarInfoVo, area);
+//
+//        List<TKCarModel> tkCarModels = CarModelinfoQueryResult.hasModel(carModelinfoQueryResult);
 
         return carModelinfoQueryResult;
     }
@@ -442,7 +444,7 @@ public class TKSimpleService {
         agent.setAgentPhone(agentQueryResult.getAgentPhone());
         agent.setAgencyCode(agentQueryResult.getComCode());
         agent.setAgencyName(agentQueryResult.getAgencyName());
-        agent.setAgencyCode(agentQueryResult.getAgencyCode());
+//        agent.setAgencyCode(agentQueryResult.getAgencyCode());
         // 注意,agent 上 comCode 要与页面选择出来的 city 的 comCode 保持一致。
         agent.setComCode(city.getComCode());
         agent.setFromID(agentFuzzy.getFromID());
@@ -583,7 +585,7 @@ public class TKSimpleService {
      * @param tkAreaInfoVo
      * @param carModelinfoQueryResult
      */
-    public void orderCreate(TKLoginSession session,
+    public void     orderCreate(TKLoginSession session,
                             String mainOrderId,
                             QuoteVo commonQuoteVo,
                             TKAreaInfoVo tkAreaInfoVo,
@@ -595,7 +597,7 @@ public class TKSimpleService {
 
         // 找到车型,后面要使用
         TKCarModel tkCarModel = CarModelsFilterUtils.to(carModelinfoQueryResult.getCarModel(), commonQuoteVo.getCarInfoVo());
-
+        tkCarModel.setVehicleStyleUniqueId("");
         CarModelinfoQueryResult.CarInfoDto carInfoDto = carModelinfoQueryResult.getCarInfoDto();
 
         // 车辆所有人信息
@@ -655,6 +657,9 @@ public class TKSimpleService {
             CodeUtil.autoSetter(car::setBrandName, commonCarInfoVo::getBrandName, tkCarModel::getModelName); // todo 与 tkCarModel.getModelName() 重复
 
             car.setSeatFlag("1"); // todo
+            car.setExhaustScale(tkCarModel.getDisplacement().substring(0,tkCarModel.getDisplacement().indexOf(".")));
+            car.setPurchasePrice(tkCarModel.getPurchasePrice().substring(0,tkCarModel.getPurchasePrice().indexOf(".")));
+
 
             Double tonCount = commonCarInfoVo.getTonCountDouble();
             if (tonCount != null && tonCount > 2) {
@@ -669,6 +674,7 @@ public class TKSimpleService {
                 car.setTransferDate(commonCarInfoVo.getTransferDate()); // 过户时间
             } else {
                 car.setChgOwnerFlag("0"); // 不是过户
+                car.setTransferDate("");
             }
 
             String vehicleUseCode = commonCarInfoVo.getVehicleUseCode();
@@ -721,13 +727,13 @@ public class TKSimpleService {
 
         // 其他信息
         SaveBasicInfoParam.OtherInfo otherInfo = new SaveBasicInfoParam.OtherInfo();
-        otherInfo.setIsQueryVehicleFlag(false);
+        otherInfo.setIsQueryVehicleFlag(true);
         otherInfo.setShowEngineNoFlag("0"); // todo 抓到几个包,都是 0。看代码时发现是 1。
         otherInfo.setJyQueryFlag(false);
-        otherInfo.setOcrFlag(2);
+        otherInfo.setOcrFlag(1);
         otherInfo.setNewCarFlag("0"); // todo
-        otherInfo.setKindLimitCode(""); // 交强或商业,抓包查到没有值
-        otherInfo.setRetrospectId(""); // 可回溯ID ,好像不是很需要
+        otherInfo.setKindLimitCode("1"); // 交强或商业,抓包查到没有值
+        otherInfo.setRetrospectId(UUID.randomUUID().toString()); // 可回溯ID ,好像不是很需要
 
 
         SaveBasicInfoParam param = new SaveBasicInfoParam();

+ 19 - 5
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/service/TKQuotationBaseServiceImpl.java → tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/service/impl/TKQuotationBaseServiceImpl.java

@@ -1,11 +1,13 @@
-package com.jzg.quotation.taikang.crawler.service;
+package com.jzg.quotation.taikang.crawler.service.impl;
 
 import com.jzg.commons.entity.quote.vo.CarInfoVo;
 import com.jzg.commons.entity.quote.vo.KindInfoVo;
 import com.jzg.commons.entity.quote.vo.QuoteVo;
 import com.jzg.commons.entity.quote.vo.RiskInfoVo;
 import com.jzg.commons.entity.quote.vo.aggregated.*;
+import com.jzg.commons.entity.quote.vo.base.LoginBase;
 import com.jzg.commons.util.idgen.IdGenerate;
+import com.jzg.quotation.commons.annotation.QuoteCrawlerService;
 import com.jzg.quotation.commons.constant.InsuranceCode;
 import com.jzg.quotation.commons.service.QuotationBaseService;
 import com.jzg.quotation.taikang.crawler.model.TKLoginSession;
@@ -13,6 +15,9 @@ import com.jzg.quotation.taikang.crawler.model.api.*;
 import com.jzg.quotation.taikang.crawler.model.entity.*;
 import com.jzg.quotation.taikang.crawler.repository.TKLoginSessionRepository;
 import com.jzg.quotation.taikang.crawler.repository.TKPreciseInitResultRepository;
+import com.jzg.quotation.taikang.crawler.service.TKHttpAPIService;
+import com.jzg.quotation.taikang.crawler.service.TKQuotationBaseService;
+import com.jzg.quotation.taikang.crawler.service.TKSimpleService;
 import io.micrometer.core.instrument.simple.SimpleConfig;
 import jakarta.annotation.Resource;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -22,8 +27,8 @@ import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 
-@Service(value = InsuranceCode.INSURANCE_TKIC)
-public class TKQuotationBaseServiceImpl implements QuotationBaseService {
+@QuoteCrawlerService(value = InsuranceCode.INSURANCE_TKIC)
+public class TKQuotationBaseServiceImpl implements TKQuotationBaseService {
 
     @Autowired
     private SimpleConfig simpleConfig;
@@ -40,7 +45,8 @@ public class TKQuotationBaseServiceImpl implements QuotationBaseService {
     @Resource
     private TKLoginSessionRepository loginSessionRepository;
 
-    private final String agentCode = "R35016546";
+//    private final String agentCode = "R35016546";
+    private final String agentCode = "R82041531";
 
     private final String intermediaryName = "泰康人寿(个险)(64827)";
 
@@ -70,6 +76,11 @@ public class TKQuotationBaseServiceImpl implements QuotationBaseService {
         return session;
     }
 
+    @Override
+    public void login(LoginBase loginBase) {
+
+    }
+
     @Override
     public QuoteResultsVo quote(QuoteVo commonQuoteVo) {
         CarInfoVo commonCarInfoVo = commonQuoteVo.getCarInfoVo();
@@ -87,7 +98,7 @@ public class TKQuotationBaseServiceImpl implements QuotationBaseService {
         AgentFuzzyResult agentFuzzyResult = tkSimpleService.agentChannel(session, mainOrderId, intermediaryName);
 
         if (agentFuzzyResult == null) {
-            throw new RuntimeException("未能获取代理信息!");
+            throw new RuntimeException("未能获取代理机构信息!");
         }
 
 
@@ -108,6 +119,7 @@ public class TKQuotationBaseServiceImpl implements QuotationBaseService {
         CarModelinfoQueryResult carModelinfoQueryResult = tkSimpleService.queryCarModel(session, mainOrderId, commonCarInfoVo, tkAreaInfoVo);
 
         // todo 暂时不知道是否需要执行 /car/modelinfo/checkVehicleType 接口
+        httpService.carModelinfoCheckVehicleType(session,commonQuoteVo,mainOrderId,carModelinfoQueryResult);
 
         // # 创建车险投保单
         tkSimpleService.orderCreate(session, mainOrderId, commonQuoteVo, tkAreaInfoVo, carModelinfoQueryResult);
@@ -448,4 +460,6 @@ public class TKQuotationBaseServiceImpl implements QuotationBaseService {
 
         return null;
     }
+
+
 }

+ 7 - 7
tenant/insurance/quotation-taikang/src/test/java/com/jzg/quotation/taikang/crawler/TKHttpAPIServiceTest1.java

@@ -648,13 +648,13 @@ public class TKHttpAPIServiceTest1 {
         //carModelinfoCheckVehicleTypeParam.setOrderId("WBPC202503060839036710000");
         carModelinfoCheckVehicleTypeParam.setCarInfoVo(carInfoVo);
 
-        String carModelinfoCheckVehicleTypeResult = httpService.carModelinfoCheckVehicleType(tokenResult.getTkCarRequestToken(), carModelinfoCheckVehicleTypeParam);
-
-        assertNotNull(carModelinfoCheckVehicleTypeResult);
-
-        System.out.println(carModelinfoCheckVehicleTypeResult);
-
-        assertEquals("交管车辆类型校验成功",  carModelinfoCheckVehicleTypeResult);
+//        String carModelinfoCheckVehicleTypeResult = httpService.carModelinfoCheckVehicleType(tokenResult.getTkCarRequestToken(), carModelinfoCheckVehicleTypeParam);
+//
+//        assertNotNull(carModelinfoCheckVehicleTypeResult);
+//
+//        System.out.println(carModelinfoCheckVehicleTypeResult);
+//
+//        assertEquals("交管车辆类型校验成功",  carModelinfoCheckVehicleTypeResult);
 
     }