Pārlūkot izejas kodu

Merge branch 'dev' of http://192.168.1.245:11111/jinjilong/onlineEducation-fwd into dev

honorfire 8 mēneši atpakaļ
vecāks
revīzija
14d421a87d

+ 14 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/controller/CollegeController.java

@@ -79,6 +79,20 @@ public class CollegeController {
         return CommonResult.data(collegeService.tree());
     }
 
+
+    /**
+     * 获取组织树
+     *
+     * @author xuyuxiang
+     * @date 2022/4/24 20:00
+     */
+    @ApiOperationSupport(order = 2)
+    @ApiOperation("获取组织树")
+    @GetMapping("/disk/college/treeAll")
+    public CommonResult<List<Tree<String>>> treeAll() {
+        return CommonResult.data(collegeService.treeAll());
+    }
+
     /**
      * 添加组织
      *

+ 1 - 1
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/mapper/mapping/UserCommentMapper.xml

@@ -38,7 +38,7 @@
 
 
     <select id="queryListCount" resultType="vip.xiaonuo.disk.vo.comment.UserCommentVo">
-        SELECT * FROM user_comment WHERE resource_id=#{resourceId}  AND pid IS null
+        SELECT * FROM user_comment WHERE resource_id=#{resourceId}
     </select>
 
 

+ 7 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/CollegeService.java

@@ -44,6 +44,13 @@ public interface CollegeService extends IService<College> {
      */
     List<Tree<String>> tree();
 
+    /**
+     * 获取组织树
+     *
+     * @author xuyuxiang
+     * @date 2022/4/24 20:08
+     */
+    List<Tree<String>> treeAll();
     /**
      * 添加组织
      *

+ 24 - 0
snowy-plugin/snowy-plugin-disk/snowy-plugin-disk-func/src/main/java/vip/xiaonuo/disk/service/impl/CollegeServiceImpl.java

@@ -39,6 +39,7 @@ import vip.xiaonuo.disk.mapper.CollegeMapper;
 import vip.xiaonuo.disk.param.*;
 import vip.xiaonuo.disk.service.CollegeService;
 
+import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -85,6 +86,29 @@ public class CollegeServiceImpl extends ServiceImpl<CollegeMapper, College> impl
         return TreeUtil.build(treeNodeList, "0");
     }
 
+
+    @Override
+    public List<Tree<String>> treeAll() {
+        List<College> collegeList = this.getAllOrgList();
+        List<TreeNode<String>> treeNodeList = collegeList.stream().map(college ->
+                        new TreeNode<>(college.getId(), college.getParentId(),
+                                college.getName(), college.getSortCode()).setExtra(JSONUtil.parseObj(college)))
+                .collect(Collectors.toList());
+        List<Tree<String>> list= TreeUtil.build(treeNodeList, "0");
+        Tree<String>  tree=new Tree<String>();
+        tree.setName("全部");
+        Tree<String> child=new Tree<String>();
+        child.setName("全部");
+        List<Tree<String>> childList=new ArrayList<>();
+        childList.add(child);
+        tree.setChildren(childList);
+        list.add(0,tree);
+        return list;
+    }
+
+
+
+
     @Transactional(rollbackFor = Exception.class)
     @Override
     public void add(CollegeAddParam collegeAddParam) {