|
@@ -64,25 +64,17 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
|
|
public List<SysDept> selectDeptList(SysDept dept) {
|
|
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
if (!String.valueOf(loginUser.getUserId()).equals("1")) {
|
|
|
- List<Integer> deptList = new ArrayList<>();
|
|
|
+ List<Long> deptList = new ArrayList<>();
|
|
|
//获取到子孙级部门id
|
|
|
- Integer deptId = Math.toIntExact(loginUser.getDeptId());
|
|
|
+ Long deptId = loginUser.getDeptId();
|
|
|
if (deptService.hasChildByDeptId(loginUser.getDeptId())) {
|
|
|
- List<Integer> children = deptService.getDeptChildren(deptId);
|
|
|
+ List<Long> children = deptService.getDeptChildren(deptId);
|
|
|
System.err.println(children.size());
|
|
|
deptList.addAll(children);
|
|
|
}
|
|
|
deptList.add(deptId);
|
|
|
dept.setDeptList(deptList);
|
|
|
}
|
|
|
- if (!ObjectUtils.isEmpty(dept.getDeptList())) {
|
|
|
- List<Integer> list = dept.getDeptList();
|
|
|
- System.err.println(list.size());
|
|
|
- for (Integer integer : list) {
|
|
|
- System.err.println(integer);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
return deptMapper.selectDeptList(dept);
|
|
|
}
|
|
|
|
|
@@ -200,7 +192,7 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<Integer> getChildIdByDeptId(Long deptId) {
|
|
|
+ public List<Long> getChildIdByDeptId(Long deptId) {
|
|
|
return deptMapper.getChildIdByDeptId(deptId);
|
|
|
}
|
|
|
|
|
@@ -393,13 +385,12 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
|
|
}
|
|
|
|
|
|
//获取到子孙级部门id
|
|
|
- public List<Integer> getDeptChildren(Integer deptId) {
|
|
|
- List<Integer> deptList = new ArrayList<>();
|
|
|
- Integer did = deptId;
|
|
|
- List<Integer> childByDeptId = getChildIdByDeptId(Long.valueOf(did));
|
|
|
- for (Integer cid : childByDeptId) {
|
|
|
+ public List<Long> getDeptChildren(Long deptId) {
|
|
|
+ List<Long> deptList = new ArrayList<>();
|
|
|
+ List<Long> childByDeptId = getChildIdByDeptId(deptId);
|
|
|
+ for (Long cid : childByDeptId) {
|
|
|
deptList.add(cid);
|
|
|
- if (hasChildByDeptId(Long.valueOf(cid))) {
|
|
|
+ if (hasChildByDeptId(cid)) {
|
|
|
deptList.addAll(getDeptChildren(cid));
|
|
|
}
|
|
|
}
|