From 44f2a0a32c096bdb05d4cc0ac162cdc1eb14c3ed Mon Sep 17 00:00:00 2001
From: Administrator <1144154118@qq.com>
Date: 星期四, 10 八月 2023 13:14:29 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ard-work/src/main/java/com/ruoyi/inspect/controller/TaskController.java | 33 +++++++++++++++++++++++----------
1 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/inspect/controller/TaskController.java b/ard-work/src/main/java/com/ruoyi/inspect/controller/TaskController.java
index faf8110..c3ab320 100644
--- a/ard-work/src/main/java/com/ruoyi/inspect/controller/TaskController.java
+++ b/ard-work/src/main/java/com/ruoyi/inspect/controller/TaskController.java
@@ -1,22 +1,21 @@
package com.ruoyi.inspect.controller;
-import com.ruoyi.common.annotation.Anonymous;
+
import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.inspect.domain.ArdVideoInspectTask;
import com.ruoyi.inspect.service.IArdVideoInspectTaskService;
import com.ruoyi.inspect.service.impl.InspectionTaskManager;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-
-import java.util.Map;
import java.util.Set;
/**
- * @Description: 宸℃浠诲姟
+ * @Description: 宸℃浠诲姟controller
* @ClassName: TaskController
* @Author: 鍒樿嫃涔�
* @Date: 2023骞�06鏈�01鏃�9:19
@@ -24,18 +23,31 @@
**/
@RestController
@Api(tags = "宸℃浠诲姟")
-@Anonymous
+@RequestMapping("/inspect/control")
public class TaskController {
@Autowired
private InspectionTaskManager inspectionTaskManager;
-
+ @Autowired
+ IArdVideoInspectTaskService ardVideoInspectTaskService;
+ @PreAuthorize("@ss.hasPermi('inspect:control:manual')")
@GetMapping("/startTask/{taskId}")
@ApiOperation("鎵嬪姩寮�鍚贰妫�")
AjaxResult startTask(@PathVariable String taskId) {
- // 寮�鍚贰妫�浠诲姟
- inspectionTaskManager.startInspectionTask(taskId);
- return AjaxResult.success();
+ boolean enablemanualTask = ardVideoInspectTaskService.isEnablemanualTask(taskId);
+ if (enablemanualTask)
+ {
+ // 寮�鍚贰妫�浠诲姟
+ inspectionTaskManager.startInspectionTask(taskId);
+ return AjaxResult.success();
+ }
+ else
+ {
+ return AjaxResult.error();
+ }
+
}
+
+ @PreAuthorize("@ss.hasPermi('inspect:control:manual')")
@ApiOperation("鎵嬪姩鍋滄宸℃")
@GetMapping("/stopTask/{taskId}")
AjaxResult stopTask(@PathVariable String taskId) {
@@ -43,6 +55,7 @@
inspectionTaskManager.stopInspectionTask(taskId);
return AjaxResult.success();
}
+ @PreAuthorize("@ss.hasPermi('inspect:control:manual')")
@ApiOperation("鏌ヨ宸插惎鍔ㄤ换鍔�")
@GetMapping("/getTaskList")
AjaxResult getTaskList() {
--
Gitblit v1.9.3