From bfe2eb20746ba63fe7fc86b1b2ad5dc3095cc9b3 Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期四, 11 六月 2026 19:30:35 +0800
Subject: [PATCH] fix: 客户档案改成一个,不区分公海私海

---
 src/main/java/com/ruoyi/ai/controller/SalesAiController.java        |    2 +-
 src/main/resources/mapper/basic/CustomerMapper.xml                  |   16 ++++++++--------
 src/main/java/com/ruoyi/ai/tools/SalesAgentTools.java               |    4 ++--
 src/main/java/com/ruoyi/ai/assistant/SalesIntentExecutor.java       |   13 +++++--------
 src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java |    8 ++++----
 5 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/src/main/java/com/ruoyi/ai/assistant/SalesIntentExecutor.java b/src/main/java/com/ruoyi/ai/assistant/SalesIntentExecutor.java
index 4388a3c..68b52e9 100644
--- a/src/main/java/com/ruoyi/ai/assistant/SalesIntentExecutor.java
+++ b/src/main/java/com/ruoyi/ai/assistant/SalesIntentExecutor.java
@@ -52,7 +52,7 @@
         if (containsAny(text, "鎸囨爣", "缁熻", "鐪嬫澘", "鎬昏", "缁忚惀鍒嗘瀽")) {
             return salesAgentTools.getSalesDashboard(memoryId, startDate, endDate, text);
         }
-        if (containsAny(text, "瀹㈡埛妗f", "绉佹捣", "鍏捣", "瀹㈡埛姹�")) {
+        if (containsAny(text, "瀹㈡埛妗f", "閿�鍞。妗�", "鍏捣", "瀹㈡埛姹�")) {
             return salesAgentTools.listCustomerProfiles(memoryId, extractSeaType(text), keyword, limit);
         }
         if (containsAny(text, "閿�鍞姤浠�", "鎶ヤ环鍗�", "鎶ヤ环", "璇环")) {
@@ -75,10 +75,10 @@
 
     private String tryExecuteQuickPrompt(String memoryId, String text) {
         String normalized = normalizeForMatch(text);
-        if ("鏌ヨ绉佹捣瀹㈡埛妗f鍓�10鏉�".equals(normalized)) {
-            return salesAgentTools.listCustomerProfiles(memoryId, "private", null, 10);
+        if ("鏌ヨ閿�鍞。妗堝墠10鏉�".equals(normalized)) {
+            return salesAgentTools.listCustomerProfiles(memoryId, "public", null, 10);
         }
-        if ("鏌ヨ鍏捣瀹㈡埛妗f".equals(normalized)) {
+        if ("鏌ヨ瀹㈡埛妗f".equals(normalized)) {
             return salesAgentTools.listCustomerProfiles(memoryId, "public", null, 10);
         }
         if ("鏌ヨ鏈湀閿�鍞姤浠�".equals(normalized)) {
@@ -125,11 +125,8 @@
     }
 
     private String extractSeaType(String text) {
-        if (text.contains("鍏捣")) {
+        if (text.contains("鍏捣") || text.contains("閿�鍞。妗�")) {
             return "public";
-        }
-        if (text.contains("绉佹捣")) {
-            return "private";
         }
         return null;
     }
diff --git a/src/main/java/com/ruoyi/ai/controller/SalesAiController.java b/src/main/java/com/ruoyi/ai/controller/SalesAiController.java
index ae7b15f..d09e7c0 100644
--- a/src/main/java/com/ruoyi/ai/controller/SalesAiController.java
+++ b/src/main/java/com/ruoyi/ai/controller/SalesAiController.java
@@ -126,7 +126,7 @@
         }
         String text = message.trim();
         return containsAny(text,
-                "鏌ヨ", "鏌ョ湅", "缁熻", "鍒嗘瀽", "寤鸿", "瀹㈡埛妗f", "绉佹捣", "鍏捣",
+                "鏌ヨ", "鏌ョ湅", "缁熻", "鍒嗘瀽", "寤鸿", "瀹㈡埛妗f", "閿�鍞。妗�", "鍏捣",
                 "閿�鍞姤浠�", "閿�鍞彴璐�", "閿�鍞��璐�", "瀹㈡埛寰�鏉�", "鍙戣揣鍙拌处", "鍥炴", "鎶ヤ环", "椋庨櫓");
     }
 
diff --git a/src/main/java/com/ruoyi/ai/tools/SalesAgentTools.java b/src/main/java/com/ruoyi/ai/tools/SalesAgentTools.java
index 0f7e586..8bcab9f 100644
--- a/src/main/java/com/ruoyi/ai/tools/SalesAgentTools.java
+++ b/src/main/java/com/ruoyi/ai/tools/SalesAgentTools.java
@@ -1123,7 +1123,7 @@
         String value = seaType.trim().toLowerCase(Locale.ROOT);
         return switch (value) {
             case "private", "绉佹捣", "0" -> 0;
-            case "public", "鍏捣", "1" -> 1;
+            case "public", "鍏捣", "閿�鍞。妗�", "1" -> 1;
             default -> null;
         };
     }
@@ -1132,7 +1132,7 @@
         if (type == null) {
             return "鏈煡";
         }
-        return type == 1 ? "鍏捣" : "绉佹捣";
+        return type == 1 ? "閿�鍞。妗�" : "鏅��";
     }
 
     private int normalizeLimit(Integer limit) {
diff --git a/src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java b/src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
index eef85aa..827e3a2 100644
--- a/src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
+++ b/src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
@@ -223,7 +223,7 @@
             throw new RuntimeException("瀹㈡埛妗f涓嬫湁閿�鍞悎鍚岋紝璇峰厛鍒犻櫎閿�鍞悎鍚�");
         }
         // 鏌ヨ鏄惁鏈夊凡鍒嗛厤鐨勫叕娴峰鎴�
-        List<Customer> assignedPools = customerMapper.selectList(
+        /*List<Customer> assignedPools = customerMapper.selectList(
                 new QueryWrapper<Customer>().lambda()
                         .in(Customer::getId, idList)
                         .eq(Customer::getType, 1).
@@ -231,7 +231,7 @@
         );
         if (!assignedPools.isEmpty()) {
             throw new RuntimeException("瀹㈡埛妗f涓嬫湁宸插垎閰嶇殑鍏捣瀹㈡埛锛岃鍏堟敹鍥�");
-        }
+        }*/
         // 鍒犻櫎瀹㈡埛鐨勫悓鏃朵篃闇�瑕佸垹闄ゅ搴旂殑瀹㈡埛璺熼殢銆侀檮浠跺拰鍥炶鎻愰啋
         for (Long id : ids) {
             customerFollowUpService.deleteByCustomerId(id);
@@ -271,11 +271,11 @@
             }
 
             // 鏍规嵁 type 鍙傛暟璁剧疆瀹㈡埛绫诲瀷锛堢娴�/鍏捣锛�
-            if (type != null) {
+            /*if (type != null) {
                 userList.forEach(customer -> {
                     customer.setType(type);
                 });
-            }
+            }*/
             this.saveOrUpdateBatch(userList);
             return R.ok(true);
         } catch (Exception e) {
diff --git a/src/main/resources/mapper/basic/CustomerMapper.xml b/src/main/resources/mapper/basic/CustomerMapper.xml
index 99a5a28..c9be760 100644
--- a/src/main/resources/mapper/basic/CustomerMapper.xml
+++ b/src/main/resources/mapper/basic/CustomerMapper.xml
@@ -33,11 +33,11 @@
                 and customer_type = #{c.customerType}
             </if>
             <!-- 鍏捣鏌ヨ锛歵ype = 1锛堝叕娴峰鎴凤級-->
-            <if test="c.type != null and c.type == 1">
+            <!--<if test="c.type != null and c.type == 1">
                 and type = #{c.type}
-            </if>
+            </if>-->
             <!-- 绉佹捣鏌ヨ锛歵ype = 0锛堢娴峰鎴凤級鎴栬�� type = 1锛堝叕娴峰鎴凤級涓斿凡琚垎閰嶏紝骞朵笖鏄嚜宸遍鐢ㄣ�佽嚜宸卞垱寤烘垨鑰呭叡浜粰鑷繁鐨勫鎴� -->
-            <if test="c.type != null and c.type == 0">
+            <!--<if test="c.type != null and c.type == 0">
                 and (
                     (type = #{c.type} or (type = 1 and is_assigned = 1))
                     and (
@@ -50,7 +50,7 @@
                         )
                     )
                 )
-            </if>
+            </if>-->
         </where>
     </select>
 
@@ -87,11 +87,11 @@
                 and customer_type = #{c.customerType}
             </if>
             <!-- 鍏捣鏌ヨ锛歵ype = 1锛堝叕娴峰鎴凤級-->
-            <if test="c.type != null and c.type == 1">
+            <!--<if test="c.type != null and c.type == 1">
                 and type = #{c.type}
-            </if>
+            </if>-->
             <!-- 绉佹捣鏌ヨ锛歵ype = 0锛堢娴峰鎴凤級鎴栬�� type = 1锛堝叕娴峰鎴凤級涓斿凡琚垎閰嶏紝骞朵笖鏄嚜宸遍鐢ㄣ�佽嚜宸卞垱寤烘垨鑰呭叡浜粰鑷繁鐨勫鎴� -->
-            <if test="c.type != null and c.type == 0">
+            <!--<if test="c.type != null and c.type == 0">
                 and (
                     (type = #{c.type} or (type = 1 and is_assigned = 1))
                     and (
@@ -104,7 +104,7 @@
                         )
                     )
                 )
-            </if>
+            </if>-->
         </where>
     </select>
 

--
Gitblit v1.9.3