From 2edf8f5847bcc121a35c9aaee5531585e6b923f5 Mon Sep 17 00:00:00 2001 From: fengjin <1435304038@qq.com> Date: 星期三, 23 十一月 2022 13:55:35 +0800 Subject: [PATCH] 1.更改系统设置更改问题 2.新增导半人员设置创建人 3.搜索sql优化 --- flower_city/src/main/java/com/dg/core/controller/OrganizationController.java | 62 +++++++++++++++++++++++++++++++ 1 files changed, 62 insertions(+), 0 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 c55fa12..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 @@ -162,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 */ @@ -218,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