|
@@ -7,8 +7,6 @@ import cn.efunbox.manage.base.service.DepartmentService;
|
|
|
import cn.efunbox.manage.base.vo.DeptTreeVO;
|
|
|
import cn.efunbox.manage.common.result.ApiCode;
|
|
|
import cn.efunbox.manage.common.result.ApiResult;
|
|
|
-import cn.efunbox.manage.common.utils.SnowflakeIdUtil;
|
|
|
-import com.sun.xml.internal.rngom.parse.host.Base;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -119,7 +117,7 @@ public class DepartmentServiceImpl implements DepartmentService {
|
|
|
DeptTreeVO node = new DeptTreeVO();
|
|
|
node.setLabel(department.getName());
|
|
|
node.setId(department.getId());
|
|
|
- List<Department> childTreeNodes = departmentRepository.findByPathAndStatusInOrderBySortAsc(cid, status);
|
|
|
+ List<Department> childTreeNodes = departmentRepository.findByPathAndStatusInOrderByCodeAsc(cid, status);
|
|
|
for(Department child : childTreeNodes){
|
|
|
DeptTreeVO n = recursiveTree(child.getId(), status); //递归
|
|
|
node.getChildren().add(n);
|
|
@@ -128,7 +126,7 @@ public class DepartmentServiceImpl implements DepartmentService {
|
|
|
}
|
|
|
|
|
|
private List<Department> deptChild(Long cid, List<Department> departments, List<BaseStatusEnum> status) {
|
|
|
- List<Department> childTreeNodes = departmentRepository.findByPathAndStatusInOrderBySortAsc(cid, status);
|
|
|
+ List<Department> childTreeNodes = departmentRepository.findByPathAndStatusInOrderByCodeAsc(cid, status);
|
|
|
departments.addAll(childTreeNodes);
|
|
|
for(Department child : childTreeNodes){
|
|
|
deptChild(child.getId(), departments, status); //递归
|