From 9bbe23024b988c44abcaeb81f725ad3d13a42fc0 Mon Sep 17 00:00:00 2001 From: fengjin <1435304038@qq.com> Date: 星期二, 08 十一月 2022 16:26:06 +0800 Subject: [PATCH] 办事指南导入功能 --- flower_city/src/main/java/com/dg/core/controller/OrganizationController.java | 44 +++++++++++++++++++++++++++++++++++++------- 1 files changed, 37 insertions(+), 7 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 de7cf8c..c55fa12 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 @@ -9,6 +9,7 @@ import com.dg.core.db.gen.entity.TransactionEvent; import com.dg.core.service.IOrganizationChartService; import com.dg.core.service.ITransactionEventService; +import com.dg.core.util.PermissionUtil; import com.dg.core.util.TableDataInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -41,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)); } /** @@ -80,7 +93,7 @@ public ResultData updateConfig(@RequestBody OrganizationChartEntity entity,@CurrentUser SysUser sysUser) { entity.setUpdateTime(LocalDateTime.now()); - entity.setUpdateUserId(Integer.parseInt(String.valueOf(sysUser.getUserId()))); + entity.setUpdateUserId(sysUser.getUserId()); return toAjax(iOrganizationChartService.updateConfig(entity)); } @@ -138,11 +151,14 @@ @Authorization public TableDataInfo queryList(@RequestParam(value = "pageNum",required = false) Integer pageNum, @RequestParam(value = "pageSize",required = false) Integer pageSize, - @RequestParam(value = "organizationName",required = false)String organizationName){ + @RequestParam(value = "organizationName",required = false)String organizationName, + @CurrentUser SysUser sysUser){ Assert.notNull(pageNum, "pageNum can not be empty"); Assert.notNull(pageSize, "pageSize can not be empty"); Page<OrganizationChartEntity> pageParam = new Page<>(pageNum,pageSize); - return getDataTable(iOrganizationChartService.queryList(pageParam,pageSize,organizationName),iOrganizationChartService.countList(organizationName)); + List<String> ids= PermissionUtil.getPermission(sysUser,iOrganizationChartService); + return getDataTable(iOrganizationChartService.queryList(pageParam,pageSize,organizationName,ids), + iOrganizationChartService.countList(organizationName,ids)); } @@ -156,7 +172,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)); @@ -166,7 +192,12 @@ { return null; } - ids.add(iOrganizationChartService.selectConfigById(departmentId)); + + if(!StringUtils.isEmpty(departmentId)) + { + ids.add(iOrganizationChartService.selectConfigById(departmentId)); + } + return getDataTable(ids); } @@ -187,5 +218,4 @@ } return ids; } - } -- Gitblit v1.7.1