wl
2022-11-11 e1008dbb1fa76874a28c06913b95c16d18acdfa7
ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java
@@ -1,6 +1,7 @@
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;
@@ -10,6 +11,7 @@
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;
@@ -26,23 +28,29 @@
@RestController
@RequestMapping("/api/event")
public class EnforcementEventsController {
    @Resource
    private CheckApiUtil checkApiUtil;
    @ApiOperation(value = "执法事件统计")
    @GetMapping("/statistics")
    public CommonResult<Map<String, Object>> statistics(@Validated CockpitVO.Params2VO params) {
    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));
        eventVO.setUp(true);
        map.put("reported", eventVO);
        map.put("disposition", eventVO);
        map.put("dispositionInTime",eventVO);
        map.put("dispositionInTime", eventVO);
        map.put("register", eventVO);
        return CommonResult.success(map);
    }
    @ApiOperation(value = "事件类型")
    @GetMapping("/type")
    public CommonResult<EnforcementEventsVO.TypeAndSourceVO> type(@Validated CockpitVO.Params2VO params) {
    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;
@@ -60,13 +68,15 @@
    @ApiOperation(value = "视频抓拍告发点位")
    @GetMapping("/video")
    public CommonResult<List<EnforcementEventsVO.VideoAndAreaVO>> video(@Validated CockpitVO.Params2VO params) {
    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);
@@ -74,7 +84,8 @@
    @ApiOperation(value = "事件来源")
    @GetMapping("/source")
    public CommonResult<EnforcementEventsVO.TypeAndSourceVO> source(@Validated CockpitVO.Params2VO params) {
    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;
@@ -92,7 +103,8 @@
    @ApiOperation(value = "事件区域统计")
    @GetMapping("/area")
    public CommonResult<List<EnforcementEventsVO.VideoAndAreaVO>> area(@Validated CockpitVO.Params2VO params) {
    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++) {
@@ -106,7 +118,8 @@
    @ApiOperation(value = "延误事件")
    @GetMapping("/delay")
    public CommonResult<List<EnforcementEventsVO.DelayVO>> delay(@Validated CockpitVO.Params2VO params) {
    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++) {
@@ -121,7 +134,8 @@
    @ApiOperation(value = "事件信息")
    @GetMapping("/info")
    public CommonResult<EnforcementEventsVO.InfoVO> info(@Validated CockpitVO.Params2VO params) {
    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);