From f72e5445beea756fccf5264e6fb4d0f533840bff Mon Sep 17 00:00:00 2001
From: heheng <475597332@qq.com>
Date: 星期四, 04 十二月 2025 14:53:08 +0800
Subject: [PATCH] 修改必填
---
multi-admin/src/main/java/com/gkhy/exam/admin/controller/system/SysDeptController.java | 83 ++++++++++++++++++++++++++++++++---------
1 files changed, 64 insertions(+), 19 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..a7a66fd 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,8 +4,11 @@
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.SysFunctionalRemark;
+import com.gkhy.exam.system.domain.req.SysDeptPageReq;
import com.gkhy.exam.system.domain.vo.DeptVo;
import com.gkhy.exam.system.domain.vo.FunctionalDistributionVo;
import com.gkhy.exam.system.domain.vo.SysDeptResponsibilityReqVo;
@@ -31,7 +34,7 @@
*
* @author expert
*/
-@Api(tags = "部门-业务处室")
+@Api(tags = "部门管理")
@RestController
@RequestMapping("/system/dept")
public class SysDeptController
@@ -53,6 +56,36 @@
return CommonResult.success(depts);
}
+ @GetMapping("/getOutDeptList")
+ @ApiOperation(value = "获取部门列表简化版本")
+ public CommonResult getOutDeptList(SysDept dept)
+ {
+ List<SysDept> outDeptList = deptService.getOutDeptList(dept);
+ return CommonResult.success(outDeptList);
+ }
+
+
+ @GetMapping("/pageList")
+ @ApiImplicitParams({
+ @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
+ @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"),
+ })
+ @ApiOperation(value = "获取部门列表分页")
+ public CommonResult pageList(SysDeptPageReq dept)
+ {
+ return CommonResult.success(deptService.selectDeptPageList(dept));
+ }
+
+
+
+ @GetMapping("/treeList")
+ @ApiOperation(value = "获取部门列表树状")
+ public CommonResult treeList(SysDept dept)
+ {
+ List<TreeSelect> treeSelects = deptService.selectDeptTreeList(dept);
+ return CommonResult.success(treeSelects);
+ }
+
@@ -60,17 +93,17 @@
* 查询部门列表(排除节点)
*/
//@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);
+// }
/**
* 根据部门编号获取详细信息
@@ -114,6 +147,18 @@
return CommonResult.success(functionalDistributionList);
}
+ @GetMapping("/functionalRemarkList")
+ @ApiOperation(value = "职能分配备注数据")
+ @ApiImplicitParams({
+ @ApiImplicitParam(paramType = "query", name = "companyId", dataType = "Long", required = true, value = "公司id"),
+ })
+ public CommonResult functionalRemarkList(@RequestParam Long companyId)
+ {
+ List<SysFunctionalRemark> functionalRemarkList = deptService.getFunctionalRemarkList(companyId);
+
+ return CommonResult.success(functionalRemarkList);
+ }
+
@PostMapping("/saveFunctionalDistribution")
@ApiOperation(value = "保存职能分配")
@@ -127,7 +172,7 @@
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "companyId", dataType = "Long", required = true, value = "公司id"),
})
- public CommonResult initFunctionalDistribution(@RequestParam Long companyId) {
+ public CommonResult initFunctionalDistribution(@RequestParam("companyId") Long companyId) {
return CommonResult.success(deptService.initFunctionalDistribution(companyId));
}
@@ -182,19 +227,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