From aeea62d121a1a8fd4475da30f1ef8b44b4776c7b Mon Sep 17 00:00:00 2001
From: wl <173@qq.com>
Date: 星期三, 04 一月 2023 14:02:47 +0800
Subject: [PATCH] fix: 店铺消息发送
---
ycl-platform/src/main/java/com/ycl/controller/cockpit/aiIot/AIIotController.java | 85 ++++++++++++++++++++++++++----------------
1 files changed, 52 insertions(+), 33 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 4d1d238..307a6fe 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
@@ -1,11 +1,21 @@
package com.ycl.controller.cockpit.aiIot;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ycl.api.CommonResult;
+import com.ycl.entity.video.VideoPoint;
+import com.ycl.service.carManage.ICarSlagcarService;
+import com.ycl.service.equipment.IHandheldTerminalService;
+import com.ycl.service.equipment.ILoudspeakerService;
+import com.ycl.service.video.impl.IVideoPointService;
import com.ycl.util.CheckApiUtil;
+import com.ycl.util.VideoUtil;
import com.ycl.vo.cockpit.CockpitVO;
import com.ycl.vo.cockpit.aiIot.AIIotVO;
+import com.ycl.vo.cockpit.aiIot.EfficiencyVO;
+import com.ycl.vo.cockpit.aiIot.VideoVO;
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;
@@ -16,6 +26,7 @@
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
+import java.util.stream.Collectors;
/**
* @author Lyq
@@ -30,48 +41,56 @@
@Resource
private CheckApiUtil checkApiUtil;
+ @Autowired
+ private IVideoPointService iVideoPointService;
+ @Autowired
+ private VideoUtil videoUtil;
+ @Autowired
+ IHandheldTerminalService iHandheldTerminalService;
+ @Autowired
+ ILoudspeakerService loudspeakerService;
+ @Autowired
+ ICarSlagcarService iCarSlagcarService;
+
@ApiOperation(value = "鐩戞祴鏁版嵁")
@GetMapping("/detection")
- public CommonResult<AIIotVO.DetectionVO> detection(@Validated CockpitVO.Params1VO params) {
- checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null);
+ public CommonResult<AIIotVO.DetectionVO> detection(@Validated CockpitVO params) {
+ checkApiUtil.cockpit(params);
AIIotVO.DetectionVO detectionVO = new AIIotVO.DetectionVO();
- detectionVO.setVideo(121);
- detectionVO.setIndividual(20);
- detectionVO.setLampblack(154);
- detectionVO.setLoudspeaker(30);
- detectionVO.setSlagCar(33);
+ detectionVO.setVideo(iVideoPointService.count());
+ detectionVO.setIndividual(iHandheldTerminalService.count());
+ detectionVO.setLampblack(154L);
+ /// TODO: 2022/12/13 缂哄皯娌圭儫鏈虹洃鎺ц〃
+ detectionVO.setLoudspeaker(loudspeakerService.count());
+ detectionVO.setSlagCar(iCarSlagcarService.count());
return CommonResult.success(detectionVO);
}
@ApiOperation(value = "瀹炴椂瑙嗛鐩戞帶")
@GetMapping("/video")
- public CommonResult<List<AIIotVO.VideoVO>> video(@Validated CockpitVO.Params1VO params) {
- checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null);
- List<AIIotVO.VideoVO> videoVOS = new ArrayList<>();
- AIIotVO.VideoVO a = null;
- for (int i = 0; i < 4; i++) {
- a = new AIIotVO.VideoVO();
- a.setLongitude("32.11");
- a.setLatitude("106.111");
- a.setName("璁惧涓�");
- a.setResourceId("012");
- a.setBrand("澶у崕");
- a.setModel("鐞冩満");
- a.setIp("10.23.14.2");
- a.setUrl("http://10.23.14.2:12001");
- videoVOS.add(a);
- }
- return CommonResult.success(videoVOS);
+ public CommonResult video(@Validated CockpitVO params) {
+ checkApiUtil.cockpit(params);
+ /// TODO: 2022/12/13 瑙嗛鐐逛綅璁惧涓虹┖ 娌℃暟鎹�
+ return CommonResult.success(iVideoPointService.list(new LambdaQueryWrapper<VideoPoint>().eq(params.getStreetId() != null, VideoPoint::getStreetId, params.getStreetId()).isNotNull(VideoPoint::getPlatResourceId)).stream().map(item -> {
+ VideoVO videoVO = new VideoVO();
+ videoVO.setName(item.getName());
+ videoVO.setBrand(item.getEquipmentBrand());
+ videoVO.setModel(item.getEquipmentModel());
+ videoVO.setIp(item.getEquipmentIp());
+ videoVO.setLatitude(item.getLatitude().toString());
+ videoVO.setLongitude(item.getLongitude().toString());
+ videoVO.setResourceId(item.getPlatResourceId());
+ return videoVO;
+ }).collect(Collectors.toList()));
}
@ApiOperation(value = "AI绠楁硶鏁堣兘")
@GetMapping("/efficiency")
- public CommonResult<List<AIIotVO.EfficiencyVO>> efficiency(@Validated CockpitVO.Params2VO params) {
- checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime());
- List<AIIotVO.EfficiencyVO> efficiencyVOS = new ArrayList<>();
- AIIotVO.EfficiencyVO a = null;
+ public CommonResult efficiency(@Validated CockpitVO params) {
+ checkApiUtil.cockpit(params);
+ List<EfficiencyVO> efficiencyVOS = new ArrayList<>();
for (int i = 0; i < 4; i++) {
- a = new AIIotVO.EfficiencyVO();
+ EfficiencyVO a = new EfficiencyVO();
a.setType("閬撹矾鐮存崯");
a.setCount(12);
a.setRatio(new BigDecimal("0.63").setScale(2, RoundingMode.HALF_UP));
@@ -82,8 +101,8 @@
@ApiOperation(value = "娓e湡鑱斿姩")
@GetMapping("/slag_car")
- public CommonResult<AIIotVO.SlagCarVO> slagCar(@Validated CockpitVO.Params1VO params) {
- checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null);
+ public CommonResult<AIIotVO.SlagCarVO> slagCar(@Validated CockpitVO params) {
+ checkApiUtil.cockpit(params);
AIIotVO.SlagCarVO slagCarVO = new AIIotVO.SlagCarVO();
slagCarVO.setCar(236);
slagCarVO.setTeam(20);
@@ -92,8 +111,8 @@
@ApiOperation(value = "AI浜嬩欢缁熻")
@GetMapping("/event_statistics")
- public CommonResult<List<AIIotVO.StatisticsVO>> statistics(@Validated CockpitVO.Params2VO params) {
- checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime());
+ public CommonResult<List<AIIotVO.StatisticsVO>> statistics(@Validated CockpitVO params) {
+ checkApiUtil.cockpit(params);
List<AIIotVO.StatisticsVO> statisticsVOS = new ArrayList<>();
List<AIIotVO.Statistics1VO> statistics1VOS = new ArrayList<>();
AIIotVO.StatisticsVO a = null;
--
Gitblit v1.8.0