zhanghua
2022-11-04 9eba8d0c7cbadb31c40e0fe1536b01d5392f1665
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
package com.ycl.controller.cockpit.enforcementEvents;
 
import com.ycl.api.CommonResult;
import com.ycl.util.CheckApiUtil;
import com.ycl.vo.cockpit.CockpitVO;
import com.ycl.vo.cockpit.enforcementEvents.EnforcementEventsVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
/**
 * @author Lyq
 * @version 1.0
 * @date 2022/10/26
 */
@Api(tags = "驾驶舱数据-执法事件")
@RestController
@RequestMapping("/api/event")
public class EnforcementEventsController {
    @Resource
    private CheckApiUtil checkApiUtil;
 
    @ApiOperation(value = "执法事件统计")
    @GetMapping("/statistics")
    public CommonResult<Map<String, Object>> statistics(@Validated CockpitVO params) {
        checkApiUtil.cockpit(params);
        Map<String, Object> map = new HashMap<>();
        EnforcementEventsVO.StatisticsEventVO eventVO = new EnforcementEventsVO.StatisticsEventVO();
        eventVO.setCount(10);
        eventVO.setRatio(new BigDecimal("0.69").setScale(2, RoundingMode.HALF_UP));
        map.put("reported", eventVO);
        map.put("disposition", eventVO);
        map.put("dispositionInTime", eventVO);
        map.put("register", eventVO);
        return CommonResult.success(map);
    }
 
    @ApiOperation(value = "事件类型")
    @GetMapping("/type")
    public CommonResult<EnforcementEventsVO.TypeAndSourceVO> type(@Validated CockpitVO params) {
        checkApiUtil.cockpit(params);
        List<EnforcementEventsVO.TypeAndSourceVO1> typeVO1s = new ArrayList<>();
        EnforcementEventsVO.TypeAndSourceVO typeVO = new EnforcementEventsVO.TypeAndSourceVO();
        EnforcementEventsVO.TypeAndSourceVO1 typeVO1 = null;
        for (int i = 0; i < 4; i++) {
            typeVO1 = new EnforcementEventsVO.TypeAndSourceVO1();
            typeVO1.setName("团结屯");
            typeVO1.setCount(20);
            typeVO1.setRatio(new BigDecimal("0.69").setScale(2, RoundingMode.HALF_UP));
            typeVO1s.add(typeVO1);
        }
        typeVO.setAll(100);
        typeVO.setRecords(typeVO1s);
        return CommonResult.success(typeVO);
    }
 
    @ApiOperation(value = "视频抓拍告发点位")
    @GetMapping("/video")
    public CommonResult<List<EnforcementEventsVO.VideoAndAreaVO>> video(@Validated CockpitVO params) {
        checkApiUtil.cockpit(params);
        List<EnforcementEventsVO.VideoAndAreaVO> videoVOS = new ArrayList<>();
        EnforcementEventsVO.VideoAndAreaVO videoVO = null;
        for (int i = 0; i < 4; i++) {
            videoVO = new EnforcementEventsVO.VideoAndAreaVO();
            videoVO.setName("团结屯");
            videoVO.setCount(10);
            videoVO.setRatio(new BigDecimal("0.65").setScale(2, RoundingMode.HALF_UP));
            videoVOS.add(videoVO);
        }
        return CommonResult.success(videoVOS);
    }
 
    @ApiOperation(value = "事件来源")
    @GetMapping("/source")
    public CommonResult<EnforcementEventsVO.TypeAndSourceVO> source(@Validated CockpitVO params) {
        checkApiUtil.cockpit(params);
        List<EnforcementEventsVO.TypeAndSourceVO1> typeVO1s = new ArrayList<>();
        EnforcementEventsVO.TypeAndSourceVO typeVO = new EnforcementEventsVO.TypeAndSourceVO();
        EnforcementEventsVO.TypeAndSourceVO1 typeVO1 = null;
        for (int i = 0; i < 4; i++) {
            typeVO1 = new EnforcementEventsVO.TypeAndSourceVO1();
            typeVO1.setName("团结屯");
            typeVO1.setCount(20);
            typeVO1.setRatio(new BigDecimal("0.69").setScale(2, RoundingMode.HALF_UP));
            typeVO1s.add(typeVO1);
        }
        typeVO.setAll(100);
        typeVO.setRecords(typeVO1s);
        return CommonResult.success(typeVO);
    }
 
    @ApiOperation(value = "事件区域统计")
    @GetMapping("/area")
    public CommonResult<List<EnforcementEventsVO.VideoAndAreaVO>> area(@Validated CockpitVO params) {
        checkApiUtil.cockpit(params);
        List<EnforcementEventsVO.VideoAndAreaVO> videoVOS = new ArrayList<>();
        EnforcementEventsVO.VideoAndAreaVO videoVO = null;
        for (int i = 0; i < 4; i++) {
            videoVO = new EnforcementEventsVO.VideoAndAreaVO();
            videoVO.setName("团结屯");
            videoVO.setCount(10);
            videoVOS.add(videoVO);
        }
        return CommonResult.success(videoVOS);
    }
 
    @ApiOperation(value = "延误事件")
    @GetMapping("/delay")
    public CommonResult<List<EnforcementEventsVO.DelayVO>> delay(@Validated CockpitVO params) {
        checkApiUtil.cockpit(params);
        List<EnforcementEventsVO.DelayVO> delayVOS = new ArrayList<>();
        EnforcementEventsVO.DelayVO delayVO = null;
        for (int i = 0; i < 4; i++) {
            delayVO = new EnforcementEventsVO.DelayVO();
            delayVO.setCode("201245555555");
            delayVO.setDescription("团结屯");
            delayVO.setDuration(30);
            delayVOS.add(delayVO);
        }
        return CommonResult.success(delayVOS);
    }
 
    @ApiOperation(value = "事件信息")
    @GetMapping("/info")
    public CommonResult<EnforcementEventsVO.InfoVO> info(@Validated CockpitVO params) {
        checkApiUtil.cockpit(params);
        EnforcementEventsVO.InfoVO infoVO = new EnforcementEventsVO.InfoVO();
        EnforcementEventsVO.EventVO eventVO = new EnforcementEventsVO.EventVO();
        infoVO.setToday(5);
        infoVO.setWeek(10);
        infoVO.setDispatch(20);
        infoVO.setIdentification(20);
        eventVO.setDescription("事件描述");
        eventVO.setAddress("事发地址");
        eventVO.setAlarmTime("2022-10-15 16:12:13");
        eventVO.setPoint("1号点位");
        eventVO.setPicture("http://12.2.23.4/xx.png");
        eventVO.setSource("AI识别");
        infoVO.setEvent(eventVO);
        return CommonResult.success(infoVO);
    }
 
}