From 661cc0afdb7699abcaafff23fa2fe9283979ee06 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期四, 14 五月 2020 16:25:43 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue

---
 ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDeptController.java |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDeptController.java b/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDeptController.java
index 0b104e4..3c2cb0b 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDeptController.java
+++ b/ruoyi/src/main/java/com/ruoyi/project/system/controller/SysDeptController.java
@@ -14,6 +14,7 @@
 import org.springframework.web.bind.annotation.RestController;
 import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
@@ -41,7 +42,7 @@
     public AjaxResult list(SysDept dept)
     {
         List<SysDept> depts = deptService.selectDeptList(dept);
-        return AjaxResult.success(deptService.buildDeptTree(depts));
+        return AjaxResult.success(depts);
     }
 
     /**
@@ -109,6 +110,11 @@
         {
             return AjaxResult.error("淇敼閮ㄩ棬'" + dept.getDeptName() + "'澶辫触锛屼笂绾ч儴闂ㄤ笉鑳芥槸鑷繁");
         }
+        else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus())
+                && deptService.selectNormalChildrenDeptById(dept.getDeptId()) > 0)
+        {
+            return AjaxResult.error("璇ラ儴闂ㄥ寘鍚湭鍋滅敤鐨勫瓙閮ㄩ棬锛�");
+        }
         dept.setUpdateBy(SecurityUtils.getUsername());
         return toAjax(deptService.updateDept(dept));
     }

--
Gitblit v1.9.3