Browse Source

填写采购服务站后进行同步

buzhanyi 1 year ago
parent
commit
40bcf7b5a6

+ 5 - 0
purchase-system/src/main/java/com/ozs/system/service/impl/SysDeptServiceImpl.java

@@ -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());