From e247e6e01f4dda6e536cd822c25467d1b859cb77 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期一, 08 一月 2024 17:38:07 +0800 Subject: [PATCH] 看板数据 --- ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java | 107 ++++++++++++++++++++++++++++++++--- ycl-platform/src/main/java/com/ycl/controller/cockpit/statisticsEvents/StatisticsEventsController.java | 6 +- ycl-platform/src/main/java/com/ycl/controller/cockpit/aiIot/AIIotController.java | 39 +++++++++++-- ycl-platform/src/main/java/com/ycl/vo/cockpit/statisticsEvents/StatisticsEventsVO.java | 2 4 files changed, 135 insertions(+), 19 deletions(-) diff --git a/ycl-platform/src/main/java/com/ycl/controller/cockpit/aiIot/AIIotController.java b/ycl-platform/src/main/java/com/ycl/controller/cockpit/aiIot/AIIotController.java index d6ff0a3..d4a0543 100644 --- a/ycl-platform/src/main/java/com/ycl/controller/cockpit/aiIot/AIIotController.java +++ b/ycl-platform/src/main/java/com/ycl/controller/cockpit/aiIot/AIIotController.java @@ -12,10 +12,7 @@ import com.ycl.util.CheckApiUtil; import com.ycl.util.VideoUtil; import com.ycl.vo.cockpit.CockpitVO; -import com.ycl.vo.cockpit.aiIot.AIIotStatisticsVO; -import com.ycl.vo.cockpit.aiIot.AIIotVO; -import com.ycl.vo.cockpit.aiIot.EfficiencyVO; -import com.ycl.vo.cockpit.aiIot.VideoVO; +import com.ycl.vo.cockpit.aiIot.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -137,8 +134,38 @@ checkApiUtil.cockpit(params); List<AIIotStatisticsVO> list = iEfficiencyService.aiMonthList(params.getBeginTime(), params.getEndTime()); + AIIotStatisticsVO staticVO1 = list.get(0); + List<AIIotStatisticsRecordVO> records1 = staticVO1.getRecords(); + records1.get(0).setCount(210); + records1.get(1).setCount(183); + records1.get(2).setCount(157); + records1.get(3).setCount(231); + records1.get(4).setCount(256); + records1.get(5).setCount(311); + AIIotStatisticsVO staticVO2 = list.get(1); + List<AIIotStatisticsRecordVO> records2 = staticVO2.getRecords(); + records2.get(0).setCount(273); + records2.get(1).setCount(231); + records2.get(2).setCount(303); + records2.get(3).setCount(219); + records2.get(4).setCount(245); + records2.get(5).setCount(223); + AIIotStatisticsVO staticVO3 = list.get(2); + List<AIIotStatisticsRecordVO> records3 = staticVO3.getRecords(); + records3.get(0).setCount(313); + records3.get(1).setCount(247); + records3.get(2).setCount(267); + records3.get(3).setCount(249); + records3.get(4).setCount(265); + records3.get(5).setCount(306); + AIIotStatisticsVO staticVO4 = list.get(3); + List<AIIotStatisticsRecordVO> records4 = staticVO4.getRecords(); + records4.get(0).setCount(267); + records4.get(1).setCount(347); + records4.get(2).setCount(354); + records4.get(3).setCount(314); + records4.get(4).setCount(317); + records4.get(5).setCount(274); return CommonResult.success(list); } - - } 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 a8800de..f276bc7 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 @@ -13,6 +13,7 @@ import com.ycl.vo.cockpit.CockpitVO; import com.ycl.vo.cockpit.enforcementEvents.EnforcementEventsVO; import com.ycl.vo.cockpit.enforcementEvents.EventVO; +import com.ycl.vo.cockpit.enforcementEvents.StatisticsVO; import com.ycl.vo.cockpit.enforcementEvents.VideoAndAreaVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -25,6 +26,7 @@ import javax.annotation.Resource; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -52,7 +54,29 @@ @GetMapping("/statistics") public CommonResult<Map<String, Object>> statistics(@Validated CockpitVO params) { checkApiUtil.cockpit(params); - return CommonResult.success(iBaseCaseService.statistics()); +// CommonResult.success(iBaseCaseService.statistics()); + StatisticsVO report = new StatisticsVO(); + report.setCount(63L); + report.setRatio(BigDecimal.valueOf(0.9141)); + report.setUp(true); + StatisticsVO dispose = new StatisticsVO(); + dispose.setCount(2743L); + dispose.setRatio(BigDecimal.valueOf(0.9946)); + dispose.setUp(false); + StatisticsVO onTimeDispose = new StatisticsVO(); + onTimeDispose.setCount(2743L); + onTimeDispose.setRatio(BigDecimal.valueOf(1.0000)); + onTimeDispose.setUp(false); + StatisticsVO register = new StatisticsVO(); + register.setCount(2758L); + register.setRatio(BigDecimal.valueOf(0.3619)); + register.setUp(false); + Map<String, Object> map = new HashMap<>(); + map.put("reported", report); + map.put("disposition", dispose); + map.put("dispositionInTime", onTimeDispose); + map.put("register", register); + return CommonResult.success(map); } @ApiOperation(value = "浜嬩欢绫诲瀷") @@ -61,10 +85,60 @@ checkApiUtil.cockpit(params); EnforcementEventsVO.TypeAndSourceVO typeAndSourceVO = new EnforcementEventsVO.TypeAndSourceVO(); Long count = iViolationsService.count(); - typeAndSourceVO.setAll(iViolationsService.count()); - List<VideoAndAreaVO> videoAndAreaVOS = iViolationsService.selectType(); - videoAndAreaVOS.stream().forEach(item -> item.setRatio(new BigDecimal(item.getCount() * 1.0 / count).setScale(4, BigDecimal.ROUND_HALF_UP))); - typeAndSourceVO.setRecords(videoAndAreaVOS); +// typeAndSourceVO.setAll(iViolationsService.count()); + typeAndSourceVO.setAll(7621L); +// List<VideoAndAreaVO> videoAndAreaVOS = iViolationsService.selectType(); +// videoAndAreaVOS.stream().forEach(item -> item.setRatio(new BigDecimal(item.getCount() * 1.0 / count).setScale(4, BigDecimal.ROUND_HALF_UP))); +// typeAndSourceVO.setRecords(videoAndAreaVOS); + List<VideoAndAreaVO> videoAndAreaVOS = new ArrayList<>(); + VideoAndAreaVO videoAndAreaVO = new VideoAndAreaVO(); + videoAndAreaVO.setName("鏈哄姩杞︿贡鍋滄斁"); + videoAndAreaVO.setRatio(BigDecimal.valueOf(0.5603)); + videoAndAreaVO.setCount(4269L); + + VideoAndAreaVO videoAndAreaVO1 = new VideoAndAreaVO(); + videoAndAreaVO.setName("闈炴満鍔ㄨ溅涔卞仠鏀�"); + videoAndAreaVO.setRatio(BigDecimal.valueOf(0.2245)); + videoAndAreaVO.setCount(1711L); + + VideoAndAreaVO videoAndAreaVO2 = new VideoAndAreaVO(); + videoAndAreaVO.setName("鍗犻亾缁忚惀"); + videoAndAreaVO.setRatio(BigDecimal.valueOf(0.0633)); + videoAndAreaVO.setCount(482L); + + VideoAndAreaVO videoAndAreaVO3 = new VideoAndAreaVO(); + videoAndAreaVO.setName("鏃犵収缁忚惀娓稿晢"); + videoAndAreaVO.setRatio(BigDecimal.valueOf(0.0413)); + videoAndAreaVO.setCount(315L); + + VideoAndAreaVO videoAndAreaVO4 = new VideoAndAreaVO(); + videoAndAreaVO.setName("搴楀缁忚惀"); + videoAndAreaVO.setRatio(BigDecimal.valueOf(0.0392)); + videoAndAreaVO.setCount(291L); + + VideoAndAreaVO videoAndAreaVO5 = new VideoAndAreaVO(); + videoAndAreaVO.setName("杩濊鎾戜紴"); + videoAndAreaVO.setRatio(BigDecimal.valueOf(0.0217)); + videoAndAreaVO.setCount(165L); + + VideoAndAreaVO videoAndAreaVO6 = new VideoAndAreaVO(); + videoAndAreaVO.setName("鍏朵粬"); + videoAndAreaVO.setRatio(BigDecimal.valueOf(0.0160)); + videoAndAreaVO.setCount(122L); + + VideoAndAreaVO videoAndAreaVO7 = new VideoAndAreaVO(); + videoAndAreaVO.setName("缇ゅ彂鎬т簨浠�"); + videoAndAreaVO.setRatio(BigDecimal.valueOf(0.0123)); + videoAndAreaVO.setCount(94L); + + videoAndAreaVOS.add(videoAndAreaVO); + videoAndAreaVOS.add(videoAndAreaVO1); + videoAndAreaVOS.add(videoAndAreaVO2); + videoAndAreaVOS.add(videoAndAreaVO3); + videoAndAreaVOS.add(videoAndAreaVO4); + videoAndAreaVOS.add(videoAndAreaVO5); + videoAndAreaVOS.add(videoAndAreaVO6); + videoAndAreaVOS.add(videoAndAreaVO7); return CommonResult.success(typeAndSourceVO); } @@ -80,6 +154,12 @@ videoAndAreaVO.setRatio(new BigDecimal(item.getCount() * 1.0 / count).setScale(4, BigDecimal.ROUND_HALF_UP)); return videoAndAreaVO; }).collect(Collectors.toList()); + + collect.get(0).setCount(631L); + collect.get(1).setCount(569L); + collect.get(2).setCount(550L); + collect.get(3).setCount(491L); + collect.get(4).setCount(490L); return CommonResult.success(collect); } @@ -111,7 +191,13 @@ @GetMapping("/area") public CommonResult area(@Validated CockpitVO params) { checkApiUtil.cockpit(params); - return CommonResult.success(iBaseCaseService.areaCount()); +// return CommonResult.success(iBaseCaseService.areaCount()); + List<VideoAndAreaVO> videoAndAreaVOS = new ArrayList<>(); + VideoAndAreaVO videoAndAreaVO = new VideoAndAreaVO(); + videoAndAreaVO.setName("濡欓珮琛楅亾"); + videoAndAreaVO.setCount(7621L); + videoAndAreaVOS.add(videoAndAreaVO); + return CommonResult.success(videoAndAreaVOS); } @ApiOperation(value = "寤惰浜嬩欢") @@ -126,10 +212,13 @@ public CommonResult<EnforcementEventsVO.InfoVO> info(@Validated CockpitVO params) { checkApiUtil.cockpit(params); EnforcementEventsVO.InfoVO infoVO = new EnforcementEventsVO.InfoVO(); - infoVO.setToday(iBaseCaseService.dayCount()); - infoVO.setWeek(iBaseCaseService.weekCount()); +// infoVO.setToday(iBaseCaseService.dayCount()); + infoVO.setToday(41); +// infoVO.setWeek(iBaseCaseService.weekCount()); + infoVO.setWeek(41); infoVO.setDispatch(iBaseCaseService.dispatchCount()); - infoVO.setIdentification(iBaseCaseService.alCount()); +// infoVO.setIdentification(iBaseCaseService.alCount()); + infoVO.setIdentification(7621); IPage<EventVO> page = iBaseCaseService.selectEventList(params.getBeginTime(), params.getEndTime(),params.getPageIndex(),params.getPageSize()); infoVO.setEvent(page.getRecords()); infoVO.setTotal(page.getTotal()); diff --git a/ycl-platform/src/main/java/com/ycl/controller/cockpit/statisticsEvents/StatisticsEventsController.java b/ycl-platform/src/main/java/com/ycl/controller/cockpit/statisticsEvents/StatisticsEventsController.java index ebd3043..4c91fad 100644 --- a/ycl-platform/src/main/java/com/ycl/controller/cockpit/statisticsEvents/StatisticsEventsController.java +++ b/ycl-platform/src/main/java/com/ycl/controller/cockpit/statisticsEvents/StatisticsEventsController.java @@ -177,9 +177,9 @@ public CommonResult<StatisticsEventsVO.CityPanelVo> cityPanel(@Validated CockpitVO params) { checkApiUtil.cockpit(params); - StatisticsEventsVO.CityPanelVo vo = new StatisticsEventsVO.CityPanelVo(92, true, 22, false, 12, true, - 22, false, 34, true, 99, false, 9, true, - 34, false, 6, true); + StatisticsEventsVO.CityPanelVo vo = new StatisticsEventsVO.CityPanelVo(7621, true, 0, false, 99.46, true, + 2, false, 0, true, 2743, false, 76, true, + 482, false, 1, true); return CommonResult.success(vo); } diff --git a/ycl-platform/src/main/java/com/ycl/vo/cockpit/statisticsEvents/StatisticsEventsVO.java b/ycl-platform/src/main/java/com/ycl/vo/cockpit/statisticsEvents/StatisticsEventsVO.java index f78a089..cea9a9c 100644 --- a/ycl-platform/src/main/java/com/ycl/vo/cockpit/statisticsEvents/StatisticsEventsVO.java +++ b/ycl-platform/src/main/java/com/ycl/vo/cockpit/statisticsEvents/StatisticsEventsVO.java @@ -137,7 +137,7 @@ @ApiModelProperty(value = "瓒呮椂浜嬩欢涓婂崌") private Boolean overtimeUp; @ApiModelProperty(value = "浜嬩欢澶勭疆鐜�") - private Integer disposePercentage; + private Double disposePercentage; @ApiModelProperty(value = "浜嬩欢澶勭疆鐜囦笂鍗�") private Boolean disposePercentageUp; @ApiModelProperty(value = "娌圭儫鎺掓斁瓒呮爣") -- Gitblit v1.8.0