Bladeren bron

Merge branch 'master' into wrq_dev

wangrq 1 maand geleden
bovenliggende
commit
908d597cbc

+ 65 - 1
tenant/insurance/quotation-hengbang/src/main/java/com/jzg/quotation/hengbang/crawler/service/Impl/HengBangCrawlerRequestImpl.java

@@ -11,6 +11,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
 import com.jzg.commons.constants.ProductsType;
 import com.jzg.commons.constants.dict.InsOrderStatusEnum;
 import com.jzg.commons.constants.quote.enums.base.InsuranceImageEnum;
+import com.jzg.commons.entity.orders.po.InsOrders;
 import com.jzg.commons.entity.orders.po.InsOrdersCarUserInfo;
 import com.jzg.commons.entity.po.SysUploadFiles;
 import com.jzg.commons.entity.quote.vo.AttributionInformationVo;
@@ -621,8 +622,71 @@ public class HengBangCrawlerRequestImpl implements HengBangCrawlerRequest {
         HttpHeaders headers = hbCrawlerRequestComponent.getHeaders(attributionInformationVo.getUsername(), attributionInformationVo.getPassword());
         HengBangCrawlerConfigureParameters parameters = ConfigureParametersConversion.conversionEntity(HengBangCrawlerConfigureParameters.class, attributionInformationVo.getConfigInfo());
 
+        OrderStatusResultVo orderStatusResultVo = new OrderStatusResultVo();
         HbCrawlerOrderStateResponse orderStateResponse = hbCrawlerRequestComponent.orderState(parameters.getLicenseNo(), parameters.getAppTime(), attributionInformationVo.getUsername(), headers);
-        return null;
+        if (orderStateResponse == null || CollUtil.isEmpty(orderStateResponse.getContent())) {
+            return orderStatusResultVo;
+        }
+
+        // 获取订单信息
+        HbCrawlerOrder hbCrawlerOrder = hbCrawlerOrderService.findByOrdersNo(orderStatusVo.getOrder().getOrdersNo());
+        InsOrders insOrders = orderStatusVo.getInsOrders();
+
+        // 匹配交强和商业投保单的记录(按投保单号一一对应)
+        HbCrawlerOrderStateResponse.ContentDTO ciContent = orderStateResponse.getContent().stream()
+                .filter(item -> hbCrawlerOrder != null && StringUtils.hasLength(hbCrawlerOrder.getCiProposalNo()) && hbCrawlerOrder.getCiProposalNo().equals(item.getPROPOSALNO()))
+                .findFirst().orElse(null);
+        HbCrawlerOrderStateResponse.ContentDTO biContent = orderStateResponse.getContent().stream()
+                .filter(item -> hbCrawlerOrder != null && StringUtils.hasLength(hbCrawlerOrder.getBiProposalNo()) && hbCrawlerOrder.getBiProposalNo().equals(item.getPROPOSALNO()))
+                .findFirst().orElse(null);
+
+        // 获取交强和商业的保单号
+        String ciPolicyNo = ciContent != null ? ciContent.getPOLICYNO() : null;
+        String biPolicyNo = biContent != null ? biContent.getPOLICYNO() : null;
+        boolean ciHasPolicy = StringUtils.hasLength(ciPolicyNo);
+        boolean biHasPolicy = StringUtils.hasLength(biPolicyNo);
+
+        // 核保是否通过(待提核:-1;审核通过:1,3,5;下发修改:2;拒保:4;承保确认:6;初始状态:0)
+        boolean ciAuditPassed = ciContent != null && isAuditPassed(ciContent.getUNDERWRITESTATUS());
+        boolean biAuditPassed = biContent != null && isAuditPassed(biContent.getUNDERWRITESTATUS());
+
+        // 待核保状态 → 核保通过 → 待缴费(与API版逻辑保持一致)
+        if (insOrders != null && InsOrderStatusEnum.WAIT_AUDIT.getCode().equals(insOrders.getOrderStatus())) {
+            // 单交 / 单商 / 交商 任一核保通过即转为待缴费
+            boolean jqBoo = ciContent != null && biContent == null && ciAuditPassed;
+            boolean syBoo = biContent != null && ciContent == null && biAuditPassed;
+            boolean jqSyBoo = ciContent != null && biContent != null && ciAuditPassed && biAuditPassed;
+            if (jqBoo || syBoo || jqSyBoo) {
+                orderStatusResultVo.setOrderStatus(InsOrderStatusEnum.PAY_PENDING);
+                PaymentLinkVo paymentLinkVo = new PaymentLinkVo();
+                paymentLinkVo.setOrder(orderStatusVo.getOrder());
+                PaymentLinkResultsVo paymentLinkResultsVo = getPaymentLink(paymentLinkVo);
+                orderStatusResultVo.setPaymentLink(paymentLinkResultsVo.getPaymentLink());
+            }
+        }
+
+        // 保单号存在 → 已承保/已出单
+        if (ciHasPolicy || biHasPolicy) {
+            if (ciHasPolicy) {
+                orderStatusResultVo.setJqPolicyno(ciPolicyNo);
+                orderStatusResultVo.setJqApplyNo(hbCrawlerOrder.getCiProposalNo());
+            }
+            if (biHasPolicy) {
+                orderStatusResultVo.setSyPolicyno(biPolicyNo);
+                orderStatusResultVo.setSyApplyNo(hbCrawlerOrder.getBiProposalNo());
+            }
+            orderStatusResultVo.setOrderStatus(InsOrderStatusEnum.UNDERWRITED);
+        }
+
+        return orderStatusResultVo;
+    }
+
+    /**
+     * 核保是否通过
+     * 恒邦状态:待提核-1;审核通过1,3,5;下发修改2;拒保4;承保确认6;初始状态0
+     */
+    private boolean isAuditPassed(String underWriteStatus) {
+        return "1".equals(underWriteStatus) || "3".equals(underWriteStatus) || "5".equals(underWriteStatus);
     }
 
 

+ 2 - 0
tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/component/ZmCrawlerRequestComponent.java

@@ -259,6 +259,8 @@ public class ZmCrawlerRequestComponent {
      * @return
      */
     public Mono<ZmCrawlerNetpointQueryResponse> netpointQuery(ZmCrawlerNetpointQueryRequest modelQueryRequest) {
+        InsuranceLog.infoLog(InsuranceEnum.ZMBX.getPinyin(), "\n\t---------> {} \n\t---------> URl: {} \n\t---------> 请求参数:{}",
+                "爬虫网点查询",RequestUrl.NETPOINT_QUERY.getRequestUrl(zmCrawlerProperties.getBaseUrl()),JSON.toJSONString(modelQueryRequest));
         return requestComponent.postGbk(RequestUrl.NETPOINT_QUERY.getRequestUrl(zmCrawlerProperties.getBaseUrl()),
                 Base64Tool.encode(JSONObject.toJSONString(modelQueryRequest)), ZmCrawlerNetpointQueryResponse.class,new HttpHeaders(),"网点查询");
     }

+ 26 - 4
tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/entity/Request/ZmCrawlerQuotedPriceRequest.java

@@ -425,7 +425,7 @@ public class ZmCrawlerQuotedPriceRequest extends BaseRequest {
                 PolicyCarDTO policyCar = new PolicyCarDTO(carInfoVo, actualValueResponse,fullCarDataDTO.getFullCarData());
                 this.policyCar = policyCar;
 
-                ModelDetailsDTO modelDetails = new ModelDetailsDTO();
+                ModelDetailsDTO modelDetails = new ModelDetailsDTO(fullCarDataDTO);
                 this.modelDetails = modelDetails;
 
                 this.violationBeanlist = new ArrayList<>();
@@ -634,6 +634,7 @@ public class ZmCrawlerQuotedPriceRequest extends BaseRequest {
                     this.carCheckTime = "";
                     this.carChecker = "";
                     this.carQueryCheckCode = "";
+                    this.isrelief = fullCarData.getIsrelief();
                     this.carUseType = carInfoVo.getVehicleUseCode();
                     this.engine = carInfoVo.getEngineNo();
                     this.issueDate = carInfoVo.getIssueDate() + " 00:00:00";
@@ -832,6 +833,7 @@ public class ZmCrawlerQuotedPriceRequest extends BaseRequest {
                     this.energyTypes = fullCarData.getEnergyTypes();
                     this.fuelType = fullCarData.getFuelType();
                     this.localModelCode = fullCarData.getLocalModelCode();
+                    this.isrelief = fullCarData.getIsrelief();
                     this.modelCode = fullCarData.getLocalModelCode();
                     this.newVehicleClassCode = fullCarData.getNewVehicleClassCode();
                     this.originalPurchasePrice = fullCarData.getOriginalPurchasePrice();
@@ -937,13 +939,33 @@ public class ZmCrawlerQuotedPriceRequest extends BaseRequest {
 
                 public ModelDetailsDTO(ZmCrawlerModelQueryResponse.FullCarDataDTO fullCarDataDTO) {
                     ZmCrawlerModelQueryResponse.FullCarDataDTO.FullCarData fullCarData = fullCarDataDTO.getFullCarData();
+                    this.approvedLoad = fullCarData.getApprovedLoad();
+                    this.approvedPassengersCapacity = fullCarData.getApprovedPassengersCapacity();
                     this.brand = fullCarData.getModelName();
+                    this.carAlias = fullCarData.getModelName();
+                    this.carType = fullCarData.getCarType();
+                    this.carYear = fullCarData.getCarYear();
+                    this.deptCode = fullCarDataDTO.getPlatFormCar().getDeptCode();
                     this.displacement = fullCarData.getDisplacement()/1000;
+                    this.fuelType = fullCarData.getFuelType();
                     this.grossMass = "--";
-                    this.deptCode = fullCarDataDTO.getPlatFormCar().getDeptCode();
-                    this.platSeriesGroup = "--";
-                    this.modelCode = "--";
                     this.groupName = "--";
+                    this.localModelCode = fullCarData.getLocalModelCode();
+                    this.modelCode = "--";
+                    this.modelName = fullCarData.getModelName();
+                    this.newVehicleClass = fullCarData.getNewVehicleClass();
+                    this.platSeriesGroup = "--";
+                    this.power = fullCarData.getPower();
+                    this.purchasePrice = fullCarData.getPurchasePrice();
+                    this.remark = fullCarData.getRemark();
+                    this.series = fullCarData.getSeries();
+                    this.taxReliefFlag = fullCarData.getTaxReliefFlag();
+                    this.transmissionType = fullCarData.getTransmissionType();
+                    this.unladenMass = fullCarData.getUnladenMass();
+                    this.vehicleRisk = new VehicleRiskDTO();
+
+
+
                 }
 
                 @Data

+ 12 - 0
tenant/insurance/quotation-zhongmei/src/main/java/com/jzg/quotation/zhongmei/crawler/entity/Response/ZmCrawlerQuotedPriceResponse.java

@@ -1327,6 +1327,12 @@ public class ZmCrawlerQuotedPriceResponse extends BaseResponse {
                 @JsonProperty("deductionDueProportion")
                 private Double deductionDueProportion;
 
+                @JsonProperty("deductionDueCode")
+                private String deductionDueCode;
+
+                @JsonProperty("deductionDueType")
+                private String deductionDueType;
+
                 @JsonProperty("documentNumber")
                 private String documentNumber;
 
@@ -1410,6 +1416,12 @@ public class ZmCrawlerQuotedPriceResponse extends BaseResponse {
                     @JsonProperty("deductionDueProportion")
                     private String deductionDueProportion;
 
+                    @JsonProperty("deductionDueCode")
+                    private String deductionDueCode;
+
+                    @JsonProperty("deductionDueType")
+                    private String deductionDueType;
+
                     @JsonProperty("exceedDate")
                     private String exceedDate;