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