From 6f30b5c886cd05081d6250eb0506816fb2ac80ec Mon Sep 17 00:00:00 2001
From: lidongdong <1459917685@qq.com>
Date: 星期二, 22 十一月 2022 14:11:30 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/huacheng_test' into huacheng_test
---
flower_city/src/main/java/com/dg/core/controller/OrganizationController.java | 95 ++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 92 insertions(+), 3 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 0748d90..f75835d 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
@@ -42,7 +42,19 @@
@GetMapping("/getList")
public TableDataInfo selectConfigList()
{
- return getDataTable(iOrganizationChartService.selectConfigList("",""));
+ return getDataTable(iOrganizationChartService.selectConfigList("","",null));
+ }
+
+
+ /**
+ * 查询机构列表(权限)
+ */
+ @ApiOperation(value = "查询机构列表(权限 选择用 ) ",response = OrganizationChartEntity.class)
+ @GetMapping("/selectJurisdiction")
+ @Authorization
+ public TableDataInfo selectJurisdiction(@CurrentUser SysUser sysUser)
+ {
+ return getDataTable(iOrganizationChartService.selectConfigList(sysUser.getDepartmentId(),"",null));
}
/**
@@ -150,8 +162,34 @@
}
+
+
/**
* 通过父级id查询对应机构下的全部部门id
+ * @param departmentId
+ * @return
+ */
+ @ApiOperation(value = "通过父级id查询对应机构下的全部部门")
+ @GetMapping("/getdepartment/id")
+ public TableDataInfo getOrganizationIds(@RequestParam(value = "department",required = false) String departmentId)
+ {
+ if(StringUtils.isEmpty(departmentId))
+ {
+ return getDataTable("departmentId 不能为空");
+ }
+
+ List<String> ids=new ArrayList<>();
+ List<String> getId=iOrganizationChartService.getIds(departmentId);
+ ids.addAll(getId);
+ return getDataTable(ids);
+ }
+
+
+
+
+
+ /**
+ * 通过父级id查询对应机构下的全部部门
* @param departmentId
* @return
*/
@@ -160,7 +198,17 @@
public TableDataInfo getOrganizations(@RequestParam(value = "department",required = false) String departmentId)
{
List<OrganizationChartEntity> ids=new ArrayList<>();
- List<OrganizationChartEntity> lists = iOrganizationChartService.selectParentList(departmentId,"");
+ List<OrganizationChartEntity> lists=null;
+ if(StringUtils.isEmpty(departmentId))
+ {
+ lists= iOrganizationChartService.selectParentList(null,"1");
+
+ }
+ else
+ {
+ lists= iOrganizationChartService.selectParentList(departmentId,null);
+ }
+
if(lists.size()<1)
{
lists.add(iOrganizationChartService.selectConfigById(departmentId));
@@ -170,7 +218,12 @@
{
return null;
}
- ids.add(iOrganizationChartService.selectConfigById(departmentId));
+
+ if(!StringUtils.isEmpty(departmentId))
+ {
+ ids.add(iOrganizationChartService.selectConfigById(departmentId));
+ }
+
return getDataTable(ids);
}
@@ -191,4 +244,40 @@
}
return ids;
}
+
+
+ /**
+ * 查询机构列表
+ */
+ @ApiOperation(value = "查询可切换机构列表",response = OrganizationChartEntity.class)
+ @GetMapping("switch/getList")
+ @Authorization
+ public TableDataInfo switchGetList(@CurrentUser SysUser sysUser)
+ {
+ List<String> ids=new ArrayList<>();
+ if(!StringUtils.isEmpty(sysUser.getMoreDepartmentIds()))
+ {
+ if(sysUser.getMoreDepartmentIds().indexOf(",")==-1)
+ {
+ ids.add(sysUser.getDepartmentId());
+ }
+ else
+ {
+ String[] list=sysUser.getMoreDepartmentIds().split(",");
+ for (String id:list)
+ {
+ ids.add(id);
+ }
+ }
+ }
+ else
+ {
+ ids.add(sysUser.getDepartmentId());
+ }
+
+ return getDataTable(iOrganizationChartService.selectConfigList(ids));
+ }
+
+
+
}
--
Gitblit v1.7.1