update 优化默认部门,不允许删除
This commit is contained in:
parent
7471fa7ee0
commit
8f95374cef
@ -77,4 +77,9 @@ public interface SystemConstants {
|
|||||||
*/
|
*/
|
||||||
String ROOT_DEPT_ANCESTORS = "0";
|
String ROOT_DEPT_ANCESTORS = "0";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认部门 ID
|
||||||
|
*/
|
||||||
|
Long DEFAULT_DEPT_ID = 100L;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -113,8 +113,8 @@ public class SysDeptController extends BaseController {
|
|||||||
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{deptId}")
|
@DeleteMapping("/{deptId}")
|
||||||
public R<Void> remove(@PathVariable Long deptId) {
|
public R<Void> remove(@PathVariable Long deptId) {
|
||||||
if (StringUtils.equals(SystemConstants.ROOT_DEPT_ANCESTORS, String.valueOf(deptId))) {
|
if (SystemConstants.DEFAULT_DEPT_ID.equals(deptId)) {
|
||||||
return R.warn("根部门不允许删除");
|
return R.warn("默认部门,不允许删除");
|
||||||
}
|
}
|
||||||
if (deptService.hasChildByDeptId(deptId)) {
|
if (deptService.hasChildByDeptId(deptId)) {
|
||||||
return R.warn("存在下级部门,不允许删除");
|
return R.warn("存在下级部门,不允许删除");
|
||||||
|
Loading…
Reference in New Issue
Block a user