shc hace 8 meses
padre
commit
90217a0b17

+ 4 - 2
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/SysDeptController.java

@@ -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)) {