From 5e724cc0628554b949f0102bee6294db8a23c7f5 Mon Sep 17 00:00:00 2001
From: wangyimeng <421132955@qq.com>
Date: 星期三, 06 七月 2022 15:33:43 +0800
Subject: [PATCH] Merge branch 'wvp-28181-2.0' of https://github.com/mrjackwang/wvp-GB28181-pro into wvp-28181-2.0
---
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java | 34 ++++++++++++++++++++++++++++------
1 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
index 1f35911..9a5be6e 100644
--- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
@@ -25,12 +25,13 @@
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
-/**
+/**
* 瑙嗛璁惧鏁版嵁瀛樺偍-jdbc瀹炵幇
* swwheihei
* 2020骞�5鏈�6鏃� 涓嬪崍2:31:42
@@ -195,7 +196,7 @@
@Override
public boolean resetChannels(String deviceId, List<DeviceChannel> deviceChannelList) {
- if (deviceChannelList == null) {
+ if (CollectionUtils.isEmpty(deviceChannelList)) {
return false;
}
List<DeviceChannel> allChannelInPlay = deviceChannelMapper.getAllChannelInPlay();
@@ -245,6 +246,10 @@
}
if (stringBuilder.length() > 0) {
logger.info("[鐩綍鏌ヨ]鏀跺埌鐨勬暟鎹瓨鍦ㄩ噸澶嶏細 {}" , stringBuilder);
+ }
+ if(CollectionUtils.isEmpty(channels)){
+ logger.info("閫氶亾閲嶈锛屾暟鎹负绌�={}" , deviceChannelList);
+ return false;
}
try {
int cleanChannelsResult = deviceChannelMapper.cleanChannelsNotInList(deviceId, channels);
@@ -315,6 +320,9 @@
List<DeviceChannel> all;
if (catalogUnderDevice != null && catalogUnderDevice) {
all = deviceChannelMapper.queryChannels(deviceId, deviceId, query, hasSubChannel, online);
+ // 娴峰悍璁惧鐨刾arentId鏄疭IP id
+ List<DeviceChannel> deviceChannels = deviceChannelMapper.queryChannels(deviceId, sipConfig.getId(), query, hasSubChannel, online);
+ all.addAll(deviceChannels);
}else {
all = deviceChannelMapper.queryChannels(deviceId, null, query, hasSubChannel, online);
}
@@ -464,6 +472,9 @@
*/
@Override
public synchronized boolean insertMobilePosition(MobilePosition mobilePosition) {
+ if (mobilePosition.getDeviceId().equals(mobilePosition.getChannelId())) {
+ mobilePosition.setChannelId(null);
+ }
return deviceMobilePositionMapper.insertNewPosition(mobilePosition) > 0;
}
@@ -703,7 +714,6 @@
streamProxyItem.setStatus(true);
String now = DateUtil.getNow();
streamProxyItem.setCreateTime(now);
- streamProxyItem.setCreateStamp(System.currentTimeMillis());
try {
if (streamProxyMapper.add(streamProxyItem) > 0) {
if (!StringUtils.isEmpty(streamProxyItem.getGbId())) {
@@ -877,6 +887,11 @@
}
@Override
+ public StreamPushItem getMedia(String app, String stream) {
+ return streamPushMapper.selectOne(app, stream);
+ }
+
+ @Override
public void clearMediaList() {
streamPushMapper.clear();
}
@@ -993,7 +1008,7 @@
@Override
public int setDefaultCatalog(String platformId, String catalogId) {
- return platformMapper.setDefaultCatalog(platformId, catalogId);
+ return platformMapper.setDefaultCatalog(platformId, catalogId, DateUtil.getNow());
}
@Override
@@ -1106,7 +1121,14 @@
}
@Override
- public void updateChannelPotion(String deviceId, String channelId, double longitude, double latitude) {
- deviceChannelMapper.updatePotion(deviceId, channelId, longitude, latitude);
+ public void updateChannelPosition(DeviceChannel deviceChannel) {
+ if (deviceChannel.getChannelId().equals(deviceChannel.getDeviceId())) {
+ deviceChannel.setChannelId(null);
+ }
+ if (deviceChannel.getGpsTime() == null) {
+ deviceChannel.setGpsTime(DateUtil.getNow());
+ }
+
+ deviceChannelMapper.updatePosition(deviceChannel);
}
}
--
Gitblit v1.8.0