Prechádzať zdrojové kódy

华泰-处理报价车型异常的逻辑调整问题

lixiaolong 3 mesiacov pred
rodič
commit
073c9d030e

+ 19 - 6
tenant/insurance/quotation-huatai/src/main/java/com/jzg/quotation/huatai/crawler/service/Impl/HuaTaiCrawlerRequestImpl.java

@@ -213,7 +213,8 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
 
 
         String cookie = extractCookie(mmap);
         String cookie = extractCookie(mmap);
         CarInfoVo car = quoteVo.getCarInfoVo();
         CarInfoVo car = quoteVo.getCarInfoVo();
-
+        QuoteResultsVo quoteResultsVo = new QuoteResultsVo();
+        quoteResultsVo.setQuoteStatusEnum(InsOrderStatusEnum.QUOTE_FAIL);
         // 带重试的获取报价编号、车型型号
         // 带重试的获取报价编号、车型型号
         Map<String, Object> xbResult = retry(() -> {
         Map<String, Object> xbResult = retry(() -> {
             try { return xbQuery(dto.getUsername(), cookie, car); }
             try { return xbQuery(dto.getUsername(), cookie, car); }
@@ -222,14 +223,26 @@ public class HuaTaiCrawlerRequestImpl implements HuaTaiCrawlerRequest {
 
 
         String quotationNo = str(xbResult, "quotationNo");
         String quotationNo = str(xbResult, "quotationNo");
         String modelcodexh = StringUtils.isBlank(str(xbResult, "modelcodexh")) ? car.getCarModelNo() : str(xbResult, "modelcodexh");
         String modelcodexh = StringUtils.isBlank(str(xbResult, "modelcodexh")) ? car.getCarModelNo() : str(xbResult, "modelcodexh");
-        log.info("modelcodexh: {}", str(xbResult, "modelcodexh"));
-        log.info("modelcodexh: {}", modelcodexh);
+        log.info("XBResult_modelCodeXH: {}", str(xbResult, "modelcodexh"));
+        log.info("modelCode_XH: {}", modelcodexh);
 
 
         // 报价前预处理-保存车辆信息、过滤车型等处理
         // 报价前预处理-保存车辆信息、过滤车型等处理
-        PreResult pre = prepareQuote(attr, mmap, car, modelcodexh, cookie, quotationNo, xbResult);
+        PreResult pre = null;
+        try {
+            pre = prepareQuote(attr, mmap, car, modelcodexh, cookie, quotationNo, xbResult);
+        } catch (Exception e) {
+            log.error("报价失败:保存车辆信息、过滤车型异常,{}",e.getMessage());
+            return quoteResultsVo;
+        }
         // 报价
         // 报价
-        CoreResult core = executeQuote(quoteVo, quotationNo, dto, cookie, pre, gsInfo, attr);
-        if (!core.success()) throw new SystemException("报价失败");
+        CoreResult core = null;
+        try {
+            core = executeQuote(quoteVo, quotationNo, dto, cookie, pre, gsInfo, attr);
+        } catch (Exception e) {
+            log.error("报价失败,{}",e.getMessage());
+            return quoteResultsVo;
+        }
+        if (!core.success()) return quoteResultsVo;
         // 保存订单到MongoDB
         // 保存订单到MongoDB
         saveOrder(quoteVo, core);
         saveOrder(quoteVo, core);
         // 组装费用、评分、险种信息、续保标志
         // 组装费用、评分、险种信息、续保标志