From ca26988c6efb1e61afddb2fcb12141a2dfdbba5b Mon Sep 17 00:00:00 2001
From: lidongdong <1459917685@qq.com>
Date: 星期日, 09 十月 2022 10:40:33 +0800
Subject: [PATCH] 修改token验证

---
 flower_city/src/main/java/com/dg/core/controller/OrganizationController.java |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 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 bc0f74d..7efd705 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
@@ -89,7 +89,10 @@
     {
         Assert.notNull(Id, "Id 不能为空");
         OrganizationChartEntity entity=iOrganizationChartService.selectConfigById(Id);
-        if(!StringUtils.isEmpty(entity.getParentId()))
+
+        List<OrganizationChartEntity> list=iOrganizationChartService.selectConfigList(entity.getId()+"","");
+
+        if(list.size()>0)
         {
             return ResultData.error("该机构下存在其他部门!请先删除子部门");
         }
@@ -138,7 +141,7 @@
      */
     @ApiOperation(value = "通过父级id查询对应机构下的全部部门",response = OrganizationChartEntity.class)
     @GetMapping("/getdepartment")
-    public TableDataInfo getIds(@RequestParam(value = "department",required = false) String departmentId)
+    public TableDataInfo getOrganizations(@RequestParam(value = "department",required = false) String departmentId)
     {
         List<OrganizationChartEntity> ids=new ArrayList<>();
         List<OrganizationChartEntity> lists = iOrganizationChartService.selectConfigList(departmentId,"");
@@ -146,18 +149,17 @@
         {
             lists.add(iOrganizationChartService.selectConfigById(departmentId));
         }
-        ids=disposestreetId(lists);
+        ids=disposestreet(lists);
         if(ids.size()<1)
         {
             return null;
         }
-//        ids.add(streetId);
         ids.add(iOrganizationChartService.selectConfigById(departmentId));
         return getDataTable(ids);
     }
 
     //递归取id
-    private List<OrganizationChartEntity> disposestreetId(List<OrganizationChartEntity> lists)
+    private List<OrganizationChartEntity> disposestreet(List<OrganizationChartEntity> lists)
     {
         List<OrganizationChartEntity> ids=new ArrayList<>();
         for (OrganizationChartEntity sysStreet:lists)
@@ -165,7 +167,7 @@
             ids.add(sysStreet);
             if(sysStreet.getChild()!=null && sysStreet.getChild().size()>0)
             {
-                ids.addAll(disposestreetId(sysStreet.getChild()));
+                ids.addAll(disposestreet(sysStreet.getChild()));
             }
             else
             {

--
Gitblit v1.7.1