林火综合应急信息管理系统后端
guoshilong
2023-03-09 a084945f219ace036070bce83487e747c411b876
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
package org.springblade.modules.dp.controller;
 
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.tool.api.R;
import org.springblade.modules.device.entity.DeviceEntity;
import org.springblade.modules.dp.service.IComprehensiveStatisticsService;
import org.springblade.modules.fire.service.IFireService;
import org.springblade.modules.fire.vo.FireVO;
import org.springblade.modules.fireSupplement.service.IFireSupplementService;
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;
 
import java.util.HashMap;
import java.util.List;
 
/**
 * 大屏综合统计 控制器
 *
 * @author GuoShiLong
 * @since 2023-03-08
 */
@RestController
@AllArgsConstructor
@RequestMapping("dp/comprehensiveStatistics")
@Api(value = "综合统计", tags = "综合统计接口")
public class ComprehensiveStatisticsController extends BladeController {
    private IComprehensiveStatisticsService comprehensiveStatisticsService;
    private IFireService fireService;
    private IFireSupplementService fireSupplementService;
 
    /**
     * 数据概览 (出警次数还没有统计)
     */
    @GetMapping("/dataOverview")
    @ApiOperation(value = "数据概览", notes = "数据概览")
    public R getDataOverview() {
        List<HashMap<String,String>> dataStatistics = comprehensiveStatisticsService.getDataOverview();
        return R.data(dataStatistics);
    }
 
    /**
     * 入驻单位统计
     */
    @GetMapping("/deptStatistics")
    @ApiOperation(value = "入驻单位统计", notes = "入驻单位统计")
    public R getDeptStatistics() {
        List<HashMap<String,String>> deptStatistics = comprehensiveStatisticsService.getDeptStatistics();
        return R.data(deptStatistics);
    }
 
    /**
     * 实时火警事件
     * @param time 时间
     * @return
     */
    @GetMapping("/realtimeFireAlarmIncident")
    @ApiOperation(value = "实时火警事件", notes = "实时火警事件")
    public R getRealtimeFireAlarmIncident(@RequestParam(name="time", defaultValue="48")String time) {
        List<FireVO> fireList = fireService.getRealtime(time);
        return R.data(fireList);
    }
 
    /**
     * 火警事件来源
     */
    @GetMapping("/fireCallSource")
    @ApiOperation(value = "火警事件来源", notes = "火警事件来源")
    public R getFireCallSource() {
        List fireCallSource = comprehensiveStatisticsService.getFireCallSource();
        return R.data(fireCallSource);
    }
 
    /**
     * 易发区统计
     * @param regionCode 区域编码 36 3601 360124,三种任意一种
     * @param limit 限制前几
     * @return
     */
    @GetMapping("/proneAreasStatistics")
    @ApiOperation(value = "易发区统计", notes = "易发区统计")
    public R getProneAreasStatistics(String regionCode, @RequestParam(name="limit", defaultValue="15")Integer limit) {
        List proneAreasStatistics = comprehensiveStatisticsService.getProneAreasStatistics(regionCode,limit);
        return R.data(proneAreasStatistics);
    }
 
    /**
     * 火警上报趋势
     */
    @GetMapping("/fireReportingTrend")
    @ApiOperation(value = "火警上报趋势", notes = "火警上报趋势")
    public R getFireReportingTrend() {
        List<HashMap<String,String>> FireReportingTrend = comprehensiveStatisticsService.getFireReportingTrend();
        return R.data(FireReportingTrend);
    }
}