Explorar o código

操作日志数据过滤

xuezizhuo hai 1 ano
pai
achega
fe5903a2e0

+ 12 - 0
zkqy-admin/src/main/java/com/zkqy/web/controller/monitor/SysOperlogController.java

@@ -2,6 +2,8 @@ package com.zkqy.web.controller.monitor;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.zkqy.common.core.domain.entity.SysUser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.DeleteMapping;
@@ -35,6 +37,11 @@ public class SysOperlogController extends BaseController
     @GetMapping("/list")
     public TableDataInfo list(SysOperLog operLog)
     {
+        if(SysUser.isAdmin(getUserId())){
+            operLog.setTenantId(0L);
+        }else {
+            operLog.setTenantId(getTenantId());
+        }
         startPage();
         List<SysOperLog> list = operLogService.selectOperLogList(operLog);
         return getDataTable(list);
@@ -45,6 +52,11 @@ public class SysOperlogController extends BaseController
     @PostMapping("/export")
     public void export(HttpServletResponse response, SysOperLog operLog)
     {
+        if(SysUser.isAdmin(getUserId())){
+            operLog.setTenantId(0L);
+        }else {
+            operLog.setTenantId(getTenantId());
+        }
         List<SysOperLog> list = operLogService.selectOperLogList(operLog);
         ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
         util.exportExcel(response, list, "操作日志");

+ 250 - 0
zkqy-system/src/main/java/com/zkqy/system/service/impl/SysTenantServiceImpl.java

@@ -1329,6 +1329,256 @@ public class SysTenantServiceImpl implements ISysTenantService
                 "        \"children\": [],\n" +
                 "        \"tenantName\": null,\n" +
                 "        \"tenantId\": null\n" +
+                "    },\n" +
+                "    {\n" +
+                "        \"createBy\": null,\n" +
+                "        \"createTime\": \"2023-07-06 13:28:04\",\n" +
+                "        \"updateBy\": null,\n" +
+                "        \"updateTime\": null,\n" +
+                "        \"remark\": null,\n" +
+                "        \"menuId\": 1092,\n" +
+                "        \"menuName\": \"日志管理\",\n" +
+                "        \"parentName\": null,\n" +
+                "        \"parentId\": 0,\n" +
+                "        \"orderNum\": 6,\n" +
+                "        \"path\": \"log\",\n" +
+                "        \"component\": null,\n" +
+                "        \"query\": null,\n" +
+                "        \"isFrame\": \"1\",\n" +
+                "        \"isCache\": \"0\",\n" +
+                "        \"menuType\": \"M\",\n" +
+                "        \"visible\": \"0\",\n" +
+                "        \"status\": \"0\",\n" +
+                "        \"perms\": null,\n" +
+                "        \"icon\": \"log\",\n" +
+                "        \"children\": [],\n" +
+                "        \"tenantName\": null,\n" +
+                "        \"tenantId\": null\n" +
+                "    },\n" +
+                "    {\n" +
+                "        \"createBy\": null,\n" +
+                "        \"createTime\": \"2023-07-06 13:29:50\",\n" +
+                "        \"updateBy\": null,\n" +
+                "        \"updateTime\": null,\n" +
+                "        \"remark\": null,\n" +
+                "        \"menuId\": 1093,\n" +
+                "        \"menuName\": \"操作日志\",\n" +
+                "        \"parentName\": null,\n" +
+                "        \"parentId\": 1092,\n" +
+                "        \"orderNum\": 1,\n" +
+                "        \"path\": \"operlog\",\n" +
+                "        \"component\": \"monitor/operlog/index\",\n" +
+                "        \"query\": null,\n" +
+                "        \"isFrame\": \"1\",\n" +
+                "        \"isCache\": \"0\",\n" +
+                "        \"menuType\": \"C\",\n" +
+                "        \"visible\": \"0\",\n" +
+                "        \"status\": \"0\",\n" +
+                "        \"perms\": \"monitor:operlog:list\",\n" +
+                "        \"icon\": \"form\",\n" +
+                "        \"children\": [],\n" +
+                "        \"tenantName\": null,\n" +
+                "        \"tenantId\": null\n" +
+                "    },\n" +
+                "    {\n" +
+                "        \"createBy\": null,\n" +
+                "        \"createTime\": \"2023-07-06 13:32:45\",\n" +
+                "        \"updateBy\": null,\n" +
+                "        \"updateTime\": null,\n" +
+                "        \"remark\": null,\n" +
+                "        \"menuId\": 1095,\n" +
+                "        \"menuName\": \"操作查询\",\n" +
+                "        \"parentName\": null,\n" +
+                "        \"parentId\": 1093,\n" +
+                "        \"orderNum\": 1,\n" +
+                "        \"path\": \"\",\n" +
+                "        \"component\": null,\n" +
+                "        \"query\": null,\n" +
+                "        \"isFrame\": \"1\",\n" +
+                "        \"isCache\": \"0\",\n" +
+                "        \"menuType\": \"F\",\n" +
+                "        \"visible\": \"0\",\n" +
+                "        \"status\": \"0\",\n" +
+                "        \"perms\": \"monitor:operlog:query\",\n" +
+                "        \"icon\": \"#\",\n" +
+                "        \"children\": [],\n" +
+                "        \"tenantName\": null,\n" +
+                "        \"tenantId\": null\n" +
+                "    },\n" +
+                "    {\n" +
+                "        \"createBy\": null,\n" +
+                "        \"createTime\": \"2023-07-06 13:34:04\",\n" +
+                "        \"updateBy\": null,\n" +
+                "        \"updateTime\": null,\n" +
+                "        \"remark\": null,\n" +
+                "        \"menuId\": 1096,\n" +
+                "        \"menuName\": \"操作删除\",\n" +
+                "        \"parentName\": null,\n" +
+                "        \"parentId\": 1093,\n" +
+                "        \"orderNum\": 2,\n" +
+                "        \"path\": \"\",\n" +
+                "        \"component\": null,\n" +
+                "        \"query\": null,\n" +
+                "        \"isFrame\": \"1\",\n" +
+                "        \"isCache\": \"0\",\n" +
+                "        \"menuType\": \"F\",\n" +
+                "        \"visible\": \"0\",\n" +
+                "        \"status\": \"0\",\n" +
+                "        \"perms\": \"monitor:operlog:remove\",\n" +
+                "        \"icon\": \"#\",\n" +
+                "        \"children\": [],\n" +
+                "        \"tenantName\": null,\n" +
+                "        \"tenantId\": null\n" +
+                "    },\n" +
+                "    {\n" +
+                "        \"createBy\": null,\n" +
+                "        \"createTime\": \"2023-07-06 13:34:27\",\n" +
+                "        \"updateBy\": null,\n" +
+                "        \"updateTime\": null,\n" +
+                "        \"remark\": null,\n" +
+                "        \"menuId\": 1097,\n" +
+                "        \"menuName\": \"日志导出\",\n" +
+                "        \"parentName\": null,\n" +
+                "        \"parentId\": 1093,\n" +
+                "        \"orderNum\": 3,\n" +
+                "        \"path\": \"\",\n" +
+                "        \"component\": null,\n" +
+                "        \"query\": null,\n" +
+                "        \"isFrame\": \"1\",\n" +
+                "        \"isCache\": \"0\",\n" +
+                "        \"menuType\": \"F\",\n" +
+                "        \"visible\": \"0\",\n" +
+                "        \"status\": \"0\",\n" +
+                "        \"perms\": \"monitor:operlog:export\",\n" +
+                "        \"icon\": \"#\",\n" +
+                "        \"children\": [],\n" +
+                "        \"tenantName\": null,\n" +
+                "        \"tenantId\": null\n" +
+                "    },\n" +
+                "    {\n" +
+                "        \"createBy\": null,\n" +
+                "        \"createTime\": \"2023-07-06 13:31:06\",\n" +
+                "        \"updateBy\": null,\n" +
+                "        \"updateTime\": null,\n" +
+                "        \"remark\": null,\n" +
+                "        \"menuId\": 1094,\n" +
+                "        \"menuName\": \"登录日志\",\n" +
+                "        \"parentName\": null,\n" +
+                "        \"parentId\": 1092,\n" +
+                "        \"orderNum\": 2,\n" +
+                "        \"path\": \"logininfor\",\n" +
+                "        \"component\": \"monitor/logininfor/index\",\n" +
+                "        \"query\": null,\n" +
+                "        \"isFrame\": \"1\",\n" +
+                "        \"isCache\": \"0\",\n" +
+                "        \"menuType\": \"C\",\n" +
+                "        \"visible\": \"0\",\n" +
+                "        \"status\": \"0\",\n" +
+                "        \"perms\": \"monitor:logininfor:list\",\n" +
+                "        \"icon\": \"logininfor\",\n" +
+                "        \"children\": [],\n" +
+                "        \"tenantName\": null,\n" +
+                "        \"tenantId\": null\n" +
+                "    },\n" +
+                "    {\n" +
+                "        \"createBy\": null,\n" +
+                "        \"createTime\": \"2023-07-06 13:34:57\",\n" +
+                "        \"updateBy\": null,\n" +
+                "        \"updateTime\": null,\n" +
+                "        \"remark\": null,\n" +
+                "        \"menuId\": 1098,\n" +
+                "        \"menuName\": \"登录查询\",\n" +
+                "        \"parentName\": null,\n" +
+                "        \"parentId\": 1094,\n" +
+                "        \"orderNum\": 1,\n" +
+                "        \"path\": \"\",\n" +
+                "        \"component\": null,\n" +
+                "        \"query\": null,\n" +
+                "        \"isFrame\": \"1\",\n" +
+                "        \"isCache\": \"0\",\n" +
+                "        \"menuType\": \"F\",\n" +
+                "        \"visible\": \"0\",\n" +
+                "        \"status\": \"0\",\n" +
+                "        \"perms\": \"monitor:logininfor:query\",\n" +
+                "        \"icon\": \"#\",\n" +
+                "        \"children\": [],\n" +
+                "        \"tenantName\": null,\n" +
+                "        \"tenantId\": null\n" +
+                "    },\n" +
+                "    {\n" +
+                "        \"createBy\": null,\n" +
+                "        \"createTime\": \"2023-07-06 13:36:58\",\n" +
+                "        \"updateBy\": null,\n" +
+                "        \"updateTime\": null,\n" +
+                "        \"remark\": null,\n" +
+                "        \"menuId\": 1099,\n" +
+                "        \"menuName\": \"登录删除\",\n" +
+                "        \"parentName\": null,\n" +
+                "        \"parentId\": 1094,\n" +
+                "        \"orderNum\": 2,\n" +
+                "        \"path\": \"\",\n" +
+                "        \"component\": null,\n" +
+                "        \"query\": null,\n" +
+                "        \"isFrame\": \"1\",\n" +
+                "        \"isCache\": \"0\",\n" +
+                "        \"menuType\": \"F\",\n" +
+                "        \"visible\": \"0\",\n" +
+                "        \"status\": \"0\",\n" +
+                "        \"perms\": \"monitor:logininfor:remove\",\n" +
+                "        \"icon\": \"#\",\n" +
+                "        \"children\": [],\n" +
+                "        \"tenantName\": null,\n" +
+                "        \"tenantId\": null\n" +
+                "    },\n" +
+                "    {\n" +
+                "        \"createBy\": null,\n" +
+                "        \"createTime\": \"2023-07-06 13:37:21\",\n" +
+                "        \"updateBy\": null,\n" +
+                "        \"updateTime\": null,\n" +
+                "        \"remark\": null,\n" +
+                "        \"menuId\": 1100,\n" +
+                "        \"menuName\": \"日志导出\",\n" +
+                "        \"parentName\": null,\n" +
+                "        \"parentId\": 1094,\n" +
+                "        \"orderNum\": 3,\n" +
+                "        \"path\": \"\",\n" +
+                "        \"component\": null,\n" +
+                "        \"query\": null,\n" +
+                "        \"isFrame\": \"1\",\n" +
+                "        \"isCache\": \"0\",\n" +
+                "        \"menuType\": \"F\",\n" +
+                "        \"visible\": \"0\",\n" +
+                "        \"status\": \"0\",\n" +
+                "        \"perms\": \"monitor:logininfor:export\",\n" +
+                "        \"icon\": \"#\",\n" +
+                "        \"children\": [],\n" +
+                "        \"tenantName\": null,\n" +
+                "        \"tenantId\": null\n" +
+                "    },\n" +
+                "    {\n" +
+                "        \"createBy\": null,\n" +
+                "        \"createTime\": \"2023-07-06 13:37:44\",\n" +
+                "        \"updateBy\": null,\n" +
+                "        \"updateTime\": null,\n" +
+                "        \"remark\": null,\n" +
+                "        \"menuId\": 1101,\n" +
+                "        \"menuName\": \"账户解锁\",\n" +
+                "        \"parentName\": null,\n" +
+                "        \"parentId\": 1094,\n" +
+                "        \"orderNum\": 4,\n" +
+                "        \"path\": \"\",\n" +
+                "        \"component\": null,\n" +
+                "        \"query\": null,\n" +
+                "        \"isFrame\": \"1\",\n" +
+                "        \"isCache\": \"0\",\n" +
+                "        \"menuType\": \"F\",\n" +
+                "        \"visible\": \"0\",\n" +
+                "        \"status\": \"0\",\n" +
+                "        \"perms\": \"monitor:logininfor:unlock\",\n" +
+                "        \"icon\": \"#\",\n" +
+                "        \"children\": [],\n" +
+                "        \"tenantName\": null,\n" +
+                "        \"tenantId\": null\n" +
                 "    }\n" +
                 "]";
         List<SysMenu> list = new ArrayList<>();