瀏覽代碼

作者:张哲
时间:2023/08/16
类型:修改
描述:4.删除的分类不计入统计范围 5.知识标签

zizg 1 年之前
父節點
當前提交
67d9a3e61c

+ 1 - 1
src/main/java/com/redxun/knowledge/controller/KnowledgeLabelController.java

@@ -72,7 +72,7 @@ public class KnowledgeLabelController extends BaseController<KnowledgeLabel> {
         JsonResult jsonResult = JsonResult.getSuccessResult("");
 
         if (tops == null) {
-            tops = 24;
+            tops = 50;
         }
 
         try {

+ 9 - 10
src/main/java/com/redxun/knowledge/service/KnowledgeLabelServiceImpl.java

@@ -103,16 +103,15 @@ public class KnowledgeLabelServiceImpl extends SuperServiceImpl<KnowledgeLabelMa
         return page;
     }
 
-    public List<KnowledgeLabelVo> labels(Integer tops) {
-        List<KnowledgeLabelVo> labels = knowledgeLabelMapper.selectTops(tops);
-        labels.forEach(e -> {
-            JPaasUser user = userService.queryUser(e.getOperator());
-            if (user != null) {
-                e.setOperatorName(user.getFullName());
-            }
-        });
-
-        return labels;
+    /**
+     * 去高频词找寻前50条记录
+     * @param tops
+     * @return
+     */
+    public List<String> labels(Integer tops) {
+        List<SearchParticipleWordCloudVo> searchParticipleWordCloudVos = analysisCommonService.searchParticipleWordCloud(tops);
+        List<String> result = searchParticipleWordCloudVos.stream().map(SearchParticipleWordCloudVo::getParticiple).collect(Collectors.toList());
+        return result;
     }
 
     /**

+ 1 - 1
src/main/resources/mapper/knowledge/analysis/AnalysisAlbumMapper.xml

@@ -5,7 +5,7 @@
     <select id="selectCategory" resultType="string">
         select PK_ID
         FROM KM_ALBUM_CATEGORY
-        where PARENT = '0'
+        where PARENT = '0' and IS_DEL = 0
     </select>
 
     <select id="selectAlbumId" resultType="int">

+ 1 - 1
src/main/resources/mapper/knowledge/analysis/AnalysisCommonMapper.xml

@@ -42,7 +42,7 @@
     <select id="level1Knowledge" resultType="string">
         select PK_ID
         from KM_KNOWLEDGE_CATEGORY
-        where PARENT = '0'
+        where PARENT = '0' and IS_DEL = 0
     </select>
 
     <select id="level1KnowledgeHistogram" resultType="int">