|
@@ -579,6 +579,9 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
m.getRequestLabel().getCondition().getCustomer().setCCity(insureMap.get("cityCode"));
|
|
m.getRequestLabel().getCondition().getCustomer().setCCity(insureMap.get("cityCode"));
|
|
|
m.getRequestLabel().getCondition().getCustomer().setCCounty(insureMap.get("areaCode"));
|
|
m.getRequestLabel().getCondition().getCustomer().setCCounty(insureMap.get("areaCode"));
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+// findRegion()
|
|
|
|
|
+
|
|
|
//接口请求
|
|
//接口请求
|
|
|
String responseData = httpPostResultLog(xmlMapper, m, YcBuildData.API_AUDIT, "永诚API方式 - 核保 - ");
|
|
String responseData = httpPostResultLog(xmlMapper, m, YcBuildData.API_AUDIT, "永诚API方式 - 核保 - ");
|
|
|
|
|
|
|
@@ -835,23 +838,29 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
AssertionUtils.isEmpty(iac, "报价订单不存在");
|
|
AssertionUtils.isEmpty(iac, "报价订单不存在");
|
|
|
InsOrders order = insOrdersService.getById(iac.getOrderno());
|
|
InsOrders order = insOrdersService.getById(iac.getOrderno());
|
|
|
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ String ip = InetAddress.getLocalHost().getHostAddress();
|
|
|
|
|
+ log.debug("------------------------------");
|
|
|
|
|
+ log.debug("----测试服务器IP----" + ip);
|
|
|
|
|
+ log.debug("------------------------------");
|
|
|
|
|
+ } catch (UnknownHostException e) {
|
|
|
|
|
+ throw new RuntimeException(e);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
String licensePlate = order.getLicenseno();
|
|
String licensePlate = order.getLicenseno();
|
|
|
|
|
|
|
|
- //如果保单已经生成了就直接返回
|
|
|
|
|
- if (policyPrintVo.getType().equals("2")) {
|
|
|
|
|
- Map m = new HashMap();
|
|
|
|
|
-
|
|
|
|
|
- String jqFlagUrl = gainExistCarInsPolicy(licensePlate + "-交强险标志.pdf", licensePlate);
|
|
|
|
|
- String jqUrl = gainExistCarInsPolicy(licensePlate + "-交强险保单.pdf", licensePlate);
|
|
|
|
|
- String syUrl = gainExistCarInsPolicy(licensePlate + "-商业险保单.pdf", licensePlate);
|
|
|
|
|
- if (null != jqFlagUrl || null != jqUrl || null != syUrl) {
|
|
|
|
|
- m.put("jqFlagUrl", jqFlagUrl);
|
|
|
|
|
- m.put("jqUrl", jqUrl);
|
|
|
|
|
- m.put("syUrl", syUrl);
|
|
|
|
|
- return HttpResult.ok(m);
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
+ Map m = new HashMap();
|
|
|
|
|
+
|
|
|
|
|
+ String jqFlagUrl = gainExistCarInsPolicy(licensePlate + "-交强险标志.pdf", licensePlate);
|
|
|
|
|
+ String jqUrl = gainExistCarInsPolicy(licensePlate + "-交强险保单.pdf", licensePlate);
|
|
|
|
|
+ String syUrl = gainExistCarInsPolicy(licensePlate + "-商业险保单.pdf", licensePlate);
|
|
|
|
|
+ if (null != jqFlagUrl || null != jqUrl || null != syUrl) {
|
|
|
|
|
+ m.put("jqFlagUrl", jqFlagUrl);
|
|
|
|
|
+ m.put("jqUrl", jqUrl);
|
|
|
|
|
+ m.put("syUrl", syUrl);
|
|
|
|
|
+ return HttpResult.ok(m);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -859,47 +868,44 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
YcConfigureParameters ycConfigureParameters = gainYcConfigParams(iac.getAgreementId());
|
|
YcConfigureParameters ycConfigureParameters = gainYcConfigParams(iac.getAgreementId());
|
|
|
String policyNo = policyPrintVo.getRiskCode().equals("0507") ? iac.getJqpolicyno() : iac.getSypolicyno();
|
|
String policyNo = policyPrintVo.getRiskCode().equals("0507") ? iac.getJqpolicyno() : iac.getSypolicyno();
|
|
|
|
|
|
|
|
-
|
|
|
|
|
//组装参数
|
|
//组装参数
|
|
|
Policy p = Policy.buildPolicyParam(policyNo, ycConfigureParameters.gainAuthorityDataXml());
|
|
Policy p = Policy.buildPolicyParam(policyNo, ycConfigureParameters.gainAuthorityDataXml());
|
|
|
|
|
|
|
|
ObjectMapper xmlMapper = gainXmlMapper();
|
|
ObjectMapper xmlMapper = gainXmlMapper();
|
|
|
- //接口请求
|
|
|
|
|
- log.debug("=========永诚API方式 - xml请求 - 获取保单开始======");
|
|
|
|
|
- String responseData = httpPostResultLog(xmlMapper, p, YcBuildData.API_GUARANTEE_SLIP, "永诚API方式 - 获取保单 - ");
|
|
|
|
|
|
|
|
|
|
-// InsApiLog apiLog = httpPost(xmlMapper, p, YcBuildData.API_GUARANTEE_SLIP);
|
|
|
|
|
- log.debug("=========永诚API方式 - xml请求 - 获取保单结束!======");
|
|
|
|
|
-// verifyRequest(apiLog, iac, InsQuoteFlow.Q_S_4);
|
|
|
|
|
-// String responseData = apiLog.getResponseData();
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //接口请求
|
|
|
|
|
+ String responseData = httpPostResultLog(xmlMapper, p, YcBuildData.API_GUARANTEE_SLIP, "车牌号:"+order.getLicenseno()+",永诚API方式 - 获取保单 - ");
|
|
|
|
|
|
|
|
String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
String cleanStr = YcBuildData.cleanResponseStr(responseData);
|
|
|
PolicyResponse pResp = xmlMapper.readValue(cleanStr, PolicyResponse.class);
|
|
PolicyResponse pResp = xmlMapper.readValue(cleanStr, PolicyResponse.class);
|
|
|
|
|
|
|
|
if (pResp.getHead().getResponseCompleteMessageStatus().getMessageStatusCode().equals("E0000")) {
|
|
if (pResp.getHead().getResponseCompleteMessageStatus().getMessageStatusCode().equals("E0000")) {
|
|
|
- Map m = new HashMap();
|
|
|
|
|
-
|
|
|
|
|
- String bzInsUrl = StringUtils.isNotEmpty(pResp.getPolicyBZUrl()) ? pResp.getPolicyBZUrl().replaceAll(";pkid", "&pkid") : "";
|
|
|
|
|
- String jqFlagUrl = gainCarInsPolicy(bzInsUrl, licensePlate + "-交强险标志.pdf", licensePlate);
|
|
|
|
|
- if (policyPrintVo.getType().equals("1")) {
|
|
|
|
|
- m.put("jqFlagUrl", jqFlagUrl);
|
|
|
|
|
- m.put("jqUrl", "");
|
|
|
|
|
- m.put("syUrl", "");
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //标志
|
|
|
|
|
+ if(StringUtils.isNotEmpty(pResp.getPolicyBZUrl())){
|
|
|
|
|
+ String bzInsUrl = pResp.getPolicyBZUrl().replaceAll(";pkid", "&pkid");
|
|
|
|
|
+ jqFlagUrl = gainCarInsPolicy(bzInsUrl, licensePlate + "-交强险标志.pdf", licensePlate);
|
|
|
}
|
|
}
|
|
|
- if (policyPrintVo.getType().equals("2")) {
|
|
|
|
|
- String jqInsUrl = StringUtils.isNotEmpty(pResp.getJqpolicyUrl()) ? pResp.getJqpolicyUrl().replaceAll(";pkid", "&pkid") : "";
|
|
|
|
|
- String syInsUrl = StringUtils.isNotEmpty(pResp.getSypolicyUrl()) ? pResp.getSypolicyUrl().replaceAll(";pkid", "&pkid") : "";
|
|
|
|
|
|
|
+ //交强
|
|
|
|
|
+ if(StringUtils.isNotEmpty(pResp.getJqpolicyUrl())){
|
|
|
|
|
+ String jqInsUrl = pResp.getJqpolicyUrl().replaceAll(";pkid", "&pkid");
|
|
|
|
|
+ jqUrl = gainCarInsPolicy(jqInsUrl, licensePlate + "-交强险保单.pdf", licensePlate);
|
|
|
|
|
|
|
|
- String jqUrl = gainCarInsPolicy(jqInsUrl, licensePlate + "-交强险保单.pdf", licensePlate);
|
|
|
|
|
- String syUrl = gainCarInsPolicy(syInsUrl, licensePlate + "-商业险保单.pdf", licensePlate);
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- m.put("jqFlagUrl", jqFlagUrl);
|
|
|
|
|
- m.put("jqUrl", jqUrl);
|
|
|
|
|
- m.put("syUrl", syUrl);
|
|
|
|
|
|
|
+ //商业
|
|
|
|
|
+ if(StringUtils.isNotEmpty(pResp.getSypolicyUrl())){
|
|
|
|
|
+ String syInsUrl = pResp.getSypolicyUrl().replaceAll(";pkid", "&pkid");
|
|
|
|
|
+ syUrl = gainCarInsPolicy(syInsUrl, licensePlate + "-交强险保单.pdf", licensePlate);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
-// httpResult.setData(m);
|
|
|
|
|
-// httpResult.setMsg(pResp.getHead().getResponseCompleteMessageStatus().getMessageStatusDescription());
|
|
|
|
|
|
|
+
|
|
|
|
|
+ m.put("jqFlagUrl", jqFlagUrl);
|
|
|
|
|
+ m.put("jqUrl", jqUrl);
|
|
|
|
|
+ m.put("syUrl", syUrl);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
return HttpResult.ok(pResp.getHead().getResponseCompleteMessageStatus().getMessageStatusDescription(), m);
|
|
return HttpResult.ok(pResp.getHead().getResponseCompleteMessageStatus().getMessageStatusDescription(), m);
|
|
|
|
|
|
|
|
} else {
|
|
} else {
|
|
@@ -1671,16 +1677,21 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
Map rMap = new HashMap();
|
|
Map rMap = new HashMap();
|
|
|
|
|
|
|
|
|
|
|
|
|
- if (address.indexOf("湖北省仙桃市") == 0) {
|
|
|
|
|
- rMap.put("provinceCode", "420000");
|
|
|
|
|
- rMap.put("cityCode", "429004");
|
|
|
|
|
- rMap.put("areaCode", "");
|
|
|
|
|
- return rMap;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if (address.indexOf("湖北省仙桃市") == 0) {
|
|
|
|
|
+// rMap.put("provinceCode", "420000");
|
|
|
|
|
+// rMap.put("cityCode", "429004");
|
|
|
|
|
+// rMap.put("areaCode", "");
|
|
|
|
|
+// return rMap;
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
if(address.contains("邢台县")){
|
|
if(address.contains("邢台县")){
|
|
|
address.replaceAll("邢台县","信都区");
|
|
address.replaceAll("邢台县","信都区");
|
|
|
-
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ if(address.contains("旬阳县")){
|
|
|
|
|
+ address.replaceAll("旬阳县","旬阳市");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(address.contains("开县")){
|
|
|
|
|
+ address.replaceAll("开县","开州区");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1714,6 +1725,12 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
|
|
|
cityLqw.eq(InsAlltrustRegion::getArea, city);
|
|
cityLqw.eq(InsAlltrustRegion::getArea, city);
|
|
|
areaList = insAlltrustRegionMapper.selectList(cityLqw);
|
|
areaList = insAlltrustRegionMapper.selectList(cityLqw);
|
|
|
}
|
|
}
|
|
|
|
|
+ //如果地区查不到 查市
|
|
|
|
|
+ if (null == areaList || areaList.size() < 1) {
|
|
|
|
|
+ LambdaQueryWrapper<InsAlltrustRegion> cityLqw = new LambdaQueryWrapper<>();
|
|
|
|
|
+ cityLqw.eq(InsAlltrustRegion::getCity, city);
|
|
|
|
|
+ areaList = insAlltrustRegionMapper.selectList(cityLqw);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
if (null != areaList && areaList.size() > 0) {
|
|
if (null != areaList && areaList.size() > 0) {
|