|
@@ -184,65 +184,6 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
//==============================API 方式
|
|
//==============================API 方式
|
|
|
//
|
|
//
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 1 车型查询接口
|
|
|
|
|
- */
|
|
|
|
|
- @Override
|
|
|
|
|
- public HttpResult modelsQueryApi(CarModel_Req carModelReq) {
|
|
|
|
|
-
|
|
|
|
|
-// if (org.springframework.util.StringUtils.isEmpty(carModelReq.getFrameNo()) || org.springframework.util.StringUtils.isEmpty(carModelReq.getEnrollDate()) || org.springframework.util.StringUtils.isEmpty(carModelReq.getModelName())) {
|
|
|
|
|
-// return HttpResult.error("frameNo, enrollDate, modelName 这些参数不能为空!");
|
|
|
|
|
-// }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-// gainAuthorityDataXml(), apiComponents.gainAgent()
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- // 获取协议配置信息
|
|
|
|
|
- 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);
|
|
|
|
|
- if (rd.getReturnCode().equals("E0001")) {
|
|
|
|
|
- return HttpResult.ok(rd.getMsg());
|
|
|
|
|
- }
|
|
|
|
|
- return HttpResult.ok(buildCarModel(rd));
|
|
|
|
|
- } catch (IOException e) {
|
|
|
|
|
- throw new RuntimeException(e);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public List<ModelsQueryResponse.VehicleInfo> modelsQuery(CarModel_Req carModelReq) {
|
|
|
|
|
-// 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) {
|
|
public void gainVehicleModel(YcConfigureParameters ycConfigureParameters, CarInfoVo carInfo) {
|
|
@@ -257,8 +198,9 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
ObjectMapper xmlMapper = this.gainXmlMapper();
|
|
ObjectMapper xmlMapper = this.gainXmlMapper();
|
|
|
|
|
|
|
|
log.info("===永诚--车型查询接口请求开始--" + carInfo.getLicenseNo() + "===");
|
|
log.info("===永诚--车型查询接口请求开始--" + carInfo.getLicenseNo() + "===");
|
|
|
- InsApiLog apiLog = httpPost(xmlMapper, m, YcBuildData.API_MODEL);
|
|
|
|
|
- String responseData = apiLog.getResponseData();
|
|
|
|
|
|
|
+// InsApiLog apiLog = httpPost(xmlMapper, m, YcBuildData.API_MODEL);
|
|
|
|
|
+ String responseData = httpPostResultLog(xmlMapper, m, YcBuildData.API_MODEL,"永诚API方式 - 车型查询 - ");
|
|
|
|
|
+// String responseData = apiLog.getResponseData();
|
|
|
log.info("===永诚--车型查询接口请求结束--" + carInfo.getLicenseNo() + "===");
|
|
log.info("===永诚--车型查询接口请求结束--" + carInfo.getLicenseNo() + "===");
|
|
|
ModelsQueryResponse rd = null;
|
|
ModelsQueryResponse rd = null;
|
|
|
try {
|
|
try {
|
|
@@ -335,8 +277,10 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
|
|
|
|
|
BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo());
|
|
BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo());
|
|
|
|
|
|
|
|
|
|
+ CarInfoVo carInfo = yaQuoteInfoVo.getCarInfo();
|
|
|
|
|
+
|
|
|
//构造车辆信息
|
|
//构造车辆信息
|
|
|
- gainVehicleModel(ycConfigureParameters, yaQuoteInfoVo.getCarInfo());
|
|
|
|
|
|
|
+ gainVehicleModel(ycConfigureParameters, carInfo);
|
|
|
|
|
|
|
|
|
|
|
|
|
HttpResult httpResult = new HttpResult();
|
|
HttpResult httpResult = new HttpResult();
|
|
@@ -356,21 +300,11 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
//构造地区
|
|
//构造地区
|
|
|
buildRegion(m);
|
|
buildRegion(m);
|
|
|
|
|
|
|
|
-// //请求转保处理
|
|
|
|
|
-// if (StringUtils.isNotEmpty(quoteVo.getRenewalCodeJq()) || StringUtils.isNotEmpty(quoteVo.getRenewalCodeSy())) {
|
|
|
|
|
-// m.getRequestLabel().getCondition().getVhl().setCCheckCodeJQ(quoteVo.getRenewalCodeJq());
|
|
|
|
|
-// m.getRequestLabel().getCondition().getVhl().setCCheckCodeSY(quoteVo.getRenewalCodeSy());
|
|
|
|
|
-// m.getRequestLabel().getCondition().getVhl().setCBusType("2");
|
|
|
|
|
-// m.getRequestLabel().getCondition().getVhl().setCQryCdeJQ(quoteVo.getCQryCdeJq());
|
|
|
|
|
-// m.getRequestLabel().getCondition().getVhl().setCQryCdeSY(quoteVo.getCQryCdeSy());
|
|
|
|
|
-//
|
|
|
|
|
-// }
|
|
|
|
|
-
|
|
|
|
|
RuoteResponse rr = null;
|
|
RuoteResponse rr = null;
|
|
|
boolean boo = false;
|
|
boolean boo = false;
|
|
|
boolean isRenewal = true;
|
|
boolean isRenewal = true;
|
|
|
boolean isBiRepeat = true;
|
|
boolean isBiRepeat = true;
|
|
|
- String textHead = "==========永城API方式 - 报价 ";
|
|
|
|
|
|
|
+ String textHead = "==========永诚API方式 - 车架号:"+carInfo.getVinNo()+" - 报价 ";
|
|
|
while (!boo) {
|
|
while (!boo) {
|
|
|
rr = requestApi(m, new RuoteResponse(), iac, YcBuildData.API_QUOTE, InsQuoteFlow.Q_S_0,textHead);
|
|
rr = requestApi(m, new RuoteResponse(), iac, YcBuildData.API_QUOTE, InsQuoteFlow.Q_S_0,textHead);
|
|
|
//处理返回信息
|
|
//处理返回信息
|
|
@@ -680,10 +614,11 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
|
|
|
|
|
log.debug("=========永诚API方式 - xml请求 - 核保开始======");
|
|
log.debug("=========永诚API方式 - xml请求 - 核保开始======");
|
|
|
//接口请求
|
|
//接口请求
|
|
|
- InsApiLog apiLog = httpPost(xmlMapper, m, YcBuildData.API_AUDIT);
|
|
|
|
|
|
|
+// InsApiLog apiLog = httpPost(xmlMapper, m, YcBuildData.API_AUDIT);
|
|
|
|
|
+ String responseData = httpPostResultLog(xmlMapper, m, YcBuildData.API_AUDIT,"永诚API方式 - 核保 - ");
|
|
|
log.debug("=========永诚API方式 - xml请求 - 核保结束!======");
|
|
log.debug("=========永诚API方式 - xml请求 - 核保结束!======");
|
|
|
- verifyRequest(apiLog, iac, InsQuoteFlow.Q_S_1);
|
|
|
|
|
- String responseData = apiLog.getResponseData();
|
|
|
|
|
|
|
+// verifyRequest(apiLog, iac, InsQuoteFlow.Q_S_1);
|
|
|
|
|
+// String responseData = apiLog.getResponseData();
|
|
|
|
|
|
|
|
String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
|
AuditResponse rd = xmlMapper.readValue(cleanStr, AuditResponse.class);
|
|
AuditResponse rd = xmlMapper.readValue(cleanStr, AuditResponse.class);
|
|
@@ -766,16 +701,15 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
insTaskImages.stream().forEach(a -> {
|
|
insTaskImages.stream().forEach(a -> {
|
|
|
InsApiLog apiLog = null;
|
|
InsApiLog apiLog = null;
|
|
|
//组装参数
|
|
//组装参数
|
|
|
- log.debug("=========永诚API方式 - xml请求 - 影像上传开始======");
|
|
|
|
|
//接口请求
|
|
//接口请求
|
|
|
ImageUp iUp = ImageUp.buildImageUpParam(order, ycConfigureParameters, a.getImage(), a.getImgtype());
|
|
ImageUp iUp = ImageUp.buildImageUpParam(order, ycConfigureParameters, a.getImage(), a.getImgtype());
|
|
|
- log.debug("=========永诚API方式 - xml请求 - 影像上传结束!======");
|
|
|
|
|
ObjectMapper xmlMapper = gainXmlMapper();
|
|
ObjectMapper xmlMapper = gainXmlMapper();
|
|
|
//接口请求
|
|
//接口请求
|
|
|
- apiLog = httpPost(xmlMapper, iUp, YcBuildData.API_UPLOAD);
|
|
|
|
|
|
|
+// apiLog = httpPost(xmlMapper, iUp, YcBuildData.API_UPLOAD);
|
|
|
|
|
+ String responseData = httpPostResultLog(xmlMapper, iUp, YcBuildData.API_UPLOAD,"永诚API方式 - 影像上传 - ");
|
|
|
verifyRequest(apiLog, iac, InsQuoteFlow.Q_S_2);
|
|
verifyRequest(apiLog, iac, InsQuoteFlow.Q_S_2);
|
|
|
try {
|
|
try {
|
|
|
- String responseData = apiLog.getResponseData();
|
|
|
|
|
|
|
+// String responseData = apiLog.getResponseData();
|
|
|
String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
|
log.error("===永诚API方式--上传影像清洗返回参数:" + cleanStr);
|
|
log.error("===永诚API方式--上传影像清洗返回参数:" + cleanStr);
|
|
|
ImageUpResponse iur = xmlMapper.readValue(cleanStr, ImageUpResponse.class);
|
|
ImageUpResponse iur = xmlMapper.readValue(cleanStr, ImageUpResponse.class);
|
|
@@ -807,10 +741,11 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
ObjectMapper xmlMapper = gainXmlMapper();
|
|
ObjectMapper xmlMapper = gainXmlMapper();
|
|
|
//接口请求
|
|
//接口请求
|
|
|
log.debug("=========永诚API方式 - xml请求 - 获取缴费链接开始======");
|
|
log.debug("=========永诚API方式 - xml请求 - 获取缴费链接开始======");
|
|
|
- InsApiLog apiLog = httpPost(xmlMapper, pay, YcBuildData.API_PAY);
|
|
|
|
|
|
|
+ String responseData = httpPostResultLog(xmlMapper, pay, YcBuildData.API_PAY,"永诚API方式 - 获取缴费链接 - ");
|
|
|
|
|
+// InsApiLog apiLog = httpPost(xmlMapper, pay, YcBuildData.API_PAY);
|
|
|
log.debug("=========永诚API方式 - xml请求 - 获取缴费链接结束!======");
|
|
log.debug("=========永诚API方式 - xml请求 - 获取缴费链接结束!======");
|
|
|
- verifyRequest(apiLog, iac, InsQuoteFlow.Q_S_3);
|
|
|
|
|
- String responseData = apiLog.getResponseData();
|
|
|
|
|
|
|
+// verifyRequest(apiLog, iac, InsQuoteFlow.Q_S_3);
|
|
|
|
|
+// String responseData = apiLog.getResponseData();
|
|
|
|
|
|
|
|
|
|
|
|
|
String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
@@ -966,10 +901,12 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
ObjectMapper xmlMapper = gainXmlMapper();
|
|
ObjectMapper xmlMapper = gainXmlMapper();
|
|
|
//接口请求
|
|
//接口请求
|
|
|
log.debug("=========永诚API方式 - xml请求 - 获取保单开始======");
|
|
log.debug("=========永诚API方式 - xml请求 - 获取保单开始======");
|
|
|
- InsApiLog apiLog = httpPost(xmlMapper, p, YcBuildData.API_GUARANTEE_SLIP);
|
|
|
|
|
|
|
+ String responseData = httpPostResultLog(xmlMapper, p, YcBuildData.API_GUARANTEE_SLIP,"永诚API方式 - 获取保单 - ");
|
|
|
|
|
+
|
|
|
|
|
+// InsApiLog apiLog = httpPost(xmlMapper, p, YcBuildData.API_GUARANTEE_SLIP);
|
|
|
log.debug("=========永诚API方式 - xml请求 - 获取保单结束!======");
|
|
log.debug("=========永诚API方式 - xml请求 - 获取保单结束!======");
|
|
|
- verifyRequest(apiLog, iac, InsQuoteFlow.Q_S_4);
|
|
|
|
|
- String responseData = apiLog.getResponseData();
|
|
|
|
|
|
|
+// verifyRequest(apiLog, iac, InsQuoteFlow.Q_S_4);
|
|
|
|
|
+// String responseData = apiLog.getResponseData();
|
|
|
|
|
|
|
|
String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
|
PolicyResponse pResp = xmlMapper.readValue(cleanStr, PolicyResponse.class);
|
|
PolicyResponse pResp = xmlMapper.readValue(cleanStr, PolicyResponse.class);
|
|
@@ -1026,10 +963,11 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
ObjectMapper xmlMapper = gainXmlMapper();
|
|
ObjectMapper xmlMapper = gainXmlMapper();
|
|
|
//接口请求
|
|
//接口请求
|
|
|
log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询开始======");
|
|
log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询开始======");
|
|
|
- InsApiLog apiLog = httpPost(xmlMapper, accident, YcBuildData.API_ACCIDENT);
|
|
|
|
|
|
|
+ String responseData = httpPostResultLog(xmlMapper, accident, YcBuildData.API_ACCIDENT,"永诚API方式 - 获取意健险方案及险种 - ");
|
|
|
|
|
+// InsApiLog apiLog = httpPost(xmlMapper, accident, YcBuildData.API_ACCIDENT);
|
|
|
log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询结束!======");
|
|
log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询结束!======");
|
|
|
// verifyRequest(apiLog, iac,InsQuoteFlow.);
|
|
// verifyRequest(apiLog, iac,InsQuoteFlow.);
|
|
|
- String responseData = apiLog.getResponseData();
|
|
|
|
|
|
|
+// String responseData = apiLog.getResponseData();
|
|
|
|
|
|
|
|
|
|
|
|
|
String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
@@ -1176,10 +1114,11 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
ObjectMapper xmlMapper = gainXmlMapper();
|
|
ObjectMapper xmlMapper = gainXmlMapper();
|
|
|
//接口请求
|
|
//接口请求
|
|
|
log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询开始======");
|
|
log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询开始======");
|
|
|
- InsApiLog apiLog = httpPost(xmlMapper, accident, YcBuildData.API_ACCIDENT);
|
|
|
|
|
|
|
+ String responseData = httpPostResultLog(xmlMapper, accident, YcBuildData.API_ACCIDENT,"永诚API方式 - 获取意健险方案及险种 - ");
|
|
|
|
|
+// InsApiLog apiLog = httpPost(xmlMapper, accident, YcBuildData.API_ACCIDENT);
|
|
|
log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询结束!======");
|
|
log.debug("=========永诚API方式 - xml请求 - 获取意健险方案及险种查询结束!======");
|
|
|
// verifyRequest(apiLog, iac,InsQuoteFlow.);
|
|
// verifyRequest(apiLog, iac,InsQuoteFlow.);
|
|
|
- String responseData = apiLog.getResponseData();
|
|
|
|
|
|
|
+// String responseData = apiLog.getResponseData();
|
|
|
|
|
|
|
|
|
|
|
|
|
String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
@@ -1322,26 +1261,26 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- private <T> InsApiLog httpPost(ObjectMapper mapper, T requestData, String apiName) {
|
|
|
|
|
-
|
|
|
|
|
- String xmlString = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:tns=\"http://newWS.front.app.echannel.ebiz.alltrust.com/\">";
|
|
|
|
|
- xmlString += "<soapenv:Body>";
|
|
|
|
|
- try {
|
|
|
|
|
- mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
|
|
|
|
- xmlString += mapper.writeValueAsString(requestData);
|
|
|
|
|
-
|
|
|
|
|
- xmlString += "</soapenv:Body>\n" +
|
|
|
|
|
- "</soapenv:Envelope>";
|
|
|
|
|
-
|
|
|
|
|
- } catch (JsonProcessingException e) {
|
|
|
|
|
- throw new RuntimeException("永诚API方式-xml转换失败");
|
|
|
|
|
- }
|
|
|
|
|
- InsApiLog iplog = HttpXmlUtil.sendXmlPost(apiComponents.getUrl() + apiName, xmlString);
|
|
|
|
|
-// log.info("永诚API方式 - xml请求 - 参数:" + iplog.getRequestData());
|
|
|
|
|
-// log.info("永诚API方式 - xml请求 ------------分割线----------------");
|
|
|
|
|
-// log.info("永诚API方式 - xml请求 - 响应:" + iplog.getResponseData());
|
|
|
|
|
- return iplog;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// private <T> InsApiLog httpPost(ObjectMapper mapper, T requestData, String apiName) {
|
|
|
|
|
+//
|
|
|
|
|
+// String xmlString = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:tns=\"http://newWS.front.app.echannel.ebiz.alltrust.com/\">";
|
|
|
|
|
+// xmlString += "<soapenv:Body>";
|
|
|
|
|
+// try {
|
|
|
|
|
+// mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
|
|
|
|
+// xmlString += mapper.writeValueAsString(requestData);
|
|
|
|
|
+//
|
|
|
|
|
+// xmlString += "</soapenv:Body>\n" +
|
|
|
|
|
+// "</soapenv:Envelope>";
|
|
|
|
|
+//
|
|
|
|
|
+// } catch (JsonProcessingException e) {
|
|
|
|
|
+// throw new RuntimeException("永诚API方式-xml转换失败");
|
|
|
|
|
+// }
|
|
|
|
|
+// InsApiLog iplog = HttpXmlUtil.sendXmlPost(apiComponents.getUrl() + apiName, xmlString);
|
|
|
|
|
+//// log.info("永诚API方式 - xml请求 - 参数:" + iplog.getRequestData());
|
|
|
|
|
+//// log.info("永诚API方式 - xml请求 ------------分割线----------------");
|
|
|
|
|
+//// log.info("永诚API方式 - xml请求 - 响应:" + iplog.getResponseData());
|
|
|
|
|
+// return iplog;
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 日志返回处理
|
|
* 日志返回处理
|