From d8012ee77b6a9e86611aae9074d5925826f4210d Mon Sep 17 00:00:00 2001 From: heheng <475597332@qq.com> Date: 星期一, 30 六月 2025 14:42:31 +0800 Subject: [PATCH] 新功能模块 --- multi-admin/src/main/java/com/gkhy/exam/admin/controller/system/SysDeptController.java | 46 ++++++++++++++++++++++++++++------------------ 1 files changed, 28 insertions(+), 18 deletions(-) diff --git a/multi-admin/src/main/java/com/gkhy/exam/admin/controller/system/SysDeptController.java b/multi-admin/src/main/java/com/gkhy/exam/admin/controller/system/SysDeptController.java index 907972f..fa76240 100644 --- a/multi-admin/src/main/java/com/gkhy/exam/admin/controller/system/SysDeptController.java +++ b/multi-admin/src/main/java/com/gkhy/exam/admin/controller/system/SysDeptController.java @@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil; import com.gkhy.exam.common.api.CommonResult; import com.gkhy.exam.common.constant.UserConstant; +import com.gkhy.exam.common.domain.TreeSelect; import com.gkhy.exam.common.domain.entity.SysDept; import com.gkhy.exam.system.domain.SysFunctionalDistribution; import com.gkhy.exam.system.domain.vo.DeptVo; @@ -31,7 +32,7 @@ * * @author expert */ -@Api(tags = "部门-业务处室") +@Api(tags = "部门管理") @RestController @RequestMapping("/system/dept") public class SysDeptController @@ -54,23 +55,32 @@ } + @GetMapping("/treeList") + @ApiOperation(value = "获取部门列表树状") + public CommonResult treeList(SysDept dept) + { + List<TreeSelect> treeSelects = deptService.selectDeptTreeList(dept); + return CommonResult.success(treeSelects); + } + + /** * 查询部门列表(排除节点) */ //@PreAuthorize("hasAnyAuthority('system:dept:list')") - @GetMapping("/list/exclude/{deptId}") - @ApiImplicitParams({ - @ApiImplicitParam(paramType = "query", name = "deptId", dataType = "Long", required = true, value = "部门id"), - }) - @ApiOperation(value = "查询部门列表(排除节点)") - public CommonResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) - { - List<SysDept> depts = deptService.getOutDeptList(new SysDept()); - depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")); - return CommonResult.success(depts); - } +// @GetMapping("/list/exclude/{deptId}") +// @ApiImplicitParams({ +// @ApiImplicitParam(paramType = "query", name = "deptId", dataType = "Long", required = true, value = "部门id"), +// }) +// @ApiOperation(value = "查询部门列表(排除节点)") +// public CommonResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) +// { +// List<SysDept> depts = deptService.getOutDeptList(new SysDept()); +// depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")); +// return CommonResult.success(depts); +// } /** * 根据部门编号获取详细信息 @@ -182,19 +192,19 @@ */ //@PreAuthorize("hasAnyAuthority('system:dept:remove')") @DeleteMapping("/{deptId}") - @ApiOperation(value = "删除部门门业务处室") + @ApiOperation(value = "删除部门") public CommonResult remove(@PathVariable Long deptId) { if (deptService.hasChildByDeptId(deptId)) { return CommonResult.failed("存在下级部门,不允许删除"); } - if (deptService.checkDeptExistUser(deptId)) - { - return CommonResult.failed("部门存在用户,不允许删除"); - } +// if (deptService.checkDeptExistUser(deptId)) +// { +// return CommonResult.failed("部门存在用户,不允许删除"); +// } //todo 校验专家是否申请复用 - deptService.checkDeptDataScope(deptId); +// deptService.checkDeptDataScope(deptId); return CommonResult.success(deptService.deleteDeptById(deptId)); } } -- Gitblit v1.9.2