|
|
|
@ -1,7 +1,6 @@
|
|
|
|
|
package com.ruoyi.system.controller;
|
|
|
|
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
|
|
import cn.hutool.core.lang.tree.Tree;
|
|
|
|
|
import cn.hutool.core.util.ArrayUtil;
|
|
|
|
|
import com.ruoyi.common.core.constant.UserConstants;
|
|
|
|
|
import com.ruoyi.common.core.domain.R;
|
|
|
|
@ -15,9 +14,7 @@ import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 部门信息
|
|
|
|
@ -108,10 +105,10 @@ public class SysDeptController extends BaseController {
|
|
|
|
|
@DeleteMapping("/{deptId}")
|
|
|
|
|
public R<Void> remove(@PathVariable Long deptId) {
|
|
|
|
|
if (deptService.hasChildByDeptId(deptId)) {
|
|
|
|
|
return R.fail("存在下级部门,不允许删除");
|
|
|
|
|
return R.warn("存在下级部门,不允许删除");
|
|
|
|
|
}
|
|
|
|
|
if (deptService.checkDeptExistUser(deptId)) {
|
|
|
|
|
return R.fail("部门存在用户,不允许删除");
|
|
|
|
|
return R.warn("部门存在用户,不允许删除");
|
|
|
|
|
}
|
|
|
|
|
deptService.checkDeptDataScope(deptId);
|
|
|
|
|
return toAjax(deptService.deleteDeptById(deptId));
|
|
|
|
|