!108 部门修改bug修复

Merge pull request !108 from Ucer/master
pull/108/MERGE
若依 2019-07-20 11:22:14 +08:00 committed by Gitee
commit 126c4bc8c3
1 changed files with 6 additions and 0 deletions

View File

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