zxl
6 小时以前 3b0516a2959e25576e4f3fda697a3b025d06c8c9
ycl-server/src/main/java/com/ycl/platform/controller/TMonitorController.java
@@ -2,6 +2,7 @@
import annotation.Log;
import com.ycl.platform.domain.entity.TMonitor;
import com.ycl.platform.domain.form.VideoExportForm;
import com.ycl.platform.domain.vo.TMonitorVO;
import com.ycl.platform.service.ITMonitorService;
import com.ycl.system.AjaxResult;
@@ -12,8 +13,10 @@
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.List;
/**
@@ -42,22 +45,45 @@
    }
    /**
     * 导出设备资产列表
     * 导出
     */
   @PreAuthorize("@ss.hasPermi('system:monitor:export')")
    @Log(title = "设备资产", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, TMonitorVO tMonitor)
    {
        List<TMonitorVO> list = tMonitorService.selectTMonitorList(tMonitor);
        ExcelUtil<TMonitorVO> util = new ExcelUtil<TMonitorVO>(TMonitorVO.class);
        util.exportExcel(response, list, "设备资产数据");
    @PreAuthorize("@ss.hasPermi('system:monitor:export')")
    @Log(title = "导出视频总量数据", businessType = BusinessType.EXPORT)
    @PostMapping("/export/video/total")
    public void exportVideoTotal(HttpServletResponse response, @Validated VideoExportForm exportForm) throws IOException {
        tMonitorService.exportVideoTotal(response,exportForm);
    }
    /**
     * 导出
     */
    @PreAuthorize("@ss.hasPermi('system:monitor:export')")
    @Log(title = "导出每日在线情况", businessType = BusinessType.EXPORT)
    @PostMapping("/export/video/online")
    public void exportVideoOnline(HttpServletResponse response, @Validated VideoExportForm exportForm) throws IOException, NoSuchFieldException, IllegalAccessException {
        tMonitorService.exportVideoOnline(response,exportForm);
    }
    /**
     * 导出
     */
    @PreAuthorize("@ss.hasPermi('system:monitor:export')")
    @Log(title = "导出每日录像情况", businessType = BusinessType.EXPORT)
    @PostMapping("/export/video/record")
    public void exportVideoRecord(HttpServletResponse response, @Validated VideoExportForm exportForm) throws IOException, NoSuchFieldException, IllegalAccessException {
        tMonitorService.exportVideoRecord(response,exportForm);
    }
    /**
     * 导出
     */
    @PreAuthorize("@ss.hasPermi('system:monitor:export')")
    @Log(title = "导出每日离线时长", businessType = BusinessType.EXPORT)
    @PostMapping("/export/video/loseTime")
    public void exportVideoOffTime(HttpServletResponse response, @Validated VideoExportForm exportForm) throws IOException, NoSuchFieldException, IllegalAccessException {
        tMonitorService.exportVideoLoseTime(response,exportForm);
    }
    /**
     * 获取设备资产详细信息
     */
   @PreAuthorize("@ss.hasPermi('system:monitor:query')")
    @PreAuthorize("@ss.hasPermi('system:monitor:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
@@ -67,7 +93,7 @@
    /**
     * 新增设备资产
     */
   @PreAuthorize("@ss.hasPermi('system:monitor:add')")
    @PreAuthorize("@ss.hasPermi('system:monitor:add')")
    @Log(title = "设备资产", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TMonitor tMonitor)
@@ -116,6 +142,14 @@
    {
        return success(tMonitorService.recoveryException(monitor));
    }
    /**
     * 导出
     */
    @PreAuthorize("@ss.hasPermi('system:monitor:export')")
    @Log(title = "导出", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response,TMonitorVO tMonitor) throws IOException, NoSuchFieldException, IllegalAccessException {
        tMonitorService.export(response,tMonitor);
    }
}