yuan
2026-06-06 bfe2eb20746ba63fe7fc86b1b2ad5dc3095cc9b3
fix: 客户档案改成一个,不区分公海私海
已修改5个文件
43 ■■■■ 文件已修改
src/main/java/com/ruoyi/ai/assistant/SalesIntentExecutor.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/ai/controller/SalesAiController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/ai/tools/SalesAgentTools.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/basic/CustomerMapper.xml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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, "客户档案", "私海", "公海", "客户池")) {
        if (containsAny(text, "客户档案", "销售档案", "公海", "客户池")) {
            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 ("查询私海客户档案前10条".equals(normalized)) {
            return salesAgentTools.listCustomerProfiles(memoryId, "private", null, 10);
        if ("查询销售档案前10条".equals(normalized)) {
            return salesAgentTools.listCustomerProfiles(memoryId, "public", null, 10);
        }
        if ("查询公海客户档案".equals(normalized)) {
        if ("查询客户档案".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;
    }
src/main/java/com/ruoyi/ai/controller/SalesAiController.java
@@ -126,7 +126,7 @@
        }
        String text = message.trim();
        return containsAny(text,
                "查询", "查看", "统计", "分析", "建议", "客户档案", "私海", "公海",
                "查询", "查看", "统计", "分析", "建议", "客户档案", "销售档案", "公海",
                "销售报价", "销售台账", "销售退货", "客户往来", "发货台账", "回款", "报价", "风险");
    }
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) {
src/main/java/com/ruoyi/basic/service/impl/CustomerServiceImpl.java
@@ -223,7 +223,7 @@
            throw new RuntimeException("客户档案下有销售合同,请先删除销售合同");
        }
        // 查询是否有已分配的公海客户
        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("客户档案下有已分配的公海客户,请先收回");
        }
        }*/
        // 删除客户的同时也需要删除对应的客户跟随、附件和回访提醒
        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) {
src/main/resources/mapper/basic/CustomerMapper.xml
@@ -33,11 +33,11 @@
                and customer_type = #{c.customerType}
            </if>
            <!-- 公海查询:type = 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>-->
            <!-- 私海查询:type = 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>
            <!-- 公海查询:type = 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>-->
            <!-- 私海查询:type = 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>