From 751bb3472ca0502dd3be5dc3c7165516486a3767 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Mon, 26 Jan 2026 10:08:31 +0800
Subject: [PATCH] feat(view): 产品问题列表按难度排序并显示难度标识

---
 src/main/java/cc/mrbird/febs/ai/controller/product/ViewController.java |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/ai/controller/product/ViewController.java b/src/main/java/cc/mrbird/febs/ai/controller/product/ViewController.java
index 9b71c7c..69da7af 100644
--- a/src/main/java/cc/mrbird/febs/ai/controller/product/ViewController.java
+++ b/src/main/java/cc/mrbird/febs/ai/controller/product/ViewController.java
@@ -72,11 +72,13 @@
         Set<String> productIds = new HashSet<>();
 
         AiProduct entity = aiProductService.getById(id);
+        String companyId = entity.getCompanyId();
         if(ObjectUtil.isNotNull(entity)){
             //右侧数据
             LambdaQueryWrapper<AiProductPointLink> query = Wrappers.lambdaQuery(AiProductPointLink.class);
             if(StrUtil.isNotEmpty(id)){
                 query.eq(AiProductPointLink::getProductId, id);
+                query.eq(AiProductPointLink::getCompanyId, companyId);
             }
             List<AiProductPointLink> selectedList = aiProductPointLinkService.selectListByQuery(query);
             if(CollUtil.isNotEmpty(selectedList)){
@@ -85,7 +87,7 @@
             }
 
             //左侧数据
-            List<AiProductPoint> allList = aiProductPointService.pointTree();
+            List<AiProductPoint> allList = aiProductPointService.pointTree(companyId);
             if(CollUtil.isNotEmpty(allList)){
                 //stream流操作mallMembers,生成一个新的List<MallMemberVo>
                 vos = allList.stream().map(AiProductPoint -> {
@@ -154,11 +156,13 @@
         Set<String> productIds = new HashSet<>();
 
         AiProduct entity = aiProductService.getById(id);
+        String companyId = entity.getCompanyId();
         if(ObjectUtil.isNotNull(entity)){
             //右侧数据
             LambdaQueryWrapper<AiProductQuestionLink> query = Wrappers.lambdaQuery(AiProductQuestionLink.class);
             if(StrUtil.isNotEmpty(id)){
                 query.eq(AiProductQuestionLink::getProductId, id);
+                query.eq(AiProductQuestionLink::getCompanyId, companyId);
             }
             List<AiProductQuestionLink> selectedList = aiProductQuestionLinkService.selectListByQuery(query);
             if(CollUtil.isNotEmpty(selectedList)){
@@ -170,13 +174,16 @@
             LambdaQueryWrapper<AiProductQuestion> aiProductQuestionLambdaQueryWrapper = Wrappers.lambdaQuery(AiProductQuestion.class);
             aiProductQuestionLambdaQueryWrapper.eq(AiProductQuestion::getProductCategoryId, entity.getProductCategoryId());
             aiProductQuestionLambdaQueryWrapper.eq(AiProductQuestion::getState, 1);
+            aiProductQuestionLambdaQueryWrapper.eq(AiProductQuestion::getCompanyId, companyId);
+            aiProductQuestionLambdaQueryWrapper.orderByDesc(AiProductQuestion::getDifficulty);
             List<AiProductQuestion> allList = aiProductQuestionService.productQuestionTree(aiProductQuestionLambdaQueryWrapper);
             if(CollUtil.isNotEmpty(allList)){
                 //stream流操作mallMembers,生成一个新的List<MallMemberVo>
                 vos = allList.stream().map(AiProductQuestion -> {
                     AdminMoveChooseInfoVo vo = new AdminMoveChooseInfoVo();
                     vo.setId(AiProductQuestion.getId());
-                    vo.setName(AiProductQuestion.getTitle());
+                    String difficulty = AiProductQuestion.getDifficulty() == 1 ? "简单" : AiProductQuestion.getDifficulty() == 2 ? "中等" : "困难";
+                    vo.setName("("+difficulty+")"+AiProductQuestion.getTitle());
                     return vo;
                 }).collect(Collectors.toList());
             }

--
Gitblit v1.9.1