mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-06 14:07:49 +08:00
Compare commits
4 Commits
fb20240eea
...
f8d765d54e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8d765d54e | ||
|
|
d7ba1cab30 | ||
|
|
594a696015 | ||
|
|
da98101aac |
@ -194,6 +194,15 @@ public class CatalogDataManager implements CommandLineRunner {
|
||||
for (String key : keySet) {
|
||||
CatalogData catalogData = dataMap.get(key);
|
||||
if (catalogData != null && deviceId.equals(catalogData.getDevice().getDeviceId())) {
|
||||
// 此时检查是否过期
|
||||
Instant instantBefore30S = Instant.now().minusMillis(TimeUnit.SECONDS.toMillis(30));
|
||||
if ((catalogData.getStatus().equals(CatalogData.CatalogDataStatus.end)
|
||||
|| catalogData.getStatus().equals(CatalogData.CatalogDataStatus.ready))
|
||||
&& catalogData.getTime().isBefore(instantBefore30S)) {
|
||||
dataMap.remove(key);
|
||||
return false;
|
||||
}
|
||||
|
||||
return !catalogData.getStatus().equals(CatalogData.CatalogDataStatus.end);
|
||||
}
|
||||
}
|
||||
@ -222,21 +231,26 @@ public class CatalogDataManager implements CommandLineRunner {
|
||||
String deviceId = catalogData.getDevice().getDeviceId();
|
||||
int sn = catalogData.getSn();
|
||||
List<DeviceChannel> deviceChannelList = getDeviceChannelList(deviceId, sn);
|
||||
if (catalogData.getTotal() == deviceChannelList.size()) {
|
||||
deviceChannelService.resetChannels(catalogData.getDevice().getId(), deviceChannelList);
|
||||
}else {
|
||||
deviceChannelService.updateChannels(catalogData.getDevice(), deviceChannelList);
|
||||
}
|
||||
List<Region> regionList = getRegionList(deviceId, sn);
|
||||
if ( regionList!= null && !regionList.isEmpty()) {
|
||||
regionService.batchAdd(regionList);
|
||||
}
|
||||
List<Group> groupList = getGroupList(deviceId, sn);
|
||||
if (groupList != null && !groupList.isEmpty()) {
|
||||
groupService.batchAdd(groupList);
|
||||
try {
|
||||
if (catalogData.getTotal() == deviceChannelList.size()) {
|
||||
deviceChannelService.resetChannels(catalogData.getDevice().getId(), deviceChannelList);
|
||||
}else {
|
||||
deviceChannelService.updateChannels(catalogData.getDevice(), deviceChannelList);
|
||||
}
|
||||
List<Region> regionList = getRegionList(deviceId, sn);
|
||||
if ( regionList!= null && !regionList.isEmpty()) {
|
||||
regionService.batchAdd(regionList);
|
||||
}
|
||||
List<Group> groupList = getGroupList(deviceId, sn);
|
||||
if (groupList != null && !groupList.isEmpty()) {
|
||||
groupService.batchAdd(groupList);
|
||||
}
|
||||
}catch (Exception e) {
|
||||
log.error("[国标通道同步] 入库失败: ", e);
|
||||
}
|
||||
String errorMsg = "更新成功,共" + catalogData.getTotal() + "条,已更新" + deviceChannelList.size() + "条";
|
||||
catalogData.setErrorMsg(errorMsg);
|
||||
catalogData.setStatus(CatalogData.CatalogDataStatus.end);
|
||||
}else if (catalogData.getStatus().equals(CatalogData.CatalogDataStatus.ready)) {
|
||||
String errorMsg = "同步失败,等待回复超时";
|
||||
catalogData.setErrorMsg(errorMsg);
|
||||
|
||||
@ -861,7 +861,7 @@
|
||||
320623,如东县,3206
|
||||
320681,启东市,3206
|
||||
320682,如皋市,3206
|
||||
320684,海门市,3206
|
||||
320684,海门区,3206
|
||||
320685,海安市,3206
|
||||
3207,连云港市,32
|
||||
320703,连云区,3207
|
||||
@ -918,8 +918,6 @@
|
||||
33,浙江省,
|
||||
3301,杭州市,33
|
||||
330102,上城区,3301
|
||||
330103,下城区,3301
|
||||
330104,江干区,3301
|
||||
330105,拱墅区,3301
|
||||
330106,西湖区,3301
|
||||
330108,滨江区,3301
|
||||
@ -927,6 +925,8 @@
|
||||
330110,余杭区,3301
|
||||
330111,富阳区,3301
|
||||
330112,临安区,3301
|
||||
330113,临平区,3301
|
||||
330114,钱塘区,3301
|
||||
330122,桐庐县,3301
|
||||
330127,淳安县,3301
|
||||
330182,建德市,3301
|
||||
|
||||
|
@ -143,7 +143,7 @@ export default {
|
||||
isFlv: false,
|
||||
isFullResize: false,
|
||||
isNotMute: this.isNotMute,
|
||||
isResize: false,
|
||||
isResize: true,
|
||||
keepScreenOn: true,
|
||||
loadingText: '请稍等, 视频加载中......',
|
||||
loadingTimeout: 10,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user