🐛 Fixing a bug. #1209 新建用户 登录后,部门管理和添加用户时,获取到的部门树数据为空

This commit is contained in:
torvalds committed 2020-05-14 20:16:13 +08:00
1 parent e192c729e6
commit 6bf616cda0
1 file changed
+3 -1
@@ -143,6 +143,8 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
node.setName(dept.getName());
return node;
}).collect(Collectors.toList());
return TreeUtil.build(treeList, 0);
return TreeUtil.build(treeList, depts.stream()
.sorted(Comparator.comparingInt(SysDept::getDeptId))
.findFirst().get().getParentId());
}
}