|
@@ -994,6 +994,7 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
|
|
|
String body = post(BASE_URL + "/htcsp/DocumentPrintAction.do?cmd=electronicPolicyEndorseDownload",
|
|
String body = post(BASE_URL + "/htcsp/DocumentPrintAction.do?cmd=electronicPolicyEndorseDownload",
|
|
|
buildDocumentHeaders(req.getCookie()), fd);
|
|
buildDocumentHeaders(req.getCookie()), fd);
|
|
|
HtCrawlerDownloadPolicyResponse res = JSONObject.parseObject(body, HtCrawlerDownloadPolicyResponse.class);
|
|
HtCrawlerDownloadPolicyResponse res = JSONObject.parseObject(body, HtCrawlerDownloadPolicyResponse.class);
|
|
|
|
|
+ log.info("下载保单响应结果,{}", JSONObject.toJSONString(res));
|
|
|
DownloadPolicyResultVo r = new DownloadPolicyResultVo();
|
|
DownloadPolicyResultVo r = new DownloadPolicyResultVo();
|
|
|
for (var ftp : res.getFtpdownloadJson()) {
|
|
for (var ftp : res.getFtpdownloadJson()) {
|
|
|
if (jq) { r.setJqUrl(ftp.getDownurl()); r.setJqFlagUrl(ftp.getBzdownurl()); }
|
|
if (jq) { r.setJqUrl(ftp.getDownurl()); r.setJqFlagUrl(ftp.getBzdownurl()); }
|
|
@@ -1010,16 +1011,21 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
|
|
|
HtCrawlerConfigureParameters params = ConfigureParametersConversion.conversionEntity(
|
|
HtCrawlerConfigureParameters params = ConfigureParametersConversion.conversionEntity(
|
|
|
HtCrawlerConfigureParameters.class, attr.getConfigInfo());
|
|
HtCrawlerConfigureParameters.class, attr.getConfigInfo());
|
|
|
HtCrawlerOrder order = orderService.findByOrdersNo(vo.getOrder().getOrdersNo());
|
|
HtCrawlerOrder order = orderService.findByOrdersNo(vo.getOrder().getOrdersNo());
|
|
|
- String html = req.queryOrderStatus(new HtCrawlerOrderStateRequest(params, order.getQuotationRelaNo()), req.getHeaders());
|
|
|
|
|
- Document doc = Jsoup.parse(html);
|
|
|
|
|
- Elements tds = doc.select("table[id='table'] tbody tr td");
|
|
|
|
|
- // TODO: 完善字段映射
|
|
|
|
|
- tds.get(1).firstElementChild().text(); // 客户名称
|
|
|
|
|
- tds.get(2).firstElementChild().text(); // 保险起保日期
|
|
|
|
|
- tds.get(3).firstElementChild().text(); // 车牌号
|
|
|
|
|
- tds.get(4).firstElementChild().text(); // 报价单创建日期
|
|
|
|
|
- tds.get(7).firstElementChild().text(); // 订单状态
|
|
|
|
|
- return null;
|
|
|
|
|
|
|
+ String orderStatus = req.queryOrderStatus(new HtCrawlerOrderStateRequest(params, order.getQuotationRelaNo()), req.getHeaders());
|
|
|
|
|
+ String regex = "<div style=\"display: inline-block;width:50px;text-align: center; \">(.*?)</div>";
|
|
|
|
|
+ Pattern pattern = Pattern.compile(regex);
|
|
|
|
|
+ Matcher matcher = pattern.matcher(orderStatus);
|
|
|
|
|
+ if (matcher.find()) orderStatus = matcher.group(1);
|
|
|
|
|
+ InsOrderStatusEnum orderStatusEnum = null;
|
|
|
|
|
+ if ("已通过核保已实收".equals(orderStatus)) {
|
|
|
|
|
+ orderStatusEnum = InsOrderStatusEnum.valueOf("QUOTE_ING");
|
|
|
|
|
+ orderStatus = orderStatusEnum.getCode();
|
|
|
|
|
+ }
|
|
|
|
|
+ OrderStatusResultVo orderStatusResultVo = new OrderStatusResultVo();
|
|
|
|
|
+ //将订单状态转换为枚举类型
|
|
|
|
|
+ orderStatusResultVo.setOrderStatus(orderStatusEnum);
|
|
|
|
|
+ orderStatusResultVo.setOrderStatusStr(orderStatus);
|
|
|
|
|
+ return orderStatusResultVo;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// ====================== Headers 统一构建 ======================
|
|
// ====================== Headers 统一构建 ======================
|