From 02d603e3816c355c538f3cbcb93ba983331305f4 Mon Sep 17 00:00:00 2001
From: lidongdong <1459917685@qq.com>
Date: 星期六, 08 十月 2022 15:01:09 +0800
Subject: [PATCH] 修改组织机构删除接口

---
 flower_city/src/main/java/com/dg/core/controller/OrganizationController.java |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/flower_city/src/main/java/com/dg/core/controller/OrganizationController.java b/flower_city/src/main/java/com/dg/core/controller/OrganizationController.java
index 2cd8557..bc0f74d 100644
--- a/flower_city/src/main/java/com/dg/core/controller/OrganizationController.java
+++ b/flower_city/src/main/java/com/dg/core/controller/OrganizationController.java
@@ -88,6 +88,11 @@
     public ResultData deleteConfigById(@RequestParam(value = "Id",required = false)  String Id)
     {
         Assert.notNull(Id, "Id 不能为空");
+        OrganizationChartEntity entity=iOrganizationChartService.selectConfigById(Id);
+        if(!StringUtils.isEmpty(entity.getParentId()))
+        {
+            return ResultData.error("该机构下存在其他部门!请先删除子部门");
+        }
         return toAjax(iOrganizationChartService.deleteConfigById(Id));
     }
 
@@ -151,7 +156,6 @@
         return getDataTable(ids);
     }
 
-
     //递归取id
     private List<OrganizationChartEntity> disposestreetId(List<OrganizationChartEntity> lists)
     {
@@ -170,8 +174,5 @@
         }
         return ids;
     }
-
-
-
 
 }

--
Gitblit v1.7.1