| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.entity.TDept; |
| | | import com.ruoyi.system.mapper.TDeptMapper; |
| | | import com.ruoyi.system.service.TDeptService; |
| | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | .peek(dept -> dept.setChildren(getChildren(dept, depts))) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | @Override |
| | | public Optional<List<Integer>> getQueryDeptAndChildIds(Integer deptId) { |
| | | if (deptId != null) { |
| | | List<Integer> allDeptIds = new ArrayList<>(); |
| | | getSubDeptIdsRecursive(deptId, allDeptIds); |
| | | return Optional.of(allDeptIds.stream().distinct().collect(Collectors.toList())); |
| | | } |
| | | return Optional.empty(); |
| | | } |
| | | } |