云
2026-10-26 80eb4f90939402440c7179afe0935069ef85fcf8
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
package com.ruoyi.safe.controller;
 
import com.ruoyi.framework.web.domain.R;
import com.ruoyi.safe.service.SafeDashboardService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * 安全生产-安全数据驾驶舱
 */
@RestController
@RequestMapping("/safeDashboard")
@AllArgsConstructor
@Tag(name = "安全生产-安全数据驾驶舱")
public class SafeDashboardController {
 
    private final SafeDashboardService safeDashboardService;
 
    @GetMapping("/getOverview")
    @Operation(summary = "安全驾驶舱-顶部总览")
    public R getOverview() {
        return R.ok(safeDashboardService.getOverview());
    }
 
    @GetMapping("/getLatestEvents")
    @Operation(summary = "安全驾驶舱-最新安全动态")
    public R getLatestEvents(@RequestParam(required = false) Integer limit) {
        return R.ok(safeDashboardService.getLatestEvents(limit));
    }
 
    @GetMapping("/getHiddenTypeDistribution")
    @Operation(summary = "安全驾驶舱-隐患类型分布")
    public R getHiddenTypeDistribution() {
        return R.ok(safeDashboardService.getHiddenTypeDistribution());
    }
 
    @GetMapping("/getHiddenTrend")
    @Operation(summary = "安全驾驶舱-近6个月隐患趋势")
    public R getHiddenTrend() {
        return R.ok(safeDashboardService.getHiddenTrend());
    }
 
    @GetMapping("/getHazardRiskDistribution")
    @Operation(summary = "安全驾驶舱-危险源风险等级分布")
    public R getHazardRiskDistribution() {
        return R.ok(safeDashboardService.getHazardRiskDistribution());
    }
 
    @GetMapping("/getHazardTypeRanking")
    @Operation(summary = "安全驾驶舱-危险源类型排名")
    public R getHazardTypeRanking(@RequestParam(required = false) Integer limit) {
        return R.ok(safeDashboardService.getHazardTypeRanking(limit));
    }
 
    @GetMapping("/getHiddenRectifyRanking")
    @Operation(summary = "安全驾驶舱-隐患整改责任人排名")
    public R getHiddenRectifyRanking(@RequestParam(required = false) Integer limit) {
        return R.ok(safeDashboardService.getHiddenRectifyRanking(limit));
    }
}