修改部门-添加验证

dep_wangsr
ucer 5 years ago committed by Limy
parent dc1370b425
commit d4eb0711dc

@ -108,6 +108,12 @@ public class SysDeptController extends BaseController
{ {
return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在"); return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
} }
if(dept.getParentId().equals(dept.getDeptId()))
{
return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
}
dept.setUpdateBy(ShiroUtils.getLoginName()); dept.setUpdateBy(ShiroUtils.getLoginName());
return toAjax(deptService.updateDept(dept)); return toAjax(deptService.updateDept(dept));
} }

Loading…
Cancel
Save