|
@@ -330,6 +330,11 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
|
|
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) {
|
|
|
throw new ServiceException("部门停用,不允许新增");
|
|
|
}
|
|
|
+ //授权到5级单位,创建6级单位时提示:只允许创建5级单位
|
|
|
+ String[] ancestors = info.getAncestors().split(",");
|
|
|
+ if (ancestors.length >= 6) {
|
|
|
+ return AjaxResult.error("只允许创建5级单位");
|
|
|
+ }
|
|
|
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
|
|
|
Integer dept1 = deptMapper.insertDept(dept);
|
|
|
return AjaxResult.success(dept.getDeptId());
|