异步通道刷新,优化ui效果
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.genersoft.iot.vmp.service;
|
||||
|
||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.SyncStatus;
|
||||
|
||||
/**
|
||||
* 设备相关业务处理
|
||||
@@ -34,4 +35,24 @@ public interface IDeviceService {
|
||||
* @return
|
||||
*/
|
||||
boolean removeMobilePositionSubscribe(Device device);
|
||||
|
||||
/**
|
||||
* 移除移动位置订阅
|
||||
* @param deviceId 设备ID
|
||||
* @return
|
||||
*/
|
||||
SyncStatus getChannelSyncStatus(String deviceId);
|
||||
|
||||
/**
|
||||
* 设置通道同步状态
|
||||
* @param deviceId 设备ID
|
||||
*/
|
||||
void setChannelSyncReady(String deviceId);
|
||||
|
||||
/**
|
||||
* 设置同步结束
|
||||
* @param deviceId 设备ID
|
||||
* @param errorMsg 错误信息
|
||||
*/
|
||||
void setChannelSyncEnd(String deviceId, String errorMsg);
|
||||
}
|
||||
|
||||
@@ -3,9 +3,12 @@ package com.genersoft.iot.vmp.service.impl;
|
||||
import com.genersoft.iot.vmp.conf.DynamicTask;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
|
||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.cmd.CatalogResponseMessageHandler;
|
||||
import com.genersoft.iot.vmp.service.IDeviceService;
|
||||
import com.genersoft.iot.vmp.gb28181.task.impl.CatalogSubscribeTask;
|
||||
import com.genersoft.iot.vmp.gb28181.task.impl.MobilePositionSubscribeTask;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.SyncStatus;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -25,6 +28,12 @@ public class DeviceServiceImpl implements IDeviceService {
|
||||
@Autowired
|
||||
private ISIPCommander sipCommander;
|
||||
|
||||
@Autowired
|
||||
private CatalogResponseMessageHandler catalogResponseMessageHandler;
|
||||
|
||||
@Autowired
|
||||
private IRedisCatchStorage redisCatchStorage;
|
||||
|
||||
@Override
|
||||
public boolean addCatalogSubscribe(Device device) {
|
||||
if (device == null || device.getSubscribeCycleForCatalog() < 0) {
|
||||
@@ -86,4 +95,19 @@ public class DeviceServiceImpl implements IDeviceService {
|
||||
dynamicTask.stop(device.getDeviceId() + "mobile_position");
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SyncStatus getChannelSyncStatus(String deviceId) {
|
||||
return catalogResponseMessageHandler.getChannelSyncProgress(deviceId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setChannelSyncReady(String deviceId) {
|
||||
catalogResponseMessageHandler.setChannelSyncReady(deviceId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setChannelSyncEnd(String deviceId, String errorMsg) {
|
||||
catalogResponseMessageHandler.setChannelSyncEnd(deviceId, errorMsg);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user