xiangpei
2024-09-09 f5e0ae6c3e2d4b7367389315bf24596446280430
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package com.ycl.platform.controller;
 
import annotation.Log;
import com.ycl.platform.domain.entity.TMonitor;
import com.ycl.platform.domain.vo.TMonitorVO;
import com.ycl.platform.service.ITMonitorService;
import com.ycl.system.AjaxResult;
import com.ycl.system.controller.BaseController;
import com.ycl.system.page.TableDataInfo;
import com.ycl.utils.poi.ExcelUtil;
import enumeration.BusinessType;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * 设备资产Controller
 *
 * @author ruoyi
 * @date 2024-03-04
 */
@RestController
@RequestMapping("/system/monitor")
public class TMonitorController extends BaseController
{
    @Autowired
    private ITMonitorService tMonitorService;
 
    /**
     * 查询设备资产列表
     */
   @PreAuthorize("@ss.hasPermi('system:monitor:list')")
    @GetMapping("/list")
    public TableDataInfo list(TMonitorVO tMonitor)
    {
        startPage();
        List<TMonitorVO> list = tMonitorService.selectTMonitorList(tMonitor);
        return getDataTable(list);
    }
 
    /**
     * 导出设备资产列表
     */
   @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:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(tMonitorService.selectTMonitorById(id));
    }
 
    /**
     * 新增设备资产
     */
   @PreAuthorize("@ss.hasPermi('system:monitor:add')")
    @Log(title = "设备资产", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TMonitor tMonitor)
    {
        return toAjax(tMonitorService.insertTMonitor(tMonitor));
    }
 
    /**
     * 修改设备资产
     */
   @PreAuthorize("@ss.hasPermi('system:monitor:edit')")
    @Log(title = "设备资产", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TMonitor tMonitor)
    {
        return toAjax(tMonitorService.updateTMonitor(tMonitor));
    }
 
    /**
     * 删除设备资产
     */
   @PreAuthorize("@ss.hasPermi('system:monitor:remove')")
    @Log(title = "设备资产", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(tMonitorService.deleteTMonitorByIds(ids));
    }
 
    /**
     * 获取视频设备统计数
     */
    @PreAuthorize("@ss.hasPermi('system:monitor:list')")
    @GetMapping("/getVideoCount/{cameraFunType}")
    public AjaxResult getVideoCount(@PathVariable String cameraFunType)
    {
        TMonitor tMonitor = new TMonitor();
        tMonitor.setCameraFunType(cameraFunType);
        return success(tMonitorService.getVideoCount(tMonitor));
    }
 
    /**
     * 获取异常恢复视频设备统计数
     */
    @PreAuthorize("@ss.hasPermi('system:monitor:list')")
    @GetMapping("/recoveryException")
    public AjaxResult recoveryException()
    {
        return success(tMonitorService.recoveryException());
    }
 
 
}