Merge branch 'wvp-28181-2.0' into main-dev
# Conflicts: # src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java # src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java结构优化
commit
2673fbb0bf
|
@ -6,6 +6,7 @@ import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||||
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
|
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
|
||||||
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
|
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
|
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.service.bean.GPSMsgInfo;
|
||||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||||
|
@ -74,7 +75,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||||
private PlatformChannelMapper platformChannelMapper;
|
private PlatformChannelMapper platformChannelMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PlatformCatalogMapper platformCatalogMapper;
|
private PlatformCatalogMapper platformCatalogMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private StreamProxyMapper streamProxyMapper;
|
private StreamProxyMapper streamProxyMapper;
|
||||||
|
@ -163,7 +164,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (channels.size() > 0) {
|
if (!channels.isEmpty()) {
|
||||||
for (DeviceChannel channel : channels) {
|
for (DeviceChannel channel : channels) {
|
||||||
if (subContMap.get(channel.getChannelId()) != null){
|
if (subContMap.get(channel.getChannelId()) != null){
|
||||||
Integer count = subContMap.get(channel.getChannelId());
|
Integer count = subContMap.get(channel.getChannelId());
|
||||||
|
@ -184,19 +185,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
int limitCount = 50;
|
int limitCount = 50;
|
||||||
int cleanChannelsResult = 0;
|
boolean result = false;
|
||||||
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();
|
|
||||||
}
|
|
||||||
cleanChannelsResult += this.deviceChannelMapper.cleanChannelsNotInList(deviceId, channels.subList(i, toIndex));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
cleanChannelsResult = this.deviceChannelMapper.cleanChannelsNotInList(deviceId, channels);
|
|
||||||
}
|
|
||||||
boolean result = cleanChannelsResult < 0;
|
|
||||||
if (!result && addChannels.size() > 0) {
|
if (!result && addChannels.size() > 0) {
|
||||||
if (addChannels.size() > limitCount) {
|
if (addChannels.size() > limitCount) {
|
||||||
for (int i = 0; i < addChannels.size(); i += limitCount) {
|
for (int i = 0; i < addChannels.size(); i += limitCount) {
|
||||||
|
|
Loading…
Reference in New Issue