From 94e3a209bb9a31c4ddbd31494bb1628f6fe2e96e Mon Sep 17 00:00:00 2001
From: lidongdong <1459917685@qq.com>
Date: 星期三, 12 十月 2022 17:54:49 +0800
Subject: [PATCH] 新增首页工单 办事指南排行榜接口   导办人员排行榜接口  组织排行榜接口  新增办事指南统计接口   导办人员统计接口  组织胖行榜统计接口

---
 flower_city/src/main/java/com/dg/core/controller/ReplyTemplateController.java |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/flower_city/src/main/java/com/dg/core/controller/ReplyTemplateController.java b/flower_city/src/main/java/com/dg/core/controller/ReplyTemplateController.java
index bfd7e48..6be56ea 100644
--- a/flower_city/src/main/java/com/dg/core/controller/ReplyTemplateController.java
+++ b/flower_city/src/main/java/com/dg/core/controller/ReplyTemplateController.java
@@ -6,6 +6,7 @@
 import com.dg.core.annotation.CurrentUser;
 import com.dg.core.db.gen.entity.ReplyTemplateEntity;
 import com.dg.core.db.gen.entity.SysUser;
+import com.dg.core.service.IOrganizationChartService;
 import com.dg.core.service.IReplyTemplateService;
 import com.dg.core.util.TableDataInfo;
 import io.swagger.annotations.Api;
@@ -25,6 +26,10 @@
     @Autowired
     IReplyTemplateService iReplyTemplateService;
 
+    @Autowired
+    IOrganizationChartService iOrganizationChartService;
+
+
     /**
      * 获取模板列表
      * @return
@@ -34,11 +39,24 @@
     @Authorization
     public TableDataInfo selectConfigList(@RequestParam(value = "pageNum",required = false) Integer pageNum,
                                           @RequestParam(value = "pageSize",required = false) Integer pageSize,
-                                          @RequestParam(value = "Name",required = false) String Name)
+                                          @RequestParam(value = "Name",required = false) String Name,
+                                          @CurrentUser SysUser sysUser)
     {
         Page<ReplyTemplateEntity> pageParam = new Page<>(pageNum,pageSize);
-        List<ReplyTemplateEntity> list = iReplyTemplateService.selectConfigList(pageParam,pageSize,Name);
-        int num=iReplyTemplateService.countNum(Name);
+        List<String> ids=iOrganizationChartService.getIds(sysUser.getDepartmentId());
+        String[] roles = sysUser.getRoleIds().split(",");
+        Integer isRole=0;//是否超管
+        for (String role: roles) {
+            if (role.equals("1")){
+                isRole=1;
+                break;
+            }
+        }
+        if (isRole.equals(1)){
+            ids=null;
+        }
+        List<ReplyTemplateEntity> list = iReplyTemplateService.selectConfigList(pageParam,pageSize,Name,ids);
+        int num=iReplyTemplateService.countNum(Name,ids);
         return getDataTable(list,num);
     }
 
@@ -78,7 +96,6 @@
         {
             return ResultData.error("模板名称不能为空");
         }
-
         entity.setId(null);
         entity.setDepartmentId(sysUser.getDepartmentId());
         entity.setCreateUserId(sysUser.getUserId()+"");

--
Gitblit v1.7.1