|
@@ -130,12 +130,14 @@ public class SysDeptController {
|
|
|
@GetMapping(value = "/list/descendant")
|
|
|
public R<List<SysDept>> listDescendants(@RequestParam(value = "deptId", required = false) Integer deptId) {
|
|
|
|
|
|
- if (deptId == null){
|
|
|
+ if (deptId == null) {
|
|
|
HnqzUser user = SecurityUtils.getUser();
|
|
|
deptId = user.getDeptId();
|
|
|
}
|
|
|
|
|
|
- List<SysDeptRelation> list = relationService.list(Wrappers.<SysDeptRelation>lambdaQuery().eq(SysDeptRelation::getAncestor, deptId));
|
|
|
+ List<SysDeptRelation> list = relationService.list(Wrappers.<SysDeptRelation>lambdaQuery()
|
|
|
+ .ne(SysDeptRelation::getDescendant, deptId)
|
|
|
+ .eq(SysDeptRelation::getAncestor, deptId));
|
|
|
|
|
|
if (CollUtil.isNotEmpty(list)) {
|
|
|
|