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.Params2VO params) {
|
checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime());
|
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.Params2VO params) {
|
checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime());
|
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.Params2VO params) {
|
checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime());
|
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("/source")
|
public CommonResult<EnforcementEventsVO.TypeAndSourceVO> source(@Validated CockpitVO.Params2VO params) {
|
checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime());
|
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.Params2VO params) {
|
checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime());
|
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.Params2VO params) {
|
checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime());
|
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.Params2VO params) {
|
checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime());
|
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);
|
}
|
|
}
|