Merge remote-tracking branch 'origin/wvp-28181-2.0' into wvp-28181-2.0
This commit is contained in:
@@ -12,6 +12,7 @@ import com.genersoft.iot.vmp.gb28181.task.impl.MobilePositionSubscribeTask;
|
||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
|
||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
||||
import com.genersoft.iot.vmp.service.IDeviceChannelService;
|
||||
import com.genersoft.iot.vmp.service.IDeviceService;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||
@@ -52,6 +53,9 @@ public class DeviceQuery {
|
||||
@Autowired
|
||||
private IVideoManagerStorage storager;
|
||||
|
||||
@Autowired
|
||||
private IDeviceChannelService deviceChannelService;
|
||||
|
||||
@Autowired
|
||||
private IRedisCatchStorage redisCatchStorage;
|
||||
|
||||
@@ -280,7 +284,7 @@ public class DeviceQuery {
|
||||
})
|
||||
@PostMapping("/channel/update/{deviceId}")
|
||||
public ResponseEntity<PageInfo> updateChannel(@PathVariable String deviceId,DeviceChannel channel){
|
||||
storager.updateChannel(deviceId, channel);
|
||||
deviceChannelService.updateChannel(deviceId, channel);
|
||||
return new ResponseEntity<>(null,HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ public class GbStreamController {
|
||||
@ApiImplicitParam(name = "platformId", value = "平台ID", required = true , dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name = "catalogId", value = "目录ID", required = false , dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name="query", value = "查询内容", required = false , dataTypeClass = String.class),
|
||||
@ApiImplicitParam(name="pushing", value = "是否正在推流", required = false , dataTypeClass = Boolean.class),
|
||||
@ApiImplicitParam(name="mediaServerId", value = "流媒体ID", required = false , dataTypeClass = String.class),
|
||||
|
||||
})
|
||||
@@ -55,7 +54,6 @@ public class GbStreamController {
|
||||
@RequestParam(required = true)String platformId,
|
||||
@RequestParam(required = false)String catalogId,
|
||||
@RequestParam(required = false)String query,
|
||||
@RequestParam(required = false)Boolean pushing,
|
||||
@RequestParam(required = false)String mediaServerId){
|
||||
if (StringUtils.isEmpty(catalogId)) {
|
||||
catalogId = null;
|
||||
@@ -69,7 +67,7 @@ public class GbStreamController {
|
||||
|
||||
// catalogId 为null 查询未在平台下分配的数据
|
||||
// catalogId 不为null 查询平台下这个,目录下的通道
|
||||
return gbStreamService.getAll(page, count, platformId, catalogId, query, pushing, mediaServerId);
|
||||
return gbStreamService.getAll(page, count, platformId, catalogId, query, mediaServerId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder;
|
||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
||||
import com.genersoft.iot.vmp.service.IPlatformChannelService;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||
@@ -48,6 +49,9 @@ public class PlatformController {
|
||||
@Autowired
|
||||
private IVideoManagerStorage storager;
|
||||
|
||||
@Autowired
|
||||
private IPlatformChannelService platformChannelService;
|
||||
|
||||
@Autowired
|
||||
private IRedisCatchStorage redisCatchStorage;
|
||||
|
||||
@@ -236,6 +240,12 @@ public class PlatformController {
|
||||
parentPlatform.setCharacterSet(parentPlatform.getCharacterSet().toUpperCase());
|
||||
ParentPlatform parentPlatformOld = storager.queryParentPlatByServerGBId(parentPlatform.getServerGBId());
|
||||
parentPlatform.setUpdateTime(DateUtil.getNow());
|
||||
if (!parentPlatformOld.getTreeType().equals(parentPlatform.getTreeType())) {
|
||||
// 目录结构发生变化,清空之前的关联关系
|
||||
logger.info("保存平台{}时发现目录结构变化,清空关联关系", parentPlatform.getDeviceGBId());
|
||||
storager.cleanContentForPlatform(parentPlatform.getServerGBId());
|
||||
|
||||
}
|
||||
boolean updateResult = storager.updateParentPlatform(parentPlatform);
|
||||
|
||||
if (updateResult) {
|
||||
@@ -256,6 +266,8 @@ public class PlatformController {
|
||||
}
|
||||
} else if (parentPlatformOld != null && parentPlatformOld.isEnable() && !parentPlatform.isEnable()) { // 关闭启用时注销
|
||||
commanderForPlatform.unregister(parentPlatformOld, null, null);
|
||||
// 停止订阅相关的定时任务
|
||||
subscribeHolder.removeAllSubscribe(parentPlatform.getServerGBId());
|
||||
}
|
||||
wvpResult.setCode(0);
|
||||
wvpResult.setMsg("success");
|
||||
@@ -405,7 +417,7 @@ public class PlatformController {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("给上级平台添加国标通道API调用");
|
||||
}
|
||||
int result = storager.updateChannelForGB(param.getPlatformId(), param.getChannelReduces(), param.getCatalogId());
|
||||
int result = platformChannelService.updateChannelForGB(param.getPlatformId(), param.getChannelReduces(), param.getCatalogId());
|
||||
|
||||
return new ResponseEntity<>(String.valueOf(result > 0), HttpStatus.OK);
|
||||
}
|
||||
@@ -485,7 +497,6 @@ public class PlatformController {
|
||||
PlatformCatalog platformCatalogInStore = storager.getCatalog(platformCatalog.getId());
|
||||
WVPResult<List<PlatformCatalog>> result = new WVPResult<>();
|
||||
|
||||
|
||||
if (platformCatalogInStore != null) {
|
||||
result.setCode(-1);
|
||||
result.setMsg(platformCatalog.getId() + " already exists");
|
||||
|
||||
Reference in New Issue
Block a user