临时提交
parent
1cbd8d677c
commit
abed3ecbec
|
@ -33,10 +33,14 @@ public class VManageBootstrap extends SpringBootServletInitializer {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
VManageBootstrap.args = args;
|
VManageBootstrap.args = args;
|
||||||
VManageBootstrap.context = SpringApplication.run(VManageBootstrap.class, args);
|
VManageBootstrap.context = SpringApplication.run(VManageBootstrap.class, args);
|
||||||
GitUtil gitUtil1 = SpringBeanFactory.getBean("gitUtil");
|
GitUtil gitUtil = SpringBeanFactory.getBean("gitUtil");
|
||||||
log.info("构建版本: {}", gitUtil1.getBuildVersion());
|
if (gitUtil == null) {
|
||||||
log.info("构建时间: {}", gitUtil1.getBuildDate());
|
log.info("获取版本信息失败");
|
||||||
log.info("GIT最后提交时间: {}", gitUtil1.getCommitTime());
|
}else {
|
||||||
|
log.info("构建版本: {}", gitUtil.getBuildVersion());
|
||||||
|
log.info("构建时间: {}", gitUtil.getBuildDate());
|
||||||
|
log.info("GIT最后提交时间: {}", gitUtil.getCommitTime());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 项目重启
|
// 项目重启
|
||||||
public static void restart() {
|
public static void restart() {
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
package com.genersoft.iot.vmp.conf;
|
package com.genersoft.iot.vmp.conf;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.alibaba.fastjson2.support.spring.http.converter.FastJsonHttpMessageConverter;
|
|
||||||
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 org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.core.MethodParameter;
|
import org.springframework.core.MethodParameter;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.converter.HttpMessageConverter;
|
import org.springframework.http.converter.HttpMessageConverter;
|
||||||
|
@ -15,6 +12,8 @@ import org.springframework.http.server.ServerHttpResponse;
|
||||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
|
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
|
||||||
|
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 全局统一返回结果
|
* 全局统一返回结果
|
||||||
* @author lin
|
* @author lin
|
||||||
|
@ -52,6 +51,13 @@ public class GlobalResponseAdvice implements ResponseBodyAdvice<Object> {
|
||||||
return JSON.toJSONString(WVPResult.success(body));
|
return JSON.toJSONString(WVPResult.success(body));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (body instanceof LinkedHashMap) {
|
||||||
|
LinkedHashMap<String, Object> bodyMap = (LinkedHashMap<String, Object>) body;
|
||||||
|
if (bodyMap.get("status") != null && (Integer)bodyMap.get("status") != 200) {
|
||||||
|
return body;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return WVPResult.success(body);
|
return WVPResult.success(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ public class SipPlatformRunner implements CommandLineRunner {
|
||||||
|
|
||||||
// 更新缓存
|
// 更新缓存
|
||||||
PlatformCatch parentPlatformCatch = new PlatformCatch();
|
PlatformCatch parentPlatformCatch = new PlatformCatch();
|
||||||
parentPlatformCatch.setParentPlatform(parentPlatform);
|
parentPlatformCatch.setPlatform(parentPlatform);
|
||||||
parentPlatformCatch.setId(parentPlatform.getServerGBId());
|
parentPlatformCatch.setId(parentPlatform.getServerGBId());
|
||||||
redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
|
redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
|
||||||
if (parentPlatformCatchOld != null) {
|
if (parentPlatformCatchOld != null) {
|
||||||
|
|
|
@ -352,7 +352,7 @@ public class CommonGBChannel {
|
||||||
commonGBChannel.setGbAddress(platform.getAddress());
|
commonGBChannel.setGbAddress(platform.getAddress());
|
||||||
commonGBChannel.setGbRegisterWay(platform.getRegisterWay());
|
commonGBChannel.setGbRegisterWay(platform.getRegisterWay());
|
||||||
commonGBChannel.setGbSecrecy(platform.getSecrecy());
|
commonGBChannel.setGbSecrecy(platform.getSecrecy());
|
||||||
commonGBChannel.setGbStatus(platform.getStatus());
|
commonGBChannel.setGbStatus(platform.isStatus()?"ON":"OFF");
|
||||||
return commonGBChannel;
|
return commonGBChannel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class Platform {
|
||||||
private String serverGBDomain;
|
private String serverGBDomain;
|
||||||
|
|
||||||
@Schema(description = "SIP服务IP")
|
@Schema(description = "SIP服务IP")
|
||||||
private String serverIP;
|
private String serverIp;
|
||||||
|
|
||||||
@Schema(description = "SIP服务端口")
|
@Schema(description = "SIP服务端口")
|
||||||
private int serverPort;
|
private int serverPort;
|
||||||
|
@ -67,7 +67,7 @@ public class Platform {
|
||||||
@Schema(description = "在线状态")
|
@Schema(description = "在线状态")
|
||||||
private boolean status;
|
private boolean status;
|
||||||
|
|
||||||
@Schema(description = "在线状态")
|
@Schema(description = "通道数量")
|
||||||
private int channelCount;
|
private int channelCount;
|
||||||
|
|
||||||
@Schema(description = "已被订阅目录信息")
|
@Schema(description = "已被订阅目录信息")
|
||||||
|
@ -94,9 +94,6 @@ public class Platform {
|
||||||
@Schema(description = "点播回复200OK使用的IP")
|
@Schema(description = "点播回复200OK使用的IP")
|
||||||
private String sendStreamIp;
|
private String sendStreamIp;
|
||||||
|
|
||||||
@Schema(description = "是否使用自定义业务分组")
|
|
||||||
private Boolean customGroup;
|
|
||||||
|
|
||||||
@Schema(description = "是否自动推送通道变化")
|
@Schema(description = "是否自动推送通道变化")
|
||||||
private Boolean autoPushChannel;
|
private Boolean autoPushChannel;
|
||||||
|
|
||||||
|
@ -130,7 +127,4 @@ public class Platform {
|
||||||
|
|
||||||
@Schema(description = "保密属性(必选)缺省为0;0-不涉密,1-涉密")
|
@Schema(description = "保密属性(必选)缺省为0;0-不涉密,1-涉密")
|
||||||
private int secrecy = 0;
|
private int secrecy = 0;
|
||||||
|
|
||||||
@Schema(description = "在线状态")
|
|
||||||
private String Status = "ON";
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ public class PlatformCatch {
|
||||||
|
|
||||||
private String callId;
|
private String callId;
|
||||||
|
|
||||||
private Platform parentPlatform;
|
private Platform platform;
|
||||||
|
|
||||||
private SipTransactionInfo sipTransactionInfo;
|
private SipTransactionInfo sipTransactionInfo;
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
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.util.Assert;
|
||||||
import org.springframework.util.ObjectUtils;
|
import org.springframework.util.ObjectUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@ -122,7 +123,7 @@ public class PlatformController {
|
||||||
@Parameter(name = "count", description = "每页条数", required = true)
|
@Parameter(name = "count", description = "每页条数", required = true)
|
||||||
public PageInfo<Platform> platforms(@PathVariable int page, @PathVariable int count) {
|
public PageInfo<Platform> platforms(@PathVariable int page, @PathVariable int count) {
|
||||||
|
|
||||||
PageInfo<Platform> parentPlatformPageInfo = platformService.queryParentPlatformList(page, count);
|
PageInfo<Platform> parentPlatformPageInfo = platformService.queryPlatformList(page, count);
|
||||||
if (parentPlatformPageInfo.getList().size() > 0) {
|
if (parentPlatformPageInfo.getList().size() > 0) {
|
||||||
for (Platform platform : parentPlatformPageInfo.getList()) {
|
for (Platform platform : parentPlatformPageInfo.getList()) {
|
||||||
platform.setMobilePositionSubscribe(subscribeHolder.getMobilePositionSubscribe(platform.getServerGBId()) != null);
|
platform.setMobilePositionSubscribe(subscribeHolder.getMobilePositionSubscribe(platform.getServerGBId()) != null);
|
||||||
|
@ -135,45 +136,53 @@ public class PlatformController {
|
||||||
/**
|
/**
|
||||||
* 添加上级平台信息
|
* 添加上级平台信息
|
||||||
*
|
*
|
||||||
* @param parentPlatform
|
* @param platform
|
||||||
* @return
|
* @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 parentPlatform) {
|
public void addPlatform(@RequestBody Platform platform) {
|
||||||
|
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("保存上级平台信息API调用");
|
log.debug("保存上级平台信息API调用");
|
||||||
}
|
}
|
||||||
if (ObjectUtils.isEmpty(parentPlatform.getName())
|
Assert.notNull(platform.getName(), "平台名称不可为空");
|
||||||
|| ObjectUtils.isEmpty(parentPlatform.getServerGBId())
|
Assert.notNull(platform.getServerGBId(), "上级平台国标编号不可为空");
|
||||||
|| ObjectUtils.isEmpty(parentPlatform.getServerGBDomain())
|
Assert.notNull(platform.getServerIp(), "上级平台IP不可为空");
|
||||||
|| ObjectUtils.isEmpty(parentPlatform.getServerIP())
|
Assert.isTrue(platform.getServerPort() > 0 && platform.getServerPort() < 65535, "上级平台端口异常");
|
||||||
|| ObjectUtils.isEmpty(parentPlatform.getServerPort())
|
Assert.notNull(platform.getDeviceGBId(), "本平台国标编号不可为空");
|
||||||
|| ObjectUtils.isEmpty(parentPlatform.getDeviceGBId())
|
|
||||||
|| ObjectUtils.isEmpty(parentPlatform.getExpires())
|
if (ObjectUtils.isEmpty(platform.getServerGBDomain())) {
|
||||||
|| ObjectUtils.isEmpty(parentPlatform.getKeepTimeout())
|
platform.setServerGBDomain(platform.getServerGBId().substring(0, 6));
|
||||||
|| ObjectUtils.isEmpty(parentPlatform.getTransport())
|
|
||||||
|| ObjectUtils.isEmpty(parentPlatform.getCharacterSet())
|
|
||||||
) {
|
|
||||||
throw new ControllerException(ErrorCode.ERROR400);
|
|
||||||
}
|
|
||||||
if (parentPlatform.getServerPort() < 0 || parentPlatform.getServerPort() > 65535) {
|
|
||||||
throw new ControllerException(ErrorCode.ERROR400.getCode(), "error severPort");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (platform.getExpires() <= 0) {
|
||||||
|
platform.setExpires(3600);
|
||||||
|
}
|
||||||
|
|
||||||
Platform parentPlatformOld = storager.queryParentPlatByServerGBId(parentPlatform.getServerGBId());
|
if (platform.getKeepTimeout() <= 0) {
|
||||||
|
platform.setKeepTimeout(60);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjectUtils.isEmpty(platform.getTransport())) {
|
||||||
|
platform.setTransport("UDP");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjectUtils.isEmpty(platform.getCharacterSet())) {
|
||||||
|
platform.setCharacterSet("GB2312");
|
||||||
|
}
|
||||||
|
|
||||||
|
Platform parentPlatformOld = platformService.queryPlatformByServerGBId(platform.getServerGBId());
|
||||||
if (parentPlatformOld != null) {
|
if (parentPlatformOld != null) {
|
||||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "平台 " + parentPlatform.getServerGBId() + " 已存在");
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), "平台 " + platform.getServerGBId() + " 已存在");
|
||||||
}
|
}
|
||||||
parentPlatform.setCreateTime(DateUtil.getNow());
|
platform.setCreateTime(DateUtil.getNow());
|
||||||
parentPlatform.setUpdateTime(DateUtil.getNow());
|
platform.setUpdateTime(DateUtil.getNow());
|
||||||
boolean updateResult = platformService.add(parentPlatform);
|
boolean updateResult = platformService.add(platform);
|
||||||
|
|
||||||
if (!updateResult) {
|
if (!updateResult) {
|
||||||
throw new ControllerException(ErrorCode.ERROR100.getCode(),"写入数据库失败");
|
throw new ControllerException(ErrorCode.ERROR100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,9 +193,9 @@ public class PlatformController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "保存上级平台信息", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "保存上级平台信息", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
@PostMapping("/save")
|
@PostMapping("/update")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public void savePlatform(@RequestBody Platform parentPlatform) {
|
public void updatePlatform(@RequestBody Platform parentPlatform) {
|
||||||
|
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("保存上级平台信息API调用");
|
log.debug("保存上级平台信息API调用");
|
||||||
|
@ -194,7 +203,7 @@ public class PlatformController {
|
||||||
if (ObjectUtils.isEmpty(parentPlatform.getName())
|
if (ObjectUtils.isEmpty(parentPlatform.getName())
|
||||||
|| ObjectUtils.isEmpty(parentPlatform.getServerGBId())
|
|| ObjectUtils.isEmpty(parentPlatform.getServerGBId())
|
||||||
|| ObjectUtils.isEmpty(parentPlatform.getServerGBDomain())
|
|| ObjectUtils.isEmpty(parentPlatform.getServerGBDomain())
|
||||||
|| ObjectUtils.isEmpty(parentPlatform.getServerIP())
|
|| ObjectUtils.isEmpty(parentPlatform.getServerIp())
|
||||||
|| ObjectUtils.isEmpty(parentPlatform.getServerPort())
|
|| ObjectUtils.isEmpty(parentPlatform.getServerPort())
|
||||||
|| ObjectUtils.isEmpty(parentPlatform.getDeviceGBId())
|
|| ObjectUtils.isEmpty(parentPlatform.getDeviceGBId())
|
||||||
|| ObjectUtils.isEmpty(parentPlatform.getExpires())
|
|| ObjectUtils.isEmpty(parentPlatform.getExpires())
|
||||||
|
|
|
@ -466,40 +466,40 @@ public interface CommonGBChannelMapper {
|
||||||
" wdc.update_time,\n" +
|
" wdc.update_time,\n" +
|
||||||
" coalesce(wpgc.device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +
|
" coalesce(wpgc.device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +
|
||||||
" coalesce(wpgc.name, wdc.gb_name, wdc.name) as gb_name,\n" +
|
" coalesce(wpgc.name, wdc.gb_name, wdc.name) as gb_name,\n" +
|
||||||
" coalesce(wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
|
" coalesce(wpgc.manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
|
||||||
" coalesce(wdc.gb_model, wdc.model) as gb_model,\n" +
|
" coalesce(wpgc.model, wdc.gb_model, wdc.model) as gb_model,\n" +
|
||||||
" coalesce(wdc.gb_owner, wdc.owner) as gb_owner,\n" +
|
" coalesce(wpgc.owner, wdc.gb_owner, wdc.owner) as gb_owner,\n" +
|
||||||
" coalesce(wpgc.civil_code, wdc.gb_civil_code, wdc.civil_code),\n" +
|
" coalesce(wpgc.civil_code, wdc.gb_civil_code, wdc.civil_code),\n" +
|
||||||
" coalesce(wdc.gb_block, wdc.block) as gb_block,\n" +
|
" coalesce(wpgc.block, wdc.gb_block, wdc.block) as gb_block,\n" +
|
||||||
" coalesce(wdc.gb_address, wdc.address) as gb_address,\n" +
|
" coalesce(wpgc.address, wdc.gb_address, wdc.address) as gb_address,\n" +
|
||||||
" coalesce(wdc.gb_parental, wdc.parental) as gb_parental,\n" +
|
" coalesce(wpgc.parental, wdc.gb_parental, wdc.parental) as gb_parental,\n" +
|
||||||
" coalesce(wpgc.parent_id, wdc.gb_parent_id, wdc.parent_id) as gb_parent_id,\n" +
|
" coalesce(wpgc.parent_id, wdc.gb_parent_id, wdc.parent_id) as gb_parent_id,\n" +
|
||||||
" coalesce(wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
|
" coalesce(wpgc.safety_way, wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
|
||||||
" coalesce(wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
|
" coalesce(wpgc.register_way, wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
|
||||||
" coalesce(wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
|
" coalesce(wpgc.cert_num, wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
|
||||||
" coalesce(wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
|
" coalesce(wpgc.certifiable, wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
|
||||||
" coalesce(wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
|
" coalesce(wpgc.err_code, wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
|
||||||
" coalesce(wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
|
" coalesce(wpgc.end_time, wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
|
||||||
" coalesce(wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
|
" coalesce(wpgc.secrecy, wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
|
||||||
" coalesce(wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
|
" coalesce(wpgc.ip_address, wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
|
||||||
" coalesce(wdc.gb_port, wdc.port) as gb_port,\n" +
|
" coalesce(wpgc.port, wdc.gb_port, wdc.port) as gb_port,\n" +
|
||||||
" coalesce(wdc.gb_password, wdc.password) as gb_password,\n" +
|
" coalesce(wpgc.password, wdc.gb_password, wdc.password) as gb_password,\n" +
|
||||||
" coalesce(wdc.gb_status, wdc.status) as gb_status,\n" +
|
" coalesce(wpgc.status, wdc.gb_status, wdc.status) as gb_status,\n" +
|
||||||
" coalesce(wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
|
" coalesce(wpgc.longitude, wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
|
||||||
" coalesce(wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
|
" coalesce(wpgc.latitude, wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
|
||||||
" coalesce(wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
|
" coalesce(wpgc.ptz_type, wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
|
||||||
" coalesce(wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
|
" coalesce(wpgc.position_type, wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
|
||||||
" coalesce(wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
|
" coalesce(wpgc.room_type, wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
|
||||||
" coalesce(wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
|
" coalesce(wpgc.use_type, wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
|
||||||
" coalesce(wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
|
" coalesce(wpgc.supply_light_type, wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
|
||||||
" coalesce(wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
|
" coalesce(wpgc.direction_type, wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
|
||||||
" coalesce(wdc.gb_resolution, wdc.resolution) as gb_resolution,\n" +
|
" coalesce(wpgc.resolution, wdc.gb_resolution, wdc.resolution) as gb_resolution,\n" +
|
||||||
" coalesce(wpgc.business_group_id, wdc.gb_business_group_id, wdc.business_group_id) as gb_business_group_id,\n" +
|
" coalesce(wpgc.business_group_id, wdc.gb_business_group_id, wdc.business_group_id) as gb_business_group_id,\n" +
|
||||||
" coalesce(wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
|
" coalesce(wpgc.download_speed, wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
|
||||||
" coalesce(wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
|
" coalesce(wpgc.svc_space_support_mod, wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
|
||||||
" coalesce(wdc.gb_svc_time_support_mode, wdc.svc_time_support_mode) as gb_svc_time_support_mode\n" +
|
" coalesce(wpgc.svc_time_support_mode, wdc.gb_svc_time_support_mode, wdc.svc_time_support_mode) as gb_svc_time_support_mode\n" +
|
||||||
" from wvp_device_channel wdc" +
|
" from wvp_device_channel wdc" +
|
||||||
" left jon wvp_platform_gb_channel wpgc on wdc.id = wpgc.device_channel_id" +
|
" left join wvp_platform_gb_channel wpgc on wdc.id = wpgc.device_channel_id" +
|
||||||
" where wpgc.platform_id = #{platformId}"
|
" where wpgc.platform_id = #{platformId}"
|
||||||
|
|
||||||
)
|
)
|
||||||
|
@ -514,40 +514,40 @@ public interface CommonGBChannelMapper {
|
||||||
" wdc.update_time,\n" +
|
" wdc.update_time,\n" +
|
||||||
" coalesce(wpgc.device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +
|
" coalesce(wpgc.device_id, wdc.gb_device_id, wdc.device_id) as gb_device_id,\n" +
|
||||||
" coalesce(wpgc.name, wdc.gb_name, wdc.name) as gb_name,\n" +
|
" coalesce(wpgc.name, wdc.gb_name, wdc.name) as gb_name,\n" +
|
||||||
" coalesce(wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
|
" coalesce(wpgc.manufacturer, wdc.gb_manufacturer, wdc.manufacturer) as gb_manufacturer,\n" +
|
||||||
" coalesce(wdc.gb_model, wdc.model) as gb_model,\n" +
|
" coalesce(wpgc.model, wdc.gb_model, wdc.model) as gb_model,\n" +
|
||||||
" coalesce(wdc.gb_owner, wdc.owner) as gb_owner,\n" +
|
" coalesce(wpgc.owner, wdc.gb_owner, wdc.owner) as gb_owner,\n" +
|
||||||
" coalesce(wpgc.civil_code, wdc.gb_civil_code, wdc.civil_code),\n" +
|
" coalesce(wpgc.civil_code, wdc.gb_civil_code, wdc.civil_code),\n" +
|
||||||
" coalesce(wdc.gb_block, wdc.block) as gb_block,\n" +
|
" coalesce(wpgc.block, wdc.gb_block, wdc.block) as gb_block,\n" +
|
||||||
" coalesce(wdc.gb_address, wdc.address) as gb_address,\n" +
|
" coalesce(wpgc.address, wdc.gb_address, wdc.address) as gb_address,\n" +
|
||||||
" coalesce(wdc.gb_parental, wdc.parental) as gb_parental,\n" +
|
" coalesce(wpgc.parental, wdc.gb_parental, wdc.parental) as gb_parental,\n" +
|
||||||
" coalesce(wpgc.parent_id, wdc.gb_parent_id, wdc.parent_id) as gb_parent_id,\n" +
|
" coalesce(wpgc.parent_id, wdc.gb_parent_id, wdc.parent_id) as gb_parent_id,\n" +
|
||||||
" coalesce(wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
|
" coalesce(wpgc.safety_way, wdc.gb_safety_way, wdc.safety_way) as gb_safety_way,\n" +
|
||||||
" coalesce(wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
|
" coalesce(wpgc.register_way, wdc.gb_register_way, wdc.register_way) as gb_register_way,\n" +
|
||||||
" coalesce(wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
|
" coalesce(wpgc.cert_num, wdc.gb_cert_num, wdc.cert_num) as gb_cert_num,\n" +
|
||||||
" coalesce(wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
|
" coalesce(wpgc.certifiable, wdc.gb_certifiable, wdc.certifiable) as gb_certifiable,\n" +
|
||||||
" coalesce(wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
|
" coalesce(wpgc.err_code, wdc.gb_err_code, wdc.err_code) as gb_err_code,\n" +
|
||||||
" coalesce(wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
|
" coalesce(wpgc.end_time, wdc.gb_end_time, wdc.end_time) as gb_end_time,\n" +
|
||||||
" coalesce(wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
|
" coalesce(wpgc.secrecy, wdc.gb_secrecy, wdc.secrecy) as gb_secrecy,\n" +
|
||||||
" coalesce(wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
|
" coalesce(wpgc.ip_address, wdc.gb_ip_address, wdc.ip_address) as gb_ip_address,\n" +
|
||||||
" coalesce(wdc.gb_port, wdc.port) as gb_port,\n" +
|
" coalesce(wpgc.port, wdc.gb_port, wdc.port) as gb_port,\n" +
|
||||||
" coalesce(wdc.gb_password, wdc.password) as gb_password,\n" +
|
" coalesce(wpgc.password, wdc.gb_password, wdc.password) as gb_password,\n" +
|
||||||
" coalesce(wdc.gb_status, wdc.status) as gb_status,\n" +
|
" coalesce(wpgc.status, wdc.gb_status, wdc.status) as gb_status,\n" +
|
||||||
" coalesce(wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
|
" coalesce(wpgc.longitude, wdc.gb_longitude, wdc.longitude) as gb_longitude,\n" +
|
||||||
" coalesce(wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
|
" coalesce(wpgc.latitude, wdc.gb_latitude, wdc.latitude) as gb_latitude,\n" +
|
||||||
" coalesce(wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
|
" coalesce(wpgc.ptz_type, wdc.gb_ptz_type, wdc.ptz_type) as gb_ptz_type,\n" +
|
||||||
" coalesce(wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
|
" coalesce(wpgc.position_type, wdc.gb_position_type, wdc.position_type) as gb_position_type,\n" +
|
||||||
" coalesce(wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
|
" coalesce(wpgc.room_type, wdc.gb_room_type, wdc.room_type) as gb_room_type,\n" +
|
||||||
" coalesce(wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
|
" coalesce(wpgc.use_type, wdc.gb_use_type, wdc.use_type) as gb_use_type,\n" +
|
||||||
" coalesce(wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
|
" coalesce(wpgc.supply_light_type, wdc.gb_supply_light_type, wdc.supply_light_type) as gb_supply_light_type,\n" +
|
||||||
" coalesce(wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
|
" coalesce(wpgc.direction_type, wdc.gb_direction_type, wdc.direction_type) as gb_direction_type,\n" +
|
||||||
" coalesce(wdc.gb_resolution, wdc.resolution) as gb_resolution,\n" +
|
" coalesce(wpgc.resolution, wdc.gb_resolution, wdc.resolution) as gb_resolution,\n" +
|
||||||
" coalesce(wpgc.business_group_id, wdc.gb_business_group_id, wdc.business_group_id) as gb_business_group_id,\n" +
|
" coalesce(wpgc.business_group_id, wdc.gb_business_group_id, wdc.business_group_id) as gb_business_group_id,\n" +
|
||||||
" coalesce(wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
|
" coalesce(wpgc.download_speed, wdc.gb_download_speed, wdc.download_speed) as gb_download_speed,\n" +
|
||||||
" coalesce(wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
|
" coalesce(wpgc.svc_space_support_mod, wdc.gb_svc_space_support_mod, wdc.svc_space_support_mod) as gb_svc_space_support_mod,\n" +
|
||||||
" coalesce(wdc.gb_svc_time_support_mode, wdc.svc_time_support_mode) as gb_svc_time_support_mode\n" +
|
" coalesce(wpgc.svc_time_support_mode, wdc.gb_svc_time_support_mode, wdc.svc_time_support_mode) as gb_svc_time_support_mode\n" +
|
||||||
" from wvp_device_channel wdc" +
|
" from wvp_device_channel wdc" +
|
||||||
" left jon wvp_platform_gb_channel wpgc on wdc.id = wpgc.device_channel_id" +
|
" left join wvp_platform_gb_channel wpgc on wdc.id = wpgc.device_channel_id" +
|
||||||
" where wpgc.platform_id = #{platformId} and coalesce(wpgc.device_id, wdc.gb_device_id, wdc.device_id) = #{channelDeviceId}"
|
" where wpgc.platform_id = #{platformId} and coalesce(wpgc.device_id, wdc.gb_device_id, wdc.device_id) = #{channelDeviceId}"
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
package com.genersoft.iot.vmp.gb28181.dao;
|
package com.genersoft.iot.vmp.gb28181.dao;
|
||||||
|
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
||||||
import com.genersoft.iot.vmp.storager.dao.dto.ChannelSourceInfo;
|
|
||||||
import org.apache.ibatis.annotations.*;
|
import org.apache.ibatis.annotations.*;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -16,59 +14,59 @@ import java.util.List;
|
||||||
public interface PlatformMapper {
|
public interface PlatformMapper {
|
||||||
|
|
||||||
@Insert("INSERT INTO wvp_platform (enable, name, server_gb_id, server_gb_domain, server_ip, server_port,device_gb_id,device_ip,"+
|
@Insert("INSERT INTO wvp_platform (enable, name, server_gb_id, server_gb_domain, server_ip, server_port,device_gb_id,device_ip,"+
|
||||||
"device_port,username,password,expires,keep_timeout,transport,character_set,ptz,rtcp,as_message_channel,auto_push_channel,"+
|
" device_port,username,password,expires,keep_timeout,transport,character_set,ptz,rtcp,status,catalog_group, update_time," +
|
||||||
"status,catalog_id,administrative_division,catalog_group,create_time,update_time,send_stream_ip) " +
|
" create_time, as_message_channel, send_stream_ip, auto_push_channel, catalog_with_platform,catalog_with_group,catalog_with_region, "+
|
||||||
" VALUES (#{enable}, #{name}, #{serverGBId}, #{serverGBDomain}, #{serverIP}, #{serverPort}, #{deviceGBId}, #{deviceIp}, " +
|
" civil_code,manufacturer,model,address,register_way,secrecy) " +
|
||||||
" #{devicePort}, #{username}, #{password}, #{expires}, #{keepTimeout}, #{transport}, #{characterSet}, #{ptz}, #{rtcp}, #{asMessageChannel}, #{autoPushChannel}, " +
|
" VALUES (#{enable}, #{name}, #{serverGBId}, #{serverGBDomain}, #{serverIp}, #{serverPort}, #{deviceGBId}, #{deviceIp}, " +
|
||||||
" #{status}, #{catalogId}, #{administrativeDivision}, #{catalogGroup}, #{createTime}, #{updateTime}, #{sendStreamIp})")
|
" #{devicePort}, #{username}, #{password}, #{expires}, #{keepTimeout}, #{transport}, #{characterSet}, #{ptz}, #{rtcp}, #{status}, #{catalogGroup},#{updateTime}," +
|
||||||
int addParentPlatform(Platform parentPlatform);
|
" #{createTime}, #{asMessageChannel}, #{sendStreamIp}, #{autoPushChannel}, #{catalogWithPlatform}, #{catalogWithGroup},#{catalogWithRegion}, " +
|
||||||
|
" #{civilCode}, #{manufacturer}, #{model}, #{address}, #{registerWay}, #{secrecy})")
|
||||||
|
int add(Platform parentPlatform);
|
||||||
|
|
||||||
@Update("UPDATE wvp_platform " +
|
@Update("UPDATE wvp_platform " +
|
||||||
"SET enable=#{enable}, " +
|
"SET update_time = #{updateTime}," +
|
||||||
"name=#{name}," +
|
" enable=#{enable}, " +
|
||||||
"device_gb_id=#{deviceGBId}," +
|
" name=#{name}," +
|
||||||
"server_gb_id=#{serverGBId}, " +
|
" server_gb_id=#{serverGBId}, " +
|
||||||
"server_gb_domain=#{serverGBDomain}, " +
|
" server_gb_domain=#{serverGBDomain}, " +
|
||||||
"server_ip=#{serverIP}," +
|
" server_ip=#{serverIp}," +
|
||||||
"server_port=#{serverPort}, " +
|
" server_port=#{serverPort}, " +
|
||||||
"device_ip=#{deviceIp}, " +
|
" device_gb_id=#{deviceGBId}," +
|
||||||
"device_port=#{devicePort}, " +
|
" device_ip=#{deviceIp}, " +
|
||||||
"username=#{username}, " +
|
" device_port=#{devicePort}, " +
|
||||||
"password=#{password}, " +
|
" username=#{username}, " +
|
||||||
"expires=#{expires}, " +
|
" password=#{password}, " +
|
||||||
"keep_timeout=#{keepTimeout}, " +
|
" expires=#{expires}, " +
|
||||||
"transport=#{transport}, " +
|
" keep_timeout=#{keepTimeout}, " +
|
||||||
"character_set=#{characterSet}, " +
|
" transport=#{transport}, " +
|
||||||
"ptz=#{ptz}, " +
|
" character_set=#{characterSet}, " +
|
||||||
"rtcp=#{rtcp}, " +
|
" ptz=#{ptz}, " +
|
||||||
"as_message_channel=#{asMessageChannel}, " +
|
" rtcp=#{rtcp}, " +
|
||||||
"auto_push_channel=#{autoPushChannel}, " +
|
" status=#{status}, " +
|
||||||
"status=#{status}, " +
|
" catalog_group=#{catalogGroup}, " +
|
||||||
"catalog_group=#{catalogGroup}, " +
|
" as_message_channel=#{asMessageChannel}, " +
|
||||||
"administrative_division=#{administrativeDivision}, " +
|
" send_stream_ip=#{sendStreamIp}, " +
|
||||||
"create_time=#{createTime}, " +
|
" auto_push_channel=#{autoPushChannel}, " +
|
||||||
"update_time=#{updateTime}, " +
|
" catalog_with_platform=#{catalogWithPlatform}, " +
|
||||||
"send_stream_ip=#{sendStreamIp}, " +
|
" catalog_with_group=#{catalogWithGroup}, " +
|
||||||
"catalog_id=#{catalogId} " +
|
" catalog_with_region=#{catalogWithRegion}, " +
|
||||||
|
" civil_code=#{civilCode}, " +
|
||||||
|
" manufacturer=#{manufacturer}, " +
|
||||||
|
" model=#{model}, " +
|
||||||
|
" address=#{address}, " +
|
||||||
|
" register_way=#{registerWay}, " +
|
||||||
|
" secrecy=#{secrecy} " +
|
||||||
"WHERE id=#{id}")
|
"WHERE id=#{id}")
|
||||||
int updateParentPlatform(Platform parentPlatform);
|
int update(Platform parentPlatform);
|
||||||
|
|
||||||
@Delete("DELETE FROM wvp_platform WHERE server_gb_id=#{serverGBId}")
|
@Delete("DELETE FROM wvp_platform WHERE server_gb_id=#{serverGBId}")
|
||||||
int delParentPlatform(Platform parentPlatform);
|
int delParentPlatform(Platform parentPlatform);
|
||||||
|
|
||||||
@Select("SELECT *, ((SELECT count(0)\n" +
|
@Select(" SELECT pp.*, " +
|
||||||
" FROM wvp_platform_gb_channel pc\n" +
|
" (SELECT count(0) FROM wvp_platform_gb_channel pc WHERE pc.platform_id = pp.id ) as channel_count" +
|
||||||
" WHERE pc.platform_id = pp.server_gb_id)\n" +
|
" FROM wvp_platform pp "
|
||||||
" +\n" +
|
)
|
||||||
" (SELECT count(0)\n" +
|
List<Platform> queryList();
|
||||||
" FROM wvp_platform_gb_stream pgs\n" +
|
|
||||||
" WHERE pgs.platform_id = pp.server_gb_id)\n" +
|
|
||||||
" +\n" +
|
|
||||||
" (SELECT count(0)\n" +
|
|
||||||
" FROM wvp_platform_catalog pgc\n" +
|
|
||||||
" WHERE pgc.platform_id = pp.server_gb_id)) as channel_count\n" +
|
|
||||||
"FROM wvp_platform pp ")
|
|
||||||
List<Platform> getParentPlatformList();
|
|
||||||
|
|
||||||
@Select("SELECT * FROM wvp_platform WHERE enable=#{enable} ")
|
@Select("SELECT * FROM wvp_platform WHERE enable=#{enable} ")
|
||||||
List<Platform> getEnableParentPlatformList(boolean enable);
|
List<Platform> getEnableParentPlatformList(boolean enable);
|
||||||
|
@ -80,23 +78,9 @@ public interface PlatformMapper {
|
||||||
Platform getParentPlatByServerGBId(String platformGbId);
|
Platform getParentPlatByServerGBId(String platformGbId);
|
||||||
|
|
||||||
@Select("SELECT * FROM wvp_platform WHERE id=#{id}")
|
@Select("SELECT * FROM wvp_platform WHERE id=#{id}")
|
||||||
Platform getParentPlatById(int id);
|
Platform query(int id);
|
||||||
|
|
||||||
@Update("UPDATE wvp_platform SET status=false" )
|
|
||||||
int outlineForAllParentPlatform();
|
|
||||||
|
|
||||||
@Update("UPDATE wvp_platform SET status=#{online} WHERE server_gb_id=#{platformGbID}" )
|
@Update("UPDATE wvp_platform SET status=#{online} WHERE server_gb_id=#{platformGbID}" )
|
||||||
int updateParentPlatformStatus(@Param("platformGbID") String platformGbID, @Param("online") boolean online);
|
int updateStatus(@Param("platformGbID") String platformGbID, @Param("online") boolean online);
|
||||||
|
|
||||||
@Update(value = {" <script>" +
|
|
||||||
"UPDATE wvp_platform " +
|
|
||||||
"SET catalog_id=#{catalogId}, update_time=#{updateTime}" +
|
|
||||||
"WHERE server_gb_id=#{platformId}"+
|
|
||||||
"</script>"})
|
|
||||||
int setDefaultCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId, @Param("updateTime") String updateTime);
|
|
||||||
|
|
||||||
@Select("select 'channel' as name, count(pgc.platform_id) count from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id where pgc.platform_id=#{platform_id} and dc.channel_id =#{gbId} " +
|
|
||||||
"union " +
|
|
||||||
"select 'stream' as name, count(pgs.platform_id) count from wvp_platform_gb_stream pgs left join wvp_gb_stream gs on pgs.gb_stream_id = gs.gb_stream_id where pgs.platform_id=#{platform_id} and gs.gb_id =#{gbId}")
|
|
||||||
List<ChannelSourceInfo> getChannelSource(@Param("platform_id") String platform_id, @Param("gbId") String gbId);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.genersoft.iot.vmp.gb28181.service;
|
package com.genersoft.iot.vmp.gb28181.service;
|
||||||
|
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
|
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
|
||||||
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.gb28181.event.SipSubscribe;
|
||||||
import com.genersoft.iot.vmp.media.event.hook.HookSubscribe;
|
import com.genersoft.iot.vmp.media.event.hook.HookSubscribe;
|
||||||
|
@ -28,7 +27,7 @@ public interface IPlatformService {
|
||||||
* @param count
|
* @param count
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
PageInfo<Platform> queryParentPlatformList(int page, int count);
|
PageInfo<Platform> queryPlatformList(int page, int count);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加级联平台
|
* 添加级联平台
|
||||||
|
|
|
@ -36,6 +36,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.util.Assert;
|
||||||
|
|
||||||
import javax.sdp.*;
|
import javax.sdp.*;
|
||||||
import javax.sip.InvalidArgumentException;
|
import javax.sip.InvalidArgumentException;
|
||||||
|
@ -130,14 +131,14 @@ public class PlatformServiceImpl implements IPlatformService {
|
||||||
List<SendRtpItem> sendRtpItems = redisCatchStorage.querySendRTPServerByStream(event.getStream());
|
List<SendRtpItem> sendRtpItems = redisCatchStorage.querySendRTPServerByStream(event.getStream());
|
||||||
if (sendRtpItems != null && !sendRtpItems.isEmpty()) {
|
if (sendRtpItems != null && !sendRtpItems.isEmpty()) {
|
||||||
for (SendRtpItem sendRtpItem : sendRtpItems) {
|
for (SendRtpItem sendRtpItem : sendRtpItems) {
|
||||||
Platform parentPlatform = platformMapper.getParentPlatByServerGBId(sendRtpItem.getPlatformId());
|
Platform platform = platformMapper.getParentPlatByServerGBId(sendRtpItem.getPlatformId());
|
||||||
ssrcFactory.releaseSsrc(sendRtpItem.getMediaServerId(), sendRtpItem.getSsrc());
|
ssrcFactory.releaseSsrc(sendRtpItem.getMediaServerId(), sendRtpItem.getSsrc());
|
||||||
try {
|
try {
|
||||||
commanderForPlatform.streamByeCmd(parentPlatform, sendRtpItem.getCallId());
|
commanderForPlatform.streamByeCmd(platform, sendRtpItem.getCallId());
|
||||||
} catch (SipException | InvalidArgumentException | ParseException e) {
|
} catch (SipException | InvalidArgumentException | ParseException e) {
|
||||||
log.error("[命令发送失败] 国标级联 发送BYE: {}", e.getMessage());
|
log.error("[命令发送失败] 国标级联 发送BYE: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
redisCatchStorage.deleteSendRTPServer(parentPlatform.getServerGBId(), sendRtpItem.getChannelId(),
|
redisCatchStorage.deleteSendRTPServer(platform.getServerGBId(), sendRtpItem.getChannelId(),
|
||||||
sendRtpItem.getCallId(), sendRtpItem.getStream());
|
sendRtpItem.getCallId(), sendRtpItem.getStream());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,32 +151,31 @@ public class PlatformServiceImpl implements IPlatformService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<Platform> queryParentPlatformList(int page, int count) {
|
public PageInfo<Platform> queryPlatformList(int page, int count) {
|
||||||
PageHelper.startPage(page, count);
|
PageHelper.startPage(page, count);
|
||||||
List<Platform> all = platformMapper.getParentPlatformList();
|
List<Platform> all = platformMapper.queryList();
|
||||||
return new PageInfo<>(all);
|
return new PageInfo<>(all);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean add(Platform parentPlatform) {
|
public boolean add(Platform platform) {
|
||||||
|
log.info("[国标级联]添加平台 {}", platform.getDeviceGBId());
|
||||||
if (parentPlatform.getCatalogGroup() == 0) {
|
if (platform.getCatalogGroup() == 0) {
|
||||||
// 每次发送目录的数量默认为1
|
// 每次发送目录的数量默认为1
|
||||||
parentPlatform.setCatalogGroup(1);
|
platform.setCatalogGroup(1);
|
||||||
}
|
}
|
||||||
int result = platformMapper.addParentPlatform(parentPlatform);
|
int result = platformMapper.add(platform);
|
||||||
// 添加缓存
|
// 添加缓存
|
||||||
PlatformCatch parentPlatformCatch = new PlatformCatch();
|
PlatformCatch platformCatch = new PlatformCatch();
|
||||||
parentPlatformCatch.setParentPlatform(parentPlatform);
|
platformCatch.setPlatform(platform);
|
||||||
parentPlatformCatch.setId(parentPlatform.getServerGBId());
|
platformCatch.setId(platform.getServerGBId());
|
||||||
parentPlatformCatch.setParentPlatform(parentPlatform);
|
redisCatchStorage.updatePlatformCatchInfo(platformCatch);
|
||||||
redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
|
if (platform.isEnable()) {
|
||||||
if (parentPlatform.isEnable()) {
|
|
||||||
// 保存时启用就发送注册
|
// 保存时启用就发送注册
|
||||||
// 注册成功时由程序直接调用了online方法
|
// 注册成功时由程序直接调用了online方法
|
||||||
try {
|
try {
|
||||||
commanderForPlatform.register(parentPlatform, eventResult -> {
|
commanderForPlatform.register(platform, eventResult -> {
|
||||||
log.info("[国标级联] {},添加向上级注册失败,请确定上级平台可用时重新保存", parentPlatform.getServerGBId());
|
log.info("[国标级联] {}({}),添加向上级注册失败,请确定上级平台可用时重新保存", platform.getName(), platform.getServerGBId());
|
||||||
}, null);
|
}, null);
|
||||||
} catch (InvalidArgumentException | ParseException | SipException e) {
|
} catch (InvalidArgumentException | ParseException | SipException e) {
|
||||||
log.error("[命令发送失败] 国标级联: {}", e.getMessage());
|
log.error("[命令发送失败] 国标级联: {}", e.getMessage());
|
||||||
|
@ -185,25 +185,26 @@ public class PlatformServiceImpl implements IPlatformService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean update(Platform parentPlatform) {
|
public boolean update(Platform platform) {
|
||||||
log.info("[国标级联]更新平台 {}", parentPlatform.getDeviceGBId());
|
Assert.isTrue(platform.getId() > 0, "ID必须存在");
|
||||||
parentPlatform.setCharacterSet(parentPlatform.getCharacterSet().toUpperCase());
|
log.info("[国标级联] 更新平台 {}({})", platform.getName(), platform.getDeviceGBId());
|
||||||
Platform parentPlatformOld = platformMapper.getParentPlatById(parentPlatform.getId());
|
platform.setCharacterSet(platform.getCharacterSet().toUpperCase());
|
||||||
PlatformCatch parentPlatformCatchOld = redisCatchStorage.queryPlatformCatchInfo(parentPlatformOld.getServerGBId());
|
Platform platformInDb = platformMapper.query(platform.getId());
|
||||||
parentPlatform.setUpdateTime(DateUtil.getNow());
|
PlatformCatch platformCatchOld = redisCatchStorage.queryPlatformCatchInfo(platformInDb.getServerGBId());
|
||||||
|
platform.setUpdateTime(DateUtil.getNow());
|
||||||
|
|
||||||
// 停止心跳定时
|
// 停止心跳定时
|
||||||
final String keepaliveTaskKey = KEEPALIVE_KEY_PREFIX + parentPlatformOld.getServerGBId();
|
final String keepaliveTaskKey = KEEPALIVE_KEY_PREFIX + platformInDb.getServerGBId();
|
||||||
dynamicTask.stop(keepaliveTaskKey);
|
dynamicTask.stop(keepaliveTaskKey);
|
||||||
// 停止注册定时
|
// 停止注册定时
|
||||||
final String registerTaskKey = REGISTER_KEY_PREFIX + parentPlatformOld.getServerGBId();
|
final String registerTaskKey = REGISTER_KEY_PREFIX + platformInDb.getServerGBId();
|
||||||
dynamicTask.stop(registerTaskKey);
|
dynamicTask.stop(registerTaskKey);
|
||||||
// 注销旧的
|
// 注销旧的
|
||||||
try {
|
try {
|
||||||
if (parentPlatformOld.isStatus() && parentPlatformCatchOld != null) {
|
if (platformInDb.isStatus() && platformCatchOld != null) {
|
||||||
log.info("保存平台{}时发现旧平台在线,发送注销命令", parentPlatformOld.getServerGBId());
|
log.info("保存平台{}时发现旧平台在线,发送注销命令", platformInDb.getServerGBId());
|
||||||
commanderForPlatform.unregister(parentPlatformOld, parentPlatformCatchOld.getSipTransactionInfo(), null, eventResult -> {
|
commanderForPlatform.unregister(platformInDb, platformCatchOld.getSipTransactionInfo(), null, eventResult -> {
|
||||||
log.info("[国标级联] 注销成功, 平台:{}", parentPlatformOld.getServerGBId());
|
log.info("[国标级联] 注销成功, 平台:{}", platformInDb.getServerGBId());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (InvalidArgumentException | ParseException | SipException e) {
|
} catch (InvalidArgumentException | ParseException | SipException e) {
|
||||||
|
@ -211,98 +212,97 @@ public class PlatformServiceImpl implements IPlatformService {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新数据库
|
// 更新数据库
|
||||||
if (parentPlatform.getCatalogGroup() == 0) {
|
if (platform.getCatalogGroup() == 0) {
|
||||||
parentPlatform.setCatalogGroup(1);
|
platform.setCatalogGroup(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
platformMapper.updateParentPlatform(parentPlatform);
|
platformMapper.update(platform);
|
||||||
// 更新redis
|
// 更新redis
|
||||||
redisCatchStorage.delPlatformCatchInfo(parentPlatformOld.getServerGBId());
|
redisCatchStorage.delPlatformCatchInfo(platformInDb.getServerGBId());
|
||||||
PlatformCatch parentPlatformCatch = new PlatformCatch();
|
PlatformCatch platformCatch = new PlatformCatch();
|
||||||
parentPlatformCatch.setParentPlatform(parentPlatform);
|
platformCatch.setPlatform(platform);
|
||||||
parentPlatformCatch.setId(parentPlatform.getServerGBId());
|
platformCatch.setId(platform.getServerGBId());
|
||||||
redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
|
redisCatchStorage.updatePlatformCatchInfo(platformCatch);
|
||||||
// 注册
|
// 注册
|
||||||
if (parentPlatform.isEnable()) {
|
if (platform.isEnable()) {
|
||||||
// 保存时启用就发送注册
|
// 保存时启用就发送注册
|
||||||
// 注册成功时由程序直接调用了online方法
|
// 注册成功时由程序直接调用了online方法
|
||||||
try {
|
try {
|
||||||
log.info("[国标级联] 平台注册 {}", parentPlatform.getDeviceGBId());
|
log.info("[国标级联] 平台注册 {}", platform.getDeviceGBId());
|
||||||
commanderForPlatform.register(parentPlatform, eventResult -> {
|
commanderForPlatform.register(platform, eventResult -> {
|
||||||
log.info("[国标级联] {},添加向上级注册失败,请确定上级平台可用时重新保存", parentPlatform.getServerGBId());
|
log.info("[国标级联] {},添加向上级注册失败,请确定上级平台可用时重新保存", platform.getServerGBId());
|
||||||
}, null);
|
}, null);
|
||||||
} catch (InvalidArgumentException | ParseException | SipException e) {
|
} catch (InvalidArgumentException | ParseException | SipException e) {
|
||||||
log.error("[命令发送失败] 国标级联: {}", e.getMessage());
|
log.error("[命令发送失败] 国标级联: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void online(Platform parentPlatform, SipTransactionInfo sipTransactionInfo) {
|
public void online(Platform platform, SipTransactionInfo sipTransactionInfo) {
|
||||||
log.info("[国标级联]:{}, 平台上线", parentPlatform.getServerGBId());
|
log.info("[国标级联]:{}, 平台上线", platform.getServerGBId());
|
||||||
final String registerFailAgainTaskKey = REGISTER_FAIL_AGAIN_KEY_PREFIX + parentPlatform.getServerGBId();
|
final String registerFailAgainTaskKey = REGISTER_FAIL_AGAIN_KEY_PREFIX + platform.getServerGBId();
|
||||||
dynamicTask.stop(registerFailAgainTaskKey);
|
dynamicTask.stop(registerFailAgainTaskKey);
|
||||||
|
|
||||||
platformMapper.updateParentPlatformStatus(parentPlatform.getServerGBId(), true);
|
platformMapper.updateStatus(platform.getServerGBId(), true);
|
||||||
PlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId());
|
PlatformCatch platformCatch = redisCatchStorage.queryPlatformCatchInfo(platform.getServerGBId());
|
||||||
if (parentPlatformCatch == null) {
|
if (platformCatch == null) {
|
||||||
parentPlatformCatch = new PlatformCatch();
|
platformCatch = new PlatformCatch();
|
||||||
parentPlatformCatch.setParentPlatform(parentPlatform);
|
platformCatch.setPlatform(platform);
|
||||||
parentPlatformCatch.setId(parentPlatform.getServerGBId());
|
platformCatch.setId(platform.getServerGBId());
|
||||||
parentPlatform.setStatus(true);
|
platform.setStatus(true);
|
||||||
parentPlatformCatch.setParentPlatform(parentPlatform);
|
platformCatch.setPlatform(platform);
|
||||||
}
|
}
|
||||||
|
|
||||||
parentPlatformCatch.getParentPlatform().setStatus(true);
|
platformCatch.getPlatform().setStatus(true);
|
||||||
parentPlatformCatch.setSipTransactionInfo(sipTransactionInfo);
|
platformCatch.setSipTransactionInfo(sipTransactionInfo);
|
||||||
redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
|
redisCatchStorage.updatePlatformCatchInfo(platformCatch);
|
||||||
|
|
||||||
final String registerTaskKey = REGISTER_KEY_PREFIX + parentPlatform.getServerGBId();
|
final String registerTaskKey = REGISTER_KEY_PREFIX + platform.getServerGBId();
|
||||||
if (!dynamicTask.isAlive(registerTaskKey)) {
|
if (!dynamicTask.isAlive(registerTaskKey)) {
|
||||||
log.info("[国标级联]:{}, 添加定时注册任务", parentPlatform.getServerGBId());
|
log.info("[国标级联]:{}, 添加定时注册任务", platform.getServerGBId());
|
||||||
// 添加注册任务
|
// 添加注册任务
|
||||||
dynamicTask.startCron(registerTaskKey,
|
dynamicTask.startCron(registerTaskKey,
|
||||||
// 注册失败(注册成功时由程序直接调用了online方法)
|
// 注册失败(注册成功时由程序直接调用了online方法)
|
||||||
()-> registerTask(parentPlatform, sipTransactionInfo),
|
()-> registerTask(platform, sipTransactionInfo),
|
||||||
parentPlatform.getExpires() * 1000);
|
platform.getExpires() * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
final String keepaliveTaskKey = KEEPALIVE_KEY_PREFIX + parentPlatform.getServerGBId();
|
final String keepaliveTaskKey = KEEPALIVE_KEY_PREFIX + platform.getServerGBId();
|
||||||
if (!dynamicTask.contains(keepaliveTaskKey)) {
|
if (!dynamicTask.contains(keepaliveTaskKey)) {
|
||||||
log.info("[国标级联]:{}, 添加定时心跳任务", parentPlatform.getServerGBId());
|
log.info("[国标级联]:{}, 添加定时心跳任务", platform.getServerGBId());
|
||||||
// 添加心跳任务
|
// 添加心跳任务
|
||||||
dynamicTask.startCron(keepaliveTaskKey,
|
dynamicTask.startCron(keepaliveTaskKey,
|
||||||
()-> {
|
()-> {
|
||||||
try {
|
try {
|
||||||
commanderForPlatform.keepalive(parentPlatform, eventResult -> {
|
commanderForPlatform.keepalive(platform, eventResult -> {
|
||||||
// 心跳失败
|
// 心跳失败
|
||||||
if (eventResult.type != SipSubscribe.EventResultType.timeout) {
|
if (eventResult.type != SipSubscribe.EventResultType.timeout) {
|
||||||
log.warn("[国标级联]发送心跳收到错误,code: {}, msg: {}", eventResult.statusCode, eventResult.msg);
|
log.warn("[国标级联]发送心跳收到错误,code: {}, msg: {}", eventResult.statusCode, eventResult.msg);
|
||||||
}
|
}
|
||||||
// 心跳失败
|
// 心跳失败
|
||||||
PlatformCatch platformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId());
|
PlatformCatch platformCatchForNow = redisCatchStorage.queryPlatformCatchInfo(platform.getServerGBId());
|
||||||
// 此时是第三次心跳超时, 平台离线
|
// 此时是第三次心跳超时, 平台离线
|
||||||
if (platformCatch.getKeepAliveReply() == 2) {
|
if (platformCatchForNow.getKeepAliveReply() == 2) {
|
||||||
// 设置平台离线,并重新注册
|
// 设置平台离线,并重新注册
|
||||||
log.info("[国标级联] 三次心跳失败, 平台{}({})离线", parentPlatform.getName(), parentPlatform.getServerGBId());
|
log.info("[国标级联] 三次心跳失败, 平台{}({})离线", platform.getName(), platform.getServerGBId());
|
||||||
offline(parentPlatform, false);
|
offline(platform, false);
|
||||||
}else {
|
}else {
|
||||||
platformCatch.setKeepAliveReply(platformCatch.getKeepAliveReply() + 1);
|
platformCatchForNow.setKeepAliveReply(platformCatchForNow.getKeepAliveReply() + 1);
|
||||||
redisCatchStorage.updatePlatformCatchInfo(platformCatch);
|
redisCatchStorage.updatePlatformCatchInfo(platformCatchForNow);
|
||||||
}
|
}
|
||||||
|
|
||||||
}, eventResult -> {
|
}, eventResult -> {
|
||||||
// 心跳成功
|
// 心跳成功
|
||||||
// 清空之前的心跳超时计数
|
// 清空之前的心跳超时计数
|
||||||
PlatformCatch platformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId());
|
PlatformCatch platformCatchForNow = redisCatchStorage.queryPlatformCatchInfo(platform.getServerGBId());
|
||||||
if (platformCatch != null && platformCatch.getKeepAliveReply() > 0) {
|
if (platformCatchForNow != null && platformCatchForNow.getKeepAliveReply() > 0) {
|
||||||
platformCatch.setKeepAliveReply(0);
|
platformCatchForNow.setKeepAliveReply(0);
|
||||||
redisCatchStorage.updatePlatformCatchInfo(platformCatch);
|
redisCatchStorage.updatePlatformCatchInfo(platformCatchForNow);
|
||||||
}
|
}
|
||||||
log.info("[发送心跳] 国标级联 发送心跳, code: {}, msg: {}", eventResult.statusCode, eventResult.msg);
|
log.info("[发送心跳] 国标级联 发送心跳, code: {}, msg: {}", eventResult.statusCode, eventResult.msg);
|
||||||
});
|
});
|
||||||
|
@ -310,37 +310,37 @@ public class PlatformServiceImpl implements IPlatformService {
|
||||||
log.error("[命令发送失败] 国标级联 发送心跳: {}", e.getMessage());
|
log.error("[命令发送失败] 国标级联 发送心跳: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
(parentPlatform.getKeepTimeout())*1000);
|
(platform.getKeepTimeout())*1000);
|
||||||
}
|
}
|
||||||
if (parentPlatform.getAutoPushChannel() != null && parentPlatform.getAutoPushChannel()) {
|
if (platform.getAutoPushChannel() != null && platform.getAutoPushChannel()) {
|
||||||
if (subscribeHolder.getCatalogSubscribe(parentPlatform.getServerGBId()) == null) {
|
if (subscribeHolder.getCatalogSubscribe(platform.getServerGBId()) == null) {
|
||||||
log.info("[国标级联]:{}, 添加自动通道推送模拟订阅信息", parentPlatform.getServerGBId());
|
log.info("[国标级联]:{}, 添加自动通道推送模拟订阅信息", platform.getServerGBId());
|
||||||
addSimulatedSubscribeInfo(parentPlatform);
|
addSimulatedSubscribeInfo(platform);
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
SubscribeInfo catalogSubscribe = subscribeHolder.getCatalogSubscribe(parentPlatform.getServerGBId());
|
SubscribeInfo catalogSubscribe = subscribeHolder.getCatalogSubscribe(platform.getServerGBId());
|
||||||
if (catalogSubscribe != null && catalogSubscribe.getExpires() == -1) {
|
if (catalogSubscribe != null && catalogSubscribe.getExpires() == -1) {
|
||||||
subscribeHolder.removeCatalogSubscribe(parentPlatform.getServerGBId());
|
subscribeHolder.removeCatalogSubscribe(platform.getServerGBId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addSimulatedSubscribeInfo(Platform parentPlatform) {
|
public void addSimulatedSubscribeInfo(Platform platform) {
|
||||||
// 自动添加一条模拟的订阅信息
|
// 自动添加一条模拟的订阅信息
|
||||||
SubscribeInfo subscribeInfo = new SubscribeInfo();
|
SubscribeInfo subscribeInfo = new SubscribeInfo();
|
||||||
subscribeInfo.setId(parentPlatform.getServerGBId());
|
subscribeInfo.setId(platform.getServerGBId());
|
||||||
subscribeInfo.setExpires(-1);
|
subscribeInfo.setExpires(-1);
|
||||||
subscribeInfo.setEventType("Catalog");
|
subscribeInfo.setEventType("Catalog");
|
||||||
int random = (int) Math.floor(Math.random() * 10000);
|
int random = (int) Math.floor(Math.random() * 10000);
|
||||||
subscribeInfo.setEventId(random + "");
|
subscribeInfo.setEventId(random + "");
|
||||||
subscribeInfo.setSimulatedCallId(UUID.randomUUID().toString().replace("-", "") + "@" + parentPlatform.getServerIP());
|
subscribeInfo.setSimulatedCallId(UUID.randomUUID().toString().replace("-", "") + "@" + platform.getServerIp());
|
||||||
subscribeInfo.setSimulatedFromTag(UUID.randomUUID().toString().replace("-", ""));
|
subscribeInfo.setSimulatedFromTag(UUID.randomUUID().toString().replace("-", ""));
|
||||||
subscribeInfo.setSimulatedToTag(UUID.randomUUID().toString().replace("-", ""));
|
subscribeInfo.setSimulatedToTag(UUID.randomUUID().toString().replace("-", ""));
|
||||||
subscribeHolder.putCatalogSubscribe(parentPlatform.getServerGBId(), subscribeInfo);
|
subscribeHolder.putCatalogSubscribe(platform.getServerGBId(), subscribeInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerTask(Platform parentPlatform, SipTransactionInfo sipTransactionInfo){
|
private void registerTask(Platform platform, SipTransactionInfo sipTransactionInfo){
|
||||||
try {
|
try {
|
||||||
// 不在同一个会话中续订则每次全新注册
|
// 不在同一个会话中续订则每次全新注册
|
||||||
if (!userSetting.isRegisterKeepIntDialog()) {
|
if (!userSetting.isRegisterKeepIntDialog()) {
|
||||||
|
@ -348,15 +348,15 @@ public class PlatformServiceImpl implements IPlatformService {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sipTransactionInfo == null) {
|
if (sipTransactionInfo == null) {
|
||||||
log.info("[国标级联] 平台:{}注册即将到期,开始重新注册", parentPlatform.getServerGBId());
|
log.info("[国标级联] 平台:{}注册即将到期,开始重新注册", platform.getServerGBId());
|
||||||
}else {
|
}else {
|
||||||
log.info("[国标级联] 平台:{}注册即将到期,开始续订", parentPlatform.getServerGBId());
|
log.info("[国标级联] 平台:{}注册即将到期,开始续订", platform.getServerGBId());
|
||||||
}
|
}
|
||||||
|
|
||||||
commanderForPlatform.register(parentPlatform, sipTransactionInfo, eventResult -> {
|
commanderForPlatform.register(platform, sipTransactionInfo, eventResult -> {
|
||||||
log.info("[国标级联] 平台:{}注册失败,{}:{}", parentPlatform.getServerGBId(),
|
log.info("[国标级联] 平台:{}注册失败,{}:{}", platform.getServerGBId(),
|
||||||
eventResult.statusCode, eventResult.msg);
|
eventResult.statusCode, eventResult.msg);
|
||||||
offline(parentPlatform, false);
|
offline(platform, false);
|
||||||
}, null);
|
}, null);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("[命令发送失败] 国标级联定时注册: {}", e.getMessage());
|
log.error("[命令发送失败] 国标级联定时注册: {}", e.getMessage());
|
||||||
|
@ -364,52 +364,52 @@ public class PlatformServiceImpl implements IPlatformService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void offline(Platform parentPlatform, boolean stopRegister) {
|
public void offline(Platform platform, boolean stopRegister) {
|
||||||
log.info("[平台离线]:{}", parentPlatform.getServerGBId());
|
log.info("[平台离线]:{}", platform.getServerGBId());
|
||||||
PlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId());
|
PlatformCatch platformCatch = redisCatchStorage.queryPlatformCatchInfo(platform.getServerGBId());
|
||||||
parentPlatformCatch.setKeepAliveReply(0);
|
platformCatch.setKeepAliveReply(0);
|
||||||
parentPlatformCatch.setRegisterAliveReply(0);
|
platformCatch.setRegisterAliveReply(0);
|
||||||
Platform parentPlatformInCatch = parentPlatformCatch.getParentPlatform();
|
Platform catchPlatform = platformCatch.getPlatform();
|
||||||
parentPlatformInCatch.setStatus(false);
|
catchPlatform.setStatus(false);
|
||||||
parentPlatformCatch.setParentPlatform(parentPlatformInCatch);
|
platformCatch.setPlatform(catchPlatform);
|
||||||
redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
|
redisCatchStorage.updatePlatformCatchInfo(platformCatch);
|
||||||
platformMapper.updateParentPlatformStatus(parentPlatform.getServerGBId(), false);
|
platformMapper.updateStatus(platform.getServerGBId(), false);
|
||||||
|
|
||||||
// 停止所有推流
|
// 停止所有推流
|
||||||
log.info("[平台离线] {}, 停止所有推流", parentPlatform.getServerGBId());
|
log.info("[平台离线] {}, 停止所有推流", platform.getServerGBId());
|
||||||
stopAllPush(parentPlatform.getServerGBId());
|
stopAllPush(platform.getServerGBId());
|
||||||
|
|
||||||
// 清除注册定时
|
// 清除注册定时
|
||||||
log.info("[平台离线] {}, 停止定时注册任务", parentPlatform.getServerGBId());
|
log.info("[平台离线] {}, 停止定时注册任务", platform.getServerGBId());
|
||||||
final String registerTaskKey = REGISTER_KEY_PREFIX + parentPlatform.getServerGBId();
|
final String registerTaskKey = REGISTER_KEY_PREFIX + platform.getServerGBId();
|
||||||
if (dynamicTask.contains(registerTaskKey)) {
|
if (dynamicTask.contains(registerTaskKey)) {
|
||||||
dynamicTask.stop(registerTaskKey);
|
dynamicTask.stop(registerTaskKey);
|
||||||
}
|
}
|
||||||
// 清除心跳定时
|
// 清除心跳定时
|
||||||
log.info("[平台离线] {}, 停止定时发送心跳任务", parentPlatform.getServerGBId());
|
log.info("[平台离线] {}, 停止定时发送心跳任务", platform.getServerGBId());
|
||||||
final String keepaliveTaskKey = KEEPALIVE_KEY_PREFIX + parentPlatform.getServerGBId();
|
final String keepaliveTaskKey = KEEPALIVE_KEY_PREFIX + platform.getServerGBId();
|
||||||
if (dynamicTask.contains(keepaliveTaskKey)) {
|
if (dynamicTask.contains(keepaliveTaskKey)) {
|
||||||
// 清除心跳任务
|
// 清除心跳任务
|
||||||
dynamicTask.stop(keepaliveTaskKey);
|
dynamicTask.stop(keepaliveTaskKey);
|
||||||
}
|
}
|
||||||
// 停止订阅回复
|
// 停止订阅回复
|
||||||
SubscribeInfo catalogSubscribe = subscribeHolder.getCatalogSubscribe(parentPlatform.getServerGBId());
|
SubscribeInfo catalogSubscribe = subscribeHolder.getCatalogSubscribe(platform.getServerGBId());
|
||||||
if (catalogSubscribe != null) {
|
if (catalogSubscribe != null) {
|
||||||
if (catalogSubscribe.getExpires() > 0) {
|
if (catalogSubscribe.getExpires() > 0) {
|
||||||
log.info("[平台离线] {}, 停止目录订阅回复", parentPlatform.getServerGBId());
|
log.info("[平台离线] {}, 停止目录订阅回复", platform.getServerGBId());
|
||||||
subscribeHolder.removeCatalogSubscribe(parentPlatform.getServerGBId());
|
subscribeHolder.removeCatalogSubscribe(platform.getServerGBId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.info("[平台离线] {}, 停止移动位置订阅回复", parentPlatform.getServerGBId());
|
log.info("[平台离线] {}, 停止移动位置订阅回复", platform.getServerGBId());
|
||||||
subscribeHolder.removeMobilePositionSubscribe(parentPlatform.getServerGBId());
|
subscribeHolder.removeMobilePositionSubscribe(platform.getServerGBId());
|
||||||
// 发起定时自动重新注册
|
// 发起定时自动重新注册
|
||||||
if (!stopRegister) {
|
if (!stopRegister) {
|
||||||
// 设置为60秒自动尝试重新注册
|
// 设置为60秒自动尝试重新注册
|
||||||
final String registerFailAgainTaskKey = REGISTER_FAIL_AGAIN_KEY_PREFIX + parentPlatform.getServerGBId();
|
final String registerFailAgainTaskKey = REGISTER_FAIL_AGAIN_KEY_PREFIX + platform.getServerGBId();
|
||||||
Platform platform = platformMapper.getParentPlatById(parentPlatform.getId());
|
Platform platformInDb = platformMapper.query(platform.getId());
|
||||||
if (platform.isEnable()) {
|
if (platformInDb.isEnable()) {
|
||||||
dynamicTask.startCron(registerFailAgainTaskKey,
|
dynamicTask.startCron(registerFailAgainTaskKey,
|
||||||
()-> registerTask(platform, null),
|
()-> registerTask(platformInDb, null),
|
||||||
userSetting.getRegisterAgainAfterTime() * 1000);
|
userSetting.getRegisterAgainAfterTime() * 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -428,15 +428,15 @@ public class PlatformServiceImpl implements IPlatformService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void login(Platform parentPlatform) {
|
public void login(Platform platform) {
|
||||||
final String registerTaskKey = REGISTER_KEY_PREFIX + parentPlatform.getServerGBId();
|
final String registerTaskKey = REGISTER_KEY_PREFIX + platform.getServerGBId();
|
||||||
try {
|
try {
|
||||||
commanderForPlatform.register(parentPlatform, eventResult1 -> {
|
commanderForPlatform.register(platform, eventResult1 -> {
|
||||||
log.info("[国标级联] {},开始定时发起注册,间隔为1分钟", parentPlatform.getServerGBId());
|
log.info("[国标级联] {},开始定时发起注册,间隔为1分钟", platform.getServerGBId());
|
||||||
// 添加注册任务
|
// 添加注册任务
|
||||||
dynamicTask.startCron(registerTaskKey,
|
dynamicTask.startCron(registerTaskKey,
|
||||||
// 注册失败(注册成功时由程序直接调用了online方法)
|
// 注册失败(注册成功时由程序直接调用了online方法)
|
||||||
()-> log.info("[国标级联] {},平台离线后持续发起注册,失败", parentPlatform.getServerGBId()),
|
()-> log.info("[国标级联] {},平台离线后持续发起注册,失败", platform.getServerGBId()),
|
||||||
60*1000);
|
60*1000);
|
||||||
}, null);
|
}, null);
|
||||||
} catch (InvalidArgumentException | ParseException | SipException e) {
|
} catch (InvalidArgumentException | ParseException | SipException e) {
|
||||||
|
@ -807,6 +807,6 @@ public class PlatformServiceImpl implements IPlatformService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Platform queryOne(Integer platformId) {
|
public Platform queryOne(Integer platformId) {
|
||||||
return platformMapper.getParentPlatById(platformId);
|
return platformMapper.query(platformId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class SIPRequestHeaderPlarformProvider {
|
||||||
String sipAddress = parentPlatform.getDeviceIp() + ":" + parentPlatform.getDevicePort();
|
String sipAddress = parentPlatform.getDeviceIp() + ":" + parentPlatform.getDevicePort();
|
||||||
//请求行
|
//请求行
|
||||||
SipURI requestLine = SipFactory.getInstance().createAddressFactory().createSipURI(parentPlatform.getServerGBId(),
|
SipURI requestLine = SipFactory.getInstance().createAddressFactory().createSipURI(parentPlatform.getServerGBId(),
|
||||||
parentPlatform.getServerIP() + ":" + parentPlatform.getServerPort());
|
parentPlatform.getServerIp() + ":" + parentPlatform.getServerPort());
|
||||||
//via
|
//via
|
||||||
ArrayList<ViaHeader> viaHeaders = new ArrayList<ViaHeader>();
|
ArrayList<ViaHeader> viaHeaders = new ArrayList<ViaHeader>();
|
||||||
ViaHeader viaHeader = SipFactory.getInstance().createHeaderFactory().createViaHeader(parentPlatform.getDeviceIp(),
|
ViaHeader viaHeader = SipFactory.getInstance().createHeaderFactory().createViaHeader(parentPlatform.getDeviceIp(),
|
||||||
|
@ -93,7 +93,7 @@ public class SIPRequestHeaderPlarformProvider {
|
||||||
|
|
||||||
|
|
||||||
Request registerRequest = createRegisterRequest(parentPlatform, redisCatchStorage.getCSEQ(), fromTag, toTag, callIdHeader, expires);
|
Request registerRequest = createRegisterRequest(parentPlatform, redisCatchStorage.getCSEQ(), fromTag, toTag, callIdHeader, expires);
|
||||||
SipURI requestURI = SipFactory.getInstance().createAddressFactory().createSipURI(parentPlatform.getServerGBId(), parentPlatform.getServerIP() + ":" + parentPlatform.getServerPort());
|
SipURI requestURI = SipFactory.getInstance().createAddressFactory().createSipURI(parentPlatform.getServerGBId(), parentPlatform.getServerIp() + ":" + parentPlatform.getServerPort());
|
||||||
if (www == null) {
|
if (www == null) {
|
||||||
AuthorizationHeader authorizationHeader = SipFactory.getInstance().createHeaderFactory().createAuthorizationHeader("Digest");
|
AuthorizationHeader authorizationHeader = SipFactory.getInstance().createHeaderFactory().createAuthorizationHeader("Digest");
|
||||||
String username = parentPlatform.getUsername();
|
String username = parentPlatform.getUsername();
|
||||||
|
@ -178,7 +178,7 @@ public class SIPRequestHeaderPlarformProvider {
|
||||||
|
|
||||||
public Request createMessageRequest(Platform parentPlatform, String content, String fromTag, String viaTag, String toTag, CallIdHeader callIdHeader) throws PeerUnavailableException, ParseException, InvalidArgumentException {
|
public Request createMessageRequest(Platform parentPlatform, String content, String fromTag, String viaTag, String toTag, CallIdHeader callIdHeader) throws PeerUnavailableException, ParseException, InvalidArgumentException {
|
||||||
Request request = null;
|
Request request = null;
|
||||||
String serverAddress = parentPlatform.getServerIP()+ ":" + parentPlatform.getServerPort();
|
String serverAddress = parentPlatform.getServerIp()+ ":" + parentPlatform.getServerPort();
|
||||||
// sipuri
|
// sipuri
|
||||||
SipURI requestURI = SipFactory.getInstance().createAddressFactory().createSipURI(parentPlatform.getServerGBId(), serverAddress);
|
SipURI requestURI = SipFactory.getInstance().createAddressFactory().createSipURI(parentPlatform.getServerGBId(), serverAddress);
|
||||||
// via
|
// via
|
||||||
|
@ -217,7 +217,7 @@ public class SIPRequestHeaderPlarformProvider {
|
||||||
public SIPRequest createNotifyRequest(Platform parentPlatform, String content, SubscribeInfo subscribeInfo) throws PeerUnavailableException, ParseException, InvalidArgumentException {
|
public SIPRequest createNotifyRequest(Platform parentPlatform, String content, SubscribeInfo subscribeInfo) throws PeerUnavailableException, ParseException, InvalidArgumentException {
|
||||||
SIPRequest request = null;
|
SIPRequest request = null;
|
||||||
// sipuri
|
// sipuri
|
||||||
SipURI requestURI = SipFactory.getInstance().createAddressFactory().createSipURI(parentPlatform.getServerGBId(), parentPlatform.getServerIP()+ ":" + parentPlatform.getServerPort());
|
SipURI requestURI = SipFactory.getInstance().createAddressFactory().createSipURI(parentPlatform.getServerGBId(), parentPlatform.getServerIp()+ ":" + parentPlatform.getServerPort());
|
||||||
// via
|
// via
|
||||||
ArrayList<ViaHeader> viaHeaders = new ArrayList<>();
|
ArrayList<ViaHeader> viaHeaders = new ArrayList<>();
|
||||||
ViaHeader viaHeader = SipFactory.getInstance().createHeaderFactory().createViaHeader(parentPlatform.getDeviceIp(), parentPlatform.getDevicePort(),
|
ViaHeader viaHeader = SipFactory.getInstance().createHeaderFactory().createViaHeader(parentPlatform.getDeviceIp(), parentPlatform.getDevicePort(),
|
||||||
|
@ -277,7 +277,7 @@ public class SIPRequestHeaderPlarformProvider {
|
||||||
|
|
||||||
SIPRequest request = null;
|
SIPRequest request = null;
|
||||||
// sipuri
|
// sipuri
|
||||||
SipURI requestURI = SipFactory.getInstance().createAddressFactory().createSipURI(platform.getServerGBId(), platform.getServerIP()+ ":" + platform.getServerPort());
|
SipURI requestURI = SipFactory.getInstance().createAddressFactory().createSipURI(platform.getServerGBId(), platform.getServerIp()+ ":" + platform.getServerPort());
|
||||||
// via
|
// via
|
||||||
ArrayList<ViaHeader> viaHeaders = new ArrayList<>();
|
ArrayList<ViaHeader> viaHeaders = new ArrayList<>();
|
||||||
ViaHeader viaHeader = SipFactory.getInstance().createHeaderFactory().createViaHeader(platform.getDeviceIp(), platform.getDevicePort(),
|
ViaHeader viaHeader = SipFactory.getInstance().createHeaderFactory().createViaHeader(platform.getDeviceIp(), platform.getDevicePort(),
|
||||||
|
@ -318,7 +318,7 @@ public class SIPRequestHeaderPlarformProvider {
|
||||||
public Request createInviteRequest(Platform platform, String channelId, String content, String viaTag, String fromTag, String ssrc, CallIdHeader callIdHeader) throws PeerUnavailableException, ParseException, InvalidArgumentException {
|
public Request createInviteRequest(Platform platform, String channelId, String content, String viaTag, String fromTag, String ssrc, CallIdHeader callIdHeader) throws PeerUnavailableException, ParseException, InvalidArgumentException {
|
||||||
Request request = null;
|
Request request = null;
|
||||||
//请求行
|
//请求行
|
||||||
String platformHostAddress = platform.getServerIP() + ":" + platform.getServerPort();
|
String platformHostAddress = platform.getServerIp() + ":" + platform.getServerPort();
|
||||||
String localHostAddress = sipLayer.getLocalIp(platform.getDeviceIp())+":"+ platform.getDevicePort();
|
String localHostAddress = sipLayer.getLocalIp(platform.getDeviceIp())+":"+ platform.getDevicePort();
|
||||||
SipURI requestLine = SipFactory.getInstance().createAddressFactory().createSipURI(channelId, platformHostAddress);
|
SipURI requestLine = SipFactory.getInstance().createAddressFactory().createSipURI(channelId, platformHostAddress);
|
||||||
//via
|
//via
|
||||||
|
|
|
@ -134,7 +134,7 @@ public abstract class SIPRequestProcessorParent {
|
||||||
// 兼容国标中的使用编码@域名作为RequestURI的情况
|
// 兼容国标中的使用编码@域名作为RequestURI的情况
|
||||||
SipURI sipURI = (SipURI)request.getRequestURI();
|
SipURI sipURI = (SipURI)request.getRequestURI();
|
||||||
if (sipURI.getPort() == -1) {
|
if (sipURI.getPort() == -1) {
|
||||||
sipURI = SipFactory.getInstance().createAddressFactory().createSipURI(platform.getServerGBId(), platform.getServerIP()+":"+platform.getServerPort());
|
sipURI = SipFactory.getInstance().createAddressFactory().createSipURI(platform.getServerGBId(), platform.getServerIp()+":"+platform.getServerPort());
|
||||||
}
|
}
|
||||||
ResponseAckExtraParam responseAckExtraParam = new ResponseAckExtraParam();
|
ResponseAckExtraParam responseAckExtraParam = new ResponseAckExtraParam();
|
||||||
responseAckExtraParam.contentTypeHeader = contentTypeHeader;
|
responseAckExtraParam.contentTypeHeader = contentTypeHeader;
|
||||||
|
@ -155,7 +155,7 @@ public abstract class SIPRequestProcessorParent {
|
||||||
|
|
||||||
SipURI sipURI = (SipURI)request.getRequestURI();
|
SipURI sipURI = (SipURI)request.getRequestURI();
|
||||||
if (sipURI.getPort() == -1) {
|
if (sipURI.getPort() == -1) {
|
||||||
sipURI = SipFactory.getInstance().createAddressFactory().createSipURI(platform.getServerGBId(), platform.getServerIP()+":"+platform.getServerPort());
|
sipURI = SipFactory.getInstance().createAddressFactory().createSipURI(platform.getServerGBId(), platform.getServerIp()+":"+platform.getServerPort());
|
||||||
}
|
}
|
||||||
ResponseAckExtraParam responseAckExtraParam = new ResponseAckExtraParam();
|
ResponseAckExtraParam responseAckExtraParam = new ResponseAckExtraParam();
|
||||||
responseAckExtraParam.contentTypeHeader = contentTypeHeader;
|
responseAckExtraParam.contentTypeHeader = contentTypeHeader;
|
||||||
|
|
|
@ -1217,7 +1217,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||||
content.append("f=v/////a/1/8/1\r\n");
|
content.append("f=v/////a/1/8/1\r\n");
|
||||||
|
|
||||||
Platform parentPlatform = new Platform();
|
Platform parentPlatform = new Platform();
|
||||||
parentPlatform.setServerIP(device.getIp());
|
parentPlatform.setServerIp(device.getIp());
|
||||||
parentPlatform.setServerPort(device.getPort());
|
parentPlatform.setServerPort(device.getPort());
|
||||||
parentPlatform.setServerGBId(device.getDeviceId());
|
parentPlatform.setServerGBId(device.getDeviceId());
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ public class RegisterResponseProcessor extends SIPResponseProcessorAbstract {
|
||||||
|
|
||||||
String action = platformRegisterInfo.isRegister() ? "注册" : "注销";
|
String action = platformRegisterInfo.isRegister() ? "注册" : "注销";
|
||||||
log.info(String.format("[国标级联]%s %S响应,%s ", action, response.getStatusCode(), platformRegisterInfo.getPlatformId() ));
|
log.info(String.format("[国标级联]%s %S响应,%s ", action, response.getStatusCode(), platformRegisterInfo.getPlatformId() ));
|
||||||
Platform parentPlatform = parentPlatformCatch.getParentPlatform();
|
Platform parentPlatform = parentPlatformCatch.getPlatform();
|
||||||
if (parentPlatform == null) {
|
if (parentPlatform == null) {
|
||||||
log.warn(String.format("[国标级联]收到 %s %s的%S请求, 但是平台信息未查询到!!!", platformRegisterInfo.getPlatformId(), action, response.getStatusCode()));
|
log.warn(String.format("[国标级联]收到 %s %s的%S请求, 但是平台信息未查询到!!!", platformRegisterInfo.getPlatformId(), action, response.getStatusCode()));
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -64,25 +64,25 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||||
}
|
}
|
||||||
PlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId());
|
PlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId());
|
||||||
if (parentPlatform.getId() == null ) {
|
if (parentPlatform.getId() == null ) {
|
||||||
result = platformMapper.addParentPlatform(parentPlatform);
|
result = platformMapper.add(parentPlatform);
|
||||||
if (parentPlatformCatch == null) {
|
if (parentPlatformCatch == null) {
|
||||||
parentPlatformCatch = new PlatformCatch();
|
parentPlatformCatch = new PlatformCatch();
|
||||||
parentPlatformCatch.setParentPlatform(parentPlatform);
|
parentPlatformCatch.setPlatform(parentPlatform);
|
||||||
parentPlatformCatch.setId(parentPlatform.getServerGBId());
|
parentPlatformCatch.setId(parentPlatform.getServerGBId());
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
if (parentPlatformCatch == null) { // serverGBId 已变化
|
if (parentPlatformCatch == null) { // serverGBId 已变化
|
||||||
Platform parentPlatById = platformMapper.getParentPlatById(parentPlatform.getId());
|
Platform parentPlatById = platformMapper.query(parentPlatform.getId());
|
||||||
// 使用旧的查出缓存ID
|
// 使用旧的查出缓存ID
|
||||||
parentPlatformCatch = new PlatformCatch();
|
parentPlatformCatch = new PlatformCatch();
|
||||||
parentPlatformCatch.setId(parentPlatform.getServerGBId());
|
parentPlatformCatch.setId(parentPlatform.getServerGBId());
|
||||||
redisCatchStorage.delPlatformCatchInfo(parentPlatById.getServerGBId());
|
redisCatchStorage.delPlatformCatchInfo(parentPlatById.getServerGBId());
|
||||||
}
|
}
|
||||||
|
|
||||||
result = platformMapper.updateParentPlatform(parentPlatform);
|
result = platformMapper.update(parentPlatform);
|
||||||
}
|
}
|
||||||
// 更新缓存
|
// 更新缓存
|
||||||
parentPlatformCatch.setParentPlatform(parentPlatform);
|
parentPlatformCatch.setPlatform(parentPlatform);
|
||||||
redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
|
redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
|
||||||
|
|
||||||
return result > 0;
|
return result > 0;
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--设备列表-->
|
<!--设备列表-->
|
||||||
<el-table size=mini :data="recordList" style="width: 100%" :height="winHeight">
|
<el-table size="medium" :data="recordList" style="width: 100%" :height="winHeight">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
type="selection"
|
type="selection"
|
||||||
width="55">
|
width="55">
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
style="float: right"
|
style="text-align: right"
|
||||||
@size-change="handleSizeChange"
|
@size-change="handleSizeChange"
|
||||||
@current-change="currentChange"
|
@current-change="currentChange"
|
||||||
:current-page="currentPage"
|
:current-page="currentPage"
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--设备列表-->
|
<!--设备列表-->
|
||||||
<el-table size=mini :data="deviceList" style="width: 100%;font-size: 12px;" :height="winHeight" header-row-class-name="table-header">
|
<el-table size="medium" :data="deviceList" style="width: 100%;font-size: 12px;" :height="winHeight" header-row-class-name="table-header">
|
||||||
<el-table-column prop="name" label="名称" min-width="160">
|
<el-table-column prop="name" label="名称" min-width="160">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="deviceId" label="设备编号" min-width="200" >
|
<el-table-column prop="deviceId" label="设备编号" min-width="200" >
|
||||||
|
@ -88,7 +88,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
style="float: right"
|
style="text-align: right"
|
||||||
@size-change="handleSizeChange"
|
@size-change="handleSizeChange"
|
||||||
@current-change="currentChange"
|
@current-change="currentChange"
|
||||||
:current-page="currentPage"
|
:current-page="currentPage"
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<div id="shared" style="text-align: right; margin-top: 1rem; background-color: #FFFFFF; padding-top: 2rem;">
|
<div id="shared" style="text-align: right; margin-top: 1rem; background-color: #FFFFFF; padding-top: 2rem;">
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="11">
|
<el-col :span="11">
|
||||||
<el-form ref="platform1" :rules="rules" :model="value" label-width="160px">
|
<el-form ref="platform1" :rules="rules" :model="value" size="medium" label-width="160px">
|
||||||
<el-form-item label="名称" prop="name">
|
<el-form-item label="名称" prop="name">
|
||||||
<el-input v-model="value.name"></el-input>
|
<el-input v-model="value.name"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -25,8 +25,8 @@
|
||||||
<el-form-item label="SIP服务国标域" prop="serverGBDomain">
|
<el-form-item label="SIP服务国标域" prop="serverGBDomain">
|
||||||
<el-input v-model="value.serverGBDomain" clearable></el-input>
|
<el-input v-model="value.serverGBDomain" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="SIP服务IP" prop="serverIP">
|
<el-form-item label="SIP服务IP" prop="serverIp">
|
||||||
<el-input v-model="value.serverIP" clearable></el-input>
|
<el-input v-model="value.serverIp" clearable></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="SIP服务端口" prop="serverPort">
|
<el-form-item label="SIP服务端口" prop="serverPort">
|
||||||
<el-input v-model="value.serverPort" clearable type="number"></el-input>
|
<el-input v-model="value.serverPort" clearable type="number"></el-input>
|
||||||
|
@ -47,16 +47,7 @@
|
||||||
<el-form-item label="本地端口" prop="devicePort">
|
<el-form-item label="本地端口" prop="devicePort">
|
||||||
<el-input v-model="value.devicePort" :disabled="true" type="number"></el-input>
|
<el-input v-model="value.devicePort" :disabled="true" type="number"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="SDP发流IP" prop="sendStreamIp">
|
|
||||||
<el-input v-model="value.sendStreamIp"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form ref="platform2" :rules="rules" :model="platform" label-width="160px">
|
|
||||||
<el-form-item label="行政区划" prop="administrativeDivision">
|
|
||||||
<el-input v-model="value.civilCode" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="SIP认证用户名" prop="username">
|
<el-form-item label="SIP认证用户名" prop="username">
|
||||||
<el-input v-model="value.username"></el-input>
|
<el-input v-model="value.username"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -69,6 +60,13 @@
|
||||||
<el-form-item label="心跳周期(秒)" prop="keepTimeout">
|
<el-form-item label="心跳周期(秒)" prop="keepTimeout">
|
||||||
<el-input v-model="value.keepTimeout"></el-input>
|
<el-input v-model="value.keepTimeout"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form ref="platform2" :rules="rules" :model="value" size="medium" label-width="160px">
|
||||||
|
<el-form-item label="SDP发流IP" prop="sendStreamIp">
|
||||||
|
<el-input v-model="value.sendStreamIp"></el-input>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="信令传输" prop="transport">
|
<el-form-item label="信令传输" prop="transport">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="value.transport"
|
v-model="value.transport"
|
||||||
|
@ -79,6 +77,12 @@
|
||||||
<el-option label="TCP" value="TCP"></el-option>
|
<el-option label="TCP" value="TCP"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="保密属性" >
|
||||||
|
<el-select v-model="value.secrecy" style="width: 100%" placeholder="请选择保密属性">
|
||||||
|
<el-option label="不涉密" :value="0"></el-option>
|
||||||
|
<el-option label="涉密" :value="1"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="目录分组" prop="catalogGroup">
|
<el-form-item label="目录分组" prop="catalogGroup">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="value.catalogGroup"
|
v-model="value.catalogGroup"
|
||||||
|
@ -101,6 +105,18 @@
|
||||||
<el-option label="UTF-8" value="UTF-8"></el-option>
|
<el-option label="UTF-8" value="UTF-8"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="行政区划" prop="civilCode">
|
||||||
|
<el-input v-model="value.civilCode" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="平台厂商" prop="manufacturer">
|
||||||
|
<el-input v-model="value.manufacturer" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="平台型号" prop="model">
|
||||||
|
<el-input v-model="value.model" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="平台安装地址" prop="address">
|
||||||
|
<el-input v-model="value.address" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="其他选项" >
|
<el-form-item label="其他选项" >
|
||||||
<div style="text-align: left">
|
<div style="text-align: left">
|
||||||
<el-checkbox label="启用" v-model="value.enable" @change="checkExpires"></el-checkbox>
|
<el-checkbox label="启用" v-model="value.enable" @change="checkExpires"></el-checkbox>
|
||||||
|
@ -108,10 +124,9 @@
|
||||||
<el-checkbox label="RTCP保活" v-model="value.rtcp" @change="rtcpCheckBoxChange"></el-checkbox>
|
<el-checkbox label="RTCP保活" v-model="value.rtcp" @change="rtcpCheckBoxChange"></el-checkbox>
|
||||||
<el-checkbox label="消息通道" v-model="value.asMessageChannel"></el-checkbox>
|
<el-checkbox label="消息通道" v-model="value.asMessageChannel"></el-checkbox>
|
||||||
<el-checkbox label="主动推送通道" v-model="value.autoPushChannel"></el-checkbox>
|
<el-checkbox label="主动推送通道" v-model="value.autoPushChannel"></el-checkbox>
|
||||||
<el-checkbox label="主动推送通道" v-model="value.autoPushChannel"></el-checkbox>
|
<el-checkbox label="推送平台信息" v-model="value.catalogWithPlatform"></el-checkbox>
|
||||||
<el-checkbox label="主动推送通道" v-model="value.autoPushChannel"></el-checkbox>
|
<el-checkbox label="推送分组信息" v-model="value.catalogWithGroup"></el-checkbox>
|
||||||
<el-checkbox label="主动推送通道" v-model="value.autoPushChannel"></el-checkbox>
|
<el-checkbox label="推送行政区划" v-model="value.catalogWithRegion"></el-checkbox>
|
||||||
<el-checkbox label="主动推送通道" v-model="value.autoPushChannel"></el-checkbox>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@ -134,7 +149,7 @@
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "platformEdit",
|
name: "platformEdit",
|
||||||
props: [ 'value', 'closeEdit'],
|
props: [ 'value', 'closeEdit', 'deviceIps'],
|
||||||
components: {
|
components: {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -164,35 +179,7 @@ export default {
|
||||||
showDialog: false,
|
showDialog: false,
|
||||||
isLoging: false,
|
isLoging: false,
|
||||||
onSubmit_text: "立即创建",
|
onSubmit_text: "立即创建",
|
||||||
saveUrl: "/api/platform/save",
|
|
||||||
|
|
||||||
platform: {
|
|
||||||
id: null,
|
|
||||||
enable: true,
|
|
||||||
ptz: true,
|
|
||||||
rtcp: false,
|
|
||||||
asMessageChannel: false,
|
|
||||||
autoPushChannel: false,
|
|
||||||
name: null,
|
|
||||||
serverGBId: null,
|
|
||||||
serverGBDomain: null,
|
|
||||||
serverIP: null,
|
|
||||||
serverPort: null,
|
|
||||||
deviceGBId: null,
|
|
||||||
deviceIp: null,
|
|
||||||
devicePort: null,
|
|
||||||
username: null,
|
|
||||||
password: null,
|
|
||||||
expires: 3600,
|
|
||||||
keepTimeout: 60,
|
|
||||||
transport: "UDP",
|
|
||||||
characterSet: "GB2312",
|
|
||||||
startOfflinePush: false,
|
|
||||||
catalogGroup: 1,
|
|
||||||
administrativeDivision: "",
|
|
||||||
sendStreamIp: null,
|
|
||||||
},
|
|
||||||
deviceIps: [], // 存储用户设备IP数组
|
|
||||||
rules: {
|
rules: {
|
||||||
name: [{required: true, message: "请输入平台名称", trigger: "blur"}],
|
name: [{required: true, message: "请输入平台名称", trigger: "blur"}],
|
||||||
serverGBId: [
|
serverGBId: [
|
||||||
|
@ -201,7 +188,7 @@ export default {
|
||||||
serverGBDomain: [
|
serverGBDomain: [
|
||||||
{required: true, message: "请输入SIP服务国标域", trigger: "blur"},
|
{required: true, message: "请输入SIP服务国标域", trigger: "blur"},
|
||||||
],
|
],
|
||||||
serverIP: [{required: true, message: "请输入SIP服务IP", trigger: "blur"}],
|
serverIp: [{required: true, message: "请输入SIP服务IP", trigger: "blur"}],
|
||||||
serverPort: [{required: true, message: "请输入SIP服务端口", trigger: "blur"}],
|
serverPort: [{required: true, message: "请输入SIP服务端口", trigger: "blur"}],
|
||||||
deviceGBId: [{validator: deviceGBIdRules, trigger: "blur"}],
|
deviceGBId: [{validator: deviceGBIdRules, trigger: "blur"}],
|
||||||
username: [{required: false, message: "请输入SIP认证用户名", trigger: "blur"}],
|
username: [{required: false, message: "请输入SIP认证用户名", trigger: "blur"}],
|
||||||
|
@ -218,53 +205,73 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onSubmit: function () {
|
onSubmit: function () {
|
||||||
console.log(typeof this.streamProxy.noneReader)
|
|
||||||
this.saveLoading = true;
|
this.saveLoading = true;
|
||||||
|
if (this.value.id) {
|
||||||
this.noneReaderHandler();
|
|
||||||
if (this.streamProxy.id) {
|
|
||||||
this.$axios({
|
this.$axios({
|
||||||
method: 'post',
|
method: 'post',
|
||||||
url:`/api/proxy/update`,
|
url: "/api/platform/update",
|
||||||
data: this.streamProxy
|
data: this.value
|
||||||
}).then((res)=> {
|
}).then((res) => {
|
||||||
this.saveLoading = false;
|
this.saveLoading = false;
|
||||||
if (typeof (res.data.code) != "undefined" && res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
this.$message.success("保存成功");
|
this.$message({
|
||||||
console.log(res.data.data)
|
showClose: true,
|
||||||
this.streamProxy = res.data.data
|
message: "保存成功",
|
||||||
}else {
|
type: "success",
|
||||||
this.$message.error(res.data.msg);
|
});
|
||||||
|
this.showDialog = false;
|
||||||
|
if (this.closeEdit) {
|
||||||
|
this.closeEdit();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
message: res.data.msg,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
}).catch((error) => {
|
||||||
this.saveLoading = false;
|
this.saveLoading = false;
|
||||||
}).catch((error) =>{
|
console.log(error);
|
||||||
this.$message.error(error);
|
});
|
||||||
this.saveLoading = false;
|
|
||||||
}).finally(()=>{
|
|
||||||
console.log("finally==finally")
|
|
||||||
this.saveLoading = false;
|
|
||||||
})
|
|
||||||
}else {
|
}else {
|
||||||
this.$axios({
|
this.$axios({
|
||||||
method: 'post',
|
method: 'post',
|
||||||
url:`/api/proxy/add`,
|
url: "/api/platform/add",
|
||||||
data: this.streamProxy
|
data: this.value
|
||||||
}).then((res)=> {
|
}).then((res) => {
|
||||||
this.saveLoading = false;
|
this.saveLoading = false;
|
||||||
if (typeof (res.data.code) != "undefined" && res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
this.$message.success("保存成功");
|
this.$message({
|
||||||
this.streamProxy = res.data.data
|
showClose: true,
|
||||||
}else {
|
message: "保存成功",
|
||||||
this.$message.error(res.data.msg);
|
type: "success",
|
||||||
|
});
|
||||||
|
if (this.closeEdit) {
|
||||||
|
this.closeEdit();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
message: res.data.msg,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}).catch((error) =>{
|
}).catch((error) => {
|
||||||
this.$message.error(res.data.error);
|
|
||||||
this.saveLoading = false;
|
this.saveLoading = false;
|
||||||
}).finally(()=>{
|
console.log(error);
|
||||||
this.saveLoading = false;
|
});
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
serverGBIdChange: function () {
|
||||||
|
if (this.value.serverGBId.length > 10) {
|
||||||
|
this.value.serverGBDomain = this.value.serverGBId.substr(0, 10);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deviceGBIdChange: function () {
|
||||||
|
this.value.username = this.value.deviceGBId;
|
||||||
},
|
},
|
||||||
checkExpires: function () {
|
checkExpires: function () {
|
||||||
if (this.value.enable && this.value.expires === "0") {
|
if (this.value.enable && this.value.expires === "0") {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--设备列表-->
|
<!--设备列表-->
|
||||||
<el-table size=mini :data="platformList" style="width: 100%" :height="winHeight">
|
<el-table size="medium" :data="platformList" style="width: 100%" :height="winHeight">
|
||||||
<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" >
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
<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>
|
||||||
|
@ -53,13 +53,13 @@
|
||||||
<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>
|
||||||
<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-delete" type="text" style="color: #f56c6c" @click="deletePlatform(scope.row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
style="float: right"
|
style="text-align: right"
|
||||||
@size-change="handleSizeChange"
|
@size-change="handleSizeChange"
|
||||||
@current-change="currentChange"
|
@current-change="currentChange"
|
||||||
:current-page="currentPage"
|
:current-page="currentPage"
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<platformEdit ref="platformEdit" v-if="platform" v-model="platform" :closeEdit="closeEdit" ></platformEdit>
|
<platformEdit ref="platformEdit" v-if="platform" v-model="platform" :closeEdit="closeEdit" :device-ips="deviceIps" ></platformEdit>
|
||||||
<chooseChannelDialog ref="chooseChannelDialog" ></chooseChannelDialog>
|
<chooseChannelDialog ref="chooseChannelDialog" ></chooseChannelDialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -118,8 +118,7 @@ export default {
|
||||||
this.platform = this.defaultPlatform;
|
this.platform = this.defaultPlatform;
|
||||||
},
|
},
|
||||||
editPlatform: function(platform) {
|
editPlatform: function(platform) {
|
||||||
console.log(platform)
|
this.platform = platform;
|
||||||
this.$refs.platformEdit.openDialog(platform, this.initData)
|
|
||||||
},
|
},
|
||||||
closeEdit: function() {
|
closeEdit: function() {
|
||||||
this.platform = null;
|
this.platform = null;
|
||||||
|
@ -154,8 +153,8 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
chooseChannel: function(platform) {
|
chooseChannel: function(platform) {
|
||||||
console.log("platform.name: " + platform.name)
|
console.log("platform.name: " + platform.name)
|
||||||
this.$refs.chooseChannelDialog.openDialog(platform.serverGBId,platform.deviceGBId, platform.name, platform.catalogId, this.initData)
|
this.$refs.chooseChannelDialog.openDialog(platform.serverGBId,platform.deviceGBId, platform.name, platform.catalogId, this.initData)
|
||||||
},
|
},
|
||||||
initData: function() {
|
initData: function() {
|
||||||
this.$axios({
|
this.$axios({
|
||||||
|
@ -174,7 +173,7 @@ export default {
|
||||||
name: null,
|
name: null,
|
||||||
serverGBId: null,
|
serverGBId: null,
|
||||||
serverGBDomain: null,
|
serverGBDomain: null,
|
||||||
serverIP: null,
|
serverIp: null,
|
||||||
serverPort: null,
|
serverPort: null,
|
||||||
deviceGBId: res.data.data.username,
|
deviceGBId: res.data.data.username,
|
||||||
deviceIp: this.deviceIps[0],
|
deviceIp: this.deviceIps[0],
|
||||||
|
@ -186,8 +185,16 @@ export default {
|
||||||
transport: "UDP",
|
transport: "UDP",
|
||||||
characterSet: "GB2312",
|
characterSet: "GB2312",
|
||||||
startOfflinePush: false,
|
startOfflinePush: false,
|
||||||
|
customGroup: false,
|
||||||
|
catalogWithPlatform: false,
|
||||||
|
catalogWithGroup: false,
|
||||||
|
catalogWithRegion: false,
|
||||||
|
manufacturer: null,
|
||||||
|
model: null,
|
||||||
|
address: null,
|
||||||
|
secrecy: 1,
|
||||||
catalogGroup: 1,
|
catalogGroup: 1,
|
||||||
administrativeDivision: res.data.data.username.substr(0, 6),
|
civilCode: null,
|
||||||
sendStreamIp: res.data.data.sendStreamIp,
|
sendStreamIp: res.data.data.sendStreamIp,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<devicePlayer ref="devicePlayer"></devicePlayer>
|
<devicePlayer ref="devicePlayer"></devicePlayer>
|
||||||
<el-table size=mini :data="streamProxyList" style="width: 100%" :height="winHeight">
|
<el-table size="medium" :data="streamProxyList" style="width: 100%" :height="winHeight">
|
||||||
<el-table-column prop="app" label="流应用名" min-width="120" show-overflow-tooltip/>
|
<el-table-column prop="app" label="流应用名" min-width="120" show-overflow-tooltip/>
|
||||||
<el-table-column prop="stream" label="流ID" min-width="120" show-overflow-tooltip/>
|
<el-table-column prop="stream" label="流ID" min-width="120" show-overflow-tooltip/>
|
||||||
<el-table-column label="流地址" min-width="250" show-overflow-tooltip >
|
<el-table-column label="流地址" min-width="250" show-overflow-tooltip >
|
||||||
|
@ -89,7 +89,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
style="float: right"
|
style="text-align: right"
|
||||||
@size-change="handleSizeChange"
|
@size-change="handleSizeChange"
|
||||||
@current-change="currentChange"
|
@current-change="currentChange"
|
||||||
:current-page="currentPage"
|
:current-page="currentPage"
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
<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=mini ref="pushListTable" :data="pushList" style="width: 100%" :height="winHeight" :loading="loading"
|
<el-table size="medium" ref="pushListTable" :data="pushList" style="width: 100%" :height="winHeight" :loading="loading"
|
||||||
@selection-change="handleSelectionChange" :row-key="(row)=> row.app + row.stream">
|
@selection-change="handleSelectionChange" :row-key="(row)=> row.app + row.stream">
|
||||||
<el-table-column type="selection" :reserve-selection="true" min-width="55">
|
<el-table-column type="selection" :reserve-selection="true" min-width="55">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -85,7 +85,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
style="float: right"
|
style="text-align: right"
|
||||||
@size-change="handleSizeChange"
|
@size-change="handleSizeChange"
|
||||||
@current-change="currentChange"
|
@current-change="currentChange"
|
||||||
:current-page="currentPage"
|
:current-page="currentPage"
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--ApiKey列表-->
|
<!--ApiKey列表-->
|
||||||
<el-table size=mini :data="userList" style="width: 100%;font-size: 12px;" :height="winHeight"
|
<el-table size="medium" :data="userList" style="width: 100%;font-size: 12px;" :height="winHeight"
|
||||||
header-row-class-name="table-header">
|
header-row-class-name="table-header">
|
||||||
<el-table-column prop="user.username" label="用户名" min-width="120"/>
|
<el-table-column prop="user.username" label="用户名" min-width="120"/>
|
||||||
<el-table-column prop="app" label="应用名" min-width="160"/>
|
<el-table-column prop="app" label="应用名" min-width="160"/>
|
||||||
|
@ -64,7 +64,7 @@
|
||||||
<addUserApiKey ref="addUserApiKey"></addUserApiKey>
|
<addUserApiKey ref="addUserApiKey"></addUserApiKey>
|
||||||
<remarkUserApiKey ref="remarkUserApiKey"></remarkUserApiKey>
|
<remarkUserApiKey ref="remarkUserApiKey"></remarkUserApiKey>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
style="float: right"
|
style="text-align: right"
|
||||||
@size-change="handleSizeChange"
|
@size-change="handleSizeChange"
|
||||||
@current-change="currentChange"
|
@current-change="currentChange"
|
||||||
:current-page="currentPage"
|
:current-page="currentPage"
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--用户列表-->
|
<!--用户列表-->
|
||||||
<el-table size=mini :data="userList" style="width: 100%;font-size: 12px;" :height="winHeight"
|
<el-table size="medium" :data="userList" style="width: 100%;font-size: 12px;" :height="winHeight"
|
||||||
header-row-class-name="table-header">
|
header-row-class-name="table-header">
|
||||||
<el-table-column prop="username" label="用户名" min-width="160"/>
|
<el-table-column prop="username" label="用户名" min-width="160"/>
|
||||||
<el-table-column prop="pushKey" label="pushkey" min-width="160"/>
|
<el-table-column prop="pushKey" label="pushkey" min-width="160"/>
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
<changePushKey ref="changePushKey"></changePushKey>
|
<changePushKey ref="changePushKey"></changePushKey>
|
||||||
<addUser ref="addUser"></addUser>
|
<addUser ref="addUser"></addUser>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
style="float: right"
|
style="text-align: right"
|
||||||
@size-change="handleSizeChange"
|
@size-change="handleSizeChange"
|
||||||
@current-change="currentChange"
|
@current-change="currentChange"
|
||||||
:current-page="currentPage"
|
:current-page="currentPage"
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
<DeviceTree ref="deviceTree" :device="device" :onlyCatalog="true" :clickEvent="treeNodeClickEvent"></DeviceTree>
|
<DeviceTree ref="deviceTree" :device="device" :onlyCatalog="true" :clickEvent="treeNodeClickEvent"></DeviceTree>
|
||||||
</el-aside>
|
</el-aside>
|
||||||
<el-main style="padding: 5px;">
|
<el-main style="padding: 5px;">
|
||||||
<el-table size=mini ref="channelListTable" :data="deviceChannelList" :height="winHeight" style="width: 100%"
|
<el-table size="medium" ref="channelListTable" :data="deviceChannelList" :height="winHeight" style="width: 100%"
|
||||||
header-row-class-name="table-header">
|
header-row-class-name="table-header">
|
||||||
<el-table-column prop="name" label="名称" min-width="180">
|
<el-table-column prop="name" label="名称" min-width="180">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -150,7 +150,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
style="float: right"
|
style="text-align: right"
|
||||||
@size-change="handleSizeChange"
|
@size-change="handleSizeChange"
|
||||||
@current-change="currentChange"
|
@current-change="currentChange"
|
||||||
:current-page="currentPage"
|
:current-page="currentPage"
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--设备列表-->
|
<!--设备列表-->
|
||||||
<el-table size=mini :data="deviceList" style="width: 100%;font-size: 12px;" :height="winHeight" header-row-class-name="table-header" @selection-change="handleSelectionChange">
|
<el-table size="medium" :data="deviceList" style="width: 100%;font-size: 12px;" :height="winHeight" header-row-class-name="table-header" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" >
|
<el-table-column type="selection" width="55" >
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="name" label="名称" min-width="160">
|
<el-table-column prop="name" label="名称" min-width="160">
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
style="text-align: right;"
|
style="text-align: right"
|
||||||
@size-change="handleSizeChange"
|
@size-change="handleSizeChange"
|
||||||
@current-change="currentChange"
|
@current-change="currentChange"
|
||||||
:current-page="currentPage"
|
:current-page="currentPage"
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<el-button v-if="catalogId !== null" type="danger" icon="el-icon-delete" size="mini" @click="remove()">全部移除</el-button>
|
<el-button v-if="catalogId !== null" type="danger" icon="el-icon-delete" size="mini" @click="remove()">全部移除</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-table size=mini ref="gbChannelsTable" :data="gbChannels" border style="width: 100%" :height="winHeight" :row-key="(row)=> row.deviceId + row.channelId" @selection-change="handleSelectionChange">
|
<el-table size="medium" ref="gbChannelsTable" :data="gbChannels" border style="width: 100%" :height="winHeight" :row-key="(row)=> row.deviceId + row.channelId" @selection-change="handleSelectionChange">
|
||||||
<el-table-column align="center" type="selection" :reserve-selection="true" width="55">
|
<el-table-column align="center" type="selection" :reserve-selection="true" width="55">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="channelId" label="通道编号" width="180" align="center">
|
<el-table-column prop="channelId" label="通道编号" width="180" align="center">
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination style="float: right;margin-top: 1rem;" @size-change="handleSizeChange" @current-change="currentChange" :current-page="currentPage" :page-size="count" :page-sizes="[10, 20, 30, 50]" layout="total, sizes, prev, pager, next" :total="total">
|
<el-pagination style="text-align: right;margin-top: 1rem;" @size-change="handleSizeChange" @current-change="currentChange" :current-page="currentPage" :page-size="count" :page-sizes="[10, 20, 30, 50]" layout="total, sizes, prev, pager, next" :total="total">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
<getCatalog ref="getCatalog" :platformId="platformId" ></getCatalog>
|
<getCatalog ref="getCatalog" :platformId="platformId" ></getCatalog>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
<el-button v-if="catalogId === null" icon="el-icon-plus" size="mini" style="margin-right: 1rem;" @click="add()">全部添加</el-button>
|
<el-button v-if="catalogId === null" icon="el-icon-plus" size="mini" style="margin-right: 1rem;" @click="add()">全部添加</el-button>
|
||||||
<el-button v-if="catalogId !== null" type="danger" icon="el-icon-delete" size="mini" style="margin-right: 1rem;" @click="remove()">全部移除</el-button>
|
<el-button v-if="catalogId !== null" type="danger" icon="el-icon-delete" size="mini" style="margin-right: 1rem;" @click="remove()">全部移除</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table size=mini ref="gbStreamsTable" :data="gbStreams" border style="width: 100%" :height="winHeight" :row-key="(row)=> row.app + row.stream" @selection-change="handleSelectionChange">
|
<el-table size="medium" ref="gbStreamsTable" :data="gbStreams" border style="width: 100%" :height="winHeight" :row-key="(row)=> row.app + row.stream" @selection-change="handleSelectionChange">
|
||||||
<el-table-column align="center" type="selection" :reserve-selection="true" width="55">
|
<el-table-column align="center" type="selection" :reserve-selection="true" width="55">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="name" label="名称" show-overflow-tooltip align="center">
|
<el-table-column prop="name" label="名称" show-overflow-tooltip align="center">
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination style="float: right;margin-top: 1rem;" @size-change="handleSizeChange" @current-change="currentChange" :current-page="currentPage" :page-size="count" :page-sizes="[10, 20, 30, 50]" layout="total, sizes, prev, pager, next" :total="total">
|
<el-pagination style="text-align: right;margin-top: 1rem;" @size-change="handleSizeChange" @current-change="currentChange" :current-page="currentPage" :page-size="count" :page-sizes="[10, 20, 30, 50]" layout="total, sizes, prev, pager, next" :total="total">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
<getCatalog ref="getCatalog" :platformId="platformId" ></getCatalog>
|
<getCatalog ref="getCatalog" :platformId="platformId" ></getCatalog>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,543 +0,0 @@
|
||||||
<template>
|
|
||||||
<div id="addlatform" v-loading="isLoging">
|
|
||||||
<el-dialog
|
|
||||||
title="添加平台"
|
|
||||||
width="70%"
|
|
||||||
top="2rem"
|
|
||||||
:close-on-click-modal="false"
|
|
||||||
:visible.sync="showDialog"
|
|
||||||
:destroy-on-close="true"
|
|
||||||
@close="close()"
|
|
||||||
>
|
|
||||||
<div id="shared" style="text-align: right; margin-top: 1rem">
|
|
||||||
<el-row :gutter="24">
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form ref="platform1" :rules="rules" :model="platform" label-width="160px">
|
|
||||||
<el-form-item label="名称" prop="name">
|
|
||||||
<el-input v-model="platform.name"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="SIP服务国标编码" prop="serverGBId">
|
|
||||||
<el-input v-model="platform.serverGBId" clearable @input="serverGBIdChange"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="SIP服务国标域" prop="serverGBDomain">
|
|
||||||
<el-input v-model="platform.serverGBDomain" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="SIP服务IP" prop="serverIP">
|
|
||||||
<el-input v-model="platform.serverIP" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="SIP服务端口" prop="serverPort">
|
|
||||||
<el-input v-model="platform.serverPort" clearable type="number"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="设备国标编号" prop="deviceGBId">
|
|
||||||
<el-input v-model="platform.deviceGBId" clearable @input="deviceGBIdChange"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="本地IP" prop="deviceIp">
|
|
||||||
<el-select v-model="platform.deviceIp" placeholder="请选择与上级相通的网卡" style="width: 100%">
|
|
||||||
<el-option
|
|
||||||
v-for="ip in deviceIps"
|
|
||||||
:key="ip"
|
|
||||||
:label="ip"
|
|
||||||
:value="ip">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="本地端口" prop="devicePort">
|
|
||||||
<el-input v-model="platform.devicePort" :disabled="true" type="number"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="SDP发流IP" prop="sendStreamIp">
|
|
||||||
<el-input v-model="platform.sendStreamIp"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form ref="platform2" :rules="rules" :model="platform" label-width="160px">
|
|
||||||
<el-form-item label="行政区划" prop="administrativeDivision">
|
|
||||||
<el-input v-model="platform.administrativeDivision" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="SIP认证用户名" prop="username">
|
|
||||||
<el-input v-model="platform.username"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="SIP认证密码" prop="password">
|
|
||||||
<el-input v-model="platform.password"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="注册周期(秒)" prop="expires">
|
|
||||||
<el-input v-model="platform.expires"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="心跳周期(秒)" prop="keepTimeout">
|
|
||||||
<el-input v-model="platform.keepTimeout"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="信令传输" prop="transport">
|
|
||||||
<el-select
|
|
||||||
v-model="platform.transport"
|
|
||||||
style="width: 100%"
|
|
||||||
placeholder="请选择信令传输方式"
|
|
||||||
>
|
|
||||||
<el-option label="UDP" value="UDP"></el-option>
|
|
||||||
<el-option label="TCP" value="TCP"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="目录分组" prop="catalogGroup">
|
|
||||||
<el-select
|
|
||||||
v-model="platform.catalogGroup"
|
|
||||||
style="width: 100%"
|
|
||||||
placeholder="请选择目录分组"
|
|
||||||
>
|
|
||||||
<el-option label="1" value="1"></el-option>
|
|
||||||
<el-option label="2" value="2"></el-option>
|
|
||||||
<el-option label="4" value="4"></el-option>
|
|
||||||
<el-option label="8" value="8"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="字符集" prop="characterSet">
|
|
||||||
<el-select
|
|
||||||
v-model="platform.characterSet"
|
|
||||||
style="width: 100%"
|
|
||||||
placeholder="请选择字符集"
|
|
||||||
>
|
|
||||||
<el-option label="GB2312" value="GB2312"></el-option>
|
|
||||||
<el-option label="UTF-8" value="UTF-8"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="其他选项">
|
|
||||||
<el-checkbox label="启用" v-model="platform.enable" @change="checkExpires"></el-checkbox>
|
|
||||||
<!-- <el-checkbox label="云台控制" v-model="platform.ptz"></el-checkbox>-->
|
|
||||||
<el-checkbox label="拉起推流" v-model="platform.startOfflinePush"></el-checkbox>
|
|
||||||
<el-checkbox label="RTCP保活" v-model="platform.rtcp" @change="rtcpCheckBoxChange"></el-checkbox>
|
|
||||||
<el-checkbox label="消息通道" v-model="platform.asMessageChannel"></el-checkbox>
|
|
||||||
<el-checkbox label="推送通道" v-model="platform.autoPushChannel"></el-checkbox>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="onSubmit">{{
|
|
||||||
onSubmit_text
|
|
||||||
}}
|
|
||||||
</el-button>
|
|
||||||
<el-button @click="close">取消</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: "platformEdit",
|
|
||||||
props: {},
|
|
||||||
computed: {},
|
|
||||||
data() {
|
|
||||||
var deviceGBIdRules = async (rule, value, callback) => {
|
|
||||||
console.log(value);
|
|
||||||
if (value === "") {
|
|
||||||
callback(new Error("请输入设备国标编号"));
|
|
||||||
} else {
|
|
||||||
var exit = await this.deviceGBIdExit(value);
|
|
||||||
if (exit) {
|
|
||||||
callback(new Error("设备国标编号已存在"));
|
|
||||||
} else {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return {
|
|
||||||
listChangeCallback: null,
|
|
||||||
showDialog: false,
|
|
||||||
isLoging: false,
|
|
||||||
onSubmit_text: "立即创建",
|
|
||||||
saveUrl: "/api/platform/save",
|
|
||||||
|
|
||||||
platform: {
|
|
||||||
id: null,
|
|
||||||
enable: true,
|
|
||||||
ptz: true,
|
|
||||||
rtcp: false,
|
|
||||||
asMessageChannel: false,
|
|
||||||
autoPushChannel: false,
|
|
||||||
name: null,
|
|
||||||
serverGBId: null,
|
|
||||||
serverGBDomain: null,
|
|
||||||
serverIP: null,
|
|
||||||
serverPort: null,
|
|
||||||
deviceGBId: null,
|
|
||||||
deviceIp: null,
|
|
||||||
devicePort: null,
|
|
||||||
username: null,
|
|
||||||
password: null,
|
|
||||||
expires: 3600,
|
|
||||||
keepTimeout: 60,
|
|
||||||
transport: "UDP",
|
|
||||||
characterSet: "GB2312",
|
|
||||||
startOfflinePush: false,
|
|
||||||
catalogGroup: 1,
|
|
||||||
administrativeDivision: "",
|
|
||||||
sendStreamIp: null,
|
|
||||||
},
|
|
||||||
deviceIps: [], // 存储用户设备IP数组
|
|
||||||
rules: {
|
|
||||||
name: [{required: true, message: "请输入平台名称", trigger: "blur"}],
|
|
||||||
serverGBId: [
|
|
||||||
{required: true, message: "请输入SIP服务国标编码", trigger: "blur"},
|
|
||||||
],
|
|
||||||
serverGBDomain: [
|
|
||||||
{required: true, message: "请输入SIP服务国标域", trigger: "blur"},
|
|
||||||
],
|
|
||||||
serverIP: [{required: true, message: "请输入SIP服务IP", trigger: "blur"}],
|
|
||||||
serverPort: [{required: true, message: "请输入SIP服务端口", trigger: "blur"}],
|
|
||||||
deviceGBId: [{validator: deviceGBIdRules, trigger: "blur"}],
|
|
||||||
username: [{required: false, message: "请输入SIP认证用户名", trigger: "blur"}],
|
|
||||||
password: [{required: false, message: "请输入SIP认证密码", trigger: "blur"}],
|
|
||||||
expires: [{required: true, message: "请输入注册周期", trigger: "blur"}],
|
|
||||||
keepTimeout: [{required: true, message: "请输入心跳周期", trigger: "blur"}],
|
|
||||||
transport: [{required: true, message: "请选择信令传输", trigger: "blur"}],
|
|
||||||
characterSet: [{required: true, message: "请选择编码字符集", trigger: "blur"}],
|
|
||||||
deviceIp: [{required: true, message: "请选择本地IP", trigger: "blur"}],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
openDialog: function (platform, callback) {
|
|
||||||
var that = this;
|
|
||||||
this.$axios({
|
|
||||||
method: 'get',
|
|
||||||
url: `/api/platform/server_config`
|
|
||||||
}).then(function (res) {
|
|
||||||
if (platform == null) {
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
that.platform.deviceGBId = res.data.data.username;
|
|
||||||
that.deviceIps = res.data.data.deviceIp.split(',');
|
|
||||||
that.platform.deviceIp = that.deviceIps[0];
|
|
||||||
that.platform.devicePort = res.data.data.devicePort;
|
|
||||||
that.platform.username = res.data.data.username;
|
|
||||||
that.platform.password = res.data.data.password;
|
|
||||||
that.platform.sendStreamIp = res.data.data.sendStreamIp;
|
|
||||||
that.platform.administrativeDivision = res.data.data.username.substr(0, 6);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
that.deviceIps = res.data.data.deviceIp.split(',');
|
|
||||||
}
|
|
||||||
}).catch(function (error) {
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
if (platform == null) {
|
|
||||||
this.onSubmit_text = "立即创建";
|
|
||||||
this.saveUrl = "/api/platform/add";
|
|
||||||
} else {
|
|
||||||
this.platform.id = platform.id;
|
|
||||||
this.platform.enable = platform.enable;
|
|
||||||
this.platform.ptz = platform.ptz;
|
|
||||||
this.platform.rtcp = platform.rtcp;
|
|
||||||
this.platform.asMessageChannel = platform.asMessageChannel;
|
|
||||||
this.platform.autoPushChannel = platform.autoPushChannel;
|
|
||||||
this.platform.name = platform.name;
|
|
||||||
this.platform.serverGBId = platform.serverGBId;
|
|
||||||
this.platform.serverGBDomain = platform.serverGBDomain;
|
|
||||||
this.platform.serverIP = platform.serverIP;
|
|
||||||
this.platform.serverPort = platform.serverPort;
|
|
||||||
this.platform.deviceGBId = platform.deviceGBId;
|
|
||||||
this.platform.deviceIp = platform.deviceIp;
|
|
||||||
this.platform.devicePort = platform.devicePort;
|
|
||||||
this.platform.username = platform.username;
|
|
||||||
this.platform.password = platform.password;
|
|
||||||
this.platform.expires = platform.expires;
|
|
||||||
this.platform.keepTimeout = platform.keepTimeout;
|
|
||||||
this.platform.transport = platform.transport;
|
|
||||||
this.platform.characterSet = platform.characterSet;
|
|
||||||
this.platform.catalogId = platform.catalogId;
|
|
||||||
this.platform.startOfflinePush = platform.startOfflinePush;
|
|
||||||
this.platform.catalogGroup = platform.catalogGroup;
|
|
||||||
this.platform.sendStreamIp = platform.sendStreamIp;
|
|
||||||
this.platform.administrativeDivision = platform.administrativeDivision;
|
|
||||||
this.onSubmit_text = "保存";
|
|
||||||
this.saveUrl = "/api/platform/save";
|
|
||||||
}
|
|
||||||
this.showDialog = true;
|
|
||||||
this.listChangeCallback = callback;
|
|
||||||
},
|
|
||||||
serverGBIdChange: function () {
|
|
||||||
if (this.platform.serverGBId.length > 10) {
|
|
||||||
this.platform.serverGBDomain = this.platform.serverGBId.substr(0, 10);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
deviceGBIdChange: function () {
|
|
||||||
|
|
||||||
this.platform.username = this.platform.deviceGBId;
|
|
||||||
if (this.platform.administrativeDivision == null) {
|
|
||||||
this.platform.administrativeDivision = this.platform.deviceGBId.substr(0, 6);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSubmit: function () {
|
|
||||||
this.saveForm()
|
|
||||||
},
|
|
||||||
saveForm: function () {
|
|
||||||
this.$axios({
|
|
||||||
method: 'post',
|
|
||||||
url: this.saveUrl,
|
|
||||||
data: this.platform
|
|
||||||
}).then((res) => {
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
this.$message({
|
|
||||||
showClose: true,
|
|
||||||
message: "保存成功",
|
|
||||||
type: "success",
|
|
||||||
});
|
|
||||||
this.showDialog = false;
|
|
||||||
if (this.listChangeCallback != null) {
|
|
||||||
this.listChangeCallback();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$message({
|
|
||||||
showClose: true,
|
|
||||||
message: res.data.msg,
|
|
||||||
type: "error",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}).catch((error) => {
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
close: function () {
|
|
||||||
this.showDialog = false;
|
|
||||||
this.$refs.platform1.resetFields();
|
|
||||||
this.$refs.platform2.resetFields();
|
|
||||||
this.platform = {
|
|
||||||
id: null,
|
|
||||||
enable: true,
|
|
||||||
ptz: true,
|
|
||||||
rtcp: false,
|
|
||||||
asMessageChannel: false,
|
|
||||||
autoPushChannel: false,
|
|
||||||
name: null,
|
|
||||||
serverGBId: null,
|
|
||||||
administrativeDivision: null,
|
|
||||||
serverGBDomain: null,
|
|
||||||
serverIP: null,
|
|
||||||
serverPort: null,
|
|
||||||
deviceGBId: null,
|
|
||||||
deviceIp: null,
|
|
||||||
devicePort: null,
|
|
||||||
username: null,
|
|
||||||
password: null,
|
|
||||||
expires: 3600,
|
|
||||||
keepTimeout: 60,
|
|
||||||
transport: "UDP",
|
|
||||||
characterSet: "GB2312",
|
|
||||||
startOfflinePush: false,
|
|
||||||
catalogGroup: 1,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
deviceGBIdExit: async function (deviceGbId) {
|
|
||||||
var result = false;
|
|
||||||
var that = this;
|
|
||||||
await that.$axios({
|
|
||||||
method: 'get',
|
|
||||||
url: `/api/platform/exit/${deviceGbId}`
|
|
||||||
})
|
|
||||||
.then(function (res) {
|
|
||||||
if (res.data.code === 0) {
|
|
||||||
result = res.data.data;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(function (error) {
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
return result;
|
|
||||||
},
|
|
||||||
checkExpires: function () {
|
|
||||||
if (this.platform.enable && this.platform.expires === "0") {
|
|
||||||
this.platform.expires = "3600";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
rtcpCheckBoxChange: function (result) {
|
|
||||||
if (result) {
|
|
||||||
this.$message({
|
|
||||||
showClose: true,
|
|
||||||
message: "开启RTCP保活需要上级平台支持,可以避免无效推流",
|
|
||||||
type: "warning",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
/* 谷歌 */
|
|
||||||
input::-webkit-outer-spin-button,
|
|
||||||
input::-webkit-inner-spin-button {
|
|
||||||
-webkit-appearance: none;
|
|
||||||
appearance: none;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 火狐 */
|
|
||||||
input {
|
|
||||||
-moz-appearance: textfield;
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-wrapper-not-used {
|
|
||||||
position: relative;
|
|
||||||
width: 6.25rem;
|
|
||||||
height: 6.25rem;
|
|
||||||
max-width: 6.25rem;
|
|
||||||
max-height: 6.25rem;
|
|
||||||
border-radius: 100%;
|
|
||||||
margin-top: 2.5rem;
|
|
||||||
margin-left: 0.5rem;
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-panel {
|
|
||||||
position: relative;
|
|
||||||
top: 0;
|
|
||||||
left: 5rem;
|
|
||||||
height: 11rem;
|
|
||||||
max-height: 11rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-btn {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
position: absolute;
|
|
||||||
width: 44%;
|
|
||||||
height: 44%;
|
|
||||||
border-radius: 5px;
|
|
||||||
border: 1px solid #78aee4;
|
|
||||||
box-sizing: border-box;
|
|
||||||
transition: all 0.3s linear;
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-btn i {
|
|
||||||
font-size: 20px;
|
|
||||||
color: #78aee4;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-round {
|
|
||||||
position: absolute;
|
|
||||||
top: 21%;
|
|
||||||
left: 21%;
|
|
||||||
width: 58%;
|
|
||||||
height: 58%;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-round-inner {
|
|
||||||
position: absolute;
|
|
||||||
left: 13%;
|
|
||||||
top: 13%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
width: 70%;
|
|
||||||
height: 70%;
|
|
||||||
font-size: 40px;
|
|
||||||
color: #78aee4;
|
|
||||||
border: 1px solid #78aee4;
|
|
||||||
border-radius: 100%;
|
|
||||||
transition: all 0.3s linear;
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-inner-btn {
|
|
||||||
position: absolute;
|
|
||||||
width: 60%;
|
|
||||||
height: 60%;
|
|
||||||
background: #fafafa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-top {
|
|
||||||
top: -8%;
|
|
||||||
left: 27%;
|
|
||||||
transform: rotate(-45deg);
|
|
||||||
border-radius: 5px 100% 5px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-top i {
|
|
||||||
transform: rotate(45deg);
|
|
||||||
border-radius: 5px 100% 5px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-top .control-inner {
|
|
||||||
left: -1px;
|
|
||||||
bottom: 0;
|
|
||||||
border-top: 1px solid #78aee4;
|
|
||||||
border-right: 1px solid #78aee4;
|
|
||||||
border-radius: 0 100% 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-top .fa {
|
|
||||||
transform: rotate(45deg) translateY(-7px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-left {
|
|
||||||
top: 27%;
|
|
||||||
left: -8%;
|
|
||||||
transform: rotate(45deg);
|
|
||||||
border-radius: 5px 0 5px 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-left i {
|
|
||||||
transform: rotate(-45deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-left .control-inner {
|
|
||||||
right: -1px;
|
|
||||||
top: -1px;
|
|
||||||
border-bottom: 1px solid #78aee4;
|
|
||||||
border-left: 1px solid #78aee4;
|
|
||||||
border-radius: 0 0 0 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-left .fa {
|
|
||||||
transform: rotate(-45deg) translateX(-7px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-right {
|
|
||||||
top: 27%;
|
|
||||||
right: -8%;
|
|
||||||
transform: rotate(45deg);
|
|
||||||
border-radius: 5px 100% 5px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-right i {
|
|
||||||
transform: rotate(-45deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-right .control-inner {
|
|
||||||
left: -1px;
|
|
||||||
bottom: -1px;
|
|
||||||
border-top: 1px solid #78aee4;
|
|
||||||
border-right: 1px solid #78aee4;
|
|
||||||
border-radius: 0 100% 0 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-right .fa {
|
|
||||||
transform: rotate(-45deg) translateX(7px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-bottom {
|
|
||||||
left: 27%;
|
|
||||||
bottom: -8%;
|
|
||||||
transform: rotate(45deg);
|
|
||||||
border-radius: 0 5px 100% 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-bottom i {
|
|
||||||
transform: rotate(-45deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-bottom .control-inner {
|
|
||||||
top: -1px;
|
|
||||||
left: -1px;
|
|
||||||
border-bottom: 1px solid #78aee4;
|
|
||||||
border-right: 1px solid #78aee4;
|
|
||||||
border-radius: 0 0 100% 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.control-bottom .fa {
|
|
||||||
transform: rotate(-45deg) translateY(7px);
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -37,7 +37,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-table size=mini ref="channelListTable" :data="channelList" :height="winHeight" style="width: 100%"
|
<el-table size="medium" ref="channelListTable" :data="channelList" :height="winHeight" style="width: 100%"
|
||||||
header-row-class-name="table-header" @selection-change="handleSelectionChange" @row-dblclick="rowDblclick">
|
header-row-class-name="table-header" @selection-change="handleSelectionChange" @row-dblclick="rowDblclick">
|
||||||
<el-table-column type="selection" width="55" :selectable="selectable">
|
<el-table-column type="selection" width="55" :selectable="selectable">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
style="float: right"
|
style="text-align: right"
|
||||||
@size-change="handleSizeChange"
|
@size-change="handleSizeChange"
|
||||||
@current-change="currentChange"
|
@current-change="currentChange"
|
||||||
:current-page="currentPage"
|
:current-page="currentPage"
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-table size=mini ref="channelListTable" :data="channelList" :height="winHeight" style="width: 100%"
|
<el-table size="medium" ref="channelListTable" :data="channelList" :height="winHeight" style="width: 100%"
|
||||||
header-row-class-name="table-header" @selection-change="handleSelectionChange" @row-dblclick="rowDblclick">
|
header-row-class-name="table-header" @selection-change="handleSelectionChange" @row-dblclick="rowDblclick">
|
||||||
<el-table-column type="selection" width="55" :selectable="selectable">
|
<el-table-column type="selection" width="55" :selectable="selectable">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
style="float: right"
|
style="text-align: right"
|
||||||
@size-change="handleSizeChange"
|
@size-change="handleSizeChange"
|
||||||
@current-change="currentChange"
|
@current-change="currentChange"
|
||||||
:current-page="currentPage"
|
:current-page="currentPage"
|
||||||
|
|
|
@ -259,20 +259,25 @@ create table wvp_platform
|
||||||
expires character varying(50),
|
expires character varying(50),
|
||||||
keep_timeout character varying(50),
|
keep_timeout character varying(50),
|
||||||
transport character varying(50),
|
transport character varying(50),
|
||||||
|
civil_code character varying(50),
|
||||||
|
manufacturer character varying(255),
|
||||||
|
model character varying(255),
|
||||||
|
address character varying(255),
|
||||||
character_set character varying(50),
|
character_set character varying(50),
|
||||||
ptz bool default false,
|
ptz bool default false,
|
||||||
rtcp bool default false,
|
rtcp bool default false,
|
||||||
status bool default false,
|
status bool default false,
|
||||||
catalog_group integer,
|
catalog_group integer,
|
||||||
|
register_way integer,
|
||||||
|
secrecy integer,
|
||||||
create_time character varying(50),
|
create_time character varying(50),
|
||||||
update_time character varying(50),
|
update_time character varying(50),
|
||||||
as_message_channel bool default false,
|
as_message_channel bool default false,
|
||||||
custom_group bool default false,
|
|
||||||
catalog_with_platform bool default true,
|
catalog_with_platform bool default true,
|
||||||
catalog_with_group bool default true,
|
catalog_with_group bool default true,
|
||||||
catalog_with_region bool default true,
|
catalog_with_region bool default true,
|
||||||
|
auto_push_channel bool default true,
|
||||||
send_stream_ip character varying(50),
|
send_stream_ip character varying(50),
|
||||||
device_civil_code character varying(50),
|
|
||||||
constraint uk_platform_unique_server_gb_id unique (server_gb_id)
|
constraint uk_platform_unique_server_gb_id unique (server_gb_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -284,9 +289,38 @@ create table wvp_platform_gb_channel
|
||||||
device_channel_id integer,
|
device_channel_id integer,
|
||||||
device_id character varying(50),
|
device_id character varying(50),
|
||||||
name character varying(255),
|
name character varying(255),
|
||||||
civil_code character varying(50),
|
manufacturer character varying(50),
|
||||||
parent_id character varying(50),
|
model character varying(50),
|
||||||
business_group_id character varying(50),
|
owner character varying(50),
|
||||||
|
civil_code character varying(50),
|
||||||
|
block character varying(50),
|
||||||
|
address character varying(50),
|
||||||
|
parental integer,
|
||||||
|
parent_id character varying(50),
|
||||||
|
safety_way integer,
|
||||||
|
register_way integer,
|
||||||
|
cert_num character varying(50),
|
||||||
|
certifiable integer,
|
||||||
|
err_code integer,
|
||||||
|
end_time character varying(50),
|
||||||
|
secrecy integer,
|
||||||
|
ip_address character varying(50),
|
||||||
|
port integer,
|
||||||
|
password character varying(255),
|
||||||
|
status character varying(50),
|
||||||
|
longitude double precision,
|
||||||
|
latitude double precision,
|
||||||
|
ptz_type integer,
|
||||||
|
position_type integer,
|
||||||
|
room_type integer,
|
||||||
|
use_type integer,
|
||||||
|
supply_light_type integer,
|
||||||
|
direction_type integer,
|
||||||
|
resolution character varying(255),
|
||||||
|
business_group_id character varying(255),
|
||||||
|
download_speed character varying(255),
|
||||||
|
svc_space_support_mod integer,
|
||||||
|
svc_time_support_mode integer,
|
||||||
constraint uk_platform_gb_channel_platform_id_catalog_id_device_channel_id unique (platform_id, device_channel_id),
|
constraint uk_platform_gb_channel_platform_id_catalog_id_device_channel_id unique (platform_id, device_channel_id),
|
||||||
constraint uk_platform_gb_channel_device_id unique (device_id)
|
constraint uk_platform_gb_channel_device_id unique (device_id)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue