修复级联无通道时更新停止在等待更新的问题
This commit is contained in:
parent
c53622e802
commit
d7135965da
@ -3,8 +3,14 @@ package com.genersoft.iot.vmp.gb28181.bean;
|
|||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lin
|
||||||
|
*/
|
||||||
public class CatalogData {
|
public class CatalogData {
|
||||||
private int sn; // 命令序列号
|
/**
|
||||||
|
* 命令序列号
|
||||||
|
*/
|
||||||
|
private int sn;
|
||||||
private int total;
|
private int total;
|
||||||
private List<DeviceChannel> channelList;
|
private List<DeviceChannel> channelList;
|
||||||
private Instant lastTime;
|
private Instant lastTime;
|
||||||
|
@ -2,12 +2,15 @@ package com.genersoft.iot.vmp.gb28181.bean;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 摄像机同步状态
|
* 摄像机同步状态
|
||||||
|
* @author lin
|
||||||
*/
|
*/
|
||||||
public class SyncStatus {
|
public class SyncStatus {
|
||||||
private int total;
|
private int total;
|
||||||
private int current;
|
private int current;
|
||||||
private String errorMsg;
|
private String errorMsg;
|
||||||
|
|
||||||
|
private boolean syncIng;
|
||||||
|
|
||||||
public int getTotal() {
|
public int getTotal() {
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
@ -31,4 +34,12 @@ public class SyncStatus {
|
|||||||
public void setErrorMsg(String errorMsg) {
|
public void setErrorMsg(String errorMsg) {
|
||||||
this.errorMsg = errorMsg;
|
this.errorMsg = errorMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isSyncIng() {
|
||||||
|
return syncIng;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSyncIng(boolean syncIng) {
|
||||||
|
this.syncIng = syncIng;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,11 @@ public class CatalogDataCatch {
|
|||||||
syncStatus.setCurrent(catalogData.getChannelList().size());
|
syncStatus.setCurrent(catalogData.getChannelList().size());
|
||||||
syncStatus.setTotal(catalogData.getTotal());
|
syncStatus.setTotal(catalogData.getTotal());
|
||||||
syncStatus.setErrorMsg(catalogData.getErrorMsg());
|
syncStatus.setErrorMsg(catalogData.getErrorMsg());
|
||||||
|
if (catalogData.getStatus().equals(CatalogData.CatalogDataStatus.end)) {
|
||||||
|
syncStatus.setSyncIng(false);
|
||||||
|
}else {
|
||||||
|
syncStatus.setSyncIng(true);
|
||||||
|
}
|
||||||
return syncStatus;
|
return syncStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,6 +111,7 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp
|
|||||||
int sumNum = Integer.parseInt(sumNumElement.getText());
|
int sumNum = Integer.parseInt(sumNumElement.getText());
|
||||||
|
|
||||||
if (sumNum == 0) {
|
if (sumNum == 0) {
|
||||||
|
logger.info("收到来自设备【{}】的通道: 0个", take.getDevice().getDeviceId());
|
||||||
// 数据已经完整接收
|
// 数据已经完整接收
|
||||||
storager.cleanChannelsForDevice(take.getDevice().getDeviceId());
|
storager.cleanChannelsForDevice(take.getDevice().getDeviceId());
|
||||||
catalogDataCatch.setChannelSyncEnd(take.getDevice().getDeviceId(), null);
|
catalogDataCatch.setChannelSyncEnd(take.getDevice().getDeviceId(), null);
|
||||||
|
@ -63,34 +63,39 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (res.data.data != null) {
|
if (res.data.data != null) {
|
||||||
if (res.data.data.total == 0) {
|
if (res.data.syncIng) {
|
||||||
if (res.data.data.errorMsg !== null ){
|
if (res.data.data.total == 0) {
|
||||||
this.msg = res.data.data.errorMsg;
|
|
||||||
this.syncStatus = "exception"
|
|
||||||
}else {
|
|
||||||
this.msg = `等待同步中`;
|
|
||||||
this.timmer = setTimeout(this.getProgress, 300)
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
if (res.data.data.total == res.data.data.current) {
|
|
||||||
this.syncStatus = "success"
|
|
||||||
this.percentage = 100;
|
|
||||||
this.msg = '同步成功';
|
|
||||||
}else {
|
|
||||||
if (res.data.data.errorMsg !== null ){
|
if (res.data.data.errorMsg !== null ){
|
||||||
this.msg = res.data.data.errorMsg;
|
this.msg = res.data.data.errorMsg;
|
||||||
this.syncStatus = "exception"
|
this.syncStatus = "exception"
|
||||||
}else {
|
}else {
|
||||||
this.total = res.data.data.total;
|
this.msg = `等待同步中`;
|
||||||
this.current = res.data.data.current;
|
|
||||||
this.percentage = Math.floor(Number(res.data.data.current)/Number(res.data.data.total)* 10000)/100;
|
|
||||||
this.msg = `同步中...[${res.data.data.current}/${res.data.data.total}]`;
|
|
||||||
this.timmer = setTimeout(this.getProgress, 300)
|
this.timmer = setTimeout(this.getProgress, 300)
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
if (res.data.data.total == res.data.data.current) {
|
||||||
|
this.syncStatus = "success"
|
||||||
|
this.percentage = 100;
|
||||||
|
this.msg = '同步成功';
|
||||||
|
}else {
|
||||||
|
if (res.data.data.errorMsg !== null ){
|
||||||
|
this.msg = res.data.data.errorMsg;
|
||||||
|
this.syncStatus = "exception"
|
||||||
|
}else {
|
||||||
|
this.total = res.data.data.total;
|
||||||
|
this.current = res.data.data.current;
|
||||||
|
this.percentage = Math.floor(Number(res.data.data.current)/Number(res.data.data.total)* 10000)/100;
|
||||||
|
this.msg = `同步中...[${res.data.data.current}/${res.data.data.total}]`;
|
||||||
|
this.timmer = setTimeout(this.getProgress, 300)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
this.syncStatus = "success"
|
||||||
|
this.percentage = 100;
|
||||||
|
this.msg = '同步成功';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
if (this.syncFlag) {
|
if (this.syncFlag) {
|
||||||
this.syncStatus = "success"
|
this.syncStatus = "success"
|
||||||
|
Loading…
Reference in New Issue
Block a user