src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java
@@ -12,6 +12,7 @@ import com.genersoft.iot.vmp.service.IDeviceService; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IVideoManagerStorage; import com.genersoft.iot.vmp.utils.DateUtil; import gov.nist.javax.sip.RequestEventExt; import gov.nist.javax.sip.address.AddressImpl; import gov.nist.javax.sip.address.SipUri; @@ -176,6 +177,7 @@ // 保存到redis if (registerFlag) { logger.info("[{}] 注册成功! deviceId:" + deviceId, requestAddress); device.setRegisterTime(DateUtil.getNow()); deviceService.online(device); } else { logger.info("[{}] 注销成功! deviceId:" + deviceId, requestAddress); src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/KeepaliveNotifyMessageHandler.java
@@ -72,6 +72,7 @@ device.setPort(rPort); device.setHostAddress(received.concat(":").concat(String.valueOf(rPort))); } device.setKeepaliveTime(DateUtil.getNow()); deviceService.online(device); // 回复200 OK responseAck(evt, Response.OK); src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java
@@ -76,12 +76,7 @@ redisCatchStorage.clearCatchByDeviceId(device.getDeviceId()); } if (device.getRegisterTime() == null) { device.setRegisterTime(now); } if(device.getUpdateTime() == null) { device.setUpdateTime(now); } device.setUpdateTime(now); device.setOnline(1); // 第一次上线 src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
@@ -257,4 +257,8 @@ @Update(value = {"UPDATE device_channel SET latitude=${latitude}, longitude=${longitude} WHERE deviceId=#{deviceId} AND channelId=#{channelId}"}) void updatePotion(String deviceId, String channelId, double longitude, double latitude); @Select("SELECT * FROM device_channel WHERE length(trim(streamId)) > 0") List<DeviceChannel> getAllChannelInPlay(); } src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
@@ -28,6 +28,7 @@ import org.springframework.util.StringUtils; import java.util.*; import java.util.concurrent.ConcurrentHashMap; /** * 视频设备数据存储-jdbc实现 @@ -197,17 +198,27 @@ if (deviceChannelList == null) { return false; } List<DeviceChannel> allChannelInPlay = deviceChannelMapper.getAllChannelInPlay(); Map<String,DeviceChannel> allChannelMapInPlay = new ConcurrentHashMap<>(); if (allChannelInPlay.size() > 0) { for (DeviceChannel deviceChannel : allChannelInPlay) { allChannelMapInPlay.put(deviceChannel.getChannelId(), deviceChannel); } } TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); // 数据去重 List<DeviceChannel> channels = new ArrayList<>(); StringBuilder stringBuilder = new StringBuilder(); Map<String, Integer> subContMap = new HashMap<>(); if (deviceChannelList != null && deviceChannelList.size() > 1) { if (deviceChannelList.size() > 1) { // 数据去重 Set<String> gbIdSet = new HashSet<>(); for (DeviceChannel deviceChannel : deviceChannelList) { if (!gbIdSet.contains(deviceChannel.getChannelId())) { gbIdSet.add(deviceChannel.getChannelId()); if (allChannelMapInPlay.containsKey(deviceChannel.getChannelId())) { deviceChannel.setStreamId(allChannelMapInPlay.get(deviceChannel.getChannelId()).getStreamId()); } channels.add(deviceChannel); if (!StringUtils.isEmpty(deviceChannel.getParentId())) { if (subContMap.get(deviceChannel.getParentId()) == null) { web_src/src/components/control.vue
@@ -576,7 +576,7 @@ let that = this; this.$axios({ method: 'get', url: '/zlm/' + that.mediaServerChoose + '/index/api/kick_session&id=' + id url: '/zlm/' + that.mediaServerChoose + '/index/api/kick_session?id=' + id }).then(function (res) { that.getAllSession(); that.$message({