|
@@ -85,7 +85,10 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
|
|
|
sysDeptList = result;
|
|
sysDeptList = result;
|
|
|
} else {
|
|
} else {
|
|
|
Map<String, List<SysDept>> map = sysDeptList.stream().collect(Collectors.groupingBy(SysDept::getParentId));
|
|
Map<String, List<SysDept>> map = sysDeptList.stream().collect(Collectors.groupingBy(SysDept::getParentId));
|
|
|
- sysDeptList.forEach(i -> i.setChildren(map.getOrDefault(i.getId(), new ArrayList<>())));
|
|
|
|
|
|
|
+ sysDeptList.forEach(i -> {
|
|
|
|
|
+ i.setChildren(map.getOrDefault(i.getId(), new ArrayList<>()));
|
|
|
|
|
+ i.setDeptCount(i.getChildren().size());
|
|
|
|
|
+ });
|
|
|
sysDeptList = map.get(sysDept.getParentId());
|
|
sysDeptList = map.get(sysDept.getParentId());
|
|
|
}
|
|
}
|
|
|
return sysDeptList;
|
|
return sysDeptList;
|