|
|
@@ -245,13 +245,14 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
carModelReq.setEngineNo(carInfo.getEngineNo());
|
|
|
carModelReq.setEnrollDate(carInfo.getRegisterDate().replaceAll("-",""));
|
|
|
|
|
|
+ log.info("===永诚--车型查询接口请求 =====参数确认:--"+ycConfigureParameters.getDptCde()+"===");
|
|
|
ModelsQueryXml m = buildModelsQueryParam(carModelReq, ycConfigureParameters);
|
|
|
ObjectMapper xmlMapper = this.gainXmlMapper();
|
|
|
|
|
|
- log.info("===永诚--车型查询接口请求开始===");
|
|
|
+ log.info("===永诚--车型查询接口请求开始--"+carInfo.getLicenseNo()+"===");
|
|
|
InsApiLog apiLog = httpPost(xmlMapper, m, YcBuildData.API_MODEL);
|
|
|
String responseData = apiLog.getResponseData();
|
|
|
- log.info("===永诚--车型查询接口请求结束===");
|
|
|
+ log.info("===永诚--车型查询接口请求结束--"+carInfo.getLicenseNo()+"===");
|
|
|
try {
|
|
|
String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
|
ModelsQueryResponse rd = xmlMapper.readValue(cleanStr, ModelsQueryResponse.class);
|
|
|
@@ -329,90 +330,20 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
//构造地区
|
|
|
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 = requestApi(m, new RuoteResponse(), iac, YcBuildData.API_QUOTE, InsQuoteFlow.Q_S_0);
|
|
|
- if (null == rr) return HttpResult.error("远程请求报价失败");
|
|
|
- if (rr.getHead().getErrorCode().equals("000000")) {
|
|
|
- String cCheckCodeJQ = rr.getVhl().getCCheckCodeJQ();
|
|
|
- String cCheckCodeSY = rr.getVhl().getCCheckCodeSY();
|
|
|
-
|
|
|
- boolean flagTransferInsJQ = StringUtils.isNotEmpty(rr.getVhl().getCCheckCodeJQ()) &&
|
|
|
- StringUtils.isNotEmpty(rr.getVhl().getCQryCdeJQ());
|
|
|
- boolean flagTransferInsSY = StringUtils.isNotEmpty(rr.getVhl().getCCheckCodeSY()) &&
|
|
|
- StringUtils.isNotEmpty(rr.getVhl().getCQryCdeSY());
|
|
|
- boolean flagTransferIns = StringUtils.isNotEmpty(rr.getVhl().getCBusType()) && (flagTransferInsJQ || flagTransferInsSY);
|
|
|
- //响应 转保单
|
|
|
- if (flagTransferIns) {
|
|
|
- quoteVo.setRenewalCodeJq(cCheckCodeJQ);
|
|
|
- quoteVo.setRenewalCodeSy(cCheckCodeSY);
|
|
|
- quoteVo.setCQryCdeJq(rr.getVhl().getCQryCdeJQ());
|
|
|
- quoteVo.setCQryCdeSy(rr.getVhl().getCQryCdeSY());
|
|
|
- return HttpResult.error(101, quoteVo, "转保单");
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- } else {
|
|
|
- return HttpResult.error(rr.getHead().getErrorMessage());
|
|
|
-// throw new SystemException(rd.getHead().getErrorMessage());
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-// RuoteResponse rr = null;
|
|
|
-// int flag = 0;
|
|
|
-// while (flag < 3) {
|
|
|
-// log.debug("永诚API方式 - 报价 - 请求 {} 次",flag);
|
|
|
-// rr = requestApi(m, new RuoteResponse(), iac, YcBuildData.API_QUOTE, InsQuoteFlow.Q_S_0);
|
|
|
-// if (null == rr) return HttpResult.error("远程请求报价失败");
|
|
|
-// if (rr.getHead().getErrorCode().equals("000000")) {
|
|
|
-//
|
|
|
-// String cCheckCodeJQ = rr.getVhl().getCCheckCodeJQ();
|
|
|
-// String cCheckCodeSY = rr.getVhl().getCCheckCodeSY();
|
|
|
-//
|
|
|
-// boolean flagTransferInsJQ = StringUtils.isNotEmpty(rr.getVhl().getCCheckCodeJQ()) &&
|
|
|
-// StringUtils.isNotEmpty(rr.getVhl().getCQryCdeJQ());
|
|
|
-// boolean flagTransferInsSY = StringUtils.isNotEmpty(rr.getVhl().getCCheckCodeSY()) &&
|
|
|
-// StringUtils.isNotEmpty(rr.getVhl().getCQryCdeSY());
|
|
|
-// boolean flagTransferIns = StringUtils.isNotEmpty(rr.getVhl().getCBusType()) && (flagTransferInsJQ || flagTransferInsSY);
|
|
|
-// //转保单
|
|
|
-// if (flagTransferIns) {
|
|
|
-// log.debug("永诚API方式 - 报价 - 转保单业务处理");
|
|
|
-// String cBusType = rr.getVhl().getCBusType();
|
|
|
-// m.getRequestLabel().getCondition().getVhl().setCBusType(cBusType);
|
|
|
-// if(flagTransferInsJQ){
|
|
|
-// String imgStr = Tess4jOcr.ocrImageStr(cCheckCodeJQ);
|
|
|
-// //获取图片的验证码
|
|
|
-// m.getRequestLabel().getCondition().getVhl().setCCheckCodeJQ(imgStr);
|
|
|
-// }
|
|
|
-// if(flagTransferInsSY){
|
|
|
-// String imgStr = Tess4jOcr.ocrImageStr(cCheckCodeJQ);
|
|
|
-// //获取图片的验证码
|
|
|
-// m.getRequestLabel().getCondition().getVhl().setCCheckCodeJQ(imgStr);
|
|
|
-// }
|
|
|
-//
|
|
|
-// }else{
|
|
|
-// flag = 10;
|
|
|
-// }
|
|
|
-//
|
|
|
-// flag++;
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// } else {
|
|
|
-// return HttpResult.error(rr.getHead().getErrorMessage());
|
|
|
-//// throw new SystemException(rd.getHead().getErrorMessage());
|
|
|
-// }
|
|
|
+// //请求转保处理
|
|
|
+// 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 = requestApi(m, new RuoteResponse(), iac, YcBuildData.API_QUOTE, InsQuoteFlow.Q_S_0);
|
|
|
+ if (null == rr) return HttpResult.error("远程请求报价失败");
|
|
|
+ quoteExternalApi(rr,quoteVo,iac,m);
|
|
|
+ if (!rr.getHead().getErrorCode().equals("000000")) return HttpResult.error(rr.getHead().getErrorMessage());
|
|
|
|
|
|
QuoteRespVo quoteRespVo = YcBuildData.buildQuoteRespVo(order, rr, yaQuoteInfoVo);
|
|
|
//8 生成订单
|
|
|
@@ -426,6 +357,63 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 报价响应处理
|
|
|
+ */
|
|
|
+ public void quoteExternalApi(RuoteResponse rr,BaseQuoteVo<AccidentalDrivingVo> quoteVo,InsAreaCompany iac,Ruote m ) {
|
|
|
+
|
|
|
+ if (rr.getHead().getErrorCode().equals("000000")) {
|
|
|
+ String cCheckCodeJQ = rr.getVhl().getCCheckCodeJQ();
|
|
|
+ String cCheckCodeSY = rr.getVhl().getCCheckCodeSY();
|
|
|
+
|
|
|
+ //转保调用自动识别转保码
|
|
|
+ if (StringUtils.isNotEmpty(cCheckCodeJQ) || StringUtils.isNotEmpty(cCheckCodeSY)) {
|
|
|
+ //调用python ocr
|
|
|
+ String sendBody = "";
|
|
|
+ Map bodyMap = new HashMap();
|
|
|
+ bodyMap.put("jqImage", StringUtils.isNotEmpty(cCheckCodeJQ) ? cCheckCodeJQ : "");
|
|
|
+ bodyMap.put("syImage", StringUtils.isNotEmpty(cCheckCodeSY) ? cCheckCodeSY : "");
|
|
|
+ sendBody = JsonUtils.toJson(bodyMap);
|
|
|
+ String ocrStr = HttpUtil.sendPost("http://47.92.254.66:8088/getres", sendBody);
|
|
|
+ Map ocrMap = JsonUtils.toObject(ocrStr, Map.class);
|
|
|
+
|
|
|
+
|
|
|
+ m.getRequestLabel().getCondition().getVhl().setCBusType("2");
|
|
|
+ //交强
|
|
|
+ m.getRequestLabel().getCondition().getVhl().setCCheckCodeJQ(ocrMap.get("jqImageCode").toString());
|
|
|
+ m.getRequestLabel().getCondition().getVhl().setCQryCdeJQ(rr.getVhl().getCQryCdeJQ());
|
|
|
+
|
|
|
+ //商业
|
|
|
+ m.getRequestLabel().getCondition().getVhl().setCCheckCodeSY(quoteVo.getRenewalCodeSy());
|
|
|
+ m.getRequestLabel().getCondition().getVhl().setCQryCdeSY(rr.getVhl().getCQryCdeSY());
|
|
|
+
|
|
|
+ rr = requestApi(m, new RuoteResponse(), iac, YcBuildData.API_QUOTE, InsQuoteFlow.Q_S_0);
|
|
|
+
|
|
|
+
|
|
|
+// if(ocrMap.get("code").equals("400")){
|
|
|
+// boolean flagTransferInsJQ = StringUtils.isNotEmpty(rr.getVhl().getCCheckCodeJQ()) &&
|
|
|
+// StringUtils.isNotEmpty(rr.getVhl().getCQryCdeJQ());
|
|
|
+// boolean flagTransferInsSY = StringUtils.isNotEmpty(rr.getVhl().getCCheckCodeSY()) &&
|
|
|
+// StringUtils.isNotEmpty(rr.getVhl().getCQryCdeSY());
|
|
|
+// boolean flagTransferIns = StringUtils.isNotEmpty(rr.getVhl().getCBusType()) && (flagTransferInsJQ || flagTransferInsSY);
|
|
|
+// //响应 转保单
|
|
|
+// if (flagTransferIns) {
|
|
|
+// quoteVo.setRenewalCodeJq(cCheckCodeJQ);
|
|
|
+// quoteVo.setRenewalCodeSy(cCheckCodeSY);
|
|
|
+// quoteVo.setCQryCdeJq(rr.getVhl().getCQryCdeJQ());
|
|
|
+// quoteVo.setCQryCdeSy(rr.getVhl().getCQryCdeSY());
|
|
|
+// return HttpResult.error(101, quoteVo, "转保单");
|
|
|
+// }
|
|
|
+// }else{
|
|
|
+//
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 3 核保
|
|
|
*
|
|
|
@@ -637,7 +625,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
HttpResult httpResult = new HttpResult();
|
|
|
|
|
|
try {
|
|
|
- InsAreaCompany iac = insAreaCompanyService.getById(quoteOrderNo);
|
|
|
+ InsAreaCompany iac = insAreaCompanyService.getByInsOrderNo(quoteOrderNo);
|
|
|
InsOrders order = insOrdersService.getById(iac.getOrderno());
|
|
|
if (iac == null) {
|
|
|
return HttpResult.error("报价订单不存在");
|