feat(video): 添加报警记录管理功能- 新增报警记录实体类 AlarmRecord 及相关字段定义
- 实现报警记录的增删改查接口与 Mapper 层逻辑 - 添加报警记录前端页面,支持列表展示、搜索、处理与忽略操作 - 支持批量处理报警记录及导出功能 - 增加报警记录详情查看弹窗,展示图片与视频信息- 配置定时任务白名单,允许访问 ruoyi.video 包 - 引入 JavaCV 依赖以支持视频处理功能 - 添加 testng 依赖用于测试支持
This commit is contained in:
@@ -0,0 +1,126 @@
|
||||
package com.ruoyi.video.controller;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.video.domain.InspectionTask;
|
||||
import com.ruoyi.video.service.InspectionTaskService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 巡检任务Controller
|
||||
*
|
||||
* @Author: orange
|
||||
* @CreateTime: 2025-01-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/video/inspection")
|
||||
public class InspectionTaskController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private InspectionTaskService inspectionTaskService;
|
||||
|
||||
/**
|
||||
* 查询巡检任务列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:inspection:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(InspectionTask inspectionTask) {
|
||||
startPage();
|
||||
List<InspectionTask> list = inspectionTaskService.selectInspectionTaskList(inspectionTask);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出巡检任务列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:inspection:export')")
|
||||
@Log(title = "巡检任务", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, InspectionTask inspectionTask) {
|
||||
List<InspectionTask> list = inspectionTaskService.selectInspectionTaskList(inspectionTask);
|
||||
ExcelUtil<InspectionTask> util = new ExcelUtil<InspectionTask>(InspectionTask.class);
|
||||
util.exportExcel(response, list, "巡检任务数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取巡检任务详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:inspection:query')")
|
||||
@GetMapping(value = "/{taskId}")
|
||||
public AjaxResult getInfo(@PathVariable("taskId") Long taskId) {
|
||||
return success(inspectionTaskService.selectInspectionTaskById(taskId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增巡检任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:inspection:add')")
|
||||
@Log(title = "巡检任务", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody InspectionTask inspectionTask) {
|
||||
return toAjax(inspectionTaskService.insertInspectionTask(inspectionTask));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改巡检任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:inspection:edit')")
|
||||
@Log(title = "巡检任务", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody InspectionTask inspectionTask) {
|
||||
return toAjax(inspectionTaskService.updateInspectionTask(inspectionTask));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除巡检任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:inspection:remove')")
|
||||
@Log(title = "巡检任务", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{taskIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] taskIds) {
|
||||
return toAjax(inspectionTaskService.deleteInspectionTaskByIds(taskIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动巡检任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:inspection:start')")
|
||||
@Log(title = "启动巡检任务", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/start/{taskId}")
|
||||
public AjaxResult start(@PathVariable Long taskId) {
|
||||
boolean result = inspectionTaskService.startInspectionTask(taskId);
|
||||
return result ? success("启动成功") : error("启动失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止巡检任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:inspection:stop')")
|
||||
@Log(title = "停止巡检任务", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/stop/{taskId}")
|
||||
public AjaxResult stop(@PathVariable Long taskId) {
|
||||
boolean result = inspectionTaskService.stopInspectionTask(taskId);
|
||||
return result ? success("停止成功") : error("停止失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动执行巡检任务
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('video:inspection:execute')")
|
||||
@Log(title = "执行巡检任务", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/execute/{taskId}")
|
||||
public AjaxResult execute(@PathVariable Long taskId) {
|
||||
inspectionTaskService.executeInspectionTask(taskId);
|
||||
return success("任务已提交执行");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user