|
|
@@ -3,6 +3,7 @@ package com.jzg.quotation.zijin.crawler.service.impl;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.zxing.NotFoundException;
|
|
|
+import java.util.Arrays;
|
|
|
import com.jzg.commons.constants.dict.InsOrderStatusEnum;
|
|
|
import com.jzg.commons.entity.quote.vo.AttributionInformationVo;
|
|
|
import com.jzg.commons.entity.quote.vo.QuoteVo;
|
|
|
@@ -30,14 +31,13 @@ import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
-import java.time.LocalDate;
|
|
|
-import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 紫金财险爬虫报价服务实现类
|
|
|
*
|
|
|
- * <p>通过模拟浏览器操作的方式实现渤海财险的完整报价流程</p>
|
|
|
+ * <p>通过模拟浏览器操作的方式实现紫金财险的完整报价流程</p>
|
|
|
*
|
|
|
* @author
|
|
|
* @since
|
|
|
@@ -60,7 +60,6 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
|
|
|
private final ZiJinCrawlerQuoteProcessService ziJinCrawlerQuoteProcessService;
|
|
|
|
|
|
- private static final String TOKEN = "114050281-ab12387d7bb7bd319ac3b7d4ddd22090";
|
|
|
|
|
|
/**
|
|
|
* 登录
|
|
|
@@ -440,20 +439,22 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
ZiJinCrawlerOrder ziJinCrawlerOrder = ziJinCrawlerOrderService.getById(paymentLinkVo.getOrder().getOrdersNo());
|
|
|
|
|
|
log.info("获取支付链接,订单号:{}", ziJinCrawlerOrder.getOrderNo());
|
|
|
- ZiJinCrawlerPaymentQueryRequest ziJinCrawlerPaymentQueryRequest = new ZiJinCrawlerPaymentQueryRequest();
|
|
|
- ziJinCrawlerPaymentQueryRequest.setWeChatOfficialFlag("1");
|
|
|
- ZiJinCrawlerPaymentQueryRequest.PaymentApplicationDto paymentApplicationDto = new ZiJinCrawlerPaymentQueryRequest.PaymentApplicationDto();
|
|
|
+
|
|
|
+ ZiJinCrawlerPaymentLinkRequest ziJinCrawlerPaymentLinkRequest = new ZiJinCrawlerPaymentLinkRequest();
|
|
|
+ ziJinCrawlerPaymentLinkRequest.setWeChatOfficialFlag("1");
|
|
|
+ ZiJinCrawlerPaymentLinkRequest.PaymentApplicationDto paymentApplicationDto = new ZiJinCrawlerPaymentLinkRequest.PaymentApplicationDto();
|
|
|
paymentApplicationDto.setBusinessNo(ziJinCrawlerOrder.getOrderNo());
|
|
|
paymentApplicationDto.setBusinessType("D");
|
|
|
paymentApplicationDto.setInvokeSystem("0201");
|
|
|
paymentApplicationDto.setPremium(ziJinCrawlerOrder.getTotalPremium());
|
|
|
- ziJinCrawlerPaymentQueryRequest.setPaymentApplicationDtos(Collections.singletonList(paymentApplicationDto));
|
|
|
- ziJinCrawlerPaymentQueryRequest.setOperatorCode("");
|
|
|
- ziJinCrawlerPaymentQueryRequest.setCompanyCode("");
|
|
|
+ ziJinCrawlerPaymentLinkRequest.setPaymentApplicationDtos(Collections.singletonList(paymentApplicationDto));
|
|
|
+ ziJinCrawlerPaymentLinkRequest.setOperatorCode("");
|
|
|
+ ziJinCrawlerPaymentLinkRequest.setCompanyCode("");
|
|
|
|
|
|
- ZiJinCrawlerQrcodeResponse boHaiPaymentResponse = ziJinCrawlerRequestComponent.payment(ziJinCrawlerPaymentQueryRequest, headers);
|
|
|
+ //获取支付链接
|
|
|
+ ZiJinCrawlerPaymentLinkResponse ziJinCrawlerPaymentLinkResponse = ziJinCrawlerRequestComponent.payment(ziJinCrawlerPaymentLinkRequest, headers);
|
|
|
PaymentLinkResultsVo paymentLinkResultsVo = new PaymentLinkResultsVo();
|
|
|
- paymentLinkResultsVo.setPaymentLink(boHaiPaymentResponse.getUrl());
|
|
|
+ paymentLinkResultsVo.setPaymentLink(ziJinCrawlerPaymentLinkResponse.getWechatUrl());
|
|
|
return paymentLinkResultsVo;
|
|
|
} catch (NotFoundException e) {
|
|
|
e.printStackTrace();
|
|
|
@@ -474,15 +475,24 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
try {
|
|
|
//获取归属信息
|
|
|
AttributionInformationVo attributionInformationVo = insuranceUploadImageVo.getOrder().getAttributionInformationVo();
|
|
|
- ZiJinCrawlerOrder boHaiCrawlerOrder = ziJinCrawlerOrderService.getById(insuranceUploadImageVo.getOrder().getOrdersNo());
|
|
|
HttpHeaders headers = ziJinCrawlerQuoteProcessService.getHeaders(attributionInformationVo.getUsername(), attributionInformationVo.getPassword());
|
|
|
-
|
|
|
- ZiJinCrawlerConfigureParameters parameters = ConfigureParametersConversion.conversionEntity(ZiJinCrawlerConfigureParameters.class, attributionInformationVo.getConfigInfo());
|
|
|
+ ZiJinCrawlerOrder ziJinCrawlerOrder = ziJinCrawlerOrderService.getById(insuranceUploadImageVo.getOrder().getOrdersNo());
|
|
|
|
|
|
// 上传影像文件请求参数
|
|
|
- ZiJinCrawlerImageUploadRequestDto boHaiCrawlerImageUploadRequest = new ZiJinCrawlerImageUploadRequestDto(parameters, boHaiCrawlerOrder.getOrderNo(), insuranceUploadImageVo.getImageVoList());
|
|
|
- ZiJinCrawlerImageUploadSubmitResponse boHaiCrawlerImageUploadSubmitResponse = ziJinCrawlerRequestComponent.uploadImage(boHaiCrawlerImageUploadRequest, headers);
|
|
|
- log.info("boHaiCrawlerImageUploadSubmitResponse对象的值:{}", JSON.toJSONString(boHaiCrawlerImageUploadSubmitResponse));
|
|
|
+ ZiJinCrawlerImageUploadRequest ziJinCrawlerImageUploadRequest = new ZiJinCrawlerImageUploadRequest();
|
|
|
+ ziJinCrawlerImageUploadRequest.setFileBase64("");
|
|
|
+ ziJinCrawlerImageUploadRequest.setFileName("");
|
|
|
+ ziJinCrawlerImageUploadRequest.setFileType("");
|
|
|
+ ziJinCrawlerImageUploadRequest.setOrderNo(ziJinCrawlerOrder.getOrderNo());
|
|
|
+
|
|
|
+ ZiJinCrawlerImageUploadResponse ziJinCrawlerImageUploadResponse = ziJinCrawlerRequestComponent.uploadImage(ziJinCrawlerImageUploadRequest, headers);
|
|
|
+ log.info("boHaiCrawlerImageUploadSubmitResponse对象的值:{}", JSON.toJSONString(ziJinCrawlerImageUploadResponse));
|
|
|
+ if("0000".equals(ziJinCrawlerImageUploadResponse.getRtnCode())){
|
|
|
+ log.info("影像上传成功,影像ID:{}", ziJinCrawlerImageUploadResponse.getFileId());
|
|
|
+ }else{
|
|
|
+ log.error("影像上传失败,错误码:{},错误信息:{}", ziJinCrawlerImageUploadResponse.getRtnCode(), ziJinCrawlerImageUploadResponse.getRtnMsg());
|
|
|
+ throw new RuntimeException("影像上传失败,错误码:" + ziJinCrawlerImageUploadResponse.getRtnCode() + ",错误信息:" + ziJinCrawlerImageUploadResponse.getRtnMsg());
|
|
|
+ }
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
throw new RuntimeException(e);
|
|
|
@@ -490,8 +500,6 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 下载保单
|
|
|
*
|
|
|
@@ -500,68 +508,57 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
*/
|
|
|
@Override
|
|
|
public DownloadPolicyResultVo downloadPolicy(DownloadPolicyVo downloadPolicyVo) {
|
|
|
- //获取归属信息
|
|
|
- AttributionInformationVo attributionInformationVo = downloadPolicyVo.getOrder().getAttributionInformationVo();
|
|
|
- HttpHeaders headers = ziJinCrawlerQuoteProcessService.getHeaders(attributionInformationVo.getUsername(), attributionInformationVo.getPassword());
|
|
|
- ZiJinCrawlerOrder boHaiCrawlerOrder = ziJinCrawlerOrderService.getById(downloadPolicyVo.getOrder().getOrdersNo());
|
|
|
-
|
|
|
- /*ElectronicPolicyRequest electronicPolicyRequest = new ElectronicPolicyRequest(attributionInformationVo.getConfigInfo(),
|
|
|
- boHaiCrawlerOrder.getOrderNo(), boHaiCrawlerOrder.getCiPolicyNo(), boHaiCrawlerOrder.getBiPolicyNo());*/
|
|
|
- ZiJinCrawlerDownloadResponse response = null;
|
|
|
- ZiJinCrawlerDownloadRequest boHaiCrawlerDownloadRequest = buildDownloadRequest(boHaiCrawlerOrder);
|
|
|
- DownloadPolicyResultVo downloadPolicyResultVo = new DownloadPolicyResultVo();
|
|
|
-
|
|
|
- // 下载交强险保单
|
|
|
- if (StringUtils.hasLength(boHaiCrawlerOrder.getCiPolicyNo())) {
|
|
|
- //boHaiCrawlerDownloadRequest.setBusinessNo(boHaiCrawlerOrder.getCiPolicyNo());
|
|
|
- response = ziJinCrawlerRequestComponent.electronPolicyIODownload(boHaiCrawlerDownloadRequest, headers);
|
|
|
- downloadPolicyResultVo.setJqUrl(response.getFiles().get(0).getAddress());
|
|
|
- }
|
|
|
-
|
|
|
- // 下载商业险保单
|
|
|
- if (StringUtils.hasLength(boHaiCrawlerOrder.getBiPolicyNo())) {
|
|
|
- boHaiCrawlerDownloadRequest.setBusinessNo(boHaiCrawlerOrder.getBiPolicyNo());
|
|
|
- response = ziJinCrawlerRequestComponent.electronPolicyIODownload(boHaiCrawlerDownloadRequest, headers);
|
|
|
- if (!CollectionUtils.isEmpty(response.getFiles())) {
|
|
|
- downloadPolicyResultVo.setSyUrl(response.getFiles().get(0).getAddress());
|
|
|
+ try {
|
|
|
+ //获取归属信息
|
|
|
+ AttributionInformationVo attributionInformationVo = downloadPolicyVo.getOrder().getAttributionInformationVo();
|
|
|
+ HttpHeaders headers = ziJinCrawlerQuoteProcessService.getHeaders(attributionInformationVo.getUsername(), attributionInformationVo.getPassword());
|
|
|
+ ZiJinCrawlerOrder ziJinCrawlerOrder = ziJinCrawlerOrderService.getById(downloadPolicyVo.getOrder().getOrdersNo());
|
|
|
+
|
|
|
+ //1、查询车辆保单列表(下载保单的前一步操作)
|
|
|
+ ZiJinCrawlerQueryCarPolicyListRequest ziJinCrawlerQueryCarPolicyListRequest = setQueryCarPolicyListRequest(downloadPolicyVo.getBeginDate(), downloadPolicyVo.getEndDate(), "");
|
|
|
+ ZiJinCrawlerQueryCarPolicyListResponse ziJinCrawlerQueryCarPolicyListResponse = ziJinCrawlerRequestComponent.queryCarPolicyList(ziJinCrawlerQueryCarPolicyListRequest, headers);
|
|
|
+ List<ZiJinCrawlerQueryCarPolicyListResponse.PolicyContent> content = ziJinCrawlerQueryCarPolicyListResponse.getData().getContent();
|
|
|
+ //获取所有的保单号
|
|
|
+ List<String> policyNos = content.stream().map(ZiJinCrawlerQueryCarPolicyListResponse.PolicyContent::getPolicyNo).collect(Collectors.toList());
|
|
|
+ //获取所有的加密验证码
|
|
|
+ List<String> encryptCodes = content.stream().map(ZiJinCrawlerQueryCarPolicyListResponse.PolicyContent::getEncrypt).collect(Collectors.toList());
|
|
|
+ //将保单号和加密验证码一一对应
|
|
|
+ Map<String, String> policyNoEncryptMap = new LinkedHashMap<>();
|
|
|
+ for (int i = 0; i < policyNos.size(); i++) {
|
|
|
+ policyNoEncryptMap.put(policyNos.get(i), encryptCodes.get(i));
|
|
|
+ }
|
|
|
+ //2、下载保单
|
|
|
+ ZiJinCrawlerDownloadPolicyRequest ziJinCrawlerDownloadPolicyRequest =new ZiJinCrawlerDownloadPolicyRequest();
|
|
|
+
|
|
|
+ DownloadPolicyResultVo downloadPolicyResultVo = new DownloadPolicyResultVo();
|
|
|
+ // 下载交强险保单
|
|
|
+ if (StringUtils.hasLength(ziJinCrawlerOrder.getCiPolicyNo())) {
|
|
|
+ ziJinCrawlerDownloadPolicyRequest.setPolicyNo(ziJinCrawlerOrder.getCiPolicyNo());
|
|
|
+ ziJinCrawlerDownloadPolicyRequest.setEncrypt(policyNoEncryptMap.get(ziJinCrawlerOrder.getCiPolicyNo()));
|
|
|
+ ZiJinCrawlerDownloadPolicyResponse ziJinCrawlerDownloadPolicyResponse = ziJinCrawlerRequestComponent.electronPolicyIODownload(ziJinCrawlerDownloadPolicyRequest, headers);
|
|
|
+ // 设置交强险标志地址
|
|
|
+ downloadPolicyResultVo.setJqFlagUrl(ziJinCrawlerDownloadPolicyResponse.getData().getElePolicyDownloadInfoDtoList().get(0).getDownloadPath());
|
|
|
+ // 设置交强险保单地址
|
|
|
+ downloadPolicyResultVo.setJqUrl(ziJinCrawlerDownloadPolicyResponse.getData().getElePolicyDownloadInfoDtoList().get(1).getDownloadPath());
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- // 下载驾意险保单
|
|
|
- if (StringUtils.hasLength(boHaiCrawlerOrder.getNiPolicyNo())) {
|
|
|
- boHaiCrawlerDownloadRequest.setBusinessNo(boHaiCrawlerOrder.getNiPolicyNo());
|
|
|
- response = ziJinCrawlerRequestComponent.electronPolicyIODownload(boHaiCrawlerDownloadRequest, headers);
|
|
|
- if (!CollectionUtils.isEmpty(response.getFiles())) {
|
|
|
- downloadPolicyResultVo.setJyUrl(response.getFiles().get(0).getAddress());
|
|
|
+ // 下载商业险保单
|
|
|
+ if (StringUtils.hasLength(ziJinCrawlerOrder.getBiPolicyNo())) {
|
|
|
+ ziJinCrawlerDownloadPolicyRequest.setPolicyNo(ziJinCrawlerOrder.getBiPolicyNo());
|
|
|
+ ziJinCrawlerDownloadPolicyRequest.setEncrypt(policyNoEncryptMap.get(ziJinCrawlerOrder.getBiPolicyNo()));
|
|
|
+ ZiJinCrawlerDownloadPolicyResponse ziJinCrawlerDownloadPolicyResponse = ziJinCrawlerRequestComponent.electronPolicyIODownload(ziJinCrawlerDownloadPolicyRequest, headers);
|
|
|
+ //设置驾意险保单地址
|
|
|
+ downloadPolicyResultVo.setJyUrl(ziJinCrawlerDownloadPolicyResponse.getData().getElePolicyDownloadInfoDtoList().get(2).getDownloadPath());
|
|
|
+ // 设置商业险保单地址
|
|
|
+ downloadPolicyResultVo.setSyUrl(ziJinCrawlerDownloadPolicyResponse.getData().getElePolicyDownloadInfoDtoList().get(3).getDownloadPath());
|
|
|
}
|
|
|
+ return downloadPolicyResultVo;
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new RuntimeException(e);
|
|
|
}
|
|
|
- return downloadPolicyResultVo;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 构建下载请求对象
|
|
|
- * 按照JSON字段顺序设置请求参数
|
|
|
- *
|
|
|
- * @param boHaiCrawlerOrder 渤海保险订单信息
|
|
|
- * @return ZiJinCrawlerDownloadRequest 下载请求对象
|
|
|
- */
|
|
|
- private ZiJinCrawlerDownloadRequest buildDownloadRequest(ZiJinCrawlerOrder boHaiCrawlerOrder) {
|
|
|
- ZiJinCrawlerDownloadRequest boHaiCrawlerDownloadRequest = new ZiJinCrawlerDownloadRequest();
|
|
|
- // 按照JSON字段顺序设置请求参数
|
|
|
- // 1. 设置头部信息
|
|
|
- ZiJinCrawlerDownloadRequest.Head head = new ZiJinCrawlerDownloadRequest.Head();
|
|
|
- head.setTransCode("EleDocumentAddress");
|
|
|
- head.setTransType("Req");
|
|
|
- head.setToken(TOKEN);
|
|
|
- boHaiCrawlerDownloadRequest.setHead(head);
|
|
|
- // 2. 设置业务号(保单号)
|
|
|
- //boHaiCrawlerDownloadRequest.setBusinessNo(boHaiCrawlerOrder.getOrderNo());
|
|
|
- // 3. 设置文档类型
|
|
|
- boHaiCrawlerDownloadRequest.setDocumentType("POLICY");
|
|
|
- // 4. 设置是否新影像
|
|
|
- boHaiCrawlerDownloadRequest.setIsNewImage("1");
|
|
|
- return boHaiCrawlerDownloadRequest;
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 查询订单状态
|
|
|
@@ -576,14 +573,24 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
HttpHeaders headers = ziJinCrawlerQuoteProcessService.getHeaders(attributionInformationVo.getUsername(), attributionInformationVo.getPassword());
|
|
|
ZiJinCrawlerOrder boHaiCrawlerOrder = ziJinCrawlerOrderService.getById(orderStatusVo.getOrder().getOrdersNo());
|
|
|
|
|
|
- ZiJinCrawlerQueryOrderStatusRequest boHaiCrawlerQueryOrderStatusRequest = buildOrderStatusRequest(boHaiCrawlerOrder);
|
|
|
- ZiJinCrawlerQueryOrderStatusResponse boHaiCrawlerQueryOrderStatusResponse = ziJinCrawlerRequestComponent.queryOrderStatus(boHaiCrawlerQueryOrderStatusRequest, headers);
|
|
|
- log.info("查询订单状态响应:{}", JSON.toJSONString(boHaiCrawlerQueryOrderStatusResponse));
|
|
|
+ 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));
|
|
|
//获取订单状态
|
|
|
- InsOrderStatusEnum insOrderStatusEnum = determineOrderStatus(boHaiCrawlerQueryOrderStatusResponse);
|
|
|
- log.info("订单状态:{}", insOrderStatusEnum);
|
|
|
+ String orderStatus = ziJinCrawlerQueryOrderStatusResponse.getData().getContent().get(0).getOrderStatus();
|
|
|
+ log.info("订单状态:{},中文含义:{}", orderStatus, ziJinCrawlerQueryOrderStatusResponse.getData().getContent().get(0).getOrderStatusCN());
|
|
|
OrderStatusResultVo orderStatusResultVo = new OrderStatusResultVo();
|
|
|
- orderStatusResultVo.setOrderStatus(insOrderStatusEnum);
|
|
|
+ orderStatusResultVo.setOrderStatusStr(orderStatus);
|
|
|
return orderStatusResultVo;
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
@@ -592,101 +599,26 @@ public class ZiJinCrawlerRequestImpl implements ZiJinCrawlerRequest {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 确定订单状态
|
|
|
- *
|
|
|
- * @param response
|
|
|
- * @return InsOrderStatusEnum
|
|
|
- */
|
|
|
- public InsOrderStatusEnum determineOrderStatus(ZiJinCrawlerQueryOrderStatusResponse response) {
|
|
|
- // 首先检查是否取消
|
|
|
- if ("1".equals(response.getBusinessInfoList().get(0).getCancelFlag()) ||
|
|
|
- "1".equals(response.getBusinessInfoList().get(0).getCancelFlagBI()) ||
|
|
|
- "1".equals(response.getBusinessInfoList().get(0).getCancelFlagCI())) {
|
|
|
- return InsOrderStatusEnum.ORDER_CLOSE;
|
|
|
- }
|
|
|
-
|
|
|
- // 检查是否已生效
|
|
|
- if ("3".equals(response.getBusinessInfoList().get(0).getUnderwriteFlagBI()) &&
|
|
|
- "3".equals(response.getBusinessInfoList().get(0).getUnderwriteFlagCI())) {
|
|
|
- // 检查是否已缴费
|
|
|
- if ("0".equals(response.getBusinessInfoList().get(0).getPayFlagBI()) ||
|
|
|
- "0".equals(response.getBusinessInfoList().get(0).getPayFlagCI())) {
|
|
|
- return InsOrderStatusEnum.PAY_PENDING; // 待缴费
|
|
|
- }
|
|
|
- return InsOrderStatusEnum.UNDERWRITED; // 已生效
|
|
|
- }
|
|
|
- // 其他情况可以根据业务需求进一步细分
|
|
|
- return InsOrderStatusEnum.QUOTE_ING; // 默认为订单已提交
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 构建订单状态查询请求对象
|
|
|
+ * 设置查询车险保单列表请求参数
|
|
|
*
|
|
|
- * @param boHaiCrawlerOrder 渤海爬虫订单
|
|
|
- * @return ZiJinCrawlerQueryOrderStatusRequest
|
|
|
+ * @param beginDate 开始日期
|
|
|
+ * @param endDate 结束日期
|
|
|
+ * @param loginComCode 登录公司编码
|
|
|
+ * @return ZiJinCrawlerQueryCarPolicyListRequest
|
|
|
*/
|
|
|
- private ZiJinCrawlerQueryOrderStatusRequest buildOrderStatusRequest(ZiJinCrawlerOrder boHaiCrawlerOrder) {
|
|
|
- ZiJinCrawlerQueryOrderStatusRequest boHaiCrawlerQueryOrderStatusRequest = new ZiJinCrawlerQueryOrderStatusRequest();
|
|
|
-
|
|
|
- // 设置请求头信息
|
|
|
- ZiJinCrawlerQueryOrderStatusRequest.HeadDTO head = new ZiJinCrawlerQueryOrderStatusRequest.HeadDTO();
|
|
|
- head.setToken(TOKEN);
|
|
|
- head.setTransType("Req");
|
|
|
- head.setTransCode("CompositeQuery");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setHead(head);
|
|
|
-
|
|
|
- // 按照JSON字段顺序设置请求参数
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setIsQueryAllQuoteUserCode("false");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setLoginCom("14070201");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setRows(10);
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setPageNo(1);
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setBusinessType("O");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setQueryStatus("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setUserCode("114050281");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setLicenseNo("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setLicenseNoFlag("=");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setVinNo("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setVinNoFlag("=");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setFrameNo("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setFrameNoFlag("=");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setEngineNo("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setEngineNoFlag("=");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setOrderNo(boHaiCrawlerOrder.getOrderNo());
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setOrderNoFlag("=");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setProposalNo("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setProposalNoFlag("=");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setQuotationNo("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setQuotationNoFlag("=");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setPolicyNo("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setPolicyNoFlag("=");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setEndorseNo("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setEndorseNoFlag("=");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setInsuredName("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setInsuredNameFlag("=");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setAppliName("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setAppliNameFlag("=");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setAppliIdentifyNumber("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setAppliIdentifyNumberFlag("=");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setInsuredIdentifyNumber("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setInsuredIdentifyNumberFlag("=");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setStartDateBegin("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setStartDateEnd("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setEndDateBegin("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setEndDateEnd("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setOperateDateBegin(LocalDate.now().minusMonths(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setOperateDateEnd(LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setUnderWriteDateStart("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setUnderWriteDateEnd("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setBusinessCategories2("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setBusinessCategories2Flag("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setResourceTypeCode("004");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setIsIssueUserCode("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setIsIssueUserCodeFlag("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setEnableRiskArr("");
|
|
|
- boHaiCrawlerQueryOrderStatusRequest.setIsSearchUserCode("0");
|
|
|
-
|
|
|
- return boHaiCrawlerQueryOrderStatusRequest;
|
|
|
+ private ZiJinCrawlerQueryCarPolicyListRequest setQueryCarPolicyListRequest(String beginDate, String endDate,String loginComCode) {
|
|
|
+ ZiJinCrawlerQueryCarPolicyListRequest ziJinCrawlerQueryCarPolicyListRequest = new ZiJinCrawlerQueryCarPolicyListRequest();
|
|
|
+ ziJinCrawlerQueryCarPolicyListRequest.setInputDateBegin(beginDate);
|
|
|
+ ziJinCrawlerQueryCarPolicyListRequest.setInputDateEnd(endDate);
|
|
|
+ ziJinCrawlerQueryCarPolicyListRequest.setPageNo("0");
|
|
|
+ ziJinCrawlerQueryCarPolicyListRequest.setPageSize("10");
|
|
|
+ ziJinCrawlerQueryCarPolicyListRequest.setLoginComCode(loginComCode);
|
|
|
+ ziJinCrawlerQueryCarPolicyListRequest.setElePolicyStatusQuery("1");
|
|
|
+ ziJinCrawlerQueryCarPolicyListRequest.setPolicyStatus(Arrays.asList("1", "2", "3"));
|
|
|
+ ziJinCrawlerQueryCarPolicyListRequest.setRiskCodeList(Arrays.asList());
|
|
|
+ ziJinCrawlerQueryCarPolicyListRequest.setPaidAndIneffectiveSwitch("1");
|
|
|
+ ziJinCrawlerQueryCarPolicyListRequest.setInvokeSystem("0201");
|
|
|
+ return ziJinCrawlerQueryCarPolicyListRequest;
|
|
|
}
|
|
|
|
|
|
|