update 优化根部门不允许删除以及办理人权限名称回显

This commit is contained in:
疯狂的狮子Li
2025-07-06 15:38:29 +08:00
parent edac6074fb
commit 77a245c13b
2 changed files with 7 additions and 9 deletions

View File

@@ -113,6 +113,9 @@ public class SysDeptController extends BaseController {
@Log(title = "部门管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{deptId}")
public R<Void> remove(@PathVariable Long deptId) {
if (StringUtils.equals(SystemConstants.ROOT_DEPT_ANCESTORS, String.valueOf(deptId))) {
return R.warn("根部门不允许删除");
}
if (deptService.hasChildByDeptId(deptId)) {
return R.warn("存在下级部门,不允许删除");
}