wenhongquan 3 年之前
父節點
當前提交
b32244da45

+ 15 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TableDetectionController.java

@@ -1,8 +1,12 @@
 package com.ruoyi.web.controller.system;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import javax.servlet.http.HttpServletResponse;
 
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.framework.web.service.PermissionService;
 import com.ruoyi.quartz.task.RyTask;
 import com.ruoyi.system.domain.TblDetectionLog;
 import com.ruoyi.system.service.ITblDetectionLogService;
@@ -45,6 +49,11 @@ public class TableDetectionController extends BaseController
     @Autowired
     private RyTask ryTask;
 
+    @Autowired
+    private PermissionService permissionService;
+
+
+
     /**
      * 查询检测计划列表
      */
@@ -52,6 +61,12 @@ public class TableDetectionController extends BaseController
     @GetMapping("/list")
     public TableDataInfo list(TableDetection tableDetection)
     {
+        if(permissionService.hasAnyRoles("common")){
+            Map p = tableDetection.getParams();
+            if(p==null) p = new HashMap<String,Object>();
+            p.put("userId", SecurityUtils.getLoginUser().getUserId()+"");
+            tableDetection.setParams(p);
+        }
         startPage();
         List<TableDetection> list = tableDetectionService.selectTableDetectionList(tableDetection);
         return getDataTable(list);

+ 14 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TblMaintainController.java

@@ -1,8 +1,12 @@
 package com.ruoyi.web.controller.system;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import javax.servlet.http.HttpServletResponse;
 
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.framework.web.service.PermissionService;
 import com.ruoyi.quartz.task.RyTask;
 import com.ruoyi.system.domain.TblMaintainLog;
 import com.ruoyi.system.domain.TblTask;
@@ -47,6 +51,10 @@ public class TblMaintainController extends BaseController
     @Autowired
     private RyTask ryTask;
 
+    @Autowired
+    private PermissionService permissionService;
+
+
     /**
      * 查询养护计划列表
      */
@@ -54,6 +62,12 @@ public class TblMaintainController extends BaseController
     @GetMapping("/list")
     public TableDataInfo list(TblMaintain tblMaintain)
     {
+        if(permissionService.hasAnyRoles("common")){
+            Map p = tblMaintain.getParams();
+            if(p==null) p = new HashMap<String,Object>();
+            p.put("userId", SecurityUtils.getLoginUser().getUserId()+"");
+            tblMaintain.setParams(p);
+        }
         startPage();
         List<TblMaintain> list = tblMaintainService.selectTblMaintainList(tblMaintain);
         return getDataTable(list);

+ 11 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TblTaskController.java

@@ -15,6 +15,7 @@ import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.JSUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.file.ImageUtils;
+import com.ruoyi.framework.web.service.PermissionService;
 import com.ruoyi.quartz.task.RyTask;
 import com.ruoyi.system.domain.TblTaskLog;
 import com.ruoyi.system.service.*;
@@ -65,6 +66,10 @@ public class TblTaskController extends BaseController
     @Autowired
     private ISysDeptService deptService;
 
+    @Autowired
+    private PermissionService permissionService;
+
+
     /**
      * 查询工单任务列表
      */
@@ -72,6 +77,12 @@ public class TblTaskController extends BaseController
     @GetMapping("/list")
     public TableDataInfo list(TblTask tblTask)
     {
+        if(permissionService.hasAnyRoles("common")){
+            Map p = tblTask.getParams();
+            if(p==null) p = new HashMap<String,Object>();
+            p.put("userId",SecurityUtils.getLoginUser().getUserId()+"");
+            tblTask.setParams(p);
+        }
         startPage();
         List<TblTask> list = tblTaskService.selectTblTaskList(tblTask);
         return getDataTable(list);

+ 0 - 4
ruoyi-system/pom.xml

@@ -22,10 +22,6 @@
             <groupId>com.ruoyi</groupId>
             <artifactId>ruoyi-common</artifactId>
         </dependency>
-        <dependency>
-            <groupId>com.ruoyi</groupId>
-            <artifactId>ruoyi-framework</artifactId>
-        </dependency>
 
 
     </dependencies>

+ 0 - 10
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TableDetectionServiceImpl.java

@@ -6,7 +6,6 @@ import java.util.List;
 import java.util.Map;
 
 import com.ruoyi.common.utils.SecurityUtils;
-import com.ruoyi.framework.web.service.PermissionService;
 import com.ruoyi.system.domain.TblDetectionLog;
 import com.ruoyi.system.domain.TblMaintain;
 import com.ruoyi.system.domain.TblMaintainLog;
@@ -33,9 +32,6 @@ public class TableDetectionServiceImpl implements ITableDetectionService
     @Autowired
     private ITblDetectionLogService detectionLogService;
 
-    @Autowired
-    private PermissionService permissionService;
-
 
     /**
      * 查询检测计划
@@ -65,12 +61,6 @@ public class TableDetectionServiceImpl implements ITableDetectionService
     @Override
     public List<TableDetection> selectTableDetectionList(TableDetection tableDetection)
     {
-        if(permissionService.hasAnyRoles("common")){
-            Map p = tableDetection.getParams();
-            if(p==null) p = new HashMap<String,Object>();
-            p.put("userId",SecurityUtils.getLoginUser().getUserId()+"");
-            tableDetection.setParams(p);
-        }
         return tableDetectionMapper.selectTableDetectionList(tableDetection);
     }
 

+ 0 - 9
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TblMaintainServiceImpl.java

@@ -6,7 +6,6 @@ import java.util.List;
 import java.util.Map;
 
 import com.ruoyi.common.utils.SecurityUtils;
-import com.ruoyi.framework.web.service.PermissionService;
 import com.ruoyi.system.domain.TblMaintainLog;
 import com.ruoyi.system.domain.TblTask;
 import com.ruoyi.system.domain.TblTaskLog;
@@ -32,8 +31,6 @@ public class TblMaintainServiceImpl implements ITblMaintainService
     @Autowired
     private ITblMaintainLogService tblMaintainLogService;
 
-    @Autowired
-    private PermissionService permissionService;
 
 
     /**
@@ -64,12 +61,6 @@ public class TblMaintainServiceImpl implements ITblMaintainService
     @Override
     public List<TblMaintain> selectTblMaintainList(TblMaintain tblMaintain)
     {
-        if(permissionService.hasAnyRoles("common")){
-            Map p = tblMaintain.getParams();
-            if(p==null) p = new HashMap<String,Object>();
-            p.put("userId",SecurityUtils.getLoginUser().getUserId()+"");
-            tblMaintain.setParams(p);
-        }
         return tblMaintainMapper.selectTblMaintainList(tblMaintain);
     }
 

+ 0 - 9
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TblTaskServiceImpl.java

@@ -5,7 +5,6 @@ import java.util.*;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SecurityUtils;
-import com.ruoyi.framework.web.service.PermissionService;
 import com.ruoyi.system.domain.TblTaskLog;
 import com.ruoyi.system.mapper.TblTaskLogMapper;
 import com.ruoyi.system.service.ITblTaskLogService;
@@ -31,8 +30,6 @@ public class TblTaskServiceImpl implements ITblTaskService
     private ITblTaskLogService tblTaskLogService;
 
 
-    @Autowired
-    private PermissionService permissionService;
 
     /**
      * 查询工单任务
@@ -62,12 +59,6 @@ public class TblTaskServiceImpl implements ITblTaskService
     @Override
     public List<TblTask> selectTblTaskList(TblTask tblTask)
     {
-        if(permissionService.hasAnyRoles("common")){
-            Map p = tblTask.getParams();
-            if(p==null) p = new HashMap<String,Object>();
-            p.put("userId",SecurityUtils.getLoginUser().getUserId()+"");
-            tblTask.setParams(p);
-        }
         List<TblTask> taskList = tblTaskMapper.selectTblTaskList(tblTask);
         for (TblTask t:taskList
              ) {