From 4ef3b7b71b2b444f09e20bd440215e1677a602a4 Mon Sep 17 00:00:00 2001 From: zhanghua <314079846@qq.com> Date: 星期二, 09 一月 2024 09:57:20 +0800 Subject: [PATCH] 2024年第一次bug修改 --- ycl-platform/src/main/java/com/ycl/controller/cockpit/aiIot/AIIotController.java | 61 ++++++++++++++++++++++++------ 1 files changed, 48 insertions(+), 13 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 bf474e7..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; @@ -59,6 +56,7 @@ @Autowired IEfficiencyService iEfficiencyService; + @ApiOperation(value = "鐩戞祴鏁版嵁") @GetMapping("/detection") public CommonResult<AIIotVO.DetectionVO> detection(@Validated CockpitVO params) { @@ -66,9 +64,9 @@ AIIotVO.DetectionVO detectionVO = new AIIotVO.DetectionVO(); detectionVO.setVideo(iVideoPointService.count()); detectionVO.setIndividual(iHandheldTerminalService.count()); - detectionVO.setLampblack(154L); - /// TODO: 2022/12/13 缂哄皯娌圭儫鏈虹洃鎺ц〃 - detectionVO.setLoudspeaker(loudspeakerService.count()); + detectionVO.setLampblack(iEfficiencyService.getSmokeCustomer()); + + detectionVO.setLoudspeaker(34L); detectionVO.setSlagCar(iCarSlagcarService.count()); return CommonResult.success(detectionVO); } @@ -80,7 +78,7 @@ /// TODO: 2022/12/13 瑙嗛鐐逛綅璁惧涓虹┖ 娌℃暟鎹� List<VideoPoint> list = iVideoPointService.list(new LambdaQueryWrapper<VideoPoint>() .eq(params.getStreetId() != null, VideoPoint::getStreetId, params.getStreetId()) - .isNotNull(VideoPoint::getPlatResourceId)); + .isNotNull(VideoPoint::getPlatResourceId).orderByDesc(VideoPoint::getId)); List<VideoVO> vos = list.stream().map(item -> { VideoVO videoVO = new VideoVO(); @@ -91,6 +89,7 @@ videoVO.setLatitude(item.getLatitude() != null ? item.getLatitude().toString() : ""); videoVO.setLongitude(item.getLongitude() != null ? item.getLongitude().toString() : ""); videoVO.setResourceId(item.getPlatResourceId()); + videoVO.setCode(item.getCode()); return videoVO; }).collect(Collectors.toList()); @@ -110,6 +109,10 @@ a.setRatio(1.0 - ((double) efficiencyDto.getErrorNumber() / (double) efficiencyDto.getNumber())); return a; }).collect(Collectors.toList()); + efficiencyVOS.add(new EfficiencyVO("搴楀缁忚惀", 0, 0.0)); + efficiencyVOS.add(new EfficiencyVO("娌胯鏅炬檼", 0, 0.0)); + efficiencyVOS.add(new EfficiencyVO("鏃犵収缁忚惀娓稿晢", 0, 0.0)); + efficiencyVOS.add(new EfficiencyVO("杩濊鎾戜紴", 0, 0.0)); return CommonResult.success(efficiencyVOS); } @@ -117,9 +120,11 @@ @GetMapping("/slag_car") public CommonResult<AIIotVO.SlagCarVO> slagCar(@Validated CockpitVO params) { checkApiUtil.cockpit(params); + AIIotVO.SlagCarVO slagCarVO = new AIIotVO.SlagCarVO(); - slagCarVO.setCar(236); - slagCarVO.setTeam(20); + slagCarVO.setCar(iCarSlagcarService.count()); + slagCarVO.setTeam(0L); + return CommonResult.success(slagCarVO); } @@ -128,9 +133,39 @@ public CommonResult<List<AIIotStatisticsVO>> statistics(@Validated CockpitVO params) { checkApiUtil.cockpit(params); - List<AIIotStatisticsVO> list = iEfficiencyService.aiMonthList(); + 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); } - - } -- Gitblit v1.8.0