|
@@ -1,6 +1,7 @@
|
|
|
package com.jzg.quotation.hengbang.crawler.service.Impl;
|
|
package com.jzg.quotation.hengbang.crawler.service.Impl;
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
+//import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.crypto.digest.DigestUtil;
|
|
import cn.hutool.crypto.digest.DigestUtil;
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
@@ -10,7 +11,6 @@ import com.jzg.commons.entity.orders.po.InsOrdersCarUserInfo;
|
|
|
import com.jzg.commons.entity.quote.vo.AttributionInformationVo;
|
|
import com.jzg.commons.entity.quote.vo.AttributionInformationVo;
|
|
|
import com.jzg.commons.entity.quote.vo.CarInfoVo;
|
|
import com.jzg.commons.entity.quote.vo.CarInfoVo;
|
|
|
import com.jzg.commons.entity.quote.vo.QuoteVo;
|
|
import com.jzg.commons.entity.quote.vo.QuoteVo;
|
|
|
-import com.jzg.commons.entity.quote.vo.RiskInfoVo;
|
|
|
|
|
import com.jzg.commons.entity.quote.vo.aggregated.*;
|
|
import com.jzg.commons.entity.quote.vo.aggregated.*;
|
|
|
import com.jzg.commons.entity.quote.vo.base.LoginBase;
|
|
import com.jzg.commons.entity.quote.vo.base.LoginBase;
|
|
|
import com.jzg.commons.entity.quote.vo.image.InsuranceImageVo;
|
|
import com.jzg.commons.entity.quote.vo.image.InsuranceImageVo;
|
|
@@ -19,6 +19,7 @@ import com.jzg.quotation.commons.annotation.QuoteCrawlerService;
|
|
|
import com.jzg.quotation.commons.constant.InsuranceCode;
|
|
import com.jzg.quotation.commons.constant.InsuranceCode;
|
|
|
import com.jzg.quotation.commons.filter.CarModelsFilterUtils;
|
|
import com.jzg.quotation.commons.filter.CarModelsFilterUtils;
|
|
|
import com.jzg.quotation.commons.standard.conversion.ConfigureParametersConversion;
|
|
import com.jzg.quotation.commons.standard.conversion.ConfigureParametersConversion;
|
|
|
|
|
+import com.jzg.quotation.commons.utils.DateUtils;
|
|
|
import com.jzg.quotation.hengbang.crawler.build.HbCrawlerQuoteResultVoBuild;
|
|
import com.jzg.quotation.hengbang.crawler.build.HbCrawlerQuoteResultVoBuild;
|
|
|
import com.jzg.quotation.hengbang.crawler.component.HengBangCrawlerRequestComponent;
|
|
import com.jzg.quotation.hengbang.crawler.component.HengBangCrawlerRequestComponent;
|
|
|
import com.jzg.quotation.hengbang.crawler.constant.RequestConstant;
|
|
import com.jzg.quotation.hengbang.crawler.constant.RequestConstant;
|
|
@@ -32,14 +33,16 @@ import com.jzg.quotation.hengbang.crawler.properties.HengBangCrawlerProperties;
|
|
|
import com.jzg.quotation.hengbang.crawler.service.HbCrawlerOrderService;
|
|
import com.jzg.quotation.hengbang.crawler.service.HbCrawlerOrderService;
|
|
|
import com.jzg.quotation.hengbang.crawler.service.HengBangCrawlerRequest;
|
|
import com.jzg.quotation.hengbang.crawler.service.HengBangCrawlerRequest;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.http.HttpHeaders;
|
|
import org.springframework.http.HttpHeaders;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
+import java.util.regex.Matcher;
|
|
|
|
|
+import java.util.regex.Pattern;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @description: 恒邦财险 爬虫请求
|
|
* @description: 恒邦财险 爬虫请求
|
|
@@ -110,6 +113,11 @@ public class HengBangCrawlerRequestImpl implements HengBangCrawlerRequest {
|
|
|
HbCrawlerCalculationRequest calculationRequest = new HbCrawlerCalculationRequest(quoteVo, plyappno);
|
|
HbCrawlerCalculationRequest calculationRequest = new HbCrawlerCalculationRequest(quoteVo, plyappno);
|
|
|
String calculationResult = hbCrawlerRequestComponent.getCalculationResult(calculationRequest, headers);
|
|
String calculationResult = hbCrawlerRequestComponent.getCalculationResult(calculationRequest, headers);
|
|
|
HbCrawlerProposalResponse proposalResponse = null;
|
|
HbCrawlerProposalResponse proposalResponse = null;
|
|
|
|
|
+ // 脱保情况 重新赋值核心建议起保时间 二次报价
|
|
|
|
|
+ if(calculationResult.contains("脱保")){
|
|
|
|
|
+ calculationRequest.setOutofwarrantytype("N");
|
|
|
|
|
+ calculationResult = hbCrawlerRequestComponent.getCalculationResult(calculationRequest, headers);
|
|
|
|
|
+ }
|
|
|
if(calculationResult.equals("成功")){
|
|
if(calculationResult.equals("成功")){
|
|
|
// 5.2 报价第三步,获取报价数据
|
|
// 5.2 报价第三步,获取报价数据
|
|
|
proposalResponse = hbCrawlerRequestComponent.proposal(plyappno, headers);
|
|
proposalResponse = hbCrawlerRequestComponent.proposal(plyappno, headers);
|
|
@@ -120,6 +128,18 @@ public class HengBangCrawlerRequestImpl implements HengBangCrawlerRequest {
|
|
|
}
|
|
}
|
|
|
return HbCrawlerQuoteResultVoBuild.build(quoteVo, proposalResponse, calculationResult);
|
|
return HbCrawlerQuoteResultVoBuild.build(quoteVo, proposalResponse, calculationResult);
|
|
|
}
|
|
}
|
|
|
|
|
+ private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ private static final Pattern START_TIME_PATTERN = Pattern.compile("起保起期设置为:(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2})[.。!;;]?");
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 提取系统自动分配的起保时间(从提示文本中)
|
|
|
|
|
+ * @param calculationResult 系统提示文本
|
|
|
|
|
+ * @return 提取到的时间字符串(如:2025-12-02 11:46:00),未提取到返回 null
|
|
|
|
|
+ */
|
|
|
|
|
+ private String extractSystemAssignedTime(String calculationResult) {
|
|
|
|
|
+ Matcher matcher = START_TIME_PATTERN.matcher(calculationResult);
|
|
|
|
|
+ return matcher.find() ? matcher.group(1) : null;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 提交核保 子订单
|
|
* 提交核保 子订单
|