Merge branch 'wvp-28181-2.0'

# Conflicts:
#	src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
This commit is contained in:
648540858
2023-02-22 18:08:25 +08:00
42 changed files with 553 additions and 128 deletions

View File

@@ -258,4 +258,7 @@ public interface IRedisCatchStorage {
List<SendRtpItem> queryAllSendRTPServer();
List<Device> getAllDevices();
void removeAllDevice();
}

View File

@@ -56,7 +56,7 @@ public interface IVideoManagerStorage {
* @param count 每页数量
* @return
*/
public PageInfo queryChannelsByDeviceId(String deviceId, String query, Boolean hasSubChannel, Boolean online, Boolean catalogUnderDevice, int page, int count);
public PageInfo<DeviceChannel> queryChannelsByDeviceId(String deviceId, String query, Boolean hasSubChannel, Boolean online, Boolean catalogUnderDevice, int page, int count);
public List<DeviceChannel> queryChannelsByDeviceIdWithStartAndLimit(String deviceId, String query, Boolean hasSubChannel, Boolean online, int start, int limit,List<String> channelIds);

View File

@@ -1,5 +1,6 @@
package com.genersoft.iot.vmp.storager.dao;
import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannelInPlatform;
import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo;
@@ -357,4 +358,21 @@ public interface DeviceChannelMapper {
@Select("select count(1) as total, sum(status) as online from device_channel")
ResourceBaceInfo getOverview();
@Select("select channelId" +
", deviceId" +
", latitude" +
", longitude" +
", latitudeWgs84" +
", longitudeWgs84" +
", latitudeGcj02" +
", longitudeGcj02 " +
"from device_channel where deviceId = #{deviceId} " +
"and latitude != 0 " +
"and longitude != 0 " +
"and (latitudeGcj02 = 0 or latitudeWgs84 = 0 or longitudeWgs84 = 0 or longitudeGcj02 = 0)")
List<DeviceChannel> getChannelsWithoutTransform(String deviceId);
@Select("select de.* from device de left join device_channel dc on de.deviceId = dc.deviceId where dc.channelId=#{channelId}")
List<Device> getDeviceByChannelId(String channelId);
}

View File

@@ -280,4 +280,6 @@ public interface DeviceMapper {
@Select("select count(1) as total, sum(online) as online from device")
ResourceBaceInfo getOverview();
@Select("select * from device")
List<Device> getAll();
}

View File

@@ -664,6 +664,31 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
RedisUtil.del(key);
}
@Override
public void removeAllDevice() {
String scanKey = VideoManagerConstants.DEVICE_PREFIX + userSetting.getServerId() + "_*";
List<Object> keys = RedisUtil.scan(scanKey);
for (Object key : keys) {
RedisUtil.del((String) key);
}
}
@Override
public List<Device> getAllDevices() {
String scanKey = VideoManagerConstants.DEVICE_PREFIX + userSetting.getServerId() + "_*";
List<Device> result = new ArrayList<>();
List<Object> keys = RedisUtil.scan(scanKey);
for (Object o : keys) {
String key = (String) o;
Device device = JsonUtil.redisJsonToObject(key, Device.class);
if (Objects.nonNull(device)) { // 只取没有存过得
result.add(JsonUtil.redisJsonToObject(key, Device.class));
}
}
return result;
}
@Override
public Device getDevice(String deviceId) {
String key = VideoManagerConstants.DEVICE_PREFIX + userSetting.getServerId() + "_" + deviceId;

View File

@@ -226,8 +226,10 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
if (allChannelMap.containsKey(deviceChannel.getChannelId())) {
deviceChannel.setStreamId(allChannelMap.get(deviceChannel.getChannelId()).getStreamId());
deviceChannel.setHasAudio(allChannelMap.get(deviceChannel.getChannelId()).isHasAudio());
deviceChannel.setUpdateTime(DateUtil.getNow());
updateChannels.add(deviceChannel);
}else {
deviceChannel.setCreateTime(DateUtil.getNow());
addChannels.add(deviceChannel);
}
if (!ObjectUtils.isEmpty(deviceChannel.getParentId())) {