From f17ef23e30c4b1415f587581a7955dc21583f770 Mon Sep 17 00:00:00 2001 From: zhanghua <314079846@qq.com> Date: 星期四, 08 十二月 2022 16:21:09 +0800 Subject: [PATCH] 视频功能修改 --- ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java | 52 ++++++++++++++++++++++++++-------------------------- 1 files changed, 26 insertions(+), 26 deletions(-) diff --git a/ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java b/ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java index 1c19a87..4d17945 100644 --- a/ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java +++ b/ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java @@ -1,11 +1,13 @@ package com.ycl.controller.cockpit.enforcementEvents; import com.ycl.api.CommonResult; +import com.ycl.service.caseHandler.IBaseCaseService; 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.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -31,14 +33,18 @@ @Resource private CheckApiUtil checkApiUtil; + @Autowired + IBaseCaseService iBaseCaseService; + @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()); + 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); @@ -48,8 +54,8 @@ @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()); + 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; @@ -67,14 +73,15 @@ @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()); + 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); @@ -82,8 +89,8 @@ @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()); + 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; @@ -101,8 +108,8 @@ @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()); + 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++) { @@ -116,8 +123,8 @@ @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()); + 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++) { @@ -132,21 +139,14 @@ @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()); + 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); + infoVO.setToday(iBaseCaseService.dayCount()); + infoVO.setWeek(iBaseCaseService.weekCount()); + infoVO.setDispatch(iBaseCaseService.dispatchCount()); + infoVO.setIdentification(iBaseCaseService.alCount()); + infoVO.setEvent(iBaseCaseService.selectEventList(params.getBeginTime(),params.getEndTime())); return CommonResult.success(infoVO); } -- Gitblit v1.8.0