From f6a88f721b58a8f97759c0c1542608ff68b0fb5c Mon Sep 17 00:00:00 2001
From: zhangjian <zhangjianrock@163.com>
Date: 星期二, 24 十月 2023 10:56:29 +0800
Subject: [PATCH] 视频巡检任务,加入通道管理
---
ard-work/src/main/java/com/ruoyi/device/camera/controller/ArdCamerasController.java | 3 ++-
ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java | 22 +++++++++++++++-------
2 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/device/camera/controller/ArdCamerasController.java b/ard-work/src/main/java/com/ruoyi/device/camera/controller/ArdCamerasController.java
index 4a4976e..afbee07 100644
--- a/ard-work/src/main/java/com/ruoyi/device/camera/controller/ArdCamerasController.java
+++ b/ard-work/src/main/java/com/ruoyi/device/camera/controller/ArdCamerasController.java
@@ -143,12 +143,13 @@
@ApiOperation("閫夋嫨鐩告満鏁版嵁")
public List options(ArdCameras ardCameras) {
List<ArdCameras> list = ardCamerasService.findOptions(ardCameras);
+ System.out.println("list:"+list.size());
List options = new ArrayList();
for (ArdCameras item : list) {
Map option = new HashMap();
option.put("value", item.getId());
option.put("label", item.getName());
- option.put("channel", item.getChanNo());
+ option.put("channelList", item.getChannelList());
List timeList = ardVideoInspectTaskService.getCameraIdleTimeList(item.getId());
option.put("idleTimeList", timeList);//绌洪棽鏃堕棿娈�
options.add(option);
diff --git a/ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java b/ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java
index 4de42aa..22b1c04 100644
--- a/ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java
@@ -84,12 +84,12 @@
public ArdCameras selectArdCamerasById(String id) {
ArdCameras ardCameras = ardCamerasMapper.selectArdCamerasById(id);
if (ardCameras != null) {
- ArdChannel ardChannel = new ArdChannel();
- ardChannel.setDeviceId(ardCameras.getId());
- List<ArdChannel> ardChannels = ardChannelMapper.selectArdChannelList(ardChannel);
- if (ardChannels != null) {
- ardCameras.setChannelList(ardChannels);
- }
+ ArdChannel ardChannel = new ArdChannel();
+ ardChannel.setDeviceId(ardCameras.getId());
+ List<ArdChannel> ardChannels = ardChannelMapper.selectArdChannelList(ardChannel);
+ if (ardChannels != null) {
+ ardCameras.setChannelList(ardChannels);
+ }
}
return ardCameras;
}
@@ -199,7 +199,15 @@
}
public List findOptions(ArdCameras ardCameras) {
- return ardCamerasMapper.findOptions(ardCameras);
+ List<ArdCameras> options = ardCamerasMapper.findOptions(ardCameras);
+ for (ArdCameras camera :
+ options) {
+ ArdChannel ardChannel = new ArdChannel();
+ ardChannel.setDeviceId(camera.getId());
+ List<ArdChannel> ardChannels = ardChannelMapper.selectArdChannelList(ardChannel);
+ camera.setChannelList(ardChannels);
+ }
+ return options;
}
/**
--
Gitblit v1.9.3