| | |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.inspect.service.IArdVideoInspectTaskService; |
| | | import com.ruoyi.inspect.service.impl.InspectionTaskManager; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | 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')") |