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

[众安] feat(报价): cacheCarInfo

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

+ 5 - 1
tenant/insurance/quotation-zhongan/src/main/java/com/jzg/quotation/zhongan/crawler/service/ZhongAnAPIService.java

@@ -274,6 +274,10 @@ public class ZhongAnAPIService {
 
         ZhongAnCacheCarInfoResult.Response response = form(ZhongAnAPI.CacheCarInfo, param, ZhongAnCacheCarInfoResult.Response.class, headers);
 
-        return response.getValue();
+        if (response.getErrorCode().equals("")) {
+            return response.getValue();
+        }
+
+        throw new RuntimeException(response.getErrorMsg());
     }
 }

+ 18 - 1
tenant/insurance/quotation-zhongan/src/main/java/com/jzg/quotation/zhongan/crawler/service/ZhongAnQuotaionApiBaseServiceImpl.java

@@ -1,6 +1,8 @@
 package com.jzg.quotation.zhongan.crawler.service;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
+import com.jzg.commons.entity.quote.vo.CarInfoVo;
+import com.jzg.commons.entity.quote.vo.CustomerInfoVo;
 import com.jzg.quotation.commons.entity.vo.aggregated.*;
 import com.jzg.quotation.commons.entity.vo.base.OrderBase;
 import com.jzg.quotation.commons.service.QuotationApiBaseService;
@@ -27,10 +29,13 @@ public class ZhongAnQuotaionApiBaseServiceImpl implements QuotationApiBaseServic
         String token = "";
         String flowId = "";
 
+        CarInfoVo carInfoVo = quoteVo.getCarInfoVo();
+        CustomerInfoVo ownersInfo = quoteVo.getOwnersInfo();
+
         ZhongAnCacheInputQueryParam zhongAnCacheInputQueryParam = new ZhongAnCacheInputQueryParam();
         zhongAnCacheInputQueryParam.setInsurePlace("晋城市");
         zhongAnCacheInputQueryParam.setInsurePlaceCode("140500");
-        zhongAnCacheInputQueryParam.setLicenseNo(quoteVo.getCarInfoVo().getLicenseNo());
+        zhongAnCacheInputQueryParam.setLicenseNo(carInfoVo.getLicenseNo());
 
 
         // 发起保险
@@ -38,6 +43,18 @@ public class ZhongAnQuotaionApiBaseServiceImpl implements QuotationApiBaseServic
         zhongAnAPIService.cacheInputQuery(token, flowId, zhongAnCacheInputQueryParam);
 
         ZhongAnCacheCarInfoParam zhongAnCacheCarInfoParam = new ZhongAnCacheCarInfoParam();
+        zhongAnCacheCarInfoParam.setInsurePlace("晋城市");
+        zhongAnCacheCarInfoParam.setInsurePlaceCode("140500");
+        zhongAnCacheCarInfoParam.setVehicleLicencePlateNo(carInfoVo.getLicenseNo());
+        zhongAnCacheCarInfoParam.setVehicleFrameNo(carInfoVo.getVinNo());
+        zhongAnCacheCarInfoParam.setVehicleEngineNo(carInfoVo.getEngineNo());
+        zhongAnCacheCarInfoParam.setVehicleRegisterDate(carInfoVo.getRegisterDate());
+        zhongAnCacheCarInfoParam.setVehicleOwnerName(ownersInfo.getName());
+        zhongAnCacheCarInfoParam.setIdentifyType("1"); // 身份证
+        zhongAnCacheCarInfoParam.setIdentifyNo(ownersInfo.getIdentifyNumber());
+        // todo
+
+
 
         // 保存车辆信息
         // 此接口可能不支持并发,参看接口注释。