临时提交
parent
64e9b6674f
commit
ddf917d127
|
@ -5,11 +5,11 @@ import com.genersoft.iot.vmp.conf.security.JwtUtils;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm;
|
import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IDeviceAlarmService;
|
import com.genersoft.iot.vmp.gb28181.service.IDeviceAlarmService;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IDeviceService;
|
import com.genersoft.iot.vmp.gb28181.service.IDeviceService;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
import com.genersoft.iot.vmp.gb28181.service.IPlatformService;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
||||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
@ -44,7 +44,7 @@ public class AlarmController {
|
||||||
private ISIPCommanderForPlatform commanderForPlatform;
|
private ISIPCommanderForPlatform commanderForPlatform;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IVideoManagerStorage storage;
|
private IPlatformService platformService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IDeviceService deviceService;
|
private IDeviceService deviceService;
|
||||||
|
@ -100,7 +100,7 @@ public class AlarmController {
|
||||||
@Parameter(name = "deviceId", description = "设备国标编号")
|
@Parameter(name = "deviceId", description = "设备国标编号")
|
||||||
public void delete(@RequestParam String deviceId) {
|
public void delete(@RequestParam String deviceId) {
|
||||||
Device device = deviceService.getDeviceByDeviceId(deviceId);
|
Device device = deviceService.getDeviceByDeviceId(deviceId);
|
||||||
Platform platform = storage.queryParentPlatByServerGBId(deviceId);
|
Platform platform = platformService.queryPlatformByServerGBId(deviceId);
|
||||||
DeviceAlarm deviceAlarm = new DeviceAlarm();
|
DeviceAlarm deviceAlarm = new DeviceAlarm();
|
||||||
deviceAlarm.setChannelId(deviceId);
|
deviceAlarm.setChannelId(deviceId);
|
||||||
deviceAlarm.setAlarmDescription("test");
|
deviceAlarm.setAlarmDescription("test");
|
||||||
|
|
|
@ -1,22 +1,18 @@
|
||||||
package com.genersoft.iot.vmp.gb28181.controller;
|
package com.genersoft.iot.vmp.gb28181.controller;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.genersoft.iot.vmp.common.VideoManagerConstants;
|
|
||||||
import com.genersoft.iot.vmp.conf.DynamicTask;
|
|
||||||
import com.genersoft.iot.vmp.conf.SipConfig;
|
import com.genersoft.iot.vmp.conf.SipConfig;
|
||||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
|
||||||
import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
||||||
import com.genersoft.iot.vmp.conf.security.JwtUtils;
|
import com.genersoft.iot.vmp.conf.security.JwtUtils;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.bean.PlatformChannel;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder;
|
||||||
import com.genersoft.iot.vmp.gb28181.controller.bean.UpdateChannelParam;
|
import com.genersoft.iot.vmp.gb28181.controller.bean.UpdateChannelParam;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IDeviceChannelService;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IPlatformChannelService;
|
import com.genersoft.iot.vmp.gb28181.service.IPlatformChannelService;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IPlatformService;
|
import com.genersoft.iot.vmp.gb28181.service.IPlatformService;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
|
||||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
|
||||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||||
|
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
@ -27,10 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.util.ObjectUtils;
|
import org.springframework.util.ObjectUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.context.request.async.DeferredResult;
|
||||||
import javax.sip.InvalidArgumentException;
|
|
||||||
import javax.sip.SipException;
|
|
||||||
import java.text.ParseException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 级联平台管理
|
* 级联平台管理
|
||||||
|
@ -41,41 +34,19 @@ import java.text.ParseException;
|
||||||
@RequestMapping("/api/platform")
|
@RequestMapping("/api/platform")
|
||||||
public class PlatformController {
|
public class PlatformController {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private UserSetting userSetting;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IVideoManagerStorage storager;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IPlatformChannelService platformChannelService;
|
private IPlatformChannelService platformChannelService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IRedisCatchStorage redisCatchStorage;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SubscribeHolder subscribeHolder;
|
private SubscribeHolder subscribeHolder;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISIPCommanderForPlatform commanderForPlatform;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SipConfig sipConfig;
|
private SipConfig sipConfig;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private DynamicTask dynamicTask;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IPlatformService platformService;
|
private IPlatformService platformService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IDeviceChannelService deviceChannelService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取国标服务的配置
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Operation(summary = "获取国标服务的配置", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "获取国标服务的配置", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
@GetMapping("/server_config")
|
@GetMapping("/server_config")
|
||||||
public JSONObject serverConfig() {
|
public JSONObject serverConfig() {
|
||||||
|
@ -87,11 +58,6 @@ public class PlatformController {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取级联服务器信息
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Operation(summary = "获取级联服务器信息", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "获取级联服务器信息", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
@Parameter(name = "id", description = "平台国标编号", required = true)
|
@Parameter(name = "id", description = "平台国标编号", required = true)
|
||||||
@GetMapping("/info/{id}")
|
@GetMapping("/info/{id}")
|
||||||
|
@ -104,13 +70,6 @@ public class PlatformController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询级联平台
|
|
||||||
*
|
|
||||||
* @param page 当前页
|
|
||||||
* @param count 每页条数
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GetMapping("/query/{count}/{page}")
|
@GetMapping("/query/{count}/{page}")
|
||||||
@Operation(summary = "分页查询级联平台", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "分页查询级联平台", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
@Parameter(name = "page", description = "当前页", required = true)
|
@Parameter(name = "page", description = "当前页", required = true)
|
||||||
|
@ -118,7 +77,7 @@ public class PlatformController {
|
||||||
public PageInfo<Platform> platforms(@PathVariable int page, @PathVariable int count) {
|
public PageInfo<Platform> platforms(@PathVariable int page, @PathVariable int count) {
|
||||||
|
|
||||||
PageInfo<Platform> parentPlatformPageInfo = platformService.queryPlatformList(page, count);
|
PageInfo<Platform> parentPlatformPageInfo = platformService.queryPlatformList(page, count);
|
||||||
if (parentPlatformPageInfo.getList().size() > 0) {
|
if (parentPlatformPageInfo != null && !parentPlatformPageInfo.getList().isEmpty()) {
|
||||||
for (Platform platform : parentPlatformPageInfo.getList()) {
|
for (Platform platform : parentPlatformPageInfo.getList()) {
|
||||||
platform.setMobilePositionSubscribe(subscribeHolder.getMobilePositionSubscribe(platform.getServerGBId()) != null);
|
platform.setMobilePositionSubscribe(subscribeHolder.getMobilePositionSubscribe(platform.getServerGBId()) != null);
|
||||||
platform.setCatalogSubscribe(subscribeHolder.getCatalogSubscribe(platform.getServerGBId()) != null);
|
platform.setCatalogSubscribe(subscribeHolder.getCatalogSubscribe(platform.getServerGBId()) != null);
|
||||||
|
@ -127,16 +86,10 @@ public class PlatformController {
|
||||||
return parentPlatformPageInfo;
|
return parentPlatformPageInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加上级平台信息
|
|
||||||
*
|
|
||||||
* @param platform
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Operation(summary = "添加上级平台信息", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "添加上级平台信息", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public void addPlatform(@RequestBody Platform platform) {
|
public void add(@RequestBody Platform platform) {
|
||||||
|
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("保存上级平台信息API调用");
|
log.debug("保存上级平台信息API调用");
|
||||||
|
@ -180,13 +133,7 @@ public class PlatformController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Operation(summary = "更新上级平台信息", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
* 保存上级平台信息
|
|
||||||
*
|
|
||||||
* @param parentPlatform
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Operation(summary = "保存上级平台信息", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public void updatePlatform(@RequestBody Platform parentPlatform) {
|
public void updatePlatform(@RequestBody Platform parentPlatform) {
|
||||||
|
@ -207,83 +154,33 @@ public class PlatformController {
|
||||||
) {
|
) {
|
||||||
throw new ControllerException(ErrorCode.ERROR400);
|
throw new ControllerException(ErrorCode.ERROR400);
|
||||||
}
|
}
|
||||||
|
|
||||||
platformService.update(parentPlatform);
|
platformService.update(parentPlatform);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除上级平台
|
|
||||||
*
|
|
||||||
* @param serverGBId 上级平台国标ID
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Operation(summary = "删除上级平台", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "删除上级平台", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
@Parameter(name = "serverGBId", description = "上级平台的国标编号")
|
@Parameter(name = "id", description = "上级平台ID")
|
||||||
@DeleteMapping("/delete/{serverGBId}")
|
@DeleteMapping("/delete")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public void deletePlatform(@PathVariable String serverGBId) {
|
public DeferredResult<Object> deletePlatform(Integer id) {
|
||||||
|
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("删除上级平台API调用");
|
log.debug("删除上级平台API调用");
|
||||||
}
|
}
|
||||||
if (ObjectUtils.isEmpty(serverGBId)
|
DeferredResult<Object> deferredResult = new DeferredResult<>();
|
||||||
) {
|
|
||||||
throw new ControllerException(ErrorCode.ERROR400);
|
|
||||||
}
|
|
||||||
Platform parentPlatform = storager.queryParentPlatByServerGBId(serverGBId);
|
|
||||||
PlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(serverGBId);
|
|
||||||
if (parentPlatform == null) {
|
|
||||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "平台不存在");
|
|
||||||
}
|
|
||||||
if (parentPlatformCatch == null) {
|
|
||||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "平台不存在");
|
|
||||||
}
|
|
||||||
parentPlatform.setEnable(false);
|
|
||||||
storager.updateParentPlatform(parentPlatform);
|
|
||||||
// 发送离线消息,无论是否成功都删除缓存
|
|
||||||
try {
|
|
||||||
commanderForPlatform.unregister(parentPlatform, parentPlatformCatch.getSipTransactionInfo(), (event -> {
|
|
||||||
// 清空redis缓存
|
|
||||||
redisCatchStorage.delPlatformCatchInfo(parentPlatform.getServerGBId());
|
|
||||||
redisCatchStorage.delPlatformKeepalive(parentPlatform.getServerGBId());
|
|
||||||
redisCatchStorage.delPlatformRegister(parentPlatform.getServerGBId());
|
|
||||||
}), (event -> {
|
|
||||||
// 清空redis缓存
|
|
||||||
redisCatchStorage.delPlatformCatchInfo(parentPlatform.getServerGBId());
|
|
||||||
redisCatchStorage.delPlatformKeepalive(parentPlatform.getServerGBId());
|
|
||||||
redisCatchStorage.delPlatformRegister(parentPlatform.getServerGBId());
|
|
||||||
}));
|
|
||||||
} catch (InvalidArgumentException | ParseException | SipException e) {
|
|
||||||
log.error("[命令发送失败] 国标级联 注销: {}", e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean deleteResult = storager.deleteParentPlatform(parentPlatform);
|
platformService.delete(id, (object)->{
|
||||||
// storager.delCatalogByPlatformId(parentPlatform.getServerGBId());
|
deferredResult.setResult(WVPResult.success());
|
||||||
// storager.delRelationByPlatformId(parentPlatform.getServerGBId());
|
});
|
||||||
// 停止发送位置订阅定时任务
|
return deferredResult;
|
||||||
String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetting.getServerId() + "_MobilePosition_" + parentPlatform.getServerGBId();
|
|
||||||
dynamicTask.stop(key);
|
|
||||||
// 删除缓存的订阅信息
|
|
||||||
subscribeHolder.removeAllSubscribe(parentPlatform.getServerGBId());
|
|
||||||
if (!deleteResult) {
|
|
||||||
throw new ControllerException(ErrorCode.ERROR100);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询上级平台是否存在
|
|
||||||
*
|
|
||||||
* @param serverGBId 上级平台国标ID
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Operation(summary = "查询上级平台是否存在", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "查询上级平台是否存在", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
@Parameter(name = "serverGBId", description = "上级平台的国标编号")
|
@Parameter(name = "serverGBId", description = "上级平台的国标编号")
|
||||||
@GetMapping("/exit/{serverGBId}")
|
@GetMapping("/exit/{serverGBId}")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Boolean exitPlatform(@PathVariable String serverGBId) {
|
public Boolean exitPlatform(@PathVariable String serverGBId) {
|
||||||
|
Platform platform = platformService.queryPlatformByServerGBId(serverGBId);
|
||||||
Platform parentPlatform = storager.queryParentPlatByServerGBId(serverGBId);
|
return platform != null;
|
||||||
return parentPlatform != null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "分页查询级联平台的所有所有通道", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "分页查询级联平台的所有所有通道", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
|
@ -332,12 +229,6 @@ public class PlatformController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 从上级平台移除国标通道
|
|
||||||
*
|
|
||||||
* @param param 通道关联参数
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Operation(summary = "从上级平台移除国标通道", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "从上级平台移除国标通道", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
@DeleteMapping("/channel/remove")
|
@DeleteMapping("/channel/remove")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
|
@ -9,18 +9,16 @@ import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
||||||
import com.genersoft.iot.vmp.conf.security.JwtUtils;
|
import com.genersoft.iot.vmp.conf.security.JwtUtils;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction;
|
import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction;
|
||||||
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
|
|
||||||
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.media.bean.MediaServer;
|
|
||||||
import com.genersoft.iot.vmp.media.service.IMediaServerService;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IDeviceChannelService;
|
import com.genersoft.iot.vmp.gb28181.service.IDeviceChannelService;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IDeviceService;
|
import com.genersoft.iot.vmp.gb28181.service.IDeviceService;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IInviteStreamService;
|
import com.genersoft.iot.vmp.gb28181.service.IInviteStreamService;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IPlayService;
|
import com.genersoft.iot.vmp.gb28181.service.IPlayService;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
||||||
|
import com.genersoft.iot.vmp.media.bean.MediaServer;
|
||||||
|
import com.genersoft.iot.vmp.media.service.IMediaServerService;
|
||||||
import com.genersoft.iot.vmp.service.bean.InviteErrorCode;
|
import com.genersoft.iot.vmp.service.bean.InviteErrorCode;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
|
||||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.AudioBroadcastResult;
|
import com.genersoft.iot.vmp.vmanager.bean.AudioBroadcastResult;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||||
|
@ -53,15 +51,9 @@ import java.util.UUID;
|
||||||
@RequestMapping("/api/play")
|
@RequestMapping("/api/play")
|
||||||
public class PlayController {
|
public class PlayController {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SIPCommander cmder;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private VideoStreamSessionManager streamSession;
|
private VideoStreamSessionManager streamSession;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IVideoManagerStorage storager;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IInviteStreamService inviteStreamService;
|
private IInviteStreamService inviteStreamService;
|
||||||
|
|
||||||
|
|
|
@ -410,4 +410,19 @@ public interface PlatformChannelMapper {
|
||||||
" pgc.device_channel_id = #{channelId}" +
|
" pgc.device_channel_id = #{channelId}" +
|
||||||
"</script> ")
|
"</script> ")
|
||||||
List<Platform> queryPlatFormListByChannelId(@Param("channelId") int channelId);
|
List<Platform> queryPlatFormListByChannelId(@Param("channelId") int channelId);
|
||||||
|
|
||||||
|
@Delete("<script> "+
|
||||||
|
"DELETE from wvp_platform_channel WHERE platform_id=#{platformId}" +
|
||||||
|
"</script>")
|
||||||
|
void removeChannelsByPlatformId(@Param("platformId") Integer platformId);
|
||||||
|
|
||||||
|
@Delete("<script> "+
|
||||||
|
"DELETE from wvp_platform_group WHERE platform_id=#{platformId}" +
|
||||||
|
"</script>")
|
||||||
|
void removePlatformGroupsByPlatformId(@Param("platformId") Integer platformId);
|
||||||
|
|
||||||
|
@Delete("<script> "+
|
||||||
|
"DELETE from wvp_platform_region WHERE platform_id=#{platformId}" +
|
||||||
|
"</script>")
|
||||||
|
void removePlatformRegionByPlatformId(@Param("platformId") Integer platformId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,8 +59,8 @@ public interface PlatformMapper {
|
||||||
"WHERE id=#{id}")
|
"WHERE id=#{id}")
|
||||||
int update(Platform parentPlatform);
|
int update(Platform parentPlatform);
|
||||||
|
|
||||||
@Delete("DELETE FROM wvp_platform WHERE server_gb_id=#{serverGBId}")
|
@Delete("DELETE FROM wvp_platform WHERE id=#{id}")
|
||||||
int delParentPlatform(Platform parentPlatform);
|
int delete(@Param("id") Integer id);
|
||||||
|
|
||||||
@Select(" SELECT pp.*, " +
|
@Select(" SELECT pp.*, " +
|
||||||
" (SELECT count(0) FROM wvp_platform_channel pc WHERE pc.platform_id = pp.id ) as channel_count" +
|
" (SELECT count(0) FROM wvp_platform_channel pc WHERE pc.platform_id = pp.id ) as channel_count" +
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
package com.genersoft.iot.vmp.gb28181.service;
|
package com.genersoft.iot.vmp.gb28181.service;
|
||||||
|
|
||||||
|
import com.genersoft.iot.vmp.common.CommonCallback;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
|
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
||||||
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
|
|
||||||
import com.genersoft.iot.vmp.media.event.hook.HookSubscribe;
|
|
||||||
import com.genersoft.iot.vmp.media.bean.MediaServer;
|
|
||||||
import com.genersoft.iot.vmp.service.bean.InviteTimeOutCallback;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.SipTransactionInfo;
|
import com.genersoft.iot.vmp.gb28181.bean.SipTransactionInfo;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
|
||||||
|
import com.genersoft.iot.vmp.media.bean.MediaServer;
|
||||||
|
import com.genersoft.iot.vmp.media.event.hook.HookSubscribe;
|
||||||
|
import com.genersoft.iot.vmp.service.bean.InviteTimeOutCallback;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
|
||||||
import javax.sip.InvalidArgumentException;
|
import javax.sip.InvalidArgumentException;
|
||||||
|
@ -88,5 +89,5 @@ public interface IPlatformService {
|
||||||
|
|
||||||
List<Platform> queryEnablePlatformList();
|
List<Platform> queryEnablePlatformList();
|
||||||
|
|
||||||
|
void delete(Integer platformId, CommonCallback<Object> callback);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,11 +12,11 @@ import com.github.pagehelper.PageInfo;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
import javax.sip.InvalidArgumentException;
|
import javax.sip.InvalidArgumentException;
|
||||||
import javax.sip.SipException;
|
import javax.sip.SipException;
|
||||||
import java.beans.Transient;
|
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transient
|
@Transactional
|
||||||
public int addAllChannel(Integer platformId) {
|
public int addAllChannel(Integer platformId) {
|
||||||
List<CommonGBChannel> channelListNotShare = platformChannelMapper.queryNotShare(platformId, null);
|
List<CommonGBChannel> channelListNotShare = platformChannelMapper.queryNotShare(platformId, null);
|
||||||
Assert.notEmpty(channelListNotShare, "所有通道已共享");
|
Assert.notEmpty(channelListNotShare, "所有通道已共享");
|
||||||
|
@ -232,7 +232,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transient
|
@Transactional
|
||||||
public int addChannels(Integer platformId, List<Integer> channelIds) {
|
public int addChannels(Integer platformId, List<Integer> channelIds) {
|
||||||
List<CommonGBChannel> channelListNotShare = platformChannelMapper.queryNotShare(platformId, channelIds);
|
List<CommonGBChannel> channelListNotShare = platformChannelMapper.queryNotShare(platformId, channelIds);
|
||||||
Assert.notEmpty(channelListNotShare, "通道已共享");
|
Assert.notEmpty(channelListNotShare, "通道已共享");
|
||||||
|
@ -308,7 +308,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transient
|
@Transactional
|
||||||
public int removeChannels(Integer platformId, List<Integer> channelIds) {
|
public int removeChannels(Integer platformId, List<Integer> channelIds) {
|
||||||
List<CommonGBChannel> channelList = platformChannelMapper.queryShare(platformId, channelIds);
|
List<CommonGBChannel> channelList = platformChannelMapper.queryShare(platformId, channelIds);
|
||||||
Assert.notEmpty(channelList, "所选通道未共享");
|
Assert.notEmpty(channelList, "所选通道未共享");
|
||||||
|
@ -343,7 +343,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transient
|
@Transactional
|
||||||
public void removeChannels(List<Integer> ids) {
|
public void removeChannels(List<Integer> ids) {
|
||||||
List<Platform> platformList = platformChannelMapper.queryPlatFormListByChannelList(ids);
|
List<Platform> platformList = platformChannelMapper.queryPlatFormListByChannelList(ids);
|
||||||
if (platformList.isEmpty()) {
|
if (platformList.isEmpty()) {
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
package com.genersoft.iot.vmp.gb28181.service.impl;
|
package com.genersoft.iot.vmp.gb28181.service.impl;
|
||||||
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.genersoft.iot.vmp.common.*;
|
||||||
import com.genersoft.iot.vmp.common.InviteInfo;
|
import com.genersoft.iot.vmp.common.InviteInfo;
|
||||||
import com.genersoft.iot.vmp.common.InviteSessionStatus;
|
|
||||||
import com.genersoft.iot.vmp.common.InviteSessionType;
|
|
||||||
import com.genersoft.iot.vmp.common.StreamInfo;
|
|
||||||
import com.genersoft.iot.vmp.conf.DynamicTask;
|
import com.genersoft.iot.vmp.conf.DynamicTask;
|
||||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||||
import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException;
|
import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.dao.PlatformChannelMapper;
|
||||||
import com.genersoft.iot.vmp.gb28181.dao.PlatformMapper;
|
import com.genersoft.iot.vmp.gb28181.dao.PlatformMapper;
|
||||||
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
|
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IInviteStreamService;
|
import com.genersoft.iot.vmp.gb28181.service.IInviteStreamService;
|
||||||
|
@ -36,6 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.event.EventListener;
|
import org.springframework.context.event.EventListener;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
import javax.sdp.*;
|
import javax.sdp.*;
|
||||||
|
@ -93,6 +93,9 @@ public class PlatformServiceImpl implements IPlatformService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IInviteStreamService inviteStreamService;
|
private IInviteStreamService inviteStreamService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PlatformChannelMapper platformChannelMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流离开的处理
|
* 流离开的处理
|
||||||
|
@ -392,6 +395,7 @@ public class PlatformServiceImpl implements IPlatformService {
|
||||||
subscribeHolder.removeCatalogSubscribe(platform.getServerGBId());
|
subscribeHolder.removeCatalogSubscribe(platform.getServerGBId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("[平台离线] {}({}), 停止移动位置订阅回复", platform.getName(), platform.getServerGBId());
|
log.info("[平台离线] {}({}), 停止移动位置订阅回复", platform.getName(), platform.getServerGBId());
|
||||||
subscribeHolder.removeMobilePositionSubscribe(platform.getServerGBId());
|
subscribeHolder.removeMobilePositionSubscribe(platform.getServerGBId());
|
||||||
// 发起定时自动重新注册
|
// 发起定时自动重新注册
|
||||||
|
@ -805,4 +809,61 @@ public class PlatformServiceImpl implements IPlatformService {
|
||||||
public List<Platform> queryEnablePlatformList() {
|
public List<Platform> queryEnablePlatformList() {
|
||||||
return platformMapper.queryEnablePlatformList();
|
return platformMapper.queryEnablePlatformList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void delete(Integer platformId, CommonCallback<Object> callback) {
|
||||||
|
Platform platform = platformMapper.query(platformId);
|
||||||
|
Assert.notNull(platform, "平台不存在");
|
||||||
|
// 发送离线消息,无论是否成功都删除缓存
|
||||||
|
PlatformCatch platformCatch = redisCatchStorage.queryPlatformCatchInfo(platform.getServerGBId());
|
||||||
|
if (platformCatch != null) {
|
||||||
|
String key = UUID.randomUUID().toString();
|
||||||
|
dynamicTask.startDelay(key, ()->{
|
||||||
|
deletePlatformInfo(platform);
|
||||||
|
if (callback != null) {
|
||||||
|
callback.run(null);
|
||||||
|
}
|
||||||
|
}, 2000);
|
||||||
|
try {
|
||||||
|
commanderForPlatform.unregister(platform, platformCatch.getSipTransactionInfo(), (event -> {
|
||||||
|
dynamicTask.stop(key);
|
||||||
|
// 移除平台相关的信息
|
||||||
|
deletePlatformInfo(platform);
|
||||||
|
if (callback != null) {
|
||||||
|
callback.run(null);
|
||||||
|
}
|
||||||
|
}), (event -> {
|
||||||
|
dynamicTask.stop(key);
|
||||||
|
// 移除平台相关的信息
|
||||||
|
deletePlatformInfo(platform);
|
||||||
|
if (callback != null) {
|
||||||
|
callback.run(null);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
} catch (InvalidArgumentException | ParseException | SipException e) {
|
||||||
|
log.error("[命令发送失败] 国标级联 注销: {}", e.getMessage());
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
deletePlatformInfo(platform);
|
||||||
|
if (callback != null) {
|
||||||
|
callback.run(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void deletePlatformInfo(Platform platform) {
|
||||||
|
// 删除关联的通道
|
||||||
|
platformChannelMapper.removeChannelsByPlatformId(platform.getId());
|
||||||
|
// 删除关联的分组
|
||||||
|
platformChannelMapper.removePlatformGroupsByPlatformId(platform.getId());
|
||||||
|
// 删除关联的行政区划
|
||||||
|
platformChannelMapper.removePlatformRegionByPlatformId(platform.getId());
|
||||||
|
// 删除redis缓存
|
||||||
|
redisCatchStorage.delPlatformCatchInfo(platform.getServerGBId());
|
||||||
|
// 删除平台信息
|
||||||
|
platformMapper.delete(platform.getId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,10 +11,7 @@ import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||||
import com.genersoft.iot.vmp.gb28181.controller.bean.AudioBroadcastEvent;
|
import com.genersoft.iot.vmp.gb28181.controller.bean.AudioBroadcastEvent;
|
||||||
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
|
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IDeviceChannelService;
|
import com.genersoft.iot.vmp.gb28181.service.*;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IDeviceService;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IInviteStreamService;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IPlayService;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.session.AudioBroadcastManager;
|
import com.genersoft.iot.vmp.gb28181.session.AudioBroadcastManager;
|
||||||
import com.genersoft.iot.vmp.gb28181.session.SSRCFactory;
|
import com.genersoft.iot.vmp.gb28181.session.SSRCFactory;
|
||||||
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
|
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
|
||||||
|
@ -120,6 +117,9 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SSRCFactory ssrcFactory;
|
private SSRCFactory ssrcFactory;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPlatformService platformService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流到来的处理
|
* 流到来的处理
|
||||||
*/
|
*/
|
||||||
|
@ -1155,7 +1155,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
if (sendRtpItems.size() > 0) {
|
if (sendRtpItems.size() > 0) {
|
||||||
for (SendRtpItem sendRtpItem : sendRtpItems) {
|
for (SendRtpItem sendRtpItem : sendRtpItems) {
|
||||||
if (sendRtpItem.getMediaServerId().equals(mediaServerId)) {
|
if (sendRtpItem.getMediaServerId().equals(mediaServerId)) {
|
||||||
Platform platform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId());
|
Platform platform = platformService.queryPlatformByServerGBId(sendRtpItem.getPlatformId());
|
||||||
try {
|
try {
|
||||||
sipCommanderFroPlatform.streamByeCmd(platform, sendRtpItem.getCallId());
|
sipCommanderFroPlatform.streamByeCmd(platform, sendRtpItem.getCallId());
|
||||||
} catch (SipException | InvalidArgumentException | ParseException e) {
|
} catch (SipException | InvalidArgumentException | ParseException e) {
|
||||||
|
|
|
@ -6,16 +6,16 @@ import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
|
import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.service.IDeviceService;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.service.IPlatformService;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.service.IPlayService;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
|
import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor;
|
import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
|
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
|
||||||
import com.genersoft.iot.vmp.media.bean.MediaServer;
|
import com.genersoft.iot.vmp.media.bean.MediaServer;
|
||||||
import com.genersoft.iot.vmp.media.service.IMediaServerService;
|
import com.genersoft.iot.vmp.media.service.IMediaServerService;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IDeviceService;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IPlayService;
|
|
||||||
import com.genersoft.iot.vmp.service.redisMsg.IRedisRpcService;
|
import com.genersoft.iot.vmp.service.redisMsg.IRedisRpcService;
|
||||||
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.vmanager.bean.WVPResult;
|
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
|
@ -50,6 +50,7 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IRedisCatchStorage redisCatchStorage;
|
private IRedisCatchStorage redisCatchStorage;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IRedisRpcService redisRpcService;
|
private IRedisRpcService redisRpcService;
|
||||||
|
|
||||||
|
@ -57,7 +58,7 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In
|
||||||
private UserSetting userSetting;
|
private UserSetting userSetting;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IVideoManagerStorage storager;
|
private IPlatformService platformService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IDeviceService deviceService;
|
private IDeviceService deviceService;
|
||||||
|
@ -100,7 +101,7 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In
|
||||||
sendRtpItem.getSsrc(),
|
sendRtpItem.getSsrc(),
|
||||||
sendRtpItem.isTcp()?(sendRtpItem.isTcpActive()?"TCP主动":"TCP被动"):"UDP"
|
sendRtpItem.isTcp()?(sendRtpItem.isTcpActive()?"TCP主动":"TCP被动"):"UDP"
|
||||||
);
|
);
|
||||||
Platform parentPlatform = storager.queryParentPlatByServerGBId(fromUserId);
|
Platform parentPlatform = platformService.queryPlatformByServerGBId(fromUserId);
|
||||||
|
|
||||||
if (parentPlatform != null) {
|
if (parentPlatform != null) {
|
||||||
if (!userSetting.getServerId().equals(sendRtpItem.getServerId())) {
|
if (!userSetting.getServerId().equals(sendRtpItem.getServerId())) {
|
||||||
|
|
|
@ -11,12 +11,12 @@ import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IGbChannelPlayService;
|
import com.genersoft.iot.vmp.gb28181.service.IGbChannelPlayService;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IGbChannelService;
|
import com.genersoft.iot.vmp.gb28181.service.IGbChannelService;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.service.IPlatformService;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IPlayService;
|
import com.genersoft.iot.vmp.gb28181.service.IPlayService;
|
||||||
import com.genersoft.iot.vmp.gb28181.session.AudioBroadcastManager;
|
import com.genersoft.iot.vmp.gb28181.session.AudioBroadcastManager;
|
||||||
import com.genersoft.iot.vmp.gb28181.session.SSRCFactory;
|
import com.genersoft.iot.vmp.gb28181.session.SSRCFactory;
|
||||||
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
|
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
|
import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.SIPSender;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor;
|
import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
|
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
|
||||||
|
@ -104,7 +104,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||||
private IPlayService playService;
|
private IPlayService playService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SIPSender sipSender;
|
private IPlatformService platformService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private AudioBroadcastManager audioBroadcastManager;
|
private AudioBroadcastManager audioBroadcastManager;
|
||||||
|
@ -153,7 +153,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||||
InviteInfo inviteInfo = decode(evt);
|
InviteInfo inviteInfo = decode(evt);
|
||||||
|
|
||||||
// 查询请求是否来自上级平台\设备
|
// 查询请求是否来自上级平台\设备
|
||||||
Platform platform = storager.queryParentPlatByServerGBId(inviteInfo.getRequesterId());
|
Platform platform = platformService.queryPlatformByServerGBId(inviteInfo.getRequesterId());
|
||||||
if (platform == null) {
|
if (platform == null) {
|
||||||
inviteFromDeviceHandle(request, inviteInfo.getRequesterId(), inviteInfo.getChannelId());
|
inviteFromDeviceHandle(request, inviteInfo.getRequesterId(), inviteInfo.getChannelId());
|
||||||
} else {
|
} else {
|
||||||
|
@ -266,7 +266,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// // 查询请求是否来自上级平台\设备
|
// // 查询请求是否来自上级平台\设备
|
||||||
// Platform platform = storager.queryParentPlatByServerGBId(requesterId);
|
// Platform platform = platformService.queryPlatformByServerGBId(requesterId);
|
||||||
//
|
//
|
||||||
// if (platform == null) {
|
// if (platform == null) {
|
||||||
// inviteFromDeviceHandle(request, requesterId, channelId);
|
// inviteFromDeviceHandle(request, requesterId, channelId);
|
||||||
|
|
|
@ -108,7 +108,7 @@ public class SubscribeRequestProcessor extends SIPRequestProcessorParent impleme
|
||||||
}
|
}
|
||||||
String platformId = SipUtils.getUserIdFromFromHeader(request);
|
String platformId = SipUtils.getUserIdFromFromHeader(request);
|
||||||
String deviceId = XmlUtil.getText(rootElement, "DeviceID");
|
String deviceId = XmlUtil.getText(rootElement, "DeviceID");
|
||||||
Platform platform = storager.queryParentPlatByServerGBId(platformId);
|
Platform platform = platformService.queryPlatformByServerGBId(platformId);
|
||||||
SubscribeInfo subscribeInfo = new SubscribeInfo(request, platformId);
|
SubscribeInfo subscribeInfo = new SubscribeInfo(request, platformId);
|
||||||
if (platform == null) {
|
if (platform == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -137,7 +137,7 @@ public class SubscribeRequestProcessor extends SIPRequestProcessorParent impleme
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Platform parentPlatform = storager.queryParentPlatByServerGBId(platformId);
|
Platform parentPlatform = platformService.queryPlatformByServerGBId(platformId);
|
||||||
SIPResponse response = responseXmlAck(request, resultXml.toString(), parentPlatform, subscribeInfo.getExpires());
|
SIPResponse response = responseXmlAck(request, resultXml.toString(), parentPlatform, subscribeInfo.getExpires());
|
||||||
if (subscribeInfo.getExpires() == 0) {
|
if (subscribeInfo.getExpires() == 0) {
|
||||||
subscribeHolder.removeMobilePositionSubscribe(platformId);
|
subscribeHolder.removeMobilePositionSubscribe(platformId);
|
||||||
|
@ -163,7 +163,7 @@ public class SubscribeRequestProcessor extends SIPRequestProcessorParent impleme
|
||||||
}
|
}
|
||||||
String platformId = SipUtils.getUserIdFromFromHeader(request);
|
String platformId = SipUtils.getUserIdFromFromHeader(request);
|
||||||
String deviceId = XmlUtil.getText(rootElement, "DeviceID");
|
String deviceId = XmlUtil.getText(rootElement, "DeviceID");
|
||||||
Platform platform = storager.queryParentPlatByServerGBId(platformId);
|
Platform platform = platformService.queryPlatformByServerGBId(platformId);
|
||||||
if (platform == null){
|
if (platform == null){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,7 @@ public class SubscribeRequestProcessor extends SIPRequestProcessorParent impleme
|
||||||
subscribeHolder.removeCatalogSubscribe(platformId);
|
subscribeHolder.removeCatalogSubscribe(platformId);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Platform parentPlatform = storager.queryParentPlatByServerGBId(platformId);
|
Platform parentPlatform = platformService.queryPlatformByServerGBId(platformId);
|
||||||
SIPResponse response = responseXmlAck(request, resultXml.toString(), parentPlatform, subscribeInfo.getExpires());
|
SIPResponse response = responseXmlAck(request, resultXml.toString(), parentPlatform, subscribeInfo.getExpires());
|
||||||
if (subscribeInfo.getExpires() == 0) {
|
if (subscribeInfo.getExpires() == 0) {
|
||||||
subscribeHolder.removeCatalogSubscribe(platformId);
|
subscribeHolder.removeCatalogSubscribe(platformId);
|
||||||
|
|
|
@ -4,15 +4,15 @@ import com.genersoft.iot.vmp.common.InviteInfo;
|
||||||
import com.genersoft.iot.vmp.common.InviteSessionType;
|
import com.genersoft.iot.vmp.common.InviteSessionType;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||||
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
|
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.service.IDeviceService;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.service.IInviteStreamService;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.service.IPlatformService;
|
||||||
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
|
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
|
import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor;
|
import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
|
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IDeviceService;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IInviteStreamService;
|
|
||||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
|
||||||
import gov.nist.javax.sip.message.SIPRequest;
|
import gov.nist.javax.sip.message.SIPRequest;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
|
@ -40,7 +40,7 @@ public class InfoRequestProcessor extends SIPRequestProcessorParent implements I
|
||||||
private SIPProcessorObserver sipProcessorObserver;
|
private SIPProcessorObserver sipProcessorObserver;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IVideoManagerStorage storage;
|
private IPlatformService platformService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SipSubscribe sipSubscribe;
|
private SipSubscribe sipSubscribe;
|
||||||
|
@ -77,7 +77,7 @@ public class InfoRequestProcessor extends SIPRequestProcessorParent implements I
|
||||||
// 查询设备是否存在
|
// 查询设备是否存在
|
||||||
Device device = redisCatchStorage.getDevice(ssrcTransaction.getDeviceId());
|
Device device = redisCatchStorage.getDevice(ssrcTransaction.getDeviceId());
|
||||||
// 查询上级平台是否存在
|
// 查询上级平台是否存在
|
||||||
Platform parentPlatform = storage.queryParentPlatByServerGBId(ssrcTransaction.getDeviceId());
|
Platform parentPlatform = platformService.queryPlatformByServerGBId(ssrcTransaction.getDeviceId());
|
||||||
try {
|
try {
|
||||||
if (device != null && parentPlatform != null) {
|
if (device != null && parentPlatform != null) {
|
||||||
log.warn("[重复]平台与设备编号重复:{}", ssrcTransaction.getDeviceId());
|
log.warn("[重复]平台与设备编号重复:{}", ssrcTransaction.getDeviceId());
|
||||||
|
|
|
@ -2,9 +2,9 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message;
|
||||||
|
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.service.IPlatformService;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
|
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query.cmd.CatalogQueryMessageHandler;
|
import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query.cmd.CatalogQueryMessageHandler;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
|
||||||
import gov.nist.javax.sip.message.SIPRequest;
|
import gov.nist.javax.sip.message.SIPRequest;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dom4j.Element;
|
import org.dom4j.Element;
|
||||||
|
@ -26,7 +26,7 @@ public abstract class MessageHandlerAbstract extends SIPRequestProcessorParent i
|
||||||
public Map<String, IMessageHandler> messageHandlerMap = new ConcurrentHashMap<>();
|
public Map<String, IMessageHandler> messageHandlerMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IVideoManagerStorage storage;
|
private IPlatformService platformService;
|
||||||
|
|
||||||
public void addHandler(String cmdType, IMessageHandler messageHandler) {
|
public void addHandler(String cmdType, IMessageHandler messageHandler) {
|
||||||
messageHandlerMap.put(cmdType, messageHandler);
|
messageHandlerMap.put(cmdType, messageHandler);
|
||||||
|
@ -49,7 +49,7 @@ public abstract class MessageHandlerAbstract extends SIPRequestProcessorParent i
|
||||||
//两个国标平台互相级联时由于上一步判断导致本该在平台处理的消息 放到了设备的处理逻辑
|
//两个国标平台互相级联时由于上一步判断导致本该在平台处理的消息 放到了设备的处理逻辑
|
||||||
//所以对目录查询单独做了校验
|
//所以对目录查询单独做了校验
|
||||||
if(messageHandler instanceof CatalogQueryMessageHandler){
|
if(messageHandler instanceof CatalogQueryMessageHandler){
|
||||||
Platform parentPlatform = storage.queryParentPlatByServerGBId(device.getDeviceId());
|
Platform parentPlatform = platformService.queryPlatformByServerGBId(device.getDeviceId());
|
||||||
messageHandler.handForPlatform(evt, parentPlatform, element);
|
messageHandler.handForPlatform(evt, parentPlatform, element);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,13 +5,13 @@ import com.genersoft.iot.vmp.gb28181.bean.DeviceNotFoundEvent;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction;
|
import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction;
|
||||||
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
|
import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.service.IPlatformService;
|
||||||
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
|
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
|
import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor;
|
import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
|
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
|
||||||
import com.genersoft.iot.vmp.gb28181.utils.SipUtils;
|
import com.genersoft.iot.vmp.gb28181.utils.SipUtils;
|
||||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
|
||||||
import gov.nist.javax.sip.message.SIPRequest;
|
import gov.nist.javax.sip.message.SIPRequest;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dom4j.DocumentException;
|
import org.dom4j.DocumentException;
|
||||||
|
@ -41,7 +41,7 @@ public class MessageRequestProcessor extends SIPRequestProcessorParent implement
|
||||||
private SIPProcessorObserver sipProcessorObserver;
|
private SIPProcessorObserver sipProcessorObserver;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IVideoManagerStorage storage;
|
private IPlatformService platformService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SipSubscribe sipSubscribe;
|
private SipSubscribe sipSubscribe;
|
||||||
|
@ -78,7 +78,7 @@ public class MessageRequestProcessor extends SIPRequestProcessorParent implement
|
||||||
// 查询设备是否存在
|
// 查询设备是否存在
|
||||||
Device device = redisCatchStorage.getDevice(deviceId);
|
Device device = redisCatchStorage.getDevice(deviceId);
|
||||||
// 查询上级平台是否存在
|
// 查询上级平台是否存在
|
||||||
Platform parentPlatform = storage.queryParentPlatByServerGBId(deviceId);
|
Platform parentPlatform = platformService.queryPlatformByServerGBId(deviceId);
|
||||||
try {
|
try {
|
||||||
if (device != null && parentPlatform != null) {
|
if (device != null && parentPlatform != null) {
|
||||||
String hostAddress = request.getRemoteAddress().getHostAddress();
|
String hostAddress = request.getRemoteAddress().getHostAddress();
|
||||||
|
|
|
@ -7,6 +7,8 @@ import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
|
import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction;
|
import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.service.IInviteStreamService;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.service.IPlatformService;
|
||||||
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
|
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform;
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform;
|
||||||
|
@ -16,9 +18,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.notify.
|
||||||
import com.genersoft.iot.vmp.media.event.hook.Hook;
|
import com.genersoft.iot.vmp.media.event.hook.Hook;
|
||||||
import com.genersoft.iot.vmp.media.event.hook.HookSubscribe;
|
import com.genersoft.iot.vmp.media.event.hook.HookSubscribe;
|
||||||
import com.genersoft.iot.vmp.media.event.hook.HookType;
|
import com.genersoft.iot.vmp.media.event.hook.HookType;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IInviteStreamService;
|
|
||||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
|
||||||
import gov.nist.javax.sip.message.SIPRequest;
|
import gov.nist.javax.sip.message.SIPRequest;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dom4j.Element;
|
import org.dom4j.Element;
|
||||||
|
@ -57,10 +57,7 @@ public class MediaStatusNotifyMessageHandler extends SIPRequestProcessorParent i
|
||||||
private IRedisCatchStorage redisCatchStorage;
|
private IRedisCatchStorage redisCatchStorage;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IVideoManagerStorage storage;
|
private IPlatformService platformService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private VideoStreamSessionManager sessionManager;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private HookSubscribe subscribe;
|
private HookSubscribe subscribe;
|
||||||
|
@ -110,7 +107,7 @@ public class MediaStatusNotifyMessageHandler extends SIPRequestProcessorParent i
|
||||||
// 如果级联播放,需要给上级发送此通知 TODO 多个上级同时观看一个下级 可能存在停错的问题,需要将点播CallId进行上下级绑定
|
// 如果级联播放,需要给上级发送此通知 TODO 多个上级同时观看一个下级 可能存在停错的问题,需要将点播CallId进行上下级绑定
|
||||||
SendRtpItem sendRtpItem = redisCatchStorage.querySendRTPServer(null, ssrcTransaction.getChannelId(), null, null);
|
SendRtpItem sendRtpItem = redisCatchStorage.querySendRTPServer(null, ssrcTransaction.getChannelId(), null, null);
|
||||||
if (sendRtpItem != null) {
|
if (sendRtpItem != null) {
|
||||||
Platform parentPlatform = storage.queryParentPlatByServerGBId(sendRtpItem.getPlatformId());
|
Platform parentPlatform = platformService.queryPlatformByServerGBId(sendRtpItem.getPlatformId());
|
||||||
if (parentPlatform == null) {
|
if (parentPlatform == null) {
|
||||||
log.warn("[级联消息发送]:发送MediaStatus发现上级平台{}不存在", sendRtpItem.getPlatformId());
|
log.warn("[级联消息发送]:发送MediaStatus发现上级平台{}不存在", sendRtpItem.getPlatformId());
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -10,15 +10,16 @@ import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IDeviceChannelService;
|
import com.genersoft.iot.vmp.gb28181.service.IDeviceChannelService;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IDeviceService;
|
import com.genersoft.iot.vmp.gb28181.service.IDeviceService;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IInviteStreamService;
|
import com.genersoft.iot.vmp.gb28181.service.IInviteStreamService;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.service.IPlatformService;
|
||||||
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
|
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
||||||
import com.genersoft.iot.vmp.media.bean.MediaServer;
|
import com.genersoft.iot.vmp.media.bean.MediaServer;
|
||||||
import com.genersoft.iot.vmp.media.bean.ResultForOnPublish;
|
import com.genersoft.iot.vmp.media.bean.ResultForOnPublish;
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo;
|
import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo;
|
||||||
import com.genersoft.iot.vmp.service.*;
|
import com.genersoft.iot.vmp.service.IMediaService;
|
||||||
|
import com.genersoft.iot.vmp.service.IUserService;
|
||||||
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.streamProxy.bean.StreamProxy;
|
import com.genersoft.iot.vmp.streamProxy.bean.StreamProxy;
|
||||||
import com.genersoft.iot.vmp.streamProxy.service.IStreamProxyService;
|
import com.genersoft.iot.vmp.streamProxy.service.IStreamProxyService;
|
||||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
|
@ -66,7 +67,7 @@ public class MediaServiceImpl implements IMediaService {
|
||||||
private VideoStreamSessionManager sessionManager;
|
private VideoStreamSessionManager sessionManager;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IVideoManagerStorage storager;
|
private IPlatformService platformService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IDeviceService deviceService;
|
private IDeviceService deviceService;
|
||||||
|
@ -234,7 +235,7 @@ public class MediaServiceImpl implements IMediaService {
|
||||||
inviteInfo.getChannelId());
|
inviteInfo.getChannelId());
|
||||||
if (!sendRtpItems.isEmpty()) {
|
if (!sendRtpItems.isEmpty()) {
|
||||||
for (SendRtpItem sendRtpItem : sendRtpItems) {
|
for (SendRtpItem sendRtpItem : sendRtpItems) {
|
||||||
Platform parentPlatform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId());
|
Platform parentPlatform = platformService.queryPlatformByServerGBId(sendRtpItem.getPlatformId());
|
||||||
try {
|
try {
|
||||||
commanderForPlatform.streamByeCmd(parentPlatform, sendRtpItem.getCallId());
|
commanderForPlatform.streamByeCmd(parentPlatform, sendRtpItem.getCallId());
|
||||||
} catch (SipException | InvalidArgumentException | ParseException e) {
|
} catch (SipException | InvalidArgumentException | ParseException e) {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import com.genersoft.iot.vmp.gb28181.bean.AlarmChannelMessage;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm;
|
import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.service.IPlatformService;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IDeviceChannelService;
|
import com.genersoft.iot.vmp.gb28181.service.IDeviceChannelService;
|
||||||
|
@ -47,6 +48,9 @@ public class RedisAlarmMsgListener implements MessageListener {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IVideoManagerStorage storage;
|
private IVideoManagerStorage storage;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPlatformService platformService;
|
||||||
|
|
||||||
private ConcurrentLinkedQueue<Message> taskQueue = new ConcurrentLinkedQueue<>();
|
private ConcurrentLinkedQueue<Message> taskQueue = new ConcurrentLinkedQueue<>();
|
||||||
|
|
||||||
@Qualifier("taskExecutor")
|
@Qualifier("taskExecutor")
|
||||||
|
@ -89,8 +93,8 @@ public class RedisAlarmMsgListener implements MessageListener {
|
||||||
if (ObjectUtils.isEmpty(gbId)) {
|
if (ObjectUtils.isEmpty(gbId)) {
|
||||||
if (userSetting.getSendToPlatformsWhenIdLost()) {
|
if (userSetting.getSendToPlatformsWhenIdLost()) {
|
||||||
// 发送给所有的上级
|
// 发送给所有的上级
|
||||||
List<Platform> parentPlatforms = storage.queryEnableParentPlatformList(true);
|
List<Platform> parentPlatforms = platformService.queryEnablePlatformList();
|
||||||
if (parentPlatforms.size() > 0) {
|
if (!parentPlatforms.isEmpty()) {
|
||||||
for (Platform parentPlatform : parentPlatforms) {
|
for (Platform parentPlatform : parentPlatforms) {
|
||||||
try {
|
try {
|
||||||
deviceAlarm.setChannelId(parentPlatform.getDeviceGBId());
|
deviceAlarm.setChannelId(parentPlatform.getDeviceGBId());
|
||||||
|
@ -130,7 +134,7 @@ public class RedisAlarmMsgListener implements MessageListener {
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
Device device = deviceService.getDeviceByDeviceId(gbId);
|
Device device = deviceService.getDeviceByDeviceId(gbId);
|
||||||
Platform platform = storage.queryParentPlatByServerGBId(gbId);
|
Platform platform = platformService.queryPlatformByServerGBId(gbId);
|
||||||
if (device != null && platform == null) {
|
if (device != null && platform == null) {
|
||||||
try {
|
try {
|
||||||
commander.sendAlarmMessage(device, deviceAlarm);
|
commander.sendAlarmMessage(device, deviceAlarm);
|
||||||
|
|
|
@ -10,6 +10,7 @@ import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcRequest;
|
||||||
import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcResponse;
|
import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcResponse;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
|
import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.service.IPlatformService;
|
||||||
import com.genersoft.iot.vmp.gb28181.session.SSRCFactory;
|
import com.genersoft.iot.vmp.gb28181.session.SSRCFactory;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
||||||
import com.genersoft.iot.vmp.media.bean.MediaInfo;
|
import com.genersoft.iot.vmp.media.bean.MediaInfo;
|
||||||
|
@ -20,7 +21,6 @@ import com.genersoft.iot.vmp.media.event.hook.HookType;
|
||||||
import com.genersoft.iot.vmp.media.service.IMediaServerService;
|
import com.genersoft.iot.vmp.media.service.IMediaServerService;
|
||||||
import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager;
|
import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager;
|
||||||
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.vmanager.bean.ErrorCode;
|
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
@ -66,7 +66,7 @@ public class RedisRpcController {
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IVideoManagerStorage storager;
|
private IPlatformService platformService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -317,7 +317,7 @@ public class RedisRpcController {
|
||||||
}
|
}
|
||||||
log.info("[redis-rpc] 推流已经停止: {}/{}, 目标地址: {}:{}", sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getIp(), sendRtpItem.getPort() );
|
log.info("[redis-rpc] 推流已经停止: {}/{}, 目标地址: {}:{}", sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getIp(), sendRtpItem.getPort() );
|
||||||
String platformId = sendRtpItem.getPlatformId();
|
String platformId = sendRtpItem.getPlatformId();
|
||||||
Platform platform = storager.queryParentPlatByServerGBId(platformId);
|
Platform platform = platformService.queryPlatformByServerGBId(platformId);
|
||||||
if (platform == null) {
|
if (platform == null) {
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
package com.genersoft.iot.vmp.storager;
|
package com.genersoft.iot.vmp.storager;
|
||||||
|
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.MobilePosition;
|
import com.genersoft.iot.vmp.gb28181.bean.MobilePosition;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
||||||
import com.genersoft.iot.vmp.gb28181.controller.bean.ChannelReduce;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -17,41 +15,6 @@ import java.util.List;
|
||||||
public interface IVideoManagerStorage {
|
public interface IVideoManagerStorage {
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新上级平台
|
|
||||||
* @param parentPlatform
|
|
||||||
*/
|
|
||||||
boolean updateParentPlatform(Platform parentPlatform);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除上级平台
|
|
||||||
* @param parentPlatform
|
|
||||||
*/
|
|
||||||
boolean deleteParentPlatform(Platform parentPlatform);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取所有已启用的平台
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<Platform> queryEnableParentPlatformList(boolean enable);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取上级平台
|
|
||||||
* @param platformGbId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
Platform queryParentPlatByServerGBId(String platformGbId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 移除上级平台的通道信息
|
|
||||||
* @param platformId
|
|
||||||
* @param channelReduces
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
int delChannelForGB(String platformId, List<ChannelReduce> channelReduces);
|
|
||||||
|
|
||||||
|
|
||||||
DeviceChannel queryChannelInParentPlatform(String platformId, String channelId);
|
|
||||||
|
|
||||||
Device queryVideoDeviceByPlatformIdAndChannelId(String platformId, String channelId);
|
Device queryVideoDeviceByPlatformIdAndChannelId(String platformId, String channelId);
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
package com.genersoft.iot.vmp.storager.impl;
|
package com.genersoft.iot.vmp.storager.impl;
|
||||||
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
import com.genersoft.iot.vmp.gb28181.controller.bean.ChannelReduce;
|
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.bean.MobilePosition;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
||||||
import com.genersoft.iot.vmp.gb28181.dao.*;
|
import com.genersoft.iot.vmp.gb28181.dao.*;
|
||||||
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;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -56,92 +56,11 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||||
return deviceMobilePositionMapper.queryPositionByDeviceIdAndTime(deviceId, channelId, startTime, endTime);
|
return deviceMobilePositionMapper.queryPositionByDeviceIdAndTime(deviceId, channelId, startTime, endTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean updateParentPlatform(Platform parentPlatform) {
|
|
||||||
int result = 0;
|
|
||||||
if (parentPlatform.getCatalogGroup() == 0) {
|
|
||||||
parentPlatform.setCatalogGroup(1);
|
|
||||||
}
|
|
||||||
PlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId());
|
|
||||||
if (parentPlatform.getId() == null ) {
|
|
||||||
result = platformMapper.add(parentPlatform);
|
|
||||||
if (parentPlatformCatch == null) {
|
|
||||||
parentPlatformCatch = new PlatformCatch();
|
|
||||||
parentPlatformCatch.setPlatform(parentPlatform);
|
|
||||||
parentPlatformCatch.setId(parentPlatform.getServerGBId());
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
if (parentPlatformCatch == null) { // serverGBId 已变化
|
|
||||||
Platform parentPlatById = platformMapper.query(parentPlatform.getId());
|
|
||||||
// 使用旧的查出缓存ID
|
|
||||||
parentPlatformCatch = new PlatformCatch();
|
|
||||||
parentPlatformCatch.setId(parentPlatform.getServerGBId());
|
|
||||||
redisCatchStorage.delPlatformCatchInfo(parentPlatById.getServerGBId());
|
|
||||||
}
|
|
||||||
|
|
||||||
result = platformMapper.update(parentPlatform);
|
|
||||||
}
|
|
||||||
// 更新缓存
|
|
||||||
parentPlatformCatch.setPlatform(parentPlatform);
|
|
||||||
redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
|
|
||||||
|
|
||||||
return result > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional
|
|
||||||
@Override
|
|
||||||
public boolean deleteParentPlatform(Platform parentPlatform) {
|
|
||||||
int result = platformMapper.delParentPlatform(parentPlatform);
|
|
||||||
// 删除关联的通道
|
|
||||||
platformChannelMapper.cleanChannelForGB(parentPlatform.getServerGBId());
|
|
||||||
return result > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Platform queryParentPlatByServerGBId(String platformGbId) {
|
|
||||||
return platformMapper.getParentPlatByServerGBId(platformGbId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Platform> queryEnableParentPlatformList(boolean enable) {
|
|
||||||
return platformMapper.getEnableParentPlatformList(enable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Platform> queryEnablePlatformListWithAsMessageChannel() {
|
public List<Platform> queryEnablePlatformListWithAsMessageChannel() {
|
||||||
return platformMapper.queryEnablePlatformListWithAsMessageChannel();
|
return platformMapper.queryEnablePlatformListWithAsMessageChannel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int delChannelForGB(String platformId, List<ChannelReduce> channelReduces) {
|
|
||||||
|
|
||||||
int result = platformChannelMapper.delChannelForGB(platformId, channelReduces);
|
|
||||||
List<CommonGBChannel> deviceChannelList = new ArrayList<>();
|
|
||||||
for (ChannelReduce channelReduce : channelReduces) {
|
|
||||||
CommonGBChannel deviceChannel = new CommonGBChannel();
|
|
||||||
deviceChannel.setGbDeviceId(channelReduce.getChannelId());
|
|
||||||
deviceChannelList.add(deviceChannel);
|
|
||||||
}
|
|
||||||
// eventPublisher.catalogEventPublish(platformId, deviceChannelList, CatalogEvent.DEL);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DeviceChannel queryChannelInParentPlatform(String platformId, String channelId) {
|
|
||||||
List<DeviceChannel> channels = platformChannelMapper.queryChannelInParentPlatform(platformId, channelId);
|
|
||||||
if (channels.size() > 1) {
|
|
||||||
// 出现长度大于0的时候肯定是国标通道的ID重复了
|
|
||||||
log.warn("国标ID存在重复:{}", channelId);
|
|
||||||
}
|
|
||||||
if (channels.size() == 0) {
|
|
||||||
return null;
|
|
||||||
}else {
|
|
||||||
return channels.get(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Device queryVideoDeviceByPlatformIdAndChannelId(String platformId, String channelId) {
|
public Device queryVideoDeviceByPlatformIdAndChannelId(String platformId, String channelId) {
|
||||||
List<Device> devices = platformChannelMapper.queryVideoDeviceByPlatformIdAndChannelId(platformId, channelId);
|
List<Device> devices = platformChannelMapper.queryVideoDeviceByPlatformIdAndChannelId(platformId, channelId);
|
||||||
|
|
|
@ -4,16 +4,18 @@
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<div class="page-title">上级平台列表</div>
|
<div class="page-title">上级平台列表</div>
|
||||||
<div class="page-header-btn">
|
<div class="page-header-btn">
|
||||||
<el-button icon="el-icon-plus" size="mini" style="margin-right: 1rem;" type="primary" @click="addParentPlatform">添加</el-button>
|
<el-button icon="el-icon-plus" size="mini" style="margin-right: 1rem;" type="primary"
|
||||||
|
@click="addParentPlatform">添加
|
||||||
|
</el-button>
|
||||||
<el-button icon="el-icon-refresh-right" circle size="mini" @click="refresh()"></el-button>
|
<el-button icon="el-icon-refresh-right" circle size="mini" @click="refresh()"></el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--设备列表-->
|
<!--设备列表-->
|
||||||
<el-table size="medium" :data="platformList" style="width: 100%" :height="winHeight">
|
<el-table size="medium" :data="platformList" style="width: 100%" :height="winHeight" :loading="loading">
|
||||||
<el-table-column prop="name" label="名称" ></el-table-column>
|
<el-table-column prop="name" label="名称"></el-table-column>
|
||||||
<el-table-column prop="serverGBId" label="平台编号" min-width="200"></el-table-column>
|
<el-table-column prop="serverGBId" label="平台编号" min-width="200"></el-table-column>
|
||||||
<el-table-column label="是否启用" min-width="80" >
|
<el-table-column label="是否启用" min-width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div slot="reference" class="name-wrapper">
|
<div slot="reference" class="name-wrapper">
|
||||||
<el-tag size="medium" v-if="scope.row.enable">已启用</el-tag>
|
<el-tag size="medium" v-if="scope.row.enable">已启用</el-tag>
|
||||||
|
@ -21,7 +23,7 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="状态" min-width="80" >
|
<el-table-column label="状态" min-width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div slot="reference" class="name-wrapper">
|
<div slot="reference" class="name-wrapper">
|
||||||
<el-tag size="medium" v-if="scope.row.status">在线</el-tag>
|
<el-tag size="medium" v-if="scope.row.status">在线</el-tag>
|
||||||
|
@ -29,33 +31,42 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="地址" min-width="160" >
|
<el-table-column label="地址" min-width="160">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div slot="reference" class="name-wrapper">
|
<div slot="reference" class="name-wrapper">
|
||||||
<el-tag size="medium">{{ scope.row.serverIp}}:{{scope.row.serverPort }}</el-tag>
|
<el-tag size="medium">{{ scope.row.serverIp }}:{{ scope.row.serverPort }}</el-tag>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="deviceGBId" label="设备国标编号" min-width="200" ></el-table-column>
|
<el-table-column prop="deviceGBId" label="设备国标编号" min-width="200"></el-table-column>
|
||||||
<el-table-column prop="transport" label="信令传输模式" min-width="120" ></el-table-column>
|
<el-table-column prop="transport" label="信令传输模式" min-width="120"></el-table-column>
|
||||||
<el-table-column prop="channelCount" label="通道数" min-width="120" ></el-table-column>
|
<el-table-column prop="channelCount" label="通道数" min-width="120"></el-table-column>
|
||||||
<el-table-column label="订阅信息" min-width="120" fixed="right">
|
<el-table-column label="订阅信息" min-width="120" fixed="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<i v-if="scope.row.alarmSubscribe" style="font-size: 20px" title="报警订阅" class="iconfont icon-gbaojings subscribe-on " ></i>
|
<i v-if="scope.row.alarmSubscribe" style="font-size: 20px" title="报警订阅"
|
||||||
<i v-if="!scope.row.alarmSubscribe" style="font-size: 20px" title="报警订阅" class="iconfont icon-gbaojings subscribe-off " ></i>
|
class="iconfont icon-gbaojings subscribe-on "></i>
|
||||||
<i v-if="scope.row.catalogSubscribe" title="目录订阅" class="iconfont icon-gjichus subscribe-on" ></i>
|
<i v-if="!scope.row.alarmSubscribe" style="font-size: 20px" title="报警订阅"
|
||||||
<i v-if="!scope.row.catalogSubscribe" title="目录订阅" class="iconfont icon-gjichus subscribe-off" ></i>
|
class="iconfont icon-gbaojings subscribe-off "></i>
|
||||||
<i v-if="scope.row.mobilePositionSubscribe" title="位置订阅" class="iconfont icon-gxunjians subscribe-on" ></i>
|
<i v-if="scope.row.catalogSubscribe" title="目录订阅" class="iconfont icon-gjichus subscribe-on"></i>
|
||||||
<i v-if="!scope.row.mobilePositionSubscribe" title="位置订阅" class="iconfont icon-gxunjians subscribe-off" ></i>
|
<i v-if="!scope.row.catalogSubscribe" title="目录订阅" class="iconfont icon-gjichus subscribe-off"></i>
|
||||||
|
<i v-if="scope.row.mobilePositionSubscribe" title="位置订阅"
|
||||||
|
class="iconfont icon-gxunjians subscribe-on"></i>
|
||||||
|
<i v-if="!scope.row.mobilePositionSubscribe" title="位置订阅"
|
||||||
|
class="iconfont icon-gxunjians subscribe-off"></i>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="操作" min-width="240" fixed="right">
|
<el-table-column label="操作" min-width="240" fixed="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="medium" icon="el-icon-edit" type="text" @click="editPlatform(scope.row)">编辑</el-button>
|
<el-button size="medium" icon="el-icon-edit" type="text" @click="editPlatform(scope.row)">编辑</el-button>
|
||||||
<el-button size="medium" icon="el-icon-share" type="text" @click="chooseChannel(scope.row)">通道共享</el-button>
|
<el-button size="medium" icon="el-icon-share" type="text" @click="chooseChannel(scope.row)">通道共享
|
||||||
<el-button size="medium" icon="el-icon-top" type="text" :loading="pushChannelLoading" @click="pushChannel(scope.row)">推送通道</el-button>
|
</el-button>
|
||||||
<el-button size="medium" icon="el-icon-delete" type="text" style="color: #f56c6c" @click="deletePlatform(scope.row)">删除</el-button>
|
<el-button size="medium" icon="el-icon-top" type="text" :loading="pushChannelLoading"
|
||||||
|
@click="pushChannel(scope.row)">推送通道
|
||||||
|
</el-button>
|
||||||
|
<el-button size="medium" icon="el-icon-delete" type="text" style="color: #f56c6c"
|
||||||
|
@click="deletePlatform(scope.row)">删除
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -71,8 +82,9 @@
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<platformEdit ref="platformEdit" v-if="platform" v-model="platform" :closeEdit="closeEdit" :device-ips="deviceIps" ></platformEdit>
|
<platformEdit ref="platformEdit" v-if="platform" v-model="platform" :closeEdit="closeEdit"
|
||||||
<shareChannel ref="shareChannel" ></shareChannel>
|
:device-ips="deviceIps"></platformEdit>
|
||||||
|
<shareChannel ref="shareChannel"></shareChannel>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -81,6 +93,7 @@ import uiHeader from '../layout/UiHeader.vue'
|
||||||
import shareChannel from './dialog/shareChannel.vue'
|
import shareChannel from './dialog/shareChannel.vue'
|
||||||
import platformEdit from './PlatformEdit.vue'
|
import platformEdit from './PlatformEdit.vue'
|
||||||
import streamProxyEdit from "./dialog/StreamProxyEdit.vue";
|
import streamProxyEdit from "./dialog/StreamProxyEdit.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'app',
|
name: 'app',
|
||||||
components: {
|
components: {
|
||||||
|
@ -91,23 +104,19 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
loading: false,
|
||||||
platformList: [], //设备列表
|
platformList: [], //设备列表
|
||||||
deviceIps: [], //设备列表
|
deviceIps: [], //设备列表
|
||||||
defaultPlatform: null,
|
defaultPlatform: null,
|
||||||
platform: null,
|
platform: null,
|
||||||
pushChannelLoading: false,
|
pushChannelLoading: false,
|
||||||
winHeight: window.innerHeight - 260,
|
winHeight: window.innerHeight - 260,
|
||||||
currentPage:1,
|
currentPage: 1,
|
||||||
count:15,
|
count: 15,
|
||||||
total:0
|
total: 0
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {},
|
||||||
|
|
||||||
getcurrentDeviceChannels: function() {
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.initData();
|
this.initData();
|
||||||
this.updateLooper = setInterval(this.initData, 10000);
|
this.updateLooper = setInterval(this.initData, 10000);
|
||||||
|
@ -116,48 +125,54 @@ export default {
|
||||||
clearTimeout(this.updateLooper);
|
clearTimeout(this.updateLooper);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
addParentPlatform: function() {
|
addParentPlatform: function () {
|
||||||
this.platform = this.defaultPlatform;
|
this.platform = this.defaultPlatform;
|
||||||
},
|
},
|
||||||
editPlatform: function(platform) {
|
editPlatform: function (platform) {
|
||||||
this.platform = platform;
|
this.platform = platform;
|
||||||
},
|
},
|
||||||
closeEdit: function() {
|
closeEdit: function () {
|
||||||
this.platform = null;
|
this.platform = null;
|
||||||
this.getPlatformList()
|
this.getPlatformList()
|
||||||
},
|
},
|
||||||
deletePlatform: function(platform) {
|
deletePlatform: function (platform) {
|
||||||
var that = this;
|
this.$confirm('确认删除?', '提示', {
|
||||||
that.$confirm('确认删除?', '提示', {
|
confirmButtonText: '确定',
|
||||||
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
||||||
cancelButtonText: '取消',
|
type: 'warning'
|
||||||
type: 'warning'
|
}).then(() => {
|
||||||
}).then(() => {
|
this.deletePlatformCommit(platform)
|
||||||
that.deletePlatformCommit(platform)
|
})
|
||||||
})
|
|
||||||
},
|
},
|
||||||
deletePlatformCommit: function(platform) {
|
deletePlatformCommit: function (platform) {
|
||||||
var that = this;
|
this.loading = true;
|
||||||
that.$axios({
|
this.$axios({
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
url:`/api/platform/delete/${platform.serverGBId}`
|
url: `/api/platform/delete/`,
|
||||||
}).then(function (res) {
|
params: {
|
||||||
if (res.data.code === 0) {
|
id: platform.id
|
||||||
that.$message({
|
}
|
||||||
showClose: true,
|
}).then((res) => {
|
||||||
message: '删除成功',
|
this.loading = false;
|
||||||
type: 'success'
|
if (res.data.code === 0) {
|
||||||
});
|
this.$message.success({
|
||||||
that.initData()
|
showClose: true,
|
||||||
}
|
message: '删除成功',
|
||||||
}).catch(function (error) {
|
});
|
||||||
console.log(error);
|
this.initData()
|
||||||
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
this.loading = false;
|
||||||
|
this.$message.error({
|
||||||
|
showClose: true,
|
||||||
|
message: error,
|
||||||
});
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
chooseChannel: function(platform) {
|
chooseChannel: function (platform) {
|
||||||
this.$refs.shareChannel.openDialog(platform.id, this.initData)
|
this.$refs.shareChannel.openDialog(platform.id, this.initData)
|
||||||
},
|
},
|
||||||
pushChannel: function(row) {
|
pushChannel: function (row) {
|
||||||
this.pushChannelLoading = true;
|
this.pushChannelLoading = true;
|
||||||
this.$axios({
|
this.$axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
@ -165,20 +180,20 @@ export default {
|
||||||
params: {
|
params: {
|
||||||
id: row.id,
|
id: row.id,
|
||||||
}
|
}
|
||||||
}).then((res)=> {
|
}).then((res) => {
|
||||||
this.pushChannelLoading = false;
|
this.pushChannelLoading = false;
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
this.$message.success({
|
this.$message.success({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
message: '推送成功',
|
message: '推送成功',
|
||||||
});
|
});
|
||||||
}else {
|
} else {
|
||||||
this.$message.error({
|
this.$message.error({
|
||||||
showClose: true,
|
showClose: true,
|
||||||
message: res.data.msg,
|
message: res.data.msg,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).catch((error)=> {
|
}).catch((error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
this.pushChannelLoading = false;
|
this.pushChannelLoading = false;
|
||||||
this.$message.error({
|
this.$message.error({
|
||||||
|
@ -187,11 +202,11 @@ export default {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
initData: function() {
|
initData: function () {
|
||||||
this.$axios({
|
this.$axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: `/api/platform/server_config`
|
url: `/api/platform/server_config`
|
||||||
}).then((res)=> {
|
}).then((res) => {
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
this.deviceIps = res.data.data.deviceIp.split(',');
|
this.deviceIps = res.data.data.deviceIp.split(',');
|
||||||
this.defaultPlatform = {
|
this.defaultPlatform = {
|
||||||
|
@ -234,20 +249,20 @@ export default {
|
||||||
});
|
});
|
||||||
this.getPlatformList();
|
this.getPlatformList();
|
||||||
},
|
},
|
||||||
currentChange: function(val){
|
currentChange: function (val) {
|
||||||
this.currentPage = val;
|
this.currentPage = val;
|
||||||
this.getPlatformList();
|
this.getPlatformList();
|
||||||
},
|
},
|
||||||
handleSizeChange: function(val){
|
handleSizeChange: function (val) {
|
||||||
this.count = val;
|
this.count = val;
|
||||||
this.getPlatformList();
|
this.getPlatformList();
|
||||||
},
|
},
|
||||||
getPlatformList: function() {
|
getPlatformList: function () {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|
||||||
this.$axios({
|
this.$axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url:`/api/platform/query/${that.count}/${that.currentPage}`
|
url: `/api/platform/query/${that.count}/${that.currentPage}`
|
||||||
}).then(function (res) {
|
}).then(function (res) {
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
that.total = res.data.data.total;
|
that.total = res.data.data.total;
|
||||||
|
@ -259,7 +274,7 @@ export default {
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
refresh: function (){
|
refresh: function () {
|
||||||
this.initData();
|
this.initData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,11 +282,12 @@ export default {
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
.subscribe-on{
|
.subscribe-on {
|
||||||
color: #409EFF;
|
color: #409EFF;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
.subscribe-off{
|
|
||||||
|
.subscribe-off {
|
||||||
color: #afafb3;
|
color: #afafb3;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue