RuoYi
2022-10-28 cc9bb1d05dece7f8b17aeb5f4ebfa1f99c83de38
src/main/java/com/ruoyi/project/system/service/impl/SysDeptServiceImpl.java
@@ -71,11 +71,7 @@
    public List<SysDept> buildDeptTree(List<SysDept> depts)
    {
        List<SysDept> returnList = new ArrayList<SysDept>();
        List<Long> tempList = new ArrayList<Long>();
        for (SysDept dept : depts)
        {
            tempList.add(dept.getDeptId());
        }
        List<Long> tempList = depts.stream().map(SysDept::getDeptId).collect(Collectors.toList());
        for (SysDept dept : depts)
        {
            // 如果是顶级节点, 遍历该父节点的所有子节点