添加校验部门包含未停用的子部门

This commit is contained in:
RuoYi
2020-05-07 12:15:04 +08:00
parent 2c8365b605
commit 8a9d298ffc
6 changed files with 42 additions and 2 deletions

View File

@ -112,6 +112,11 @@ public class SysDeptController extends BaseController
{
return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
}
else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus())
&& deptService.selectNormalChildrenDeptById(dept.getDeptId()) > 0)
{
return AjaxResult.error("该部门包含未停用的子部门!");
}
dept.setUpdateBy(ShiroUtils.getLoginName());
return toAjax(deptService.updateDept(dept));
}