|
|
@ -165,21 +165,21 @@ public class DeptServiceImpl extends ServiceImpl<DeptDao, DeptEntity> implements |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<DepartmentVO> listDepartmentAndEmployeeTree() { |
|
|
|
public List<DepartmentVO> listDepartmentAndEmployeeTree(String account) { |
|
|
|
return this.getListDepartmentAndEmployeeTree(deptDao.listDepartment(), 0L); |
|
|
|
return this.getListDepartmentAndEmployeeTree(deptDao.listDepartment(), 0L, account); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<DepartmentVO> getListDepartmentAndEmployeeTree(List<DepartmentVO> list, Long parentId) { |
|
|
|
private List<DepartmentVO> getListDepartmentAndEmployeeTree(List<DepartmentVO> list, Long parentId, String account) { |
|
|
|
return list.stream() |
|
|
|
return list.stream() |
|
|
|
.filter(dept -> parentId.equals(dept.getParentId())) // 过滤出部门id为所选id的部门信息(也为递归的结果条件,找不到所对应的部门id)
|
|
|
|
.filter(dept -> parentId.equals(dept.getParentId())) // 过滤出部门id为所选id的部门信息(也为递归的结果条件,找不到所对应的部门id)
|
|
|
|
.peek(dept -> { |
|
|
|
.peek(dept -> { |
|
|
|
dept.setChildren(getListDepartmentAndEmployeeTree(list, dept.getId())); // 设置该部门的子部门:递归调用
|
|
|
|
dept.setChildren(getListDepartmentAndEmployeeTree(list, dept.getId(), account)); // 设置该部门的子部门:递归调用
|
|
|
|
|
|
|
|
|
|
|
|
List<UserDeptVO> empList = employeeDao.employeeListByDeptId(dept.getId()); |
|
|
|
List<UserDeptVO> empList = employeeDao.employeeListByDeptId(dept.getId(),account); |
|
|
|
System.out.println("empList========================" + empList); |
|
|
|
System.out.println("empList========================" + empList); |
|
|
|
|
|
|
|
|
|
|
|
dept.setUserDept(employeeDao.employeeListByDeptId(dept.getId())); |
|
|
|
dept.setUserDept(employeeDao.employeeListByDeptId(dept.getId(),account)); |
|
|
|
|
|
|
|
|
|
|
|
//dept.setEmployee(employeeDao.listEmployeeByDeptId(dept.getId())); // 设置该部门下面的所有员工
|
|
|
|
//dept.setEmployee(employeeDao.listEmployeeByDeptId(dept.getId())); // 设置该部门下面的所有员工
|
|
|
|
}) |
|
|
|
}) |
|
|
@ -190,7 +190,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptDao, DeptEntity> implements |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 根据条件获取所有部门及部门下的员工信息 |
|
|
|
* 根据条件获取所有部门及部门下的员工信息 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
/* @Override |
|
|
|
public List<DepartmentVO> listDeptAndEmpTree(String name, List<Long> empIds) { |
|
|
|
public List<DepartmentVO> listDeptAndEmpTree(String name, List<Long> empIds) { |
|
|
|
|
|
|
|
|
|
|
|
return this.getListDepartmentAndEmployeeTree(deptDao.listDepartment(), 0L, name, empIds); |
|
|
|
return this.getListDepartmentAndEmployeeTree(deptDao.listDepartment(), 0L, name, empIds); |
|
|
@ -205,7 +205,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptDao, DeptEntity> implements |
|
|
|
}) |
|
|
|
}) |
|
|
|
.sorted(Comparator.comparingInt(menu -> (menu.getSort() == null ? 0 : menu.getSort()))) // 根据所选排序信息进行排序
|
|
|
|
.sorted(Comparator.comparingInt(menu -> (menu.getSort() == null ? 0 : menu.getSort()))) // 根据所选排序信息进行排序
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
.collect(Collectors.toList()); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取该部门下子部门及部门下的员工 |
|
|
|
* 获取该部门下子部门及部门下的员工 |
|
|
|