|
@@ -106,7 +106,7 @@ public class DepartmentServiceImpl implements DepartmentService {
|
|
|
DeptTreeVO node = new DeptTreeVO();
|
|
|
node.setLabel(department.getName());
|
|
|
node.setId(department.getId());
|
|
|
- List<Department> childTreeNodes = departmentRepository.findByPathOrderBySortDesc(cid);
|
|
|
+ List<Department> childTreeNodes = departmentRepository.findByPathOrderBySortAsc(cid);
|
|
|
for(Department child : childTreeNodes){
|
|
|
DeptTreeVO n = recursiveTree(child.getId()); //递归
|
|
|
node.getChildren().add(n);
|
|
@@ -115,7 +115,7 @@ public class DepartmentServiceImpl implements DepartmentService {
|
|
|
}
|
|
|
|
|
|
private List<Department> deptChild(Long cid, List<Department> departments) {
|
|
|
- List<Department> childTreeNodes = departmentRepository.findByPathOrderBySortDesc(cid);
|
|
|
+ List<Department> childTreeNodes = departmentRepository.findByPathOrderBySortAsc(cid);
|
|
|
departments.addAll(childTreeNodes);
|
|
|
for(Department child : childTreeNodes){
|
|
|
deptChild(child.getId(), departments); //递归
|