|
@@ -22,6 +22,7 @@ import com.ydtech.modules.esm.model.*;
|
|
|
import com.ydtech.modules.esm.service.*;
|
|
import com.ydtech.modules.esm.service.*;
|
|
|
import com.ydtech.modules.ins.dao.InsAlltrustRegionMapper;
|
|
import com.ydtech.modules.ins.dao.InsAlltrustRegionMapper;
|
|
|
import com.ydtech.modules.ins.model.InsApiLog;
|
|
import com.ydtech.modules.ins.model.InsApiLog;
|
|
|
|
|
+import com.ydtech.modules.ins.model.vo.CarInfoVo;
|
|
|
import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
|
|
import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
|
|
|
import com.ydtech.modules.ins.model.vo.QuoteRespVo;
|
|
import com.ydtech.modules.ins.model.vo.QuoteRespVo;
|
|
|
import com.ydtech.modules.ins.model.vo.RiskInfoVo;
|
|
import com.ydtech.modules.ins.model.vo.RiskInfoVo;
|
|
@@ -211,6 +212,73 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<CarModelDTO> modelsQuery(CarModel_Req carModelReq) {
|
|
|
|
|
+ // 获取协议配置信息
|
|
|
|
|
+ YcConfigureParameters ycConfigureParameters = gainYcConfigParams(carModelReq.getAgreementId());
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ ModelsQueryXml m = buildModelsQueryParam(carModelReq, ycConfigureParameters);
|
|
|
|
|
+ ObjectMapper xmlMapper = this.gainXmlMapper();
|
|
|
|
|
+
|
|
|
|
|
+ log.info("===永诚--车型查询接口请求开始===");
|
|
|
|
|
+ InsApiLog apiLog = httpPost(xmlMapper, m, YcBuildData.API_MODEL);
|
|
|
|
|
+ String responseData = apiLog.getResponseData();
|
|
|
|
|
+ log.info("===永诚--车型查询接口请求结束===");
|
|
|
|
|
+ try {
|
|
|
|
|
+ String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
|
|
|
+ ModelsQueryResponse rd = xmlMapper.readValue(cleanStr, ModelsQueryResponse.class);
|
|
|
|
|
+ return buildCarModel(rd);
|
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
|
+ throw new RuntimeException(e);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ public void gainVehicleModel(YcConfigureParameters ycConfigureParameters, CarInfoVo carInfo) {
|
|
|
|
|
+
|
|
|
|
|
+ CarModel_Req carModelReq = new CarModel_Req();
|
|
|
|
|
+ carModelReq.setFrameNo(carInfo.getFrameNo());
|
|
|
|
|
+ carModelReq.setEngineNo(carInfo.getEngineNo());
|
|
|
|
|
+ carModelReq.setEnrollDate(carInfo.getRegisterDate().replaceAll("-",""));
|
|
|
|
|
+
|
|
|
|
|
+ ModelsQueryXml m = buildModelsQueryParam(carModelReq, ycConfigureParameters);
|
|
|
|
|
+ ObjectMapper xmlMapper = this.gainXmlMapper();
|
|
|
|
|
+
|
|
|
|
|
+ log.info("===永诚--车型查询接口请求开始===");
|
|
|
|
|
+ InsApiLog apiLog = httpPost(xmlMapper, m, YcBuildData.API_MODEL);
|
|
|
|
|
+ String responseData = apiLog.getResponseData();
|
|
|
|
|
+ log.info("===永诚--车型查询接口请求结束===");
|
|
|
|
|
+ try {
|
|
|
|
|
+ String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
|
|
|
+ ModelsQueryResponse rd = xmlMapper.readValue(cleanStr, ModelsQueryResponse.class);
|
|
|
|
|
+ List<CarModelDTO> dtoList = buildCarModel(rd);
|
|
|
|
|
+
|
|
|
|
|
+ long count = dtoList.stream().filter(x -> x.getModelCode().equals(carInfo.getModelCode())).count();
|
|
|
|
|
+
|
|
|
|
|
+ if(count < 1 ){
|
|
|
|
|
+ //匹配车辆信息
|
|
|
|
|
+ dtoList.stream().forEach(a ->{
|
|
|
|
|
+ //购置价匹配
|
|
|
|
|
+ if(a.getReplacementValue().equals(carInfo.getPurchasePrice())){
|
|
|
|
|
+ carInfo.setModelCode(a.getModelCode());
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
|
+ throw new SystemException("车型查询接口异常,请联系管理。");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -225,8 +293,14 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
YcConfigureParameters ycConfigureParameters = gainYcConfigParams(quoteVo.getAgreementId());
|
|
YcConfigureParameters ycConfigureParameters = gainYcConfigParams(quoteVo.getAgreementId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// public HttpResult quoteApi(BaseQuoteInfoVo yaQuoteInfoVo) {
|
|
// public HttpResult quoteApi(BaseQuoteInfoVo yaQuoteInfoVo) {
|
|
|
- BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo(), quoteVo.getAgreementId());
|
|
|
|
|
|
|
+ BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo());
|
|
|
HttpResult httpResult = new HttpResult();
|
|
HttpResult httpResult = new HttpResult();
|
|
|
ObjectMapper xmlMapper = this.gainXmlMapper();
|
|
ObjectMapper xmlMapper = this.gainXmlMapper();
|
|
|
|
|
|