From b89af9a6936f15044a5d8f568ab691f796cfbec2 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期三, 24 四月 2024 20:51:28 +0800
Subject: [PATCH] Merge branch 'refs/heads/2.7.0'
---
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java | 5
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java | 203 ++++++++++++++++--
src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java | 4
src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java | 18 +
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForMobilePositionProcessor.java | 31 ++
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java | 390 ++++++++--------------------------
6 files changed, 320 insertions(+), 331 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java
index 8290a45..6e230af 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java
@@ -535,11 +535,11 @@
this.subCount = subCount;
}
- public boolean isHasAudio() {
+ public Boolean getHasAudio() {
return hasAudio;
}
- public void setHasAudio(boolean hasAudio) {
+ public void setHasAudio(Boolean hasAudio) {
this.hasAudio = hasAudio;
}
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java
index de93804..6185cda 100755
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java
@@ -1,9 +1,11 @@
package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl;
+import com.genersoft.iot.vmp.conf.DynamicTask;
import com.genersoft.iot.vmp.conf.SipConfig;
import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
+import com.genersoft.iot.vmp.gb28181.bean.HandlerCatchData;
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
@@ -17,15 +19,18 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.sip.RequestEvent;
import javax.sip.header.FromHeader;
+import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.CopyOnWriteArrayList;
/**
@@ -37,11 +42,14 @@
private final static Logger logger = LoggerFactory.getLogger(NotifyRequestForCatalogProcessor.class);
+ private final List<DeviceChannel> updateChannelOnlineList = new CopyOnWriteArrayList<>();
+ private final List<DeviceChannel> updateChannelOfflineList = new CopyOnWriteArrayList<>();
private final Map<String, DeviceChannel> updateChannelMap = new ConcurrentHashMap<>();
private final Map<String, DeviceChannel> addChannelMap = new ConcurrentHashMap<>();
private final List<DeviceChannel> deleteChannelList = new CopyOnWriteArrayList<>();
+ private ConcurrentLinkedQueue<HandlerCatchData> taskQueue = new ConcurrentLinkedQueue<>();
@Autowired
private UserSetting userSetting;
@@ -56,14 +64,30 @@
private IDeviceChannelService deviceChannelService;
@Autowired
+ private DynamicTask dynamicTask;
+
+ @Autowired
private SipConfig sipConfig;
@Transactional
- public void process(List<RequestEvent> evtList) {
- if (evtList.isEmpty()) {
+ public void process(RequestEvent evt) {
+ if (taskQueue.size() >= userSetting.getMaxNotifyCountQueue()) {
+ logger.error("[notify-鐩綍璁㈤槄] 寰呭鐞嗘秷鎭槦鍒楀凡婊� {}锛岃繑鍥�486 BUSY_HERE锛屾秷鎭笉鍋氬鐞�", userSetting.getMaxNotifyCountQueue());
return;
}
- for (RequestEvent evt : evtList) {
+ taskQueue.offer(new HandlerCatchData(evt, null, null));
+ }
+
+ @Scheduled(fixedRate = 400) //姣�400姣鎵ц涓�娆�
+ public void executeTaskQueue(){
+ if (taskQueue.isEmpty()) {
+ return;
+ }
+ for (HandlerCatchData take : taskQueue) {
+ if (take == null) {
+ continue;
+ }
+ RequestEvent evt = take.getEvt();
try {
long start = System.currentTimeMillis();
FromHeader fromHeader = (FromHeader) evt.getRequest().getHeader(FromHeader.NAME);
@@ -71,7 +95,7 @@
Device device = redisCatchStorage.getDevice(deviceId);
if (device == null || !device.isOnLine()) {
- logger.warn("[鏀跺埌鐩綍璁㈤槄]锛歿}, 浣嗘槸璁惧宸茬粡绂荤嚎", (device != null ? device.getDeviceId():"" ));
+ logger.warn("[鏀跺埌鐩綍璁㈤槄]锛歿}, 浣嗘槸璁惧宸茬粡绂荤嚎", (device != null ? device.getDeviceId() : ""));
return;
}
Element rootElement = getRootElement(evt, device.getCharset());
@@ -92,9 +116,9 @@
Element eventElement = itemDevice.element("Event");
String event;
if (eventElement == null) {
- logger.warn("[鏀跺埌鐩綍璁㈤槄]锛歿}, 浣嗘槸Event涓虹┖, 璁句负榛樿鍊� ADD", (device != null ? device.getDeviceId():"" ));
+ logger.warn("[鏀跺埌鐩綍璁㈤槄]锛歿}, 浣嗘槸Event涓虹┖, 璁句负榛樿鍊� ADD", (device != null ? device.getDeviceId() : ""));
event = CatalogEvent.ADD;
- }else {
+ } else {
event = eventElement.getText().toUpperCase();
}
DeviceChannel channel = XmlUtil.channelContentHandler(itemDevice, device, event);
@@ -106,60 +130,193 @@
channel.setParentId(null);
}
channel.setDeviceId(device.getDeviceId());
- logger.info("[鏀跺埌鐩綍璁㈤槄]锛歿}, {}/{}",event, device.getDeviceId(), channel.getChannelId());
+ logger.info("[鏀跺埌鐩綍璁㈤槄]锛歿}/{}", device.getDeviceId(), channel.getChannelId());
switch (event) {
case CatalogEvent.ON:
// 涓婄嚎
- deviceChannelService.online(channel);
+ logger.info("[鏀跺埌閫氶亾涓婄嚎閫氱煡] 鏉ヨ嚜璁惧: {}, 閫氶亾 {}", device.getDeviceId(), channel.getChannelId());
+ updateChannelOnlineList.add(channel);
if (userSetting.getDeviceStatusNotify()) {
// 鍙戦�乺edis娑堟伅
redisCatchStorage.sendDeviceOrChannelStatus(device.getDeviceId(), channel.getChannelId(), true);
}
-
break;
- case CatalogEvent.OFF :
- case CatalogEvent.VLOST:
- case CatalogEvent.DEFECT:
+ case CatalogEvent.OFF:
// 绂荤嚎
+ logger.info("[鏀跺埌閫氶亾绂荤嚎閫氱煡] 鏉ヨ嚜璁惧: {}, 閫氶亾 {}", device.getDeviceId(), channel.getChannelId());
if (userSetting.getRefuseChannelStatusChannelFormNotify()) {
- logger.info("[鐩綍璁㈤槄] 绂荤嚎 浣嗘槸骞冲彴宸查厤缃嫆缁濇娑堟伅锛屾潵鑷澶�: {}, 閫氶亾 {}", device.getDeviceId(), channel.getChannelId());
- }else {
- deviceChannelService.offline(channel);
+ logger.info("[鏀跺埌閫氶亾绂荤嚎閫氱煡] 浣嗘槸骞冲彴宸查厤缃嫆缁濇娑堟伅锛屾潵鑷澶�: {}, 閫氶亾 {}", device.getDeviceId(), channel.getChannelId());
+ } else {
+ updateChannelOfflineList.add(channel);
if (userSetting.getDeviceStatusNotify()) {
// 鍙戦�乺edis娑堟伅
redisCatchStorage.sendDeviceOrChannelStatus(device.getDeviceId(), channel.getChannelId(), false);
}
}
break;
+ case CatalogEvent.VLOST:
+ // 瑙嗛涓㈠け
+ logger.info("[鏀跺埌閫氶亾瑙嗛涓㈠け閫氱煡] 鏉ヨ嚜璁惧: {}, 閫氶亾 {}", device.getDeviceId(), channel.getChannelId());
+ if (userSetting.getRefuseChannelStatusChannelFormNotify()) {
+ logger.info("[鏀跺埌閫氶亾瑙嗛涓㈠け閫氱煡] 浣嗘槸骞冲彴宸查厤缃嫆缁濇娑堟伅锛屾潵鑷澶�: {}, 閫氶亾 {}", device.getDeviceId(), channel.getChannelId());
+ } else {
+ updateChannelOfflineList.add(channel);
+ if (userSetting.getDeviceStatusNotify()) {
+ // 鍙戦�乺edis娑堟伅
+ redisCatchStorage.sendDeviceOrChannelStatus(device.getDeviceId(), channel.getChannelId(), false);
+ }
+ }
+ break;
+ case CatalogEvent.DEFECT:
+ // 鏁呴殰
+ logger.info("[鏀跺埌閫氶亾瑙嗛鏁呴殰閫氱煡] 鏉ヨ嚜璁惧: {}, 閫氶亾 {}", device.getDeviceId(), channel.getChannelId());
+ if (userSetting.getRefuseChannelStatusChannelFormNotify()) {
+ logger.info("[鏀跺埌閫氶亾瑙嗛鏁呴殰閫氱煡] 浣嗘槸骞冲彴宸查厤缃嫆缁濇娑堟伅锛屾潵鑷澶�: {}, 閫氶亾 {}", device.getDeviceId(), channel.getChannelId());
+ } else {
+ updateChannelOfflineList.add(channel);
+ if (userSetting.getDeviceStatusNotify()) {
+ // 鍙戦�乺edis娑堟伅
+ redisCatchStorage.sendDeviceOrChannelStatus(device.getDeviceId(), channel.getChannelId(), false);
+ }
+ }
+ break;
+ case CatalogEvent.ADD:
+ // 澧炲姞
+ logger.info("[鏀跺埌澧炲姞閫氶亾閫氱煡] 鏉ヨ嚜璁惧: {}, 閫氶亾 {}", device.getDeviceId(), channel.getChannelId());
+ // 鍒ゆ柇姝ら�氶亾鏄惁瀛樺湪
+ DeviceChannel deviceChannel = deviceChannelService.getOne(deviceId, channel.getChannelId());
+ if (deviceChannel != null) {
+ logger.info("[澧炲姞閫氶亾] 宸插瓨鍦紝涓嶅彂閫侀�氱煡鍙洿鏂帮紝璁惧: {}, 閫氶亾 {}", device.getDeviceId(), channel.getChannelId());
+ channel.setId(deviceChannel.getId());
+ channel.setHasAudio(null);
+ updateChannelMap.put(channel.getChannelId(), channel);
+ } else {
+ addChannelMap.put(channel.getChannelId(), channel);
+ if (userSetting.getDeviceStatusNotify()) {
+ // 鍙戦�乺edis娑堟伅
+ redisCatchStorage.sendChannelAddOrDelete(device.getDeviceId(), channel.getChannelId(), true);
+ }
+ }
+
+ break;
case CatalogEvent.DEL:
// 鍒犻櫎
- deviceChannelService.delete(channel);
+ logger.info("[鏀跺埌鍒犻櫎閫氶亾閫氱煡] 鏉ヨ嚜璁惧: {}, 閫氶亾 {}", device.getDeviceId(), channel.getChannelId());
+ deleteChannelList.add(channel);
if (userSetting.getDeviceStatusNotify()) {
// 鍙戦�乺edis娑堟伅
redisCatchStorage.sendChannelAddOrDelete(device.getDeviceId(), channel.getChannelId(), false);
}
break;
- case CatalogEvent.ADD:
case CatalogEvent.UPDATE:
// 鏇存柊
- channel.setUpdateTime(DateUtil.getNow());
- deviceChannelService.updateChannel(deviceId,channel);
- if (userSetting.getDeviceStatusNotify()) {
- // 鍙戦�乺edis娑堟伅
- redisCatchStorage.sendChannelAddOrDelete(device.getDeviceId(), channel.getChannelId(), true);
+ logger.info("[鏀跺埌鏇存柊閫氶亾閫氱煡] 鏉ヨ嚜璁惧: {}, 閫氶亾 {}", device.getDeviceId(), channel.getChannelId());
+ // 鍒ゆ柇姝ら�氶亾鏄惁瀛樺湪
+ DeviceChannel deviceChannelForUpdate = deviceChannelService.getOne(deviceId, channel.getChannelId());
+ if (deviceChannelForUpdate != null) {
+ channel.setId(deviceChannelForUpdate.getId());
+ channel.setUpdateTime(DateUtil.getNow());
+ channel.setHasAudio(null);
+ updateChannelMap.put(channel.getChannelId(), channel);
+ } else {
+ addChannelMap.put(channel.getChannelId(), channel);
+ if (userSetting.getDeviceStatusNotify()) {
+ // 鍙戦�乺edis娑堟伅
+ redisCatchStorage.sendChannelAddOrDelete(device.getDeviceId(), channel.getChannelId(), true);
+ }
}
break;
default:
- logger.warn("[ NotifyCatalog ] event not found 锛� {}", event );
+ logger.warn("[ NotifyCatalog ] event not found 锛� {}", event);
}
// 杞彂鍙樺寲淇℃伅
eventPublisher.catalogEventPublish(null, channel, event);
}
}
+
} catch (DocumentException e) {
logger.error("鏈鐞嗙殑寮傚父 ", e);
}
}
+ taskQueue.clear();
+ if (!updateChannelMap.keySet().isEmpty()
+ || !addChannelMap.keySet().isEmpty()
+ || !updateChannelOnlineList.isEmpty()
+ || !updateChannelOfflineList.isEmpty()
+ || !deleteChannelList.isEmpty()) {
+ executeSave();
+ }
+ }
+
+ public void executeSave(){
+ try {
+ executeSaveForAdd();
+ } catch (Exception e) {
+ logger.error("[瀛樺偍鏀跺埌鐨勫鍔犻�氶亾] 寮傚父锛� ", e );
+ }
+ try {
+ executeSaveForOnline();
+ } catch (Exception e) {
+ logger.error("[瀛樺偍鏀跺埌鐨勯�氶亾涓婄嚎] 寮傚父锛� ", e );
+ }
+ try {
+ executeSaveForOffline();
+ } catch (Exception e) {
+ logger.error("[瀛樺偍鏀跺埌鐨勯�氶亾绂荤嚎] 寮傚父锛� ", e );
+ }
+ try {
+ executeSaveForUpdate();
+ } catch (Exception e) {
+ logger.error("[瀛樺偍鏀跺埌鐨勬洿鏂伴�氶亾] 寮傚父锛� ", e );
+ }
+ try {
+ executeSaveForDelete();
+ } catch (Exception e) {
+ logger.error("[瀛樺偍鏀跺埌鐨勫垹闄ら�氶亾] 寮傚父锛� ", e );
+ }
+ }
+
+ private void executeSaveForUpdate(){
+ if (!updateChannelMap.values().isEmpty()) {
+ logger.info("[瀛樺偍鏀跺埌鐨勬洿鏂伴�氶亾], 鏁伴噺锛� {}", updateChannelMap.size());
+ ArrayList<DeviceChannel> deviceChannels = new ArrayList<>(updateChannelMap.values());
+ deviceChannelService.batchUpdateChannel(deviceChannels);
+ updateChannelMap.clear();
+ }
+ }
+
+ private void executeSaveForAdd(){
+ if (!addChannelMap.values().isEmpty()) {
+ ArrayList<DeviceChannel> deviceChannels = new ArrayList<>(addChannelMap.values());
+ addChannelMap.clear();
+ deviceChannelService.batchAddChannel(deviceChannels);
+ }
+ }
+
+ private void executeSaveForDelete(){
+ if (!deleteChannelList.isEmpty()) {
+ deviceChannelService.deleteChannels(deleteChannelList);
+ deleteChannelList.clear();
+ }
+ }
+
+ private void executeSaveForOnline(){
+ if (!updateChannelOnlineList.isEmpty()) {
+ deviceChannelService.channelsOnline(updateChannelOnlineList);
+ updateChannelOnlineList.clear();
+ }
+ }
+
+ private void executeSaveForOffline(){
+ if (!updateChannelOfflineList.isEmpty()) {
+ deviceChannelService.channelsOffline(updateChannelOfflineList);
+ updateChannelOfflineList.clear();
+ }
+ }
+
+ @Scheduled(fixedRate = 10000) //姣�1绉掓墽琛屼竴娆�
+ public void execute(){
+ logger.info("[寰呭鐞哊otify-鐩綍璁㈤槄娑堟伅鏁伴噺]: {}", taskQueue.size());
}
}
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForMobilePositionProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForMobilePositionProcessor.java
index 05a5336..9f6acc9 100755
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForMobilePositionProcessor.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForMobilePositionProcessor.java
@@ -4,6 +4,7 @@
import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
+import com.genersoft.iot.vmp.gb28181.bean.HandlerCatchData;
import com.genersoft.iot.vmp.gb28181.bean.MobilePosition;
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
@@ -17,6 +18,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
@@ -27,6 +29,7 @@
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentLinkedQueue;
/**
* SIP鍛戒护绫诲瀷锛� NOTIFY璇锋眰涓殑绉诲姩浣嶇疆璇锋眰澶勭悊
@@ -37,6 +40,7 @@
private final static Logger logger = LoggerFactory.getLogger(NotifyRequestForMobilePositionProcessor.class);
+ private ConcurrentLinkedQueue<HandlerCatchData> taskQueue = new ConcurrentLinkedQueue<>();
@Autowired
private UserSetting userSetting;
@@ -50,14 +54,28 @@
@Autowired
private IDeviceChannelService deviceChannelService;
+ public void process(RequestEvent evt) {
+
+ if (taskQueue.size() >= userSetting.getMaxNotifyCountQueue()) {
+ logger.error("[notify-绉诲姩浣嶇疆] 寰呭鐞嗘秷鎭槦鍒楀凡婊� {}锛岃繑鍥�486 BUSY_HERE锛屾秷鎭笉鍋氬鐞�", userSetting.getMaxNotifyCountQueue());
+ return;
+ }
+ taskQueue.offer(new HandlerCatchData(evt, null, null));
+ }
+
+ @Scheduled(fixedRate = 200) //姣�200姣鎵ц涓�娆�
@Transactional
- public void process(List<RequestEvent> eventList) {
- if (eventList.isEmpty()) {
+ public void executeTaskQueue() {
+ if (taskQueue.isEmpty()) {
return;
}
Map<String, DeviceChannel> updateChannelMap = new ConcurrentHashMap<>();
List<MobilePosition> addMobilePositionList = new ArrayList<>();
- for (RequestEvent evt : eventList) {
+ for (HandlerCatchData take : taskQueue) {
+ if (take == null) {
+ continue;
+ }
+ RequestEvent evt = take.getEvt();
try {
FromHeader fromHeader = (FromHeader) evt.getRequest().getHeader(FromHeader.NAME);
String deviceId = SipUtils.getUserIdFromFromHeader(fromHeader);
@@ -180,10 +198,11 @@
logger.error("鏈鐞嗙殑寮傚父 ", e);
}
}
+ taskQueue.clear();
if(!updateChannelMap.isEmpty()) {
List<DeviceChannel> channels = new ArrayList<>(updateChannelMap.values());
logger.info("[绉诲姩浣嶇疆璁㈤槄]鏇存柊閫氶亾浣嶇疆锛� {}", channels.size());
- deviceChannelService.batchUpdateChannelGPS(channels);
+ deviceChannelService.batchUpdateChannel(channels);
updateChannelMap.clear();
}
if (userSetting.isSavePositionHistory() && !addMobilePositionList.isEmpty()) {
@@ -196,4 +215,8 @@
addMobilePositionList.clear();
}
}
+ @Scheduled(fixedRate = 10000)
+ public void execute(){
+ logger.info("[寰呭鐞哊otify-绉诲姩浣嶇疆璁㈤槄娑堟伅鏁伴噺]: {}", taskQueue.size());
+ }
}
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java
index 8a42624..8da07a1 100755
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java
@@ -1,12 +1,9 @@
package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl;
import com.genersoft.iot.vmp.conf.SipConfig;
-import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.gb28181.bean.*;
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
-import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
-import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
import com.genersoft.iot.vmp.gb28181.utils.NumericUtil;
@@ -14,9 +11,7 @@
import com.genersoft.iot.vmp.gb28181.utils.XmlUtil;
import com.genersoft.iot.vmp.service.IDeviceChannelService;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
-import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
import com.genersoft.iot.vmp.utils.DateUtil;
-import com.genersoft.iot.vmp.utils.redis.RedisUtil;
import gov.nist.javax.sip.message.SIPRequest;
import org.dom4j.DocumentException;
import org.dom4j.Element;
@@ -24,12 +19,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Component;
-import org.springframework.util.ObjectUtils;
import javax.sip.InvalidArgumentException;
import javax.sip.RequestEvent;
@@ -37,9 +27,6 @@
import javax.sip.header.FromHeader;
import javax.sip.message.Response;
import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ConcurrentLinkedQueue;
/**
* SIP鍛戒护绫诲瀷锛� NOTIFY璇锋眰,杩欐槸浣滀负涓婄骇鍙戦�佽闃呰姹傚悗锛岃澶囨墠浼氬搷搴旂殑
@@ -49,15 +36,6 @@
private final static Logger logger = LoggerFactory.getLogger(NotifyRequestProcessor.class);
-
- @Autowired
- private UserSetting userSetting;
-
- @Autowired
- private IVideoManagerStorage storager;
-
- @Autowired
- private EventPublisher eventPublisher;
@Autowired
private SipConfig sipConfig;
@@ -82,14 +60,6 @@
@Autowired
private NotifyRequestForMobilePositionProcessor notifyRequestForMobilePositionProcessor;
- private ConcurrentLinkedQueue<HandlerCatchData> taskQueue = new ConcurrentLinkedQueue<>();
-
- @Qualifier("taskExecutor")
- @Autowired
- private ThreadPoolTaskExecutor taskExecutor;
-
- private int maxQueueCount = 30000;
-
@Override
public void afterPropertiesSet() throws Exception {
// 娣诲姞娑堟伅澶勭悊鐨勮闃�
@@ -99,290 +69,122 @@
@Override
public void process(RequestEvent evt) {
try {
- if (taskQueue.size() >= userSetting.getMaxNotifyCountQueue()) {
- responseAck((SIPRequest) evt.getRequest(), Response.BUSY_HERE, null, null);
- logger.error("[notify] 寰呭鐞嗘秷鎭槦鍒楀凡婊� {}锛岃繑鍥�486 BUSY_HERE锛屾秷鎭笉鍋氬鐞�", userSetting.getMaxNotifyCountQueue());
- return;
- } else {
- responseAck((SIPRequest) evt.getRequest(), Response.OK, null, null);
- }
-
- } catch (SipException | InvalidArgumentException | ParseException e) {
- logger.error("鏈鐞嗙殑寮傚父 ", e);
- }
- boolean runed = !taskQueue.isEmpty();
- taskQueue.offer(new HandlerCatchData(evt, null, null));
- }
- @Scheduled(fixedRate = 200) //姣�200姣鎵ц涓�娆�
- public void executeTaskQueue(){
- if (taskQueue.isEmpty()) {
- return;
- }
- try {
- List<RequestEvent> catalogEventList = new ArrayList<>();
- List<RequestEvent> alarmEventList = new ArrayList<>();
- List<RequestEvent> mobilePositionEventList = new ArrayList<>();
- for (HandlerCatchData take : taskQueue) {
- if (take == null) {
- continue;
- }
- Element rootElement = getRootElement(take.getEvt());
- if (rootElement == null) {
- logger.error("澶勭悊NOTIFY娑堟伅鏃舵湭鑾峰彇鍒版秷鎭綋,{}", take.getEvt().getRequest());
- continue;
- }
- String cmd = XmlUtil.getText(rootElement, "CmdType");
-
- if (CmdType.CATALOG.equals(cmd)) {
- catalogEventList.add(take.getEvt());
- } else if (CmdType.ALARM.equals(cmd)) {
- alarmEventList.add(take.getEvt());
- } else if (CmdType.MOBILE_POSITION.equals(cmd)) {
- mobilePositionEventList.add(take.getEvt());
- } else {
- logger.info("鎺ユ敹鍒版秷鎭細" + cmd);
- }
- }
- taskQueue.clear();
- if (!alarmEventList.isEmpty()) {
- processNotifyAlarm(alarmEventList);
- }
- if (!catalogEventList.isEmpty()) {
- notifyRequestForCatalogProcessor.process(catalogEventList);
- }
- if (!mobilePositionEventList.isEmpty()) {
- notifyRequestForMobilePositionProcessor.process(mobilePositionEventList);
- }
- } catch (DocumentException e) {
- logger.error("澶勭悊NOTIFY娑堟伅鏃堕敊璇�", e);
- }
- }
-
-
-
- /**
- * 澶勭悊MobilePosition绉诲姩浣嶇疆Notify
- *
- * @param evt
- */
- @Async("taskExecutor")
- public void processNotifyMobilePosition(RequestEvent evt) {
- try {
- FromHeader fromHeader = (FromHeader) evt.getRequest().getHeader(FromHeader.NAME);
- String deviceId = SipUtils.getUserIdFromFromHeader(fromHeader);
- // 鍥炲 200 OK
+ responseAck((SIPRequest) evt.getRequest(), Response.OK, null, null);
Element rootElement = getRootElement(evt);
if (rootElement == null) {
- logger.error("澶勭悊MobilePosition绉诲姩浣嶇疆Notify鏃舵湭鑾峰彇鍒版秷鎭綋,{}", evt.getRequest());
+ logger.error("澶勭悊NOTIFY娑堟伅鏃舵湭鑾峰彇鍒版秷鎭綋,{}", evt.getRequest());
+ responseAck((SIPRequest) evt.getRequest(), Response.OK, null, null);
return;
}
+ String cmd = XmlUtil.getText(rootElement, "CmdType");
- MobilePosition mobilePosition = new MobilePosition();
- mobilePosition.setCreateTime(DateUtil.getNow());
-
- Element deviceIdElement = rootElement.element("DeviceID");
- String channelId = deviceIdElement.getTextTrim().toString();
- Device device = redisCatchStorage.getDevice(deviceId);
-
- if (device == null) {
- device = redisCatchStorage.getDevice(channelId);
- if (device == null) {
- // 鏍规嵁閫氶亾id鏌ヨ璁惧Id
- List<Device> deviceList = deviceChannelService.getDeviceByChannelId(channelId);
- if (deviceList.size() > 0) {
- device = deviceList.get(0);
- }
- }
- }
- if (device == null) {
- logger.warn("[mobilePosition绉诲姩浣嶇疆Notify] 鏈壘鍒伴�氶亾{}鎵�灞炵殑璁惧", channelId);
- return;
- }
- // 鍏煎璁惧閮ㄥ垎璁惧涓婃姤鏄�氶亾缂栧彿涓庤澶囩紪鍙蜂竴鑷寸殑鎯呭喌
- if(deviceId.equals(channelId)) {
- List<DeviceChannel> deviceChannels = deviceChannelService.queryChaneListByDeviceId(deviceId);
- if (deviceChannels.size() == 1) {
- channelId = deviceChannels.get(0).getChannelId();
- }
- }
- if (!ObjectUtils.isEmpty(device.getName())) {
- mobilePosition.setDeviceName(device.getName());
- }
-
- mobilePosition.setDeviceId(device.getDeviceId());
- mobilePosition.setChannelId(channelId);
- String time = XmlUtil.getText(rootElement, "Time");
- if (ObjectUtils.isEmpty(time)){
- mobilePosition.setTime(DateUtil.getNow());
- }else {
- mobilePosition.setTime(SipUtils.parseTime(time));
- }
-
- mobilePosition.setLongitude(Double.parseDouble(XmlUtil.getText(rootElement, "Longitude")));
- mobilePosition.setLatitude(Double.parseDouble(XmlUtil.getText(rootElement, "Latitude")));
- if (NumericUtil.isDouble(XmlUtil.getText(rootElement, "Speed"))) {
- mobilePosition.setSpeed(Double.parseDouble(XmlUtil.getText(rootElement, "Speed")));
+ if (CmdType.CATALOG.equals(cmd)) {
+ notifyRequestForCatalogProcessor.process(evt);
+ } else if (CmdType.ALARM.equals(cmd)) {
+ processNotifyAlarm(evt);
+ } else if (CmdType.MOBILE_POSITION.equals(cmd)) {
+ notifyRequestForMobilePositionProcessor.process(evt);
} else {
- mobilePosition.setSpeed(0.0);
+ logger.info("鎺ユ敹鍒版秷鎭細" + cmd);
}
- if (NumericUtil.isDouble(XmlUtil.getText(rootElement, "Direction"))) {
- mobilePosition.setDirection(Double.parseDouble(XmlUtil.getText(rootElement, "Direction")));
- } else {
- mobilePosition.setDirection(0.0);
- }
- if (NumericUtil.isDouble(XmlUtil.getText(rootElement, "Altitude"))) {
- mobilePosition.setAltitude(Double.parseDouble(XmlUtil.getText(rootElement, "Altitude")));
- } else {
- mobilePosition.setAltitude(0.0);
- }
-// logger.info("[鏀跺埌绉诲姩浣嶇疆璁㈤槄閫氱煡]锛歿}/{}->{}.{}", mobilePosition.getDeviceId(), mobilePosition.getChannelId(),
-// mobilePosition.getLongitude(), mobilePosition.getLatitude());
- mobilePosition.setReportSource("Mobile Position");
-
- // 鏇存柊device channel 鐨勭粡绾害
- DeviceChannel deviceChannel = new DeviceChannel();
- deviceChannel.setDeviceId(device.getDeviceId());
- deviceChannel.setChannelId(channelId);
- deviceChannel.setLongitude(mobilePosition.getLongitude());
- deviceChannel.setLatitude(mobilePosition.getLatitude());
- deviceChannel.setGpsTime(mobilePosition.getTime());
-// deviceChannel = deviceChannelService.updateGps(deviceChannel, device);
-//
-// mobilePosition.setLongitudeWgs84(deviceChannel.getLongitudeWgs84());
-// mobilePosition.setLatitudeWgs84(deviceChannel.getLatitudeWgs84());
-// mobilePosition.setLongitudeGcj02(deviceChannel.getLongitudeGcj02());
-// mobilePosition.setLatitudeGcj02(deviceChannel.getLatitudeGcj02());
-
- deviceChannelService.updateChannelGPS(device, deviceChannel, mobilePosition);
-
- } catch (DocumentException e) {
+ } catch (SipException | InvalidArgumentException | ParseException e) {
logger.error("鏈鐞嗙殑寮傚父 ", e);
+ } catch (DocumentException e) {
+ throw new RuntimeException(e);
}
- }
+ }
/***
* 澶勭悊alarm璁惧鎶ヨNotify
*/
- private void processNotifyAlarm(List<RequestEvent> evtList) {
+ private void processNotifyAlarm(RequestEvent evt) {
if (!sipConfig.isAlarm()) {
return;
}
- if (!evtList.isEmpty()) {
- for (RequestEvent evt : evtList) {
- try {
- FromHeader fromHeader = (FromHeader) evt.getRequest().getHeader(FromHeader.NAME);
- String deviceId = SipUtils.getUserIdFromFromHeader(fromHeader);
+ try {
+ FromHeader fromHeader = (FromHeader) evt.getRequest().getHeader(FromHeader.NAME);
+ String deviceId = SipUtils.getUserIdFromFromHeader(fromHeader);
- Element rootElement = getRootElement(evt);
- if (rootElement == null) {
- logger.error("澶勭悊alarm璁惧鎶ヨNotify鏃舵湭鑾峰彇鍒版秷鎭綋{}", evt.getRequest());
- return;
- }
- Element deviceIdElement = rootElement.element("DeviceID");
- String channelId = deviceIdElement.getText().toString();
-
- Device device = redisCatchStorage.getDevice(deviceId);
- if (device == null) {
- logger.warn("[ NotifyAlarm ] 鏈壘鍒拌澶囷細{}", deviceId);
- return;
- }
- rootElement = getRootElement(evt, device.getCharset());
- if (rootElement == null) {
- logger.warn("[ NotifyAlarm ] content cannot be null, {}", evt.getRequest());
- return;
- }
- DeviceAlarm deviceAlarm = new DeviceAlarm();
- deviceAlarm.setDeviceId(deviceId);
- deviceAlarm.setAlarmPriority(XmlUtil.getText(rootElement, "AlarmPriority"));
- deviceAlarm.setAlarmMethod(XmlUtil.getText(rootElement, "AlarmMethod"));
- String alarmTime = XmlUtil.getText(rootElement, "AlarmTime");
- if (alarmTime == null) {
- logger.warn("[ NotifyAlarm ] AlarmTime cannot be null");
- return;
- }
- deviceAlarm.setAlarmTime(DateUtil.ISO8601Toyyyy_MM_dd_HH_mm_ss(alarmTime));
- if (XmlUtil.getText(rootElement, "AlarmDescription") == null) {
- deviceAlarm.setAlarmDescription("");
- } else {
- deviceAlarm.setAlarmDescription(XmlUtil.getText(rootElement, "AlarmDescription"));
- }
- if (NumericUtil.isDouble(XmlUtil.getText(rootElement, "Longitude"))) {
- deviceAlarm.setLongitude(Double.parseDouble(XmlUtil.getText(rootElement, "Longitude")));
- } else {
- deviceAlarm.setLongitude(0.00);
- }
- if (NumericUtil.isDouble(XmlUtil.getText(rootElement, "Latitude"))) {
- deviceAlarm.setLatitude(Double.parseDouble(XmlUtil.getText(rootElement, "Latitude")));
- } else {
- deviceAlarm.setLatitude(0.00);
- }
- logger.info("[鏀跺埌Notify-Alarm]锛歿}/{}", device.getDeviceId(), deviceAlarm.getChannelId());
- if ("4".equals(deviceAlarm.getAlarmMethod())) {
- MobilePosition mobilePosition = new MobilePosition();
- mobilePosition.setChannelId(channelId);
- mobilePosition.setCreateTime(DateUtil.getNow());
- mobilePosition.setDeviceId(deviceAlarm.getDeviceId());
- mobilePosition.setTime(deviceAlarm.getAlarmTime());
- mobilePosition.setLongitude(deviceAlarm.getLongitude());
- mobilePosition.setLatitude(deviceAlarm.getLatitude());
- mobilePosition.setReportSource("GPS Alarm");
-
- // 鏇存柊device channel 鐨勭粡绾害
- DeviceChannel deviceChannel = new DeviceChannel();
- deviceChannel.setDeviceId(device.getDeviceId());
- deviceChannel.setChannelId(channelId);
- deviceChannel.setLongitude(mobilePosition.getLongitude());
- deviceChannel.setLatitude(mobilePosition.getLatitude());
- deviceChannel.setGpsTime(mobilePosition.getTime());
-
- deviceChannel = deviceChannelService.updateGps(deviceChannel, device);
-
- mobilePosition.setLongitudeWgs84(deviceChannel.getLongitudeWgs84());
- mobilePosition.setLatitudeWgs84(deviceChannel.getLatitudeWgs84());
- mobilePosition.setLongitudeGcj02(deviceChannel.getLongitudeGcj02());
- mobilePosition.setLatitudeGcj02(deviceChannel.getLatitudeGcj02());
-
- deviceChannelService.updateChannelGPS(device, deviceChannel, mobilePosition);
- }
-
- // 鍥炲200 OK
- if (redisCatchStorage.deviceIsOnline(deviceId)) {
- publisher.deviceAlarmEventPublish(deviceAlarm);
- }
- } catch (DocumentException e) {
- logger.error("鏈鐞嗙殑寮傚父 ", e);
- }
+ Element rootElement = getRootElement(evt);
+ if (rootElement == null) {
+ logger.error("澶勭悊alarm璁惧鎶ヨNotify鏃舵湭鑾峰彇鍒版秷鎭綋{}", evt.getRequest());
+ return;
}
+ Element deviceIdElement = rootElement.element("DeviceID");
+ String channelId = deviceIdElement.getText().toString();
+
+ Device device = redisCatchStorage.getDevice(deviceId);
+ if (device == null) {
+ logger.warn("[ NotifyAlarm ] 鏈壘鍒拌澶囷細{}", deviceId);
+ return;
+ }
+ rootElement = getRootElement(evt, device.getCharset());
+ if (rootElement == null) {
+ logger.warn("[ NotifyAlarm ] content cannot be null, {}", evt.getRequest());
+ return;
+ }
+ DeviceAlarm deviceAlarm = new DeviceAlarm();
+ deviceAlarm.setDeviceId(deviceId);
+ deviceAlarm.setAlarmPriority(XmlUtil.getText(rootElement, "AlarmPriority"));
+ deviceAlarm.setAlarmMethod(XmlUtil.getText(rootElement, "AlarmMethod"));
+ String alarmTime = XmlUtil.getText(rootElement, "AlarmTime");
+ if (alarmTime == null) {
+ logger.warn("[ NotifyAlarm ] AlarmTime cannot be null");
+ return;
+ }
+ deviceAlarm.setAlarmTime(DateUtil.ISO8601Toyyyy_MM_dd_HH_mm_ss(alarmTime));
+ if (XmlUtil.getText(rootElement, "AlarmDescription") == null) {
+ deviceAlarm.setAlarmDescription("");
+ } else {
+ deviceAlarm.setAlarmDescription(XmlUtil.getText(rootElement, "AlarmDescription"));
+ }
+ if (NumericUtil.isDouble(XmlUtil.getText(rootElement, "Longitude"))) {
+ deviceAlarm.setLongitude(Double.parseDouble(XmlUtil.getText(rootElement, "Longitude")));
+ } else {
+ deviceAlarm.setLongitude(0.00);
+ }
+ if (NumericUtil.isDouble(XmlUtil.getText(rootElement, "Latitude"))) {
+ deviceAlarm.setLatitude(Double.parseDouble(XmlUtil.getText(rootElement, "Latitude")));
+ } else {
+ deviceAlarm.setLatitude(0.00);
+ }
+ logger.info("[鏀跺埌Notify-Alarm]锛歿}/{}", device.getDeviceId(), deviceAlarm.getChannelId());
+ if ("4".equals(deviceAlarm.getAlarmMethod())) {
+ MobilePosition mobilePosition = new MobilePosition();
+ mobilePosition.setChannelId(channelId);
+ mobilePosition.setCreateTime(DateUtil.getNow());
+ mobilePosition.setDeviceId(deviceAlarm.getDeviceId());
+ mobilePosition.setTime(deviceAlarm.getAlarmTime());
+ mobilePosition.setLongitude(deviceAlarm.getLongitude());
+ mobilePosition.setLatitude(deviceAlarm.getLatitude());
+ mobilePosition.setReportSource("GPS Alarm");
+
+ // 鏇存柊device channel 鐨勭粡绾害
+ DeviceChannel deviceChannel = new DeviceChannel();
+ deviceChannel.setDeviceId(device.getDeviceId());
+ deviceChannel.setChannelId(channelId);
+ deviceChannel.setLongitude(mobilePosition.getLongitude());
+ deviceChannel.setLatitude(mobilePosition.getLatitude());
+ deviceChannel.setGpsTime(mobilePosition.getTime());
+
+ deviceChannel = deviceChannelService.updateGps(deviceChannel, device);
+
+ mobilePosition.setLongitudeWgs84(deviceChannel.getLongitudeWgs84());
+ mobilePosition.setLatitudeWgs84(deviceChannel.getLatitudeWgs84());
+ mobilePosition.setLongitudeGcj02(deviceChannel.getLongitudeGcj02());
+ mobilePosition.setLatitudeGcj02(deviceChannel.getLatitudeGcj02());
+
+ deviceChannelService.updateChannelGPS(device, deviceChannel, mobilePosition);
+ }
+
+ // 鍥炲200 OK
+ if (redisCatchStorage.deviceIsOnline(deviceId)) {
+ publisher.deviceAlarmEventPublish(deviceAlarm);
+ }
+ } catch (DocumentException e) {
+ logger.error("鏈鐞嗙殑寮傚父 ", e);
}
}
- public void setCmder(SIPCommander cmder) {
- }
- public void setStorager(IVideoManagerStorage storager) {
- this.storager = storager;
- }
-
- public void setPublisher(EventPublisher publisher) {
- this.publisher = publisher;
- }
-
- public void setRedis(RedisUtil redis) {
- }
-
- public void setDeferredResultHolder(DeferredResultHolder deferredResultHolder) {
- }
-
- public IRedisCatchStorage getRedisCatchStorage() {
- return redisCatchStorage;
- }
-
- public void setRedisCatchStorage(IRedisCatchStorage redisCatchStorage) {
- this.redisCatchStorage = redisCatchStorage;
- }
-
- @Scheduled(fixedRate = 10000) //姣�1绉掓墽琛屼竴娆�
- public void execute(){
- logger.info("[寰呭鐞哊otify娑堟伅鏁伴噺]: {}", taskQueue.size());
- }
}
diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java
index 16fc5b5..75cfb12 100755
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceChannelServiceImpl.java
@@ -275,15 +275,23 @@
}
@Override
- public void batchUpdateChannel(List<DeviceChannel> channels) {
+ public synchronized void batchUpdateChannel(List<DeviceChannel> channels) {
String now = DateUtil.getNow();
for (DeviceChannel channel : channels) {
channel.setUpdateTime(now);
}
- channelMapper.batchUpdate(channels);
- for (DeviceChannel channel : channels) {
- if (channel.getParentId() != null) {
- channelMapper.updateChannelSubCount(channel.getDeviceId(), channel.getParentId());
+ int limitCount = 1000;
+ if (!channels.isEmpty()) {
+ if (channels.size() > limitCount) {
+ for (int i = 0; i < channels.size(); i += limitCount) {
+ int toIndex = i + limitCount;
+ if (i + limitCount > channels.size()) {
+ toIndex = channels.size();
+ }
+ channelMapper.batchUpdate(channels.subList(i, toIndex));
+ }
+ }else {
+ channelMapper.batchUpdate(channels);
}
}
}
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 509240f..b1eef31 100755
--- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
@@ -7,7 +7,6 @@
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
-import com.genersoft.iot.vmp.service.IGbStreamService;
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
@@ -139,7 +138,7 @@
gbIdSet.add(deviceChannel.getChannelId());
if (allChannelMap.containsKey(deviceChannel.getChannelId())) {
deviceChannel.setStreamId(allChannelMap.get(deviceChannel.getChannelId()).getStreamId());
- deviceChannel.setHasAudio(allChannelMap.get(deviceChannel.getChannelId()).isHasAudio());
+ deviceChannel.setHasAudio(allChannelMap.get(deviceChannel.getChannelId()).getHasAudio());
if (allChannelMap.get(deviceChannel.getChannelId()).isStatus() !=deviceChannel.isStatus()){
List<String> strings = platformChannelMapper.queryParentPlatformByChannelId(deviceChannel.getChannelId());
if (!CollectionUtils.isEmpty(strings)){
@@ -275,7 +274,7 @@
deviceChannel.setUpdateTime(DateUtil.getNow());
if (allChannelMap.containsKey(deviceChannel.getChannelId())) {
deviceChannel.setStreamId(allChannelMap.get(deviceChannel.getChannelId()).getStreamId());
- deviceChannel.setHasAudio(allChannelMap.get(deviceChannel.getChannelId()).isHasAudio());
+ deviceChannel.setHasAudio(allChannelMap.get(deviceChannel.getChannelId()).getHasAudio());
if (allChannelMap.get(deviceChannel.getChannelId()).isStatus() !=deviceChannel.isStatus()){
List<String> strings = platformChannelMapper.queryParentPlatformByChannelId(deviceChannel.getChannelId());
if (!CollectionUtils.isEmpty(strings)){
--
Gitblit v1.8.0