Browse Source

fix: it 6-1

shc 8 months ago
parent
commit
9bb81f8b4a

+ 17 - 0
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/SysDeptController.java

@@ -122,6 +122,23 @@ public class SysDeptController {
         return R.ok(list);
     }
 
+    /**
+     * 查收子级列表
+     *
+     * @return 返回子级
+     */
+    @GetMapping(value = "/list/descendant")
+    public R<List<SysDeptRelation>> listDescendants(@RequestParam(value = "deptId", required = false) Integer deptId) {
+
+        if (deptId == null){
+            HnqzUser user = SecurityUtils.getUser();
+            deptId = user.getDeptId();
+        }
+
+        return R.ok(relationService.list(Wrappers.<SysDeptRelation>lambdaQuery().eq(SysDeptRelation::getAncestor, deptId)));
+    }
+
+
     /**
      * 获取登录用户企业的有效期
      *