|
|
@@ -321,6 +321,52 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询订单状态
|
|
|
+ *
|
|
|
+ * @param orderStatusVo
|
|
|
+ * @return OrderStatusResultVo
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public OrderStatusResultVo queryOrderState(OrderStatusVo orderStatusVo) {
|
|
|
+ try {
|
|
|
+ AttributionInformationVo attributionInformationVo = orderStatusVo.getOrder().getAttributionInformationVo();
|
|
|
+ HttpHeaders headers = ziJinCrawlerQuoteProcessService.getHeaders(attributionInformationVo.getUsername(), attributionInformationVo.getPassword());
|
|
|
+ ZiJinCrawlerOrder ziJinCrawlerOrder = ziJinCrawlerOrderService.getByOrdersNo(orderStatusVo.getOrder().getOrdersNo());
|
|
|
+
|
|
|
+ ZiJinCrawlerQueryOrderStatusRequest ziJinCrawlerQueryOrderStatusRequest = new ZiJinCrawlerQueryOrderStatusRequest();
|
|
|
+ // 设置请求参数
|
|
|
+ ziJinCrawlerQueryOrderStatusRequest.setOrderStatus(new String[]{});
|
|
|
+ ziJinCrawlerQueryOrderStatusRequest.setOrderNo(ziJinCrawlerOrder.getOrderNo());
|
|
|
+ ziJinCrawlerQueryOrderStatusRequest.setUpdateTimeBegin(orderStatusVo.getOrder().getUpdateTimeBegin());
|
|
|
+ ziJinCrawlerQueryOrderStatusRequest.setUpdateTimeEnd(orderStatusVo.getOrder().getUpdateTimeEnd());
|
|
|
+ ziJinCrawlerQueryOrderStatusRequest.setPageNum(1);
|
|
|
+ ziJinCrawlerQueryOrderStatusRequest.setPageSize(10);
|
|
|
+ ziJinCrawlerQueryOrderStatusRequest.setProductCodeList(new String[]{});
|
|
|
+ ziJinCrawlerQueryOrderStatusRequest.setOrderOrigin("KSCD_PROD,FH_PROD,DP_WXMP,DP_ZYB,RENEWAL_PROD,DP_ZNCD,SHHTB_B");
|
|
|
+
|
|
|
+ ZiJinCrawlerQueryOrderStatusResponse ziJinCrawlerQueryOrderStatusResponse = ziJinCrawlerRequestComponent.queryOrderStatus(ziJinCrawlerQueryOrderStatusRequest, headers);
|
|
|
+ log.info("ziJinCrawlerQueryOrderStatusResponse对象的值:{}", JSON.toJSONString(ziJinCrawlerQueryOrderStatusResponse));
|
|
|
+ //获取订单状态
|
|
|
+ String orderStatus = ziJinCrawlerQueryOrderStatusResponse.getData().getContent().get(0).getOrderStatus();
|
|
|
+ log.info("订单状态:{},中文含义:{}", orderStatus, ziJinCrawlerQueryOrderStatusResponse.getData().getContent().get(0).getOrderStatusCN());
|
|
|
+ //将保司返回的订单状态转换为系统定义的订单状态枚举类型
|
|
|
+ InsOrderStatusEnum orderStatusEnum = null;
|
|
|
+ if("5".equals(orderStatus)){
|
|
|
+ orderStatusEnum = InsOrderStatusEnum.valueOf("ORDER_CLOSE");
|
|
|
+ orderStatus = orderStatusEnum.getCode();
|
|
|
+ }
|
|
|
+ OrderStatusResultVo orderStatusResultVo = new OrderStatusResultVo();
|
|
|
+ //将订单状态转换为枚举类型
|
|
|
+ orderStatusResultVo.setOrderStatus(orderStatusEnum);
|
|
|
+ orderStatusResultVo.setOrderStatusStr(orderStatus);
|
|
|
+ return orderStatusResultVo;
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 下载保单
|
|
|
@@ -331,15 +377,14 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
@Override
|
|
|
public DownloadPolicyResultVo downloadPolicy(DownloadPolicyVo downloadPolicyVo) {
|
|
|
try {
|
|
|
- //获取归属信息
|
|
|
- AttributionInformationVo attributionInformationVo = downloadPolicyVo.getOrder().getAttributionInformationVo();
|
|
|
- HttpHeaders headers = ziJinCrawlerQuoteProcessService.getHeaders(attributionInformationVo.getUsername(), attributionInformationVo.getPassword());
|
|
|
ZiJinCrawlerOrder ziJinCrawlerOrder = ziJinCrawlerOrderService.getByOrdersNo(downloadPolicyVo.getOrder().getOrdersNo());
|
|
|
|
|
|
//1、查询车辆保单列表(下载保单的前一步操作)
|
|
|
- ZiJinCrawlerQueryCarPolicyListRequest ziJinCrawlerQueryCarPolicyListRequest = setQueryCarPolicyListRequest(downloadPolicyVo.getBeginDate(), downloadPolicyVo.getEndDate(), "");
|
|
|
- ZiJinCrawlerQueryCarPolicyListResponse ziJinCrawlerQueryCarPolicyListResponse = ziJinCrawlerRequestComponent.queryCarPolicyList(ziJinCrawlerQueryCarPolicyListRequest, headers);
|
|
|
- List<ZiJinCrawlerQueryCarPolicyListResponse.PolicyContent> content = ziJinCrawlerQueryCarPolicyListResponse.getData().getContent();
|
|
|
+ ZiJinCrawlerQueryCarPolicyListRequest ziJinCrawlerQueryCarPolicyListRequest = setQueryCarPolicyListRequest(downloadPolicyVo.getBeginDate(), downloadPolicyVo.getEndDate(), "2140000601");
|
|
|
+ ZiJinCrawlerQueryCarPolicyListResponse ziJinCrawlerQueryCarPolicyListResponse = ziJinCrawlerRequestComponent.queryCarPolicyList(ziJinCrawlerQueryCarPolicyListRequest);
|
|
|
+ log.info("ziJinCrawlerQueryCarPolicyListResponse响应对象的值:{}", JSON.toJSONString(ziJinCrawlerQueryCarPolicyListResponse));
|
|
|
+
|
|
|
+ List<ZiJinCrawlerQueryCarPolicyListResponse.PolicyContent> content = ziJinCrawlerQueryCarPolicyListResponse.getData().getPolicyDataInfoDtoList().getContent();
|
|
|
//获取所有的保单号
|
|
|
List<String> policyNos = content.stream().map(ZiJinCrawlerQueryCarPolicyListResponse.PolicyContent::getPolicyNo).collect(Collectors.toList());
|
|
|
//获取所有的加密验证码
|
|
|
@@ -349,15 +394,18 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
for (int i = 0; i < policyNos.size(); i++) {
|
|
|
policyNoEncryptMap.put(policyNos.get(i), encryptCodes.get(i));
|
|
|
}
|
|
|
+ log.info("policyNoEncryptMap的值:{}",policyNoEncryptMap);
|
|
|
//2、下载保单
|
|
|
ZiJinCrawlerDownloadPolicyRequest ziJinCrawlerDownloadPolicyRequest = new ZiJinCrawlerDownloadPolicyRequest();
|
|
|
|
|
|
DownloadPolicyResultVo downloadPolicyResultVo = new DownloadPolicyResultVo();
|
|
|
// 下载交强险保单
|
|
|
if (StringUtils.hasLength(ziJinCrawlerOrder.getCiPolicyNo())) {
|
|
|
+ log.info("开始下载交强险保单:{}",ziJinCrawlerOrder.getCiPolicyNo());
|
|
|
ziJinCrawlerDownloadPolicyRequest.setPolicyNo(ziJinCrawlerOrder.getCiPolicyNo());
|
|
|
ziJinCrawlerDownloadPolicyRequest.setEncrypt(policyNoEncryptMap.get(ziJinCrawlerOrder.getCiPolicyNo()));
|
|
|
- ZiJinCrawlerDownloadPolicyResponse ziJinCrawlerDownloadPolicyResponse = ziJinCrawlerRequestComponent.electronPolicyIODownload(ziJinCrawlerDownloadPolicyRequest, headers);
|
|
|
+ ZiJinCrawlerDownloadPolicyResponse ziJinCrawlerDownloadPolicyResponse = ziJinCrawlerRequestComponent.electronPolicyIODownload(ziJinCrawlerDownloadPolicyRequest);
|
|
|
+ log.info("ziJinCrawlerDownloadPolicyResponse响应对象的值:{}", JSON.toJSONString(ziJinCrawlerDownloadPolicyResponse));
|
|
|
// 设置交强险标志地址
|
|
|
downloadPolicyResultVo.setJqFlagUrl(ziJinCrawlerDownloadPolicyResponse.getData().getElePolicyDownloadInfoDtoList().get(0).getDownloadPath());
|
|
|
// 设置交强险保单地址
|
|
|
@@ -366,9 +414,12 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
|
|
|
// 下载商业险保单
|
|
|
if (StringUtils.hasLength(ziJinCrawlerOrder.getBiPolicyNo())) {
|
|
|
+ log.info("开始下载商业险保单:{}",ziJinCrawlerOrder.getBiPolicyNo());
|
|
|
ziJinCrawlerDownloadPolicyRequest.setPolicyNo(ziJinCrawlerOrder.getBiPolicyNo());
|
|
|
ziJinCrawlerDownloadPolicyRequest.setEncrypt(policyNoEncryptMap.get(ziJinCrawlerOrder.getBiPolicyNo()));
|
|
|
- ZiJinCrawlerDownloadPolicyResponse ziJinCrawlerDownloadPolicyResponse = ziJinCrawlerRequestComponent.electronPolicyIODownload(ziJinCrawlerDownloadPolicyRequest, headers);
|
|
|
+ ZiJinCrawlerDownloadPolicyResponse ziJinCrawlerDownloadPolicyResponse = ziJinCrawlerRequestComponent.electronPolicyIODownload(ziJinCrawlerDownloadPolicyRequest);
|
|
|
+ log.info("ziJinCrawlerDownloadPolicyResponse响应对象的值:{}", JSON.toJSONString(ziJinCrawlerDownloadPolicyResponse));
|
|
|
+
|
|
|
//设置驾意险保单地址
|
|
|
downloadPolicyResultVo.setJyUrl(ziJinCrawlerDownloadPolicyResponse.getData().getElePolicyDownloadInfoDtoList().get(2).getDownloadPath());
|
|
|
// 设置商业险保单地址
|
|
|
@@ -382,43 +433,7 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
}
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * 查询订单状态
|
|
|
- *
|
|
|
- * @param orderStatusVo
|
|
|
- * @return OrderStatusResultVo
|
|
|
- */
|
|
|
- @Override
|
|
|
- public OrderStatusResultVo queryOrderState(OrderStatusVo orderStatusVo) {
|
|
|
- try {
|
|
|
- AttributionInformationVo attributionInformationVo = orderStatusVo.getOrder().getAttributionInformationVo();
|
|
|
- HttpHeaders headers = ziJinCrawlerQuoteProcessService.getHeaders(attributionInformationVo.getUsername(), attributionInformationVo.getPassword());
|
|
|
- ZiJinCrawlerOrder boHaiCrawlerOrder = ziJinCrawlerOrderService.getByOrdersNo(orderStatusVo.getOrder().getOrdersNo());
|
|
|
-
|
|
|
- ZiJinCrawlerQueryOrderStatusRequest ziJinCrawlerQueryOrderStatusRequest = new ZiJinCrawlerQueryOrderStatusRequest();
|
|
|
- // 设置请求参数
|
|
|
- ziJinCrawlerQueryOrderStatusRequest.setOrderStatus(new String[]{});
|
|
|
- ziJinCrawlerQueryOrderStatusRequest.setOrderNo(orderStatusVo.getOrder().getOrdersNo());
|
|
|
- ziJinCrawlerQueryOrderStatusRequest.setUpdateTimeBegin("");
|
|
|
- ziJinCrawlerQueryOrderStatusRequest.setUpdateTimeEnd("");
|
|
|
- ziJinCrawlerQueryOrderStatusRequest.setPageNum(1);
|
|
|
- ziJinCrawlerQueryOrderStatusRequest.setPageSize(10);
|
|
|
- ziJinCrawlerQueryOrderStatusRequest.setProductCodeList(new String[]{});
|
|
|
- ziJinCrawlerQueryOrderStatusRequest.setOrderOrigin("KSCD_PROD,FH_PROD,DP_WXMP,DP_ZYB,RENEWAL_PROD,DP_ZNCD,SHHTB_B");
|
|
|
|
|
|
- ZiJinCrawlerQueryOrderStatusResponse ziJinCrawlerQueryOrderStatusResponse = ziJinCrawlerRequestComponent.queryOrderStatus(ziJinCrawlerQueryOrderStatusRequest, headers);
|
|
|
- log.info("查询订单状态响应:{}", JSON.toJSONString(ziJinCrawlerQueryOrderStatusResponse));
|
|
|
- //获取订单状态
|
|
|
- String orderStatus = ziJinCrawlerQueryOrderStatusResponse.getData().getContent().get(0).getOrderStatus();
|
|
|
- log.info("订单状态:{},中文含义:{}", orderStatus, ziJinCrawlerQueryOrderStatusResponse.getData().getContent().get(0).getOrderStatusCN());
|
|
|
- OrderStatusResultVo orderStatusResultVo = new OrderStatusResultVo();
|
|
|
- orderStatusResultVo.setOrderStatusStr(orderStatus);
|
|
|
- return orderStatusResultVo;
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 设置查询车险保单列表请求参数
|