| | |
| | | {
|
| | | return deptMapper.selectDeptList(dept);
|
| | | }
|
| | | |
| | | /**
|
| | | * 查询部门树结构信息
|
| | | * |
| | | * @param dept 部门信息
|
| | | * @return 部门树信息集合
|
| | | */
|
| | | @Override
|
| | | public List<TreeSelect> selectDeptTreeList(SysDept dept)
|
| | | {
|
| | | List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept);
|
| | | return buildDeptTreeSelect(depts);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 构建前端所需要树结构
|
| | |
| | | public List<SysDept> buildDeptTree(List<SysDept> depts)
|
| | | {
|
| | | List<SysDept> returnList = new ArrayList<SysDept>();
|
| | | List<Long> tempList = new ArrayList<Long>();
|
| | | for (SysDept dept : depts)
|
| | | {
|
| | | tempList.add(dept.getDeptId());
|
| | | }
|
| | | List<Long> tempList = depts.stream().map(SysDept::getDeptId).collect(Collectors.toList());
|
| | | for (SysDept dept : depts)
|
| | | {
|
| | | // 如果是顶级节点, 遍历该父节点的所有子节点
|
| | |
| | | public boolean hasChildByDeptId(Long deptId)
|
| | | {
|
| | | int result = deptMapper.hasChildByDeptId(deptId);
|
| | | return result > 0 ? true : false;
|
| | | return result > 0;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | public boolean checkDeptExistUser(Long deptId)
|
| | | {
|
| | | int result = deptMapper.checkDeptExistUser(deptId);
|
| | | return result > 0 ? true : false;
|
| | | return result > 0;
|
| | | }
|
| | |
|
| | | /**
|