From 6e462899735d25e37b06e42d7d8d7e0b33ffa44c Mon Sep 17 00:00:00 2001 From: water_xu Date: Tue, 28 May 2024 18:19:46 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E7=82=B9=E5=B7=A5=E7=A8=8B-=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E4=B8=AD=E6=89=80=E6=9C=89=E7=9A=84=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E7=8E=B0=E6=94=AF=E6=8C=81=E5=8F=8D=E6=9F=A5=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E7=9A=84=E9=87=8D=E7=82=B9=E5=B7=A5=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../keyProjects/VideoResourcesController.java | 51 +++++++++++++++++-- .../dsno2/keyProjects/OutSourcedMapper.java | 2 + .../dsno2/keyProjects/VideoManagerMapper.java | 2 + .../keyProjects/OutSourcedService.java | 2 + .../keyProjects/VideoManagerService.java | 2 + .../impl/OutSourcedServiceImpl.java | 4 ++ .../impl/VideoManagerServiceImpl.java | 5 ++ .../dsno2/keyProjects/OutSourcedMapper.xml | 13 +++++ .../dsno2/keyProjects/VideoManagerMapper.xml | 21 ++++++++ 9 files changed, 98 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/zcloud/controller/keyProjects/VideoResourcesController.java b/src/main/java/com/zcloud/controller/keyProjects/VideoResourcesController.java index 659c68be..be66af4b 100644 --- a/src/main/java/com/zcloud/controller/keyProjects/VideoResourcesController.java +++ b/src/main/java/com/zcloud/controller/keyProjects/VideoResourcesController.java @@ -1,8 +1,12 @@ package com.zcloud.controller.keyProjects; +import cn.hutool.core.collection.CollUtil; +import com.alibaba.druid.util.StringUtils; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; +import com.zcloud.service.keyProjects.OutSourcedService; +import com.zcloud.service.keyProjects.VideoManagerService; import com.zcloud.service.keyProjects.VideoResourcesService; import com.zcloud.util.DateUtil; import com.zcloud.util.Jurisdiction; @@ -13,10 +17,8 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * 说明:视频管理 @@ -31,6 +33,12 @@ public class VideoResourcesController extends BaseController { @Autowired private VideoResourcesService videoResourcesService; + @Autowired + private VideoManagerService videoManagerService; + + @Autowired + private OutSourcedService outSourcedService; + /** * 新增 * @@ -190,4 +198,39 @@ public class VideoResourcesController extends BaseController { } + /** + * 通过摄像头查询绑定的重点工程数据 + */ + @RequestMapping("/getRelevanceOutsourced") + @ResponseBody + public Object getRelevanceOutsourced() throws Exception { + Map map = new HashMap<>(); + String errInfo = "success"; + List outsourcedList = Collections.emptyList(); + // 获取该摄像头绑定的重点工程ID列表 + List outsourcedIds = videoManagerService.findRepeatOutSourcedIdByVideoId(this.getPageData()); + // 非空判断 + if (CollUtil.isNotEmpty(outsourcedIds)){ + // 通过Ids查询重点工程数据 + outsourcedList = outSourcedService.listOutSourcedByIds(outsourcedIds.stream().map(e -> e.getString("OUTSOURCED_ID")).collect(Collectors.toList())) + .stream().map(e -> { + // 遍历带有"VIDEOMANAGER_ID"的列表 + outsourcedIds.forEach( + m -> { + if (StringUtils.equals(m.getString("OUTSOURCED_ID"), e.getString("OUTSOURCED_ID"))){ + // 补全信息 + e.put("VIDEOMANAGER_ID", m.getString("VIDEOMANAGER_ID")); + } + } + ); + return e; + }) + .collect(Collectors.toList()); + } + + map.put("varList", outsourcedList); + map.put("result", errInfo); + return map; + } + } diff --git a/src/main/java/com/zcloud/mapper/dsno2/keyProjects/OutSourcedMapper.java b/src/main/java/com/zcloud/mapper/dsno2/keyProjects/OutSourcedMapper.java index 063dfe83..9bed788f 100644 --- a/src/main/java/com/zcloud/mapper/dsno2/keyProjects/OutSourcedMapper.java +++ b/src/main/java/com/zcloud/mapper/dsno2/keyProjects/OutSourcedMapper.java @@ -91,5 +91,7 @@ public interface OutSourcedMapper{ List listForCount(PageData pd); + + List listOutSourcedByIds(List ids); } diff --git a/src/main/java/com/zcloud/mapper/dsno2/keyProjects/VideoManagerMapper.java b/src/main/java/com/zcloud/mapper/dsno2/keyProjects/VideoManagerMapper.java index 8215607b..3844ae30 100644 --- a/src/main/java/com/zcloud/mapper/dsno2/keyProjects/VideoManagerMapper.java +++ b/src/main/java/com/zcloud/mapper/dsno2/keyProjects/VideoManagerMapper.java @@ -77,5 +77,7 @@ public interface VideoManagerMapper { void updateAiByOUTSOURCED_ID(PageData pd); List dataApplistPage(Page page); + + List findRepeatOutSourcedIdByVideoId(PageData video); } diff --git a/src/main/java/com/zcloud/service/keyProjects/OutSourcedService.java b/src/main/java/com/zcloud/service/keyProjects/OutSourcedService.java index 663b85fb..664892d3 100644 --- a/src/main/java/com/zcloud/service/keyProjects/OutSourcedService.java +++ b/src/main/java/com/zcloud/service/keyProjects/OutSourcedService.java @@ -93,5 +93,7 @@ public interface OutSourcedService{ List listForCount(PageData pd); + + List listOutSourcedByIds(List ids); } diff --git a/src/main/java/com/zcloud/service/keyProjects/VideoManagerService.java b/src/main/java/com/zcloud/service/keyProjects/VideoManagerService.java index 4b7c0f25..3192b5ab 100644 --- a/src/main/java/com/zcloud/service/keyProjects/VideoManagerService.java +++ b/src/main/java/com/zcloud/service/keyProjects/VideoManagerService.java @@ -75,5 +75,7 @@ public interface VideoManagerService { void updateAiByOUTSOURCED_ID(PageData pd); List listApp(Page page); + + List findRepeatOutSourcedIdByVideoId(PageData video)throws Exception; } diff --git a/src/main/java/com/zcloud/service/keyProjects/impl/OutSourcedServiceImpl.java b/src/main/java/com/zcloud/service/keyProjects/impl/OutSourcedServiceImpl.java index 9516a978..a52c36f5 100644 --- a/src/main/java/com/zcloud/service/keyProjects/impl/OutSourcedServiceImpl.java +++ b/src/main/java/com/zcloud/service/keyProjects/impl/OutSourcedServiceImpl.java @@ -121,5 +121,9 @@ public class OutSourcedServiceImpl implements OutSourcedService { public List listForCount(PageData pd) { return outsourcedMapper.listForCount(pd); } + + public List listOutSourcedByIds(List ids){ + return outsourcedMapper.listOutSourcedByIds(ids); + } } diff --git a/src/main/java/com/zcloud/service/keyProjects/impl/VideoManagerServiceImpl.java b/src/main/java/com/zcloud/service/keyProjects/impl/VideoManagerServiceImpl.java index b0dfdba5..4e6f534d 100644 --- a/src/main/java/com/zcloud/service/keyProjects/impl/VideoManagerServiceImpl.java +++ b/src/main/java/com/zcloud/service/keyProjects/impl/VideoManagerServiceImpl.java @@ -126,5 +126,10 @@ public class VideoManagerServiceImpl implements VideoManagerService { public List listApp(Page page) { return videomanagerMapper.dataApplistPage(page); } + + @Override + public List findRepeatOutSourcedIdByVideoId(PageData video)throws Exception{ + return videomanagerMapper.findRepeatOutSourcedIdByVideoId(video); + } } diff --git a/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml b/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml index 45a9e11f..5e2d3e6d 100644 --- a/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml +++ b/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml @@ -955,4 +955,17 @@ and vac.CORPINFO_ID = #{CORPINFO_ID} + + + diff --git a/src/main/resources/mybatis/dsno2/keyProjects/VideoManagerMapper.xml b/src/main/resources/mybatis/dsno2/keyProjects/VideoManagerMapper.xml index d02004c1..eec18ac6 100644 --- a/src/main/resources/mybatis/dsno2/keyProjects/VideoManagerMapper.xml +++ b/src/main/resources/mybatis/dsno2/keyProjects/VideoManagerMapper.xml @@ -312,4 +312,25 @@ ) + + +