浏览代码

Merge remote-tracking branch 'origin/master'

lixiaolong 6 天之前
父节点
当前提交
cccda809d3

+ 17 - 13
commons/src/main/java/com/jzg/commons/entity/scheme/vo/PtlSchemeSaveVo.java

@@ -286,20 +286,24 @@ public class PtlSchemeSaveVo {
     public List<PtlSchemeInsuranceDrivingIntention> getPtlSchemeInsuranceDrivingIntentionList(){
         List<PtlSchemeInsuranceDrivingIntention> ptlSchemeInsuranceDrivingIntentionList = new ArrayList<>();
         for (Scheme scheme : schemeList) {
-            // 校验同一方案内驾意险的选中类型:默认选中(1)/强制选中(2)只能出现一种且各最多一条(可选=3)
-            long defaultSelectedCount = scheme.getDrivingList().stream()
-                    .filter(drivingIntention -> "1".equals(drivingIntention.getSelectedStatus())).count();
-            long forceSelectedCount = scheme.getDrivingList().stream()
-                    .filter(drivingIntention -> "2".equals(drivingIntention.getSelectedStatus())).count();
-            if (defaultSelectedCount > 1) {
-                throw new ValidateException("方案[" + scheme.getSchemeName() + "]中默认选中的驾意险只能有一条");
-            }
-            if (forceSelectedCount > 1) {
-                throw new ValidateException("方案[" + scheme.getSchemeName() + "]中强制选中的驾意险只能有一条");
-            }
-            if (defaultSelectedCount > 0 && forceSelectedCount > 0) {
-                throw new ValidateException("方案[" + scheme.getSchemeName() + "]中默认选中与强制选中的驾意险不能同时存在");
+            // 仅自选方案(schemeType 1基础 2自选)才校验驾意险默认/强制选中,基础方案不校验
+            if ("2".equals(this.schemeType)) {
+                // 校验同一方案内驾意险的选中类型:默认选中(1)/强制选中(2)只能出现一种且各最多一条(可选=3)
+                long defaultSelectedCount = scheme.getDrivingList().stream()
+                        .filter(drivingIntention -> "1".equals(drivingIntention.getSelectedStatus())).count();
+                long forceSelectedCount = scheme.getDrivingList().stream()
+                        .filter(drivingIntention -> "2".equals(drivingIntention.getSelectedStatus())).count();
+                if (defaultSelectedCount > 1) {
+                    throw new ValidateException("方案[" + scheme.getSchemeName() + "]中默认选中的驾意险只能有一条");
+                }
+                if (forceSelectedCount > 1) {
+                    throw new ValidateException("方案[" + scheme.getSchemeName() + "]中强制选中的驾意险只能有一条");
+                }
+                if (defaultSelectedCount > 0 && forceSelectedCount > 0) {
+                    throw new ValidateException("方案[" + scheme.getSchemeName() + "]中默认选中与强制选中的驾意险不能同时存在");
+                }
             }
+
             scheme.getDrivingList().forEach(drivingIntention -> {
                 PtlSchemeInsuranceDrivingIntention ptlSchemeInsuranceDrivingIntention = new PtlSchemeInsuranceDrivingIntention();
                 ptlSchemeInsuranceDrivingIntention.setId(IdGenerate.nextId());

+ 11 - 8
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsTaskImagesServiceImpl.java

@@ -19,6 +19,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Objects;
 
 @Service
 public class  InsTaskImagesServiceImpl extends ServiceImpl<InsTaskImagesMapper, InsTaskImages> implements InsTaskImagesService {
@@ -64,14 +65,16 @@ public class  InsTaskImagesServiceImpl extends ServiceImpl<InsTaskImagesMapper,
         int delete = baseMapper.delete(new LambdaUpdateWrapper<InsTaskImages>()
                 .eq(InsTaskImages::getQuoteNo, quoteNo));
         insuranceUploadImageVo.getImageVoList().forEach(imageVo -> {
-            imageVo.getImageBase64List().forEach(base64 ->{
-                InsTaskImages insTaskImages = new InsTaskImages();
-                insTaskImages.setId(IdGenerate.nextId());
-                insTaskImages.setQuoteNo(quoteNo);
-                insTaskImages.setImageType(imageVo.getImageCode());
-                insTaskImages.setImageId(base64.getImageId());
-                images.add(insTaskImages);
-            });
+            if(Objects.nonNull(imageVo.getImageBase64List())) {
+                imageVo.getImageBase64List().forEach(base64 -> {
+                    InsTaskImages insTaskImages = new InsTaskImages();
+                    insTaskImages.setId(IdGenerate.nextId());
+                    insTaskImages.setQuoteNo(quoteNo);
+                    insTaskImages.setImageType(imageVo.getImageCode());
+                    insTaskImages.setImageId(base64.getImageId());
+                    images.add(insTaskImages);
+                });
+            }
         });
         return !baseMapper.insert(images).isEmpty();
     }

+ 6 - 0
tenant/insurance/quotation-summary/src/main/resources/application-prod.yaml

@@ -238,6 +238,12 @@ zijin:
 #    # 对接三方渠道验车链接接口
 #    sendCheckCarLink: http://open.zking.com/api/v1/open/open-aggregate/auth/wanJiaYun/sendCheckCarLink
 
+taiping:
+  crawler:
+    url: https://autopp.tpi.cntaiping.com/api
+    pythonCreateUrl: http://172.24.144.227:8888:8888/create
+    pythonCkUrl: http://172.24.144.227:8888:8888/tpck
+    pythonHzUrl: http://172.24.144.227:8888:8888/tphz
 
 feign:
   client:

+ 41 - 11
tenant/insurance/quotation-summary/src/main/resources/mapper/InsOrdersMapper.xml

@@ -859,6 +859,20 @@
 
     <!--查询车险报价订单 modify by lipf 2026年4月28日09:22:46  和田智确认后,将主订单过滤掉-->
     <select id="queryOrderList" resultType="com.jzg.commons.entity.orders.vo.OrderListVo">
+        WITH RECURSIVE leader_tree AS (
+        SELECT ss.id, su.mobile, 1 AS depth
+        FROM sys_user_jzg_info ss
+        LEFT JOIN sys_user su ON su.id = ss.user_id AND su.is_delete = 0
+        WHERE ss.id = #{insOrdersParam.jzgInfoId}
+        AND ss.is_delete = 0
+        UNION ALL
+        SELECT t.id, su.mobile, lt.depth + 1
+        FROM sys_user_jzg_info t
+        INNER JOIN leader_tree lt ON t.leader_id = lt.id
+        LEFT JOIN sys_user su ON su.id = t.user_id AND su.is_delete = 0
+        WHERE t.is_delete = 0
+        AND lt.depth <![CDATA[ < ]]> 10
+        )
         SELECT
         io.id as order_no,
         io.quote_no as no,
@@ -942,9 +956,9 @@
         <where>
             and io.is_delete = 0 and io.parent_id != '0' and sujis.type_attr NOT IN (1,2,3,4)
             <if test="insOrdersParam.jzgInfoId != null and insOrdersParam.jzgInfoId != ''">
-                and io.real_quote_user_id in (select bbb.mobile from sys_user bbb where bbb.id in ( select ss.user_id
-                from sys_user_jzg_info ss where 1 =1 and (ss.leader_id = #{insOrdersParam.jzgInfoId} or ss.id
-                =#{insOrdersParam.jzgInfoId}) and ss.is_delete = 0 ) and bbb.is_delete = 0 )
+                and io.real_quote_user_id in (
+                select lt.mobile from leader_tree lt where lt.mobile is not null
+                )
             </if>
             <if test="insOrdersParam.orderNo != null and insOrdersParam.orderNo != ''">
                 AND io.id = #{insOrdersParam.orderNo}
@@ -1271,6 +1285,18 @@
 
     <!-- 主订单列表:仅查询主订单表 ins_orders,parent_id=0,不联表;筛选条件仅支持主表字段 -->
     <select id="queryMainOrderList" resultType="com.jzg.commons.entity.orders.vo.OrderListVo">
+        WITH RECURSIVE leader_tree AS (
+        SELECT id, leader_id, 1 AS depth
+        FROM sys_user_jzg_info
+        WHERE id = #{insOrdersParam.jzgInfoId}
+        AND is_delete = 0
+        UNION ALL
+        SELECT t.id, t.leader_id, lt.depth + 1
+        FROM sys_user_jzg_info t
+        INNER JOIN leader_tree lt ON t.leader_id = lt.id
+        WHERE t.is_delete = 0
+        AND lt.depth <![CDATA[ < ]]> 10
+        )
         SELECT
         io.id as order_no,
         io.quote_no as no,
@@ -1293,9 +1319,13 @@
         <where>
             and io.is_delete = 0 and io.parent_id = '0'
             <if test="insOrdersParam.jzgInfoId != null and insOrdersParam.jzgInfoId != ''">
-                and io.real_quote_user_id in (select bbb.mobile from sys_user bbb where bbb.id in ( select ss.user_id
-                from sys_user_jzg_info ss where 1 =1 and (ss.leader_id = #{insOrdersParam.jzgInfoId} or ss.id
-                =#{insOrdersParam.jzgInfoId}) and ss.is_delete = 0 ) and bbb.is_delete = 0 )
+                and io.real_quote_user_id in (
+                select bbb.mobile
+                from sys_user bbb
+                inner join sys_user_jzg_info ss on bbb.id = ss.user_id and ss.is_delete = 0
+                inner join leader_tree lt on ss.id = lt.id
+                where bbb.is_delete = 0
+                )
             </if>
             <if test="insOrdersParam.orderNo != null and insOrdersParam.orderNo != ''">
                 AND io.id = #{insOrdersParam.orderNo}
@@ -1306,13 +1336,13 @@
             <if test="insOrdersParam.vinNo != null and insOrdersParam.vinNo != ''">
                 AND ioci.vin_no = #{insOrdersParam.vinNo}
             </if>
-            <if test="insOrdersParam.orderStatus!= null and insOrdersParam.orderStatus!= ''">
+            <if test="insOrdersParam.orderStatus != null and insOrdersParam.orderStatus != ''">
                 AND io.order_status = #{insOrdersParam.orderStatus}
             </if>
-            <if test="insOrdersParam.salesman!= null">
+            <if test="insOrdersParam.salesman != null">
                 AND io.real_quote_user_id = #{insOrdersParam.salesman}
             </if>
-            <if test="insOrdersParam.startDate != null and insOrdersParam.startDate != ''and insOrdersParam.endDate != null and insOrdersParam.endDate != ''">
+            <if test="insOrdersParam.startDate != null and insOrdersParam.startDate != '' and insOrdersParam.endDate != null and insOrdersParam.endDate != ''">
                 AND io.create_time BETWEEN #{insOrdersParam.startDate} and #{insOrdersParam.endDate}
             </if>
             <if test="insOrdersParam.companyName != null and insOrdersParam.companyName != ''">
@@ -1330,10 +1360,10 @@
             <if test="insOrdersParam.paymentLink != null and insOrdersParam.paymentLink != ''">
                 AND io.pay_link = #{insOrdersParam.paymentLink}
             </if>
-            <if test="insOrdersParam.startSigningTime != null and insOrdersParam.startSigningTime != ''and insOrdersParam.endSigningTime != null and insOrdersParam.endSigningTime != ''">
+            <if test="insOrdersParam.startSigningTime != null and insOrdersParam.startSigningTime != '' and insOrdersParam.endSigningTime != null and insOrdersParam.endSigningTime != ''">
                 AND io.signing_time BETWEEN #{insOrdersParam.startSigningTime} and #{insOrdersParam.endSigningTime}
             </if>
-            <if test="insOrdersParam.startPayTime != null and insOrdersParam.startPayTime != ''and insOrdersParam.endPayTime != null and insOrdersParam.endPayTime != ''">
+            <if test="insOrdersParam.startPayTime != null and insOrdersParam.startPayTime != '' and insOrdersParam.endPayTime != null and insOrdersParam.endPayTime != ''">
                 AND io.pay_time BETWEEN #{insOrdersParam.startPayTime} and #{insOrdersParam.endPayTime}
             </if>
         </where>

+ 8 - 1
tenant/insurance/quotation-taikang/src/main/java/com/jzg/quotation/taikang/crawler/build/TkCrawlerQuoteResultsBuild.java

@@ -1,5 +1,7 @@
 package com.jzg.quotation.taikang.crawler.build;
 
+import cn.hutool.core.util.ReUtil;
+import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.nacos.common.utils.CollectionUtils;
@@ -160,10 +162,15 @@ public class TkCrawlerQuoteResultsBuild {
         redisCacheUtil.setPreciseInitResult(preciseInitResult, quoteResultsVo.getOrdersNo());
         // 评分
         JSONArray scoreJson = new JSONArray();
+        // 报价bug统计表173,修改:保单综合评分只保留字母部分
+        String businessScore = preciseInitResult.getBusinessScore();
+        if (StrUtil.isNotBlank(businessScore)){
+            businessScore = ReUtil.replaceAll(businessScore, "\\d", "");
+        }
         scoreJson.add(new JSONObject()
                 .fluentPut("scoreName", "保单综合评分")
                 .fluentPut("scoreKey", "businessScore")
-                .fluentPut("score", preciseInitResult.getBusinessScore()));
+                .fluentPut("score", businessScore));
         scoreJson.add(new JSONObject()
                 .fluentPut("scoreName", "风险评分")
                 .fluentPut("scoreKey", "riskScore")