瀏覽代碼

新增高层部门

buzhanyi 2 年之前
父節點
當前提交
15984b0bc8
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      base-system/src/main/java/com/ozs/system/service/impl/SysDeptServiceImpl.java

+ 3 - 1
base-system/src/main/java/com/ozs/system/service/impl/SysDeptServiceImpl.java

@@ -222,8 +222,10 @@ public class SysDeptServiceImpl extends JoinServiceImpl<SysDeptMapper, SysDept>
             if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) {
                 throw new ServiceException("部门停用,不允许新增");
             }
+            dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
+        } else {
+            dept.setAncestors("0,100");
         }
-        dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
         return deptMapper.insertDept(dept);
     }