|
@@ -341,9 +341,13 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
341
|
|
341
|
|
342
|
@Override
|
342
|
@Override
|
343
|
public List<Long> selectDeptAndChildrenDeptById(Long deptId) {
|
343
|
public List<Long> selectDeptAndChildrenDeptById(Long deptId) {
|
|
|
344
|
+ SysDeptVo sysDeptVo = baseMapper.selectVoById(deptId);
|
|
|
345
|
+ if (ObjectUtil.isNull(sysDeptVo)) {
|
|
|
346
|
+ return CollUtil.newArrayList(deptId);
|
|
|
347
|
+ }
|
344
|
return baseMapper.selectList(Wrappers.lambdaQuery(SysDept.class)
|
348
|
return baseMapper.selectList(Wrappers.lambdaQuery(SysDept.class)
|
345
|
.select(SysDept::getDeptId)
|
349
|
.select(SysDept::getDeptId)
|
346
|
- .eq(SysDept::getParentId, deptId).or().eq(SysDept::getDeptId, deptId)
|
|
|
|
|
350
|
+ .eq(SysDept::getParentId, deptId).or().eq(SysDept::getDeptId, deptId).or().likeRight(SysDept::getAncestors, sysDeptVo.getAncestors()+","+deptId)
|
347
|
).stream().map(SysDept::getDeptId).toList();
|
351
|
).stream().map(SysDept::getDeptId).toList();
|
348
|
}
|
352
|
}
|
349
|
}
|
353
|
}
|