|
@@ -258,31 +258,33 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
ModelsQueryResponse rd = xmlMapper.readValue(cleanStr, ModelsQueryResponse.class);
|
|
ModelsQueryResponse rd = xmlMapper.readValue(cleanStr, ModelsQueryResponse.class);
|
|
|
List<ModelsQueryResponse.VehicleInfo> vehicleInfoList = buildCarModel(rd);
|
|
List<ModelsQueryResponse.VehicleInfo> vehicleInfoList = buildCarModel(rd);
|
|
|
|
|
|
|
|
- long count = vehicleInfoList.stream().filter(x -> x.getModelCode().equals(carInfo.getModelCode())).count();
|
|
|
|
|
-
|
|
|
|
|
BigDecimal matchNum = BigDecimal.ZERO;
|
|
BigDecimal matchNum = BigDecimal.ZERO;
|
|
|
- if(count < 1 ){
|
|
|
|
|
- //匹配车辆信息
|
|
|
|
|
- vehicleInfoList.stream().forEach(a ->{
|
|
|
|
|
- //购置价匹配
|
|
|
|
|
- if(a.getVehiclePrice().equals(carInfo.getPurchasePrice())){
|
|
|
|
|
- carInfo.setModelCode(a.getVehicleId());
|
|
|
|
|
|
|
+ //匹配车辆信息
|
|
|
|
|
+ vehicleInfoList.stream().forEach(a ->{
|
|
|
|
|
+ //购置价匹配
|
|
|
|
|
+ if(a.getVehiclePrice().equals(carInfo.getPurchasePrice())){
|
|
|
|
|
+ carInfo.setModelCode(a.getVehicleId());
|
|
|
// carInfo.setCiModelCode(a.getModelCode());
|
|
// carInfo.setCiModelCode(a.getModelCode());
|
|
|
- carInfo.setCiCarName(a.getVehicleName());
|
|
|
|
|
- carInfo.setModelcname(a.getVehicleName());
|
|
|
|
|
|
|
+ carInfo.setCiCarName(a.getVehicleName());
|
|
|
|
|
+ carInfo.setModelcname(a.getVehicleName());
|
|
|
|
|
|
|
|
- matchNum.add(BigDecimal.ONE);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- //未匹配
|
|
|
|
|
- if(matchNum == BigDecimal.ZERO){
|
|
|
|
|
- carInfo.setModelCode(vehicleInfoList.get(0).getVehicleId());
|
|
|
|
|
-// carInfo.setCiModelCode(a.getModelCode());
|
|
|
|
|
- carInfo.setCiCarName(vehicleInfoList.get(0).getVehicleName());
|
|
|
|
|
- carInfo.setModelcname(vehicleInfoList.get(0).getVehicleName());
|
|
|
|
|
|
|
+ matchNum.add(BigDecimal.ONE);
|
|
|
}
|
|
}
|
|
|
|
|
+ });
|
|
|
|
|
+ //未匹配
|
|
|
|
|
+ if(matchNum == BigDecimal.ZERO){
|
|
|
|
|
+ carInfo.setModelCode(vehicleInfoList.get(0).getVehicleId());
|
|
|
|
|
+// carInfo.setCiModelCode(a.getModelCode());
|
|
|
|
|
+ carInfo.setCiCarName(vehicleInfoList.get(0).getVehicleName());
|
|
|
|
|
+ carInfo.setModelcname(vehicleInfoList.get(0).getVehicleName());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// long count = vehicleInfoList.stream().filter(x -> x.getModelCode().equals(carInfo.getModelCode())).count();
|
|
|
|
|
+//
|
|
|
|
|
+// if(count < 1 ){
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
|
throw new SystemException("车型查询接口异常,请联系管理。");
|
|
throw new SystemException("车型查询接口异常,请联系管理。");
|
|
@@ -342,12 +344,13 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
|
|
|
|
|
RuoteResponse rr = requestApi(m, new RuoteResponse(), iac, YcBuildData.API_QUOTE, InsQuoteFlow.Q_S_0);
|
|
RuoteResponse rr = requestApi(m, new RuoteResponse(), iac, YcBuildData.API_QUOTE, InsQuoteFlow.Q_S_0);
|
|
|
if (null == rr) return HttpResult.error("远程请求报价失败");
|
|
if (null == rr) return HttpResult.error("远程请求报价失败");
|
|
|
- quoteExternalApi(rr,quoteVo,iac,m);
|
|
|
|
|
if (!rr.getHead().getErrorCode().equals("000000")) return HttpResult.error(rr.getHead().getErrorMessage());
|
|
if (!rr.getHead().getErrorCode().equals("000000")) return HttpResult.error(rr.getHead().getErrorMessage());
|
|
|
|
|
+ RuoteResponse rr2 = quoteExternalApi(rr,quoteVo,iac,m);
|
|
|
|
|
+ if (!rr2.getHead().getErrorCode().equals("000000")) return HttpResult.error(rr2.getHead().getErrorMessage());
|
|
|
|
|
|
|
|
- QuoteRespVo quoteRespVo = YcBuildData.buildQuoteRespVo(order, rr, yaQuoteInfoVo);
|
|
|
|
|
|
|
+ QuoteRespVo quoteRespVo = YcBuildData.buildQuoteRespVo(order, rr2, yaQuoteInfoVo);
|
|
|
//8 生成订单
|
|
//8 生成订单
|
|
|
- iac = response_order(order, quoteRespVo, m, rr, quoteVo);
|
|
|
|
|
|
|
+ iac = response_order(order, quoteRespVo, m, rr2, quoteVo);
|
|
|
// updateApiLog(apiLog, iac);
|
|
// updateApiLog(apiLog, iac);
|
|
|
quoteRespVo.setCompanyId(iac.getId());
|
|
quoteRespVo.setCompanyId(iac.getId());
|
|
|
|
|
|
|
@@ -361,9 +364,11 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
/**
|
|
/**
|
|
|
* 报价响应处理
|
|
* 报价响应处理
|
|
|
*/
|
|
*/
|
|
|
- public void quoteExternalApi(RuoteResponse rr,BaseQuoteVo<AccidentalDrivingVo> quoteVo,InsAreaCompany iac,Ruote m ) {
|
|
|
|
|
|
|
+ public RuoteResponse quoteExternalApi(RuoteResponse rr,BaseQuoteVo<AccidentalDrivingVo> quoteVo,InsAreaCompany iac,Ruote m ) {
|
|
|
|
|
|
|
|
- if (rr.getHead().getErrorCode().equals("000000")) {
|
|
|
|
|
|
|
+ int i = 0;
|
|
|
|
|
+ if (rr.getHead().getErrorCode().equals("000000") && i < 3) {
|
|
|
|
|
+ i++;
|
|
|
String cCheckCodeJQ = rr.getVhl().getCCheckCodeJQ();
|
|
String cCheckCodeJQ = rr.getVhl().getCCheckCodeJQ();
|
|
|
String cCheckCodeSY = rr.getVhl().getCCheckCodeSY();
|
|
String cCheckCodeSY = rr.getVhl().getCCheckCodeSY();
|
|
|
|
|
|
|
@@ -388,7 +393,10 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
m.getRequestLabel().getCondition().getVhl().setCCheckCodeSY(quoteVo.getRenewalCodeSy());
|
|
m.getRequestLabel().getCondition().getVhl().setCCheckCodeSY(quoteVo.getRenewalCodeSy());
|
|
|
m.getRequestLabel().getCondition().getVhl().setCQryCdeSY(rr.getVhl().getCQryCdeSY());
|
|
m.getRequestLabel().getCondition().getVhl().setCQryCdeSY(rr.getVhl().getCQryCdeSY());
|
|
|
|
|
|
|
|
|
|
+// return requestApi(m, new RuoteResponse(), iac, YcBuildData.API_QUOTE, InsQuoteFlow.Q_S_0);
|
|
|
|
|
+// RuoteResponse rrTemp = requestApi(m, new RuoteResponse(), iac, YcBuildData.API_QUOTE, InsQuoteFlow.Q_S_0);
|
|
|
rr = requestApi(m, new RuoteResponse(), iac, YcBuildData.API_QUOTE, InsQuoteFlow.Q_S_0);
|
|
rr = requestApi(m, new RuoteResponse(), iac, YcBuildData.API_QUOTE, InsQuoteFlow.Q_S_0);
|
|
|
|
|
+ quoteExternalApi(rr,quoteVo,iac,m );
|
|
|
|
|
|
|
|
|
|
|
|
|
// if(ocrMap.get("code").equals("400")){
|
|
// if(ocrMap.get("code").equals("400")){
|
|
@@ -410,6 +418,8 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ return rr;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -625,12 +635,14 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
HttpResult httpResult = new HttpResult();
|
|
HttpResult httpResult = new HttpResult();
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- InsAreaCompany iac = insAreaCompanyService.getByInsOrderNo(quoteOrderNo);
|
|
|
|
|
|
|
+ InsAreaCompany iac = insAreaCompanyService.getById(quoteOrderNo);
|
|
|
InsOrders order = insOrdersService.getById(iac.getOrderno());
|
|
InsOrders order = insOrdersService.getById(iac.getOrderno());
|
|
|
if (iac == null) {
|
|
if (iac == null) {
|
|
|
return HttpResult.error("报价订单不存在");
|
|
return HttpResult.error("报价订单不存在");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if(StringUtils.isEmpty(iac.getAgreementId()))return HttpResult.error("协议号空");
|
|
|
|
|
+
|
|
|
// 获取协议配置信息
|
|
// 获取协议配置信息
|
|
|
YcConfigureParameters ycConfigureParameters = gainYcConfigParams(iac.getAgreementId());
|
|
YcConfigureParameters ycConfigureParameters = gainYcConfigParams(iac.getAgreementId());
|
|
|
//0 支付回调 1核保回调 5直接返回字符串信息
|
|
//0 支付回调 1核保回调 5直接返回字符串信息
|
|
@@ -700,6 +712,23 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
}
|
|
}
|
|
|
return httpResult;
|
|
return httpResult;
|
|
|
}
|
|
}
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 补传回调
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void callbackAnOrder() {
|
|
|
|
|
+
|
|
|
|
|
+ LambdaQueryWrapper<InsAreaCompany> lqw = new LambdaQueryWrapper<>();
|
|
|
|
|
+ lqw.eq(InsAreaCompany::getOrderstatus,InsOrderStatus.S_2.getCode());
|
|
|
|
|
+ List<InsAreaCompany> list = insAreaCompanyService.list(lqw);
|
|
|
|
|
+
|
|
|
|
|
+ if(null != list && list.size()>0){
|
|
|
|
|
+ list.stream().forEach(a ->{
|
|
|
|
|
+ callbackAnOrder(a.getId());
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 6 电子保单
|
|
* 6 电子保单
|