mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-24 14:07:50 +08:00
Merge remote-tracking branch 'origin/wvp-28181-2.0' into liujie-20220712
# Conflicts: # src/main/java/com/genersoft/iot/vmp/service/IMediaService.java # src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java
This commit is contained in:
commit
66e6756909
493
sql/mysql.sql
493
sql/mysql.sql
@ -1,6 +1,6 @@
|
|||||||
-- MySQL dump 10.13 Distrib 8.0.29, for Linux (x86_64)
|
-- MySQL dump 10.13 Distrib 8.0.29, for Linux (x86_64)
|
||||||
--
|
--
|
||||||
-- Host: 127.0.0.1 Database: wvp3
|
-- Host: 127.0.0.1 Database: wvp2
|
||||||
-- ------------------------------------------------------
|
-- ------------------------------------------------------
|
||||||
-- Server version 8.0.29-0ubuntu0.22.04.2
|
-- Server version 8.0.29-0ubuntu0.22.04.2
|
||||||
|
|
||||||
@ -23,34 +23,34 @@ DROP TABLE IF EXISTS `device`;
|
|||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!50503 SET character_set_client = utf8mb4 */;
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `device` (
|
CREATE TABLE `device` (
|
||||||
`id` int NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`manufacturer` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`manufacturer` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`model` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`model` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`firmware` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`firmware` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`transport` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`transport` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`streamMode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`streamMode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`online` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`online` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`registerTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`registerTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`keepaliveTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`keepaliveTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`port` int NOT NULL,
|
`port` int NOT NULL,
|
||||||
`expires` int NOT NULL,
|
`expires` int NOT NULL,
|
||||||
`subscribeCycleForCatalog` int NOT NULL,
|
`subscribeCycleForCatalog` int NOT NULL,
|
||||||
`hostAddress` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`hostAddress` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`charset` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`charset` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`subscribeCycleForMobilePosition` int DEFAULT NULL,
|
`subscribeCycleForMobilePosition` int DEFAULT NULL,
|
||||||
`mobilePositionSubmissionInterval` int DEFAULT '5',
|
`mobilePositionSubmissionInterval` int DEFAULT '5',
|
||||||
`subscribeCycleForAlarm` int DEFAULT NULL,
|
`subscribeCycleForAlarm` int DEFAULT NULL,
|
||||||
`ssrcCheck` int DEFAULT '0',
|
`ssrcCheck` int DEFAULT '0',
|
||||||
`geoCoordSys` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`geoCoordSys` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`treeType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`treeType` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
PRIMARY KEY (`id`) USING BTREE,
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
UNIQUE KEY `device_deviceId_uindex` (`deviceId`) USING BTREE
|
UNIQUE KEY `device_deviceId_uindex` (`deviceId`) USING BTREE
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
--
|
--
|
||||||
@ -70,17 +70,18 @@ DROP TABLE IF EXISTS `device_alarm`;
|
|||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!50503 SET character_set_client = utf8mb4 */;
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `device_alarm` (
|
CREATE TABLE `device_alarm` (
|
||||||
`id` int NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`alarmPriority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`alarmPriority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`alarmMethod` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`alarmMethod` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`alarmTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`alarmTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`alarmDescription` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`alarmDescription` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`longitude` double DEFAULT NULL,
|
`longitude` double DEFAULT NULL,
|
||||||
`latitude` double DEFAULT NULL,
|
`latitude` double DEFAULT NULL,
|
||||||
`alarmType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`alarmType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
`createTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
@ -101,46 +102,47 @@ DROP TABLE IF EXISTS `device_channel`;
|
|||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!50503 SET character_set_client = utf8mb4 */;
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `device_channel` (
|
CREATE TABLE `device_channel` (
|
||||||
`id` int NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`manufacture` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`manufacture` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`model` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`model` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`owner` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`owner` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`civilCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`civilCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`block` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`block` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`parentId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`parentId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`safetyWay` int DEFAULT NULL,
|
`safetyWay` int DEFAULT NULL,
|
||||||
`registerWay` int DEFAULT NULL,
|
`registerWay` int DEFAULT NULL,
|
||||||
`certNum` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`certNum` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`certifiable` int DEFAULT NULL,
|
`certifiable` int DEFAULT NULL,
|
||||||
`errCode` int DEFAULT NULL,
|
`errCode` int DEFAULT NULL,
|
||||||
`endTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`endTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`secrecy` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`secrecy` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`ipAddress` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`ipAddress` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`port` int DEFAULT NULL,
|
`port` int DEFAULT NULL,
|
||||||
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`PTZType` int DEFAULT NULL,
|
`PTZType` int DEFAULT NULL,
|
||||||
`status` int DEFAULT NULL,
|
`status` int DEFAULT NULL,
|
||||||
`longitude` double DEFAULT NULL,
|
`longitude` double DEFAULT NULL,
|
||||||
`latitude` double DEFAULT NULL,
|
`latitude` double DEFAULT NULL,
|
||||||
`streamId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`streamId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`parental` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`parental` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`hasAudio` bit(1) DEFAULT NULL,
|
`hasAudio` bit(1) DEFAULT NULL,
|
||||||
`createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`subCount` int DEFAULT '0',
|
`subCount` int DEFAULT '0',
|
||||||
`longitudeGcj02` double DEFAULT NULL,
|
`longitudeGcj02` double DEFAULT NULL,
|
||||||
`latitudeGcj02` double DEFAULT NULL,
|
`latitudeGcj02` double DEFAULT NULL,
|
||||||
`longitudeWgs84` double DEFAULT NULL,
|
`longitudeWgs84` double DEFAULT NULL,
|
||||||
`latitudeWgs84` double DEFAULT NULL,
|
`latitudeWgs84` double DEFAULT NULL,
|
||||||
`businessGroupId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`businessGroupId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`) USING BTREE,
|
`gpsTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
UNIQUE KEY `device_channel_id_uindex` (`id`) USING BTREE,
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
UNIQUE KEY `device_channel_pk` (`channelId`,`deviceId`) USING BTREE
|
UNIQUE KEY `device_channel_id_uindex` (`id`) USING BTREE,
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=19314 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
UNIQUE KEY `device_channel_pk` (`channelId`,`deviceId`) USING BTREE
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=19331 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
--
|
--
|
||||||
@ -160,22 +162,24 @@ DROP TABLE IF EXISTS `device_mobile_position`;
|
|||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!50503 SET character_set_client = utf8mb4 */;
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `device_mobile_position` (
|
CREATE TABLE `device_mobile_position` (
|
||||||
`id` int NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`channelId` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`deviceName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`deviceName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`time` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`time` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`longitude` double NOT NULL,
|
`longitude` double NOT NULL,
|
||||||
`latitude` double NOT NULL,
|
`latitude` double NOT NULL,
|
||||||
`altitude` double DEFAULT NULL,
|
`altitude` double DEFAULT NULL,
|
||||||
`speed` double DEFAULT NULL,
|
`speed` double DEFAULT NULL,
|
||||||
`direction` double DEFAULT NULL,
|
`direction` double DEFAULT NULL,
|
||||||
`reportSource` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`reportSource` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`geodeticSystem` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`longitudeGcj02` double DEFAULT NULL,
|
||||||
`cnLng` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`latitudeGcj02` double DEFAULT NULL,
|
||||||
`cnLat` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`longitudeWgs84` double DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
`latitudeWgs84` double DEFAULT NULL,
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
`createTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=6751 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
--
|
--
|
||||||
@ -195,21 +199,21 @@ DROP TABLE IF EXISTS `gb_stream`;
|
|||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!50503 SET character_set_client = utf8mb4 */;
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `gb_stream` (
|
CREATE TABLE `gb_stream` (
|
||||||
`gbStreamId` int NOT NULL AUTO_INCREMENT,
|
`gbStreamId` int NOT NULL AUTO_INCREMENT,
|
||||||
`app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`gbId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`gbId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`longitude` double DEFAULT NULL,
|
`longitude` double DEFAULT NULL,
|
||||||
`latitude` double DEFAULT NULL,
|
`latitude` double DEFAULT NULL,
|
||||||
`streamType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`streamType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`status` int DEFAULT NULL,
|
`createTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`createStamp` bigint DEFAULT NULL,
|
`gpsTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
PRIMARY KEY (`gbStreamId`) USING BTREE,
|
PRIMARY KEY (`gbStreamId`) USING BTREE,
|
||||||
UNIQUE KEY `app` (`app`,`stream`) USING BTREE,
|
UNIQUE KEY `app` (`app`,`stream`) USING BTREE,
|
||||||
UNIQUE KEY `gbId` (`gbId`) USING BTREE
|
UNIQUE KEY `gbId` (`gbId`) USING BTREE
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=301679 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
) ENGINE=InnoDB AUTO_INCREMENT=301681 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
--
|
--
|
||||||
@ -229,17 +233,17 @@ DROP TABLE IF EXISTS `log`;
|
|||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!50503 SET character_set_client = utf8mb4 */;
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `log` (
|
CREATE TABLE `log` (
|
||||||
`id` int NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`uri` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`uri` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`result` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`result` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`timing` bigint NOT NULL,
|
`timing` bigint NOT NULL,
|
||||||
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=21611 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
) ENGINE=InnoDB AUTO_INCREMENT=34997 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
--
|
--
|
||||||
@ -259,31 +263,31 @@ DROP TABLE IF EXISTS `media_server`;
|
|||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!50503 SET character_set_client = utf8mb4 */;
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `media_server` (
|
CREATE TABLE `media_server` (
|
||||||
`id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`hookIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`hookIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`sdpIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`sdpIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`streamIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`streamIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`httpPort` int NOT NULL,
|
`httpPort` int NOT NULL,
|
||||||
`httpSSlPort` int NOT NULL,
|
`httpSSlPort` int NOT NULL,
|
||||||
`rtmpPort` int NOT NULL,
|
`rtmpPort` int NOT NULL,
|
||||||
`rtmpSSlPort` int NOT NULL,
|
`rtmpSSlPort` int NOT NULL,
|
||||||
`rtpProxyPort` int NOT NULL,
|
`rtpProxyPort` int NOT NULL,
|
||||||
`rtspPort` int NOT NULL,
|
`rtspPort` int NOT NULL,
|
||||||
`rtspSSLPort` int NOT NULL,
|
`rtspSSLPort` int NOT NULL,
|
||||||
`autoConfig` int NOT NULL,
|
`autoConfig` int NOT NULL,
|
||||||
`secret` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`secret` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`streamNoneReaderDelayMS` int NOT NULL,
|
`streamNoneReaderDelayMS` int NOT NULL,
|
||||||
`rtpEnable` int NOT NULL,
|
`rtpEnable` int NOT NULL,
|
||||||
`rtpPortRange` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`rtpPortRange` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`sendRtpPortRange` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`sendRtpPortRange` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`recordAssistPort` int NOT NULL,
|
`recordAssistPort` int NOT NULL,
|
||||||
`defaultServer` int NOT NULL,
|
`defaultServer` int NOT NULL,
|
||||||
`createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`hookAliveInterval` int NOT NULL,
|
`hookAliveInterval` int NOT NULL,
|
||||||
PRIMARY KEY (`id`) USING BTREE,
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
UNIQUE KEY `media_server_i` (`ip`,`httpPort`) USING BTREE
|
UNIQUE KEY `media_server_i` (`ip`,`httpPort`) USING BTREE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
@ -304,34 +308,36 @@ DROP TABLE IF EXISTS `parent_platform`;
|
|||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!50503 SET character_set_client = utf8mb4 */;
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `parent_platform` (
|
CREATE TABLE `parent_platform` (
|
||||||
`id` int NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`enable` int DEFAULT NULL,
|
`enable` int DEFAULT NULL,
|
||||||
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`serverGBId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`serverGBId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`serverGBDomain` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`serverGBDomain` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`serverIP` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`serverIP` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`serverPort` int DEFAULT NULL,
|
`serverPort` int DEFAULT NULL,
|
||||||
`deviceGBId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`deviceGBId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`deviceIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`deviceIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`devicePort` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`devicePort` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`expires` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`expires` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`keepTimeout` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`keepTimeout` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`transport` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`transport` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`characterSet` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`characterSet` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`ptz` int DEFAULT NULL,
|
`ptz` int DEFAULT NULL,
|
||||||
`rtcp` int DEFAULT NULL,
|
`rtcp` int DEFAULT NULL,
|
||||||
`status` bit(1) DEFAULT NULL,
|
`status` bit(1) DEFAULT NULL,
|
||||||
`shareAllLiveStream` int DEFAULT NULL,
|
`shareAllLiveStream` int DEFAULT NULL,
|
||||||
`startOfflinePush` int DEFAULT '0',
|
`startOfflinePush` int DEFAULT '0',
|
||||||
`administrativeDivision` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`administrativeDivision` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`catalogGroup` int DEFAULT '1',
|
`catalogGroup` int DEFAULT '1',
|
||||||
PRIMARY KEY (`id`) USING BTREE,
|
`createTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
UNIQUE KEY `parent_platform_id_uindex` (`id`) USING BTREE,
|
`updateTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
UNIQUE KEY `parent_platform_pk` (`serverGBId`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
UNIQUE KEY `parent_platform_id_uindex` (`id`) USING BTREE,
|
||||||
|
UNIQUE KEY `parent_platform_pk` (`serverGBId`) USING BTREE
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
--
|
--
|
||||||
@ -351,11 +357,11 @@ DROP TABLE IF EXISTS `platform_catalog`;
|
|||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!50503 SET character_set_client = utf8mb4 */;
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `platform_catalog` (
|
CREATE TABLE `platform_catalog` (
|
||||||
`id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`parentId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`parentId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
@ -376,11 +382,11 @@ DROP TABLE IF EXISTS `platform_gb_channel`;
|
|||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!50503 SET character_set_client = utf8mb4 */;
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `platform_gb_channel` (
|
CREATE TABLE `platform_gb_channel` (
|
||||||
`id` int NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`deviceChannelId` int NOT NULL,
|
`deviceChannelId` int NOT NULL,
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=4889 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
) ENGINE=InnoDB AUTO_INCREMENT=4889 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
@ -401,12 +407,12 @@ DROP TABLE IF EXISTS `platform_gb_stream`;
|
|||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!50503 SET character_set_client = utf8mb4 */;
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `platform_gb_stream` (
|
CREATE TABLE `platform_gb_stream` (
|
||||||
`platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`gbStreamId` int NOT NULL,
|
`gbStreamId` int NOT NULL,
|
||||||
`id` int NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
PRIMARY KEY (`id`) USING BTREE,
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
UNIQUE KEY `platform_gb_stream_pk` (`platformId`,`catalogId`,`gbStreamId`) USING BTREE
|
UNIQUE KEY `platform_gb_stream_pk` (`platformId`,`catalogId`,`gbStreamId`) USING BTREE
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=302077 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
) ENGINE=InnoDB AUTO_INCREMENT=302077 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
@ -427,27 +433,28 @@ DROP TABLE IF EXISTS `stream_proxy`;
|
|||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!50503 SET character_set_client = utf8mb4 */;
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `stream_proxy` (
|
CREATE TABLE `stream_proxy` (
|
||||||
`id` int NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`src_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`src_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`dst_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`dst_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`timeout_ms` int DEFAULT NULL,
|
`timeout_ms` int DEFAULT NULL,
|
||||||
`ffmpeg_cmd_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`ffmpeg_cmd_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`rtp_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`rtp_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`enable_hls` bit(1) DEFAULT NULL,
|
`enable_hls` bit(1) DEFAULT NULL,
|
||||||
`enable_mp4` bit(1) DEFAULT NULL,
|
`enable_mp4` bit(1) DEFAULT NULL,
|
||||||
`enable` bit(1) NOT NULL,
|
`enable` bit(1) NOT NULL,
|
||||||
`status` bit(1) NOT NULL,
|
`status` bit(1) NOT NULL,
|
||||||
`enable_remove_none_reader` bit(1) NOT NULL,
|
`enable_remove_none_reader` bit(1) NOT NULL,
|
||||||
`createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`) USING BTREE,
|
`updateTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
UNIQUE KEY `stream_proxy_pk` (`app`,`stream`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=61 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
UNIQUE KEY `stream_proxy_pk` (`app`,`stream`) USING BTREE
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
--
|
--
|
||||||
@ -467,19 +474,22 @@ DROP TABLE IF EXISTS `stream_push`;
|
|||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!50503 SET character_set_client = utf8mb4 */;
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `stream_push` (
|
CREATE TABLE `stream_push` (
|
||||||
`id` int NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`totalReaderCount` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`totalReaderCount` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`originType` int DEFAULT NULL,
|
`originType` int DEFAULT NULL,
|
||||||
`originTypeStr` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`originTypeStr` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`createStamp` bigint DEFAULT NULL,
|
`createTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`aliveSecond` int DEFAULT NULL,
|
`aliveSecond` int DEFAULT NULL,
|
||||||
`mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`serverId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`serverId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
PRIMARY KEY (`id`) USING BTREE,
|
`pushTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
UNIQUE KEY `stream_push_pk` (`app`,`stream`) USING BTREE
|
`updateTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=305291 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
`status` int DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
|
UNIQUE KEY `stream_push_pk` (`app`,`stream`) USING BTREE
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=305315 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
--
|
--
|
||||||
@ -499,14 +509,15 @@ DROP TABLE IF EXISTS `user`;
|
|||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!50503 SET character_set_client = utf8mb4 */;
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `user` (
|
CREATE TABLE `user` (
|
||||||
`id` int NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`roleId` int NOT NULL,
|
`roleId` int NOT NULL,
|
||||||
`createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
PRIMARY KEY (`id`) USING BTREE,
|
`pushKey` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
UNIQUE KEY `user_username_uindex` (`username`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
|
UNIQUE KEY `user_username_uindex` (`username`) USING BTREE
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
@ -516,7 +527,7 @@ CREATE TABLE `user` (
|
|||||||
|
|
||||||
LOCK TABLES `user` WRITE;
|
LOCK TABLES `user` WRITE;
|
||||||
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
|
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
|
||||||
INSERT INTO `user` VALUES (1,'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021 - 04 - 13 14:14:57','2021 - 04 - 13 14:14:57');
|
INSERT INTO `user` VALUES (1,'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021 - 04 - 13 14:14:57','2021 - 04 - 13 14:14:57','453df297a57a5a7438934sda801fc3');
|
||||||
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
@ -528,12 +539,12 @@ DROP TABLE IF EXISTS `user_role`;
|
|||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
/*!50503 SET character_set_client = utf8mb4 */;
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
CREATE TABLE `user_role` (
|
CREATE TABLE `user_role` (
|
||||||
`id` int NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`authority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`authority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
`updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
`updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
@ -556,4 +567,4 @@ UNLOCK TABLES;
|
|||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2022-06-26 17:33:30
|
-- Dump completed on 2022-07-11 17:32:51
|
||||||
|
|||||||
@ -15,12 +15,14 @@ alter table device
|
|||||||
|
|
||||||
alter table stream_push
|
alter table stream_push
|
||||||
add serverId varchar(50) not null;
|
add serverId varchar(50) not null;
|
||||||
|
|
||||||
alter table device
|
alter table device
|
||||||
add geoCoordSys varchar(50) not null;
|
add geoCoordSys varchar(50) not null;
|
||||||
alter table device
|
alter table device
|
||||||
add treeType varchar(50) not null;
|
add treeType varchar(50) not null;
|
||||||
update device set device.geoCoordSys='WGS84';
|
update device set device.geoCoordSys='WGS84';
|
||||||
update device set device.treeType='CivilCode';
|
update device set device.treeType='CivilCode';
|
||||||
|
|
||||||
alter table device_channel
|
alter table device_channel
|
||||||
add longitudeGcj02 double default null;
|
add longitudeGcj02 double default null;
|
||||||
alter table device_channel
|
alter table device_channel
|
||||||
@ -31,4 +33,49 @@ alter table device_channel
|
|||||||
add latitudeWgs84 double default null;
|
add latitudeWgs84 double default null;
|
||||||
alter table device_channel
|
alter table device_channel
|
||||||
add businessGroupId varchar(50) default null;
|
add businessGroupId varchar(50) default null;
|
||||||
|
alter table device_channel
|
||||||
|
add gpsTime varchar(50) default null;
|
||||||
|
|
||||||
|
|
||||||
|
alter table device_mobile_position
|
||||||
|
change cnLng longitudeGcj02 double default null;
|
||||||
|
alter table device_mobile_position
|
||||||
|
change cnLat latitudeGcj02 double default null;
|
||||||
|
alter table device_mobile_position
|
||||||
|
add longitudeWgs84 double default null;
|
||||||
|
alter table device_mobile_position
|
||||||
|
add latitudeWgs84 double default null;
|
||||||
|
alter table device_mobile_position
|
||||||
|
drop geodeticSystem;
|
||||||
|
alter table device_mobile_position
|
||||||
|
add createTime varchar(50) default null;
|
||||||
|
|
||||||
|
alter table device_alarm
|
||||||
|
add createTime varchar(50) default null;
|
||||||
|
|
||||||
|
alter table gb_stream
|
||||||
|
change createStamp createTime varchar(50) default null;
|
||||||
|
|
||||||
|
alter table parent_platform
|
||||||
|
add createTime varchar(50) default null;
|
||||||
|
alter table parent_platform
|
||||||
|
add updateTime varchar(50) default null;
|
||||||
|
|
||||||
|
alter table stream_proxy
|
||||||
|
add updateTime varchar(50) default null;
|
||||||
|
|
||||||
|
alter table stream_push
|
||||||
|
add pushTime varchar(50) default null;
|
||||||
|
alter table stream_push
|
||||||
|
add status int DEFAULT NULL;
|
||||||
|
alter table stream_push
|
||||||
|
add updateTime varchar(50) default null;
|
||||||
|
alter table stream_push
|
||||||
|
change createStamp createTime varchar(50) default null;
|
||||||
|
|
||||||
|
alter table gb_stream
|
||||||
|
drop column status;
|
||||||
|
|
||||||
|
alter table user
|
||||||
|
add pushKey varchar(50) default null;
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,9 @@ public class StreamInfo {
|
|||||||
private String deviceID;
|
private String deviceID;
|
||||||
private String channelId;
|
private String channelId;
|
||||||
private String flv;
|
private String flv;
|
||||||
|
|
||||||
|
private String ip;
|
||||||
|
|
||||||
private String https_flv;
|
private String https_flv;
|
||||||
private String ws_flv;
|
private String ws_flv;
|
||||||
private String wss_flv;
|
private String wss_flv;
|
||||||
@ -292,4 +295,12 @@ public class StreamInfo {
|
|||||||
public void setProgress(double progress) {
|
public void setProgress(double progress) {
|
||||||
this.progress = progress;
|
this.progress = progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getIp() {
|
||||||
|
return ip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIp(String ip) {
|
||||||
|
this.ip = ip;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,6 +58,8 @@ public class VideoManagerConstants {
|
|||||||
|
|
||||||
public static final String MEDIA_TRANSACTION_USED_PREFIX = "VMP_MEDIA_TRANSACTION_";
|
public static final String MEDIA_TRANSACTION_USED_PREFIX = "VMP_MEDIA_TRANSACTION_";
|
||||||
|
|
||||||
|
public static final String MEDIA_STREAM_AUTHORITY = "MEDIA_STREAM_AUTHORITY_";
|
||||||
|
|
||||||
public static final String SIP_CSEQ_PREFIX = "VMP_SIP_CSEQ_";
|
public static final String SIP_CSEQ_PREFIX = "VMP_SIP_CSEQ_";
|
||||||
|
|
||||||
public static final String SIP_SN_PREFIX = "VMP_SIP_SN_";
|
public static final String SIP_SN_PREFIX = "VMP_SIP_SN_";
|
||||||
@ -71,6 +73,8 @@ public class VideoManagerConstants {
|
|||||||
public static final String SYSTEM_INFO_NET_PREFIX = "VMP_SYSTEM_INFO_NET_";
|
public static final String SYSTEM_INFO_NET_PREFIX = "VMP_SYSTEM_INFO_NET_";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//************************** redis 消息*********************************
|
//************************** redis 消息*********************************
|
||||||
|
|
||||||
// 流变化的通知
|
// 流变化的通知
|
||||||
@ -79,9 +83,15 @@ public class VideoManagerConstants {
|
|||||||
// 接收推流设备的GPS变化通知
|
// 接收推流设备的GPS变化通知
|
||||||
public static final String VM_MSG_GPS = "VM_MSG_GPS";
|
public static final String VM_MSG_GPS = "VM_MSG_GPS";
|
||||||
|
|
||||||
|
// 接收推流设备的GPS变化通知
|
||||||
|
public static final String VM_MSG_PUSH_STREAM_STATUS_CHANGE = "VM_MSG_PUSH_STREAM_STATUS_CHANGE";
|
||||||
|
|
||||||
// redis 消息通知设备推流到平台
|
// redis 消息通知设备推流到平台
|
||||||
public static final String VM_MSG_STREAM_PUSH_REQUESTED = "VM_MSG_STREAM_PUSH_REQUESTED";
|
public static final String VM_MSG_STREAM_PUSH_REQUESTED = "VM_MSG_STREAM_PUSH_REQUESTED";
|
||||||
|
|
||||||
|
// redis 消息请求所有的在线通道
|
||||||
|
public static final String VM_MSG_GET_ALL_ONLINE_REQUESTED = "VM_MSG_GET_ALL_ONLINE_REQUESTED";
|
||||||
|
|
||||||
// 移动位置订阅通知
|
// 移动位置订阅通知
|
||||||
public static final String VM_MSG_SUBSCRIBE_MOBILE_POSITION = "mobileposition";
|
public static final String VM_MSG_SUBSCRIBE_MOBILE_POSITION = "mobileposition";
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@ -103,12 +104,9 @@ public class DynamicTask {
|
|||||||
|
|
||||||
public void stop(String key) {
|
public void stop(String key) {
|
||||||
if (futureMap.get(key) != null && !futureMap.get(key).isCancelled()) {
|
if (futureMap.get(key) != null && !futureMap.get(key).isCancelled()) {
|
||||||
// Runnable runnable = runnableMap.get(key);
|
|
||||||
// if (runnable instanceof ISubscribeTask) {
|
|
||||||
// ISubscribeTask subscribeTask = (ISubscribeTask) runnable;
|
|
||||||
// subscribeTask.stop();
|
|
||||||
// }
|
|
||||||
futureMap.get(key).cancel(false);
|
futureMap.get(key).cancel(false);
|
||||||
|
futureMap.remove(key);
|
||||||
|
runnableMap.remove(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,4 +121,19 @@ public class DynamicTask {
|
|||||||
public Runnable get(String key) {
|
public Runnable get(String key) {
|
||||||
return runnableMap.get(key);
|
return runnableMap.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每五分钟检查失效的任务,并移除
|
||||||
|
*/
|
||||||
|
@Scheduled(cron="0 0/5 * * * ?")
|
||||||
|
public void execute(){
|
||||||
|
if (futureMap.size() > 0) {
|
||||||
|
for (String key : futureMap.keySet()) {
|
||||||
|
if (futureMap.get(key).isDone()) {
|
||||||
|
futureMap.remove(key);
|
||||||
|
runnableMap.remove(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,6 +77,8 @@ public class DeviceAlarm {
|
|||||||
*/
|
*/
|
||||||
private String alarmType;
|
private String alarmType;
|
||||||
|
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
@ -157,4 +159,12 @@ public class DeviceAlarm {
|
|||||||
public void setChannelId(String channelId) {
|
public void setChannelId(String channelId) {
|
||||||
this.channelId = channelId;
|
this.channelId = channelId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateTime(String createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -199,6 +199,11 @@ public class DeviceChannel {
|
|||||||
*/
|
*/
|
||||||
private String businessGroupId;
|
private String businessGroupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GPS的更新时间
|
||||||
|
*/
|
||||||
|
private String gpsTime;
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -519,4 +524,12 @@ public class DeviceChannel {
|
|||||||
public void setBusinessGroupId(String businessGroupId) {
|
public void setBusinessGroupId(String businessGroupId) {
|
||||||
this.businessGroupId = businessGroupId;
|
this.businessGroupId = businessGroupId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getGpsTime() {
|
||||||
|
return gpsTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGpsTime(String gpsTime) {
|
||||||
|
this.gpsTime = gpsTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,10 +15,8 @@ public class GbStream extends PlatformGbStream{
|
|||||||
private double latitude;
|
private double latitude;
|
||||||
private String streamType;
|
private String streamType;
|
||||||
private boolean status;
|
private boolean status;
|
||||||
/**
|
|
||||||
* GMT unix系统时间戳,单位秒
|
public String createTime;
|
||||||
*/
|
|
||||||
public Long createStamp;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer getGbStreamId() {
|
public Integer getGbStreamId() {
|
||||||
@ -102,12 +100,11 @@ public class GbStream extends PlatformGbStream{
|
|||||||
this.mediaServerId = mediaServerId;
|
this.mediaServerId = mediaServerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCreateTime() {
|
||||||
public Long getCreateStamp() {
|
return createTime;
|
||||||
return createStamp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreateStamp(Long createStamp) {
|
public void setCreateTime(String createTime) {
|
||||||
this.createStamp = createStamp;
|
this.createTime = createTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,20 +57,30 @@ public class MobilePosition {
|
|||||||
*/
|
*/
|
||||||
private String reportSource;
|
private String reportSource;
|
||||||
|
|
||||||
/**
|
|
||||||
* 国内地理坐标系(GCJ-02 / BD-09)
|
|
||||||
*/
|
|
||||||
private String GeodeticSystem;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国内坐标系:经度坐标
|
* 国内坐标系:经度坐标
|
||||||
*/
|
*/
|
||||||
private String cnLng;
|
private double longitudeGcj02;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国内坐标系:纬度坐标
|
* 国内坐标系:纬度坐标
|
||||||
*/
|
*/
|
||||||
private String cnLat;
|
private double latitudeGcj02;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国内坐标系:经度坐标
|
||||||
|
*/
|
||||||
|
private double longitudeWgs84;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国内坐标系:纬度坐标
|
||||||
|
*/
|
||||||
|
private double latitudeWgs84;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
|
||||||
public String getDeviceId() {
|
public String getDeviceId() {
|
||||||
@ -145,30 +155,6 @@ public class MobilePosition {
|
|||||||
this.reportSource = reportSource;
|
this.reportSource = reportSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getGeodeticSystem() {
|
|
||||||
return GeodeticSystem;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGeodeticSystem(String geodeticSystem) {
|
|
||||||
GeodeticSystem = geodeticSystem;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCnLng() {
|
|
||||||
return cnLng;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCnLng(String cnLng) {
|
|
||||||
this.cnLng = cnLng;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCnLat() {
|
|
||||||
return cnLat;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCnLat(String cnLat) {
|
|
||||||
this.cnLat = cnLat;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getChannelId() {
|
public String getChannelId() {
|
||||||
return channelId;
|
return channelId;
|
||||||
}
|
}
|
||||||
@ -176,4 +162,44 @@ public class MobilePosition {
|
|||||||
public void setChannelId(String channelId) {
|
public void setChannelId(String channelId) {
|
||||||
this.channelId = channelId;
|
this.channelId = channelId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double getLongitudeGcj02() {
|
||||||
|
return longitudeGcj02;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLongitudeGcj02(double longitudeGcj02) {
|
||||||
|
this.longitudeGcj02 = longitudeGcj02;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getLatitudeGcj02() {
|
||||||
|
return latitudeGcj02;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLatitudeGcj02(double latitudeGcj02) {
|
||||||
|
this.latitudeGcj02 = latitudeGcj02;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getLongitudeWgs84() {
|
||||||
|
return longitudeWgs84;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLongitudeWgs84(double longitudeWgs84) {
|
||||||
|
this.longitudeWgs84 = longitudeWgs84;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getLatitudeWgs84() {
|
||||||
|
return latitudeWgs84;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLatitudeWgs84(double latitudeWgs84) {
|
||||||
|
this.latitudeWgs84 = latitudeWgs84;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateTime(String createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -144,6 +144,16 @@ public class ParentPlatform {
|
|||||||
*/
|
*/
|
||||||
private String administrativeDivision;
|
private String administrativeDivision;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private String updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
public Integer getId() {
|
public Integer getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -368,4 +378,20 @@ public class ParentPlatform {
|
|||||||
public void setAdministrativeDivision(String administrativeDivision) {
|
public void setAdministrativeDivision(String administrativeDivision) {
|
||||||
this.administrativeDivision = administrativeDivision;
|
this.administrativeDivision = administrativeDivision;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdateTime(String updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateTime(String createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
package com.genersoft.iot.vmp.domain.req;
|
package com.genersoft.iot.vmp.gb28181.bean;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -140,6 +140,7 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements
|
|||||||
Element rootElement = getRootElement(evt);
|
Element rootElement = getRootElement(evt);
|
||||||
|
|
||||||
MobilePosition mobilePosition = new MobilePosition();
|
MobilePosition mobilePosition = new MobilePosition();
|
||||||
|
mobilePosition.setCreateTime(DateUtil.getNow());
|
||||||
Element deviceIdElement = rootElement.element("DeviceID");
|
Element deviceIdElement = rootElement.element("DeviceID");
|
||||||
String channelId = deviceIdElement.getTextTrim().toString();
|
String channelId = deviceIdElement.getTextTrim().toString();
|
||||||
Device device = redisCatchStorage.getDevice(deviceId);
|
Device device = redisCatchStorage.getDevice(deviceId);
|
||||||
@ -173,16 +174,40 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements
|
|||||||
mobilePosition.getLongitude(), mobilePosition.getLatitude());
|
mobilePosition.getLongitude(), mobilePosition.getLatitude());
|
||||||
mobilePosition.setReportSource("Mobile Position");
|
mobilePosition.setReportSource("Mobile Position");
|
||||||
// 默认来源坐标系为WGS-84处理
|
// 默认来源坐标系为WGS-84处理
|
||||||
Double[] gcj02Point = Coordtransform.WGS84ToGCJ02(mobilePosition.getLongitude(), mobilePosition.getLatitude());
|
if ("WGS84".equals(device.getGeoCoordSys())) {
|
||||||
logger.info("GCJ02坐标:" + gcj02Point[0] + ", " + gcj02Point[1]);
|
mobilePosition.setLongitudeWgs84(mobilePosition.getLongitude());
|
||||||
mobilePosition.setGeodeticSystem("GCJ-02");
|
mobilePosition.setLatitudeWgs84(mobilePosition.getLatitude());
|
||||||
mobilePosition.setCnLng(gcj02Point[0] + "");
|
Double[] position = Coordtransform.WGS84ToGCJ02(mobilePosition.getLongitude(), mobilePosition.getLatitude());
|
||||||
mobilePosition.setCnLat(gcj02Point[1] + "");
|
mobilePosition.setLongitudeGcj02(position[0]);
|
||||||
if (!userSetting.getSavePositionHistory()) {
|
mobilePosition.setLatitudeGcj02(position[1]);
|
||||||
storager.clearMobilePositionsByDeviceId(deviceId);
|
}else if ("GCJ02".equals(device.getGeoCoordSys())) {
|
||||||
|
mobilePosition.setLongitudeGcj02(mobilePosition.getLongitude());
|
||||||
|
mobilePosition.setLatitudeGcj02(mobilePosition.getLatitude());
|
||||||
|
Double[] position = Coordtransform.GCJ02ToWGS84(mobilePosition.getLongitude(), mobilePosition.getLatitude());
|
||||||
|
mobilePosition.setLongitudeWgs84(position[0]);
|
||||||
|
mobilePosition.setLatitudeWgs84(position[1]);
|
||||||
|
}else {
|
||||||
|
mobilePosition.setLongitudeGcj02(0.00);
|
||||||
|
mobilePosition.setLatitudeGcj02(0.00);
|
||||||
|
mobilePosition.setLongitudeWgs84(0.00);
|
||||||
|
mobilePosition.setLatitudeWgs84(0.00);
|
||||||
}
|
}
|
||||||
storager.insertMobilePosition(mobilePosition);
|
if (userSetting.getSavePositionHistory()) {
|
||||||
storager.updateChannelPotion(deviceId, channelId, mobilePosition.getLongitude(), mobilePosition.getLatitude() );
|
storager.insertMobilePosition(mobilePosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新device channel 的经纬度
|
||||||
|
DeviceChannel deviceChannel = new DeviceChannel();
|
||||||
|
deviceChannel.setDeviceId(device.getDeviceId());
|
||||||
|
deviceChannel.setChannelId(channelId);
|
||||||
|
deviceChannel.setLongitude(mobilePosition.getLongitude());
|
||||||
|
deviceChannel.setLatitude(mobilePosition.getLatitude());
|
||||||
|
deviceChannel.setLongitudeWgs84(mobilePosition.getLongitudeWgs84());
|
||||||
|
deviceChannel.setLatitudeWgs84(mobilePosition.getLatitudeWgs84());
|
||||||
|
deviceChannel.setLongitudeGcj02(mobilePosition.getLongitudeGcj02());
|
||||||
|
deviceChannel.setLatitudeGcj02(mobilePosition.getLatitudeGcj02());
|
||||||
|
deviceChannel.setGpsTime(mobilePosition.getTime());
|
||||||
|
storager.updateChannelPosition(deviceChannel);
|
||||||
// 发送redis消息。 通知位置信息的变化
|
// 发送redis消息。 通知位置信息的变化
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("time", time);
|
jsonObject.put("time", time);
|
||||||
@ -209,9 +234,12 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
FromHeader fromHeader = (FromHeader) evt.getRequest().getHeader(FromHeader.NAME);
|
||||||
|
String deviceId = SipUtils.getUserIdFromFromHeader(fromHeader);
|
||||||
|
|
||||||
Element rootElement = getRootElement(evt);
|
Element rootElement = getRootElement(evt);
|
||||||
Element deviceIdElement = rootElement.element("DeviceID");
|
Element deviceIdElement = rootElement.element("DeviceID");
|
||||||
String deviceId = deviceIdElement.getText().toString();
|
String channelId = deviceIdElement.getText().toString();
|
||||||
|
|
||||||
Device device = redisCatchStorage.getDevice(deviceId);
|
Device device = redisCatchStorage.getDevice(deviceId);
|
||||||
if (device == null) {
|
if (device == null) {
|
||||||
@ -247,21 +275,45 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements
|
|||||||
logger.info("[收到Notify-Alarm]:{}/{}", device.getDeviceId(), deviceAlarm.getChannelId());
|
logger.info("[收到Notify-Alarm]:{}/{}", device.getDeviceId(), deviceAlarm.getChannelId());
|
||||||
if ("4".equals(deviceAlarm.getAlarmMethod())) {
|
if ("4".equals(deviceAlarm.getAlarmMethod())) {
|
||||||
MobilePosition mobilePosition = new MobilePosition();
|
MobilePosition mobilePosition = new MobilePosition();
|
||||||
|
mobilePosition.setCreateTime(DateUtil.getNow());
|
||||||
mobilePosition.setDeviceId(deviceAlarm.getDeviceId());
|
mobilePosition.setDeviceId(deviceAlarm.getDeviceId());
|
||||||
mobilePosition.setTime(deviceAlarm.getAlarmTime());
|
mobilePosition.setTime(deviceAlarm.getAlarmTime());
|
||||||
mobilePosition.setLongitude(deviceAlarm.getLongitude());
|
mobilePosition.setLongitude(deviceAlarm.getLongitude());
|
||||||
mobilePosition.setLatitude(deviceAlarm.getLatitude());
|
mobilePosition.setLatitude(deviceAlarm.getLatitude());
|
||||||
mobilePosition.setReportSource("GPS Alarm");
|
mobilePosition.setReportSource("GPS Alarm");
|
||||||
// 默认来源坐标系为WGS-84处理
|
if ("WGS84".equals(device.getGeoCoordSys())) {
|
||||||
Double[] gcj02Point = Coordtransform.WGS84ToGCJ02(mobilePosition.getLongitude(), mobilePosition.getLatitude());
|
mobilePosition.setLongitudeWgs84(mobilePosition.getLongitude());
|
||||||
logger.info("GCJ02坐标:" + gcj02Point[0] + ", " + gcj02Point[1]);
|
mobilePosition.setLatitudeWgs84(mobilePosition.getLatitude());
|
||||||
mobilePosition.setGeodeticSystem("GCJ-02");
|
Double[] position = Coordtransform.WGS84ToGCJ02(mobilePosition.getLongitude(), mobilePosition.getLatitude());
|
||||||
mobilePosition.setCnLng(gcj02Point[0] + "");
|
mobilePosition.setLongitudeGcj02(position[0]);
|
||||||
mobilePosition.setCnLat(gcj02Point[1] + "");
|
mobilePosition.setLatitudeGcj02(position[1]);
|
||||||
if (!userSetting.getSavePositionHistory()) {
|
}else if ("GCJ02".equals(device.getGeoCoordSys())) {
|
||||||
storager.clearMobilePositionsByDeviceId(deviceId);
|
mobilePosition.setLongitudeGcj02(mobilePosition.getLongitude());
|
||||||
|
mobilePosition.setLatitudeGcj02(mobilePosition.getLatitude());
|
||||||
|
Double[] position = Coordtransform.GCJ02ToWGS84(mobilePosition.getLongitude(), mobilePosition.getLatitude());
|
||||||
|
mobilePosition.setLongitudeWgs84(position[0]);
|
||||||
|
mobilePosition.setLatitudeWgs84(position[1]);
|
||||||
|
}else {
|
||||||
|
mobilePosition.setLongitudeGcj02(0.00);
|
||||||
|
mobilePosition.setLatitudeGcj02(0.00);
|
||||||
|
mobilePosition.setLongitudeWgs84(0.00);
|
||||||
|
mobilePosition.setLatitudeWgs84(0.00);
|
||||||
}
|
}
|
||||||
storager.insertMobilePosition(mobilePosition);
|
if (userSetting.getSavePositionHistory()) {
|
||||||
|
storager.insertMobilePosition(mobilePosition);
|
||||||
|
}
|
||||||
|
// 更新device channel 的经纬度
|
||||||
|
DeviceChannel deviceChannel = new DeviceChannel();
|
||||||
|
deviceChannel.setDeviceId(device.getDeviceId());
|
||||||
|
deviceChannel.setChannelId(channelId);
|
||||||
|
deviceChannel.setLongitude(mobilePosition.getLongitude());
|
||||||
|
deviceChannel.setLatitude(mobilePosition.getLatitude());
|
||||||
|
deviceChannel.setLongitudeWgs84(mobilePosition.getLongitudeWgs84());
|
||||||
|
deviceChannel.setLatitudeWgs84(mobilePosition.getLatitudeWgs84());
|
||||||
|
deviceChannel.setLongitudeGcj02(mobilePosition.getLongitudeGcj02());
|
||||||
|
deviceChannel.setLatitudeGcj02(mobilePosition.getLatitudeGcj02());
|
||||||
|
deviceChannel.setGpsTime(mobilePosition.getTime());
|
||||||
|
storager.updateChannelPosition(deviceChannel);
|
||||||
}
|
}
|
||||||
// TODO: 需要实现存储报警信息、报警分类
|
// TODO: 需要实现存储报警信息、报警分类
|
||||||
|
|
||||||
|
|||||||
@ -80,8 +80,8 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme
|
|||||||
Element deviceIdElement = rootElement.element("DeviceID");
|
Element deviceIdElement = rootElement.element("DeviceID");
|
||||||
String channelId = deviceIdElement.getText().toString();
|
String channelId = deviceIdElement.getText().toString();
|
||||||
|
|
||||||
|
|
||||||
DeviceAlarm deviceAlarm = new DeviceAlarm();
|
DeviceAlarm deviceAlarm = new DeviceAlarm();
|
||||||
|
deviceAlarm.setCreateTime(DateUtil.getNow());
|
||||||
deviceAlarm.setDeviceId(device.getDeviceId());
|
deviceAlarm.setDeviceId(device.getDeviceId());
|
||||||
deviceAlarm.setChannelId(channelId);
|
deviceAlarm.setChannelId(channelId);
|
||||||
deviceAlarm.setAlarmPriority(getText(rootElement, "AlarmPriority"));
|
deviceAlarm.setAlarmPriority(getText(rootElement, "AlarmPriority"));
|
||||||
@ -113,21 +113,45 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme
|
|||||||
if (!StringUtils.isEmpty(deviceAlarm.getAlarmMethod())) {
|
if (!StringUtils.isEmpty(deviceAlarm.getAlarmMethod())) {
|
||||||
if ( deviceAlarm.getAlarmMethod().contains(DeviceAlarmMethod.GPS.getVal() + "")) {
|
if ( deviceAlarm.getAlarmMethod().contains(DeviceAlarmMethod.GPS.getVal() + "")) {
|
||||||
MobilePosition mobilePosition = new MobilePosition();
|
MobilePosition mobilePosition = new MobilePosition();
|
||||||
|
mobilePosition.setCreateTime(DateUtil.getNow());
|
||||||
mobilePosition.setDeviceId(deviceAlarm.getDeviceId());
|
mobilePosition.setDeviceId(deviceAlarm.getDeviceId());
|
||||||
mobilePosition.setTime(deviceAlarm.getAlarmTime());
|
mobilePosition.setTime(deviceAlarm.getAlarmTime());
|
||||||
mobilePosition.setLongitude(deviceAlarm.getLongitude());
|
mobilePosition.setLongitude(deviceAlarm.getLongitude());
|
||||||
mobilePosition.setLatitude(deviceAlarm.getLatitude());
|
mobilePosition.setLatitude(deviceAlarm.getLatitude());
|
||||||
mobilePosition.setReportSource("GPS Alarm");
|
mobilePosition.setReportSource("GPS Alarm");
|
||||||
// 默认来源坐标系为WGS-84处理
|
if ("WGS84".equals(device.getGeoCoordSys())) {
|
||||||
Double[] gcj02Point = Coordtransform.WGS84ToGCJ02(mobilePosition.getLongitude(), mobilePosition.getLatitude());
|
mobilePosition.setLongitudeWgs84(mobilePosition.getLongitude());
|
||||||
logger.info("GCJ02坐标:" + gcj02Point[0] + ", " + gcj02Point[1]);
|
mobilePosition.setLatitudeWgs84(mobilePosition.getLatitude());
|
||||||
mobilePosition.setGeodeticSystem("GCJ-02");
|
Double[] position = Coordtransform.WGS84ToGCJ02(mobilePosition.getLongitude(), mobilePosition.getLatitude());
|
||||||
mobilePosition.setCnLng(gcj02Point[0] + "");
|
mobilePosition.setLongitudeGcj02(position[0]);
|
||||||
mobilePosition.setCnLat(gcj02Point[1] + "");
|
mobilePosition.setLatitudeGcj02(position[1]);
|
||||||
if (!userSetting.getSavePositionHistory()) {
|
}else if ("GCJ02".equals(device.getGeoCoordSys())) {
|
||||||
storager.clearMobilePositionsByDeviceId(device.getDeviceId());
|
mobilePosition.setLongitudeGcj02(mobilePosition.getLongitude());
|
||||||
|
mobilePosition.setLatitudeGcj02(mobilePosition.getLatitude());
|
||||||
|
Double[] position = Coordtransform.GCJ02ToWGS84(mobilePosition.getLongitude(), mobilePosition.getLatitude());
|
||||||
|
mobilePosition.setLongitudeWgs84(position[0]);
|
||||||
|
mobilePosition.setLatitudeWgs84(position[1]);
|
||||||
|
}else {
|
||||||
|
mobilePosition.setLongitudeGcj02(0.00);
|
||||||
|
mobilePosition.setLatitudeGcj02(0.00);
|
||||||
|
mobilePosition.setLongitudeWgs84(0.00);
|
||||||
|
mobilePosition.setLatitudeWgs84(0.00);
|
||||||
}
|
}
|
||||||
storager.insertMobilePosition(mobilePosition);
|
if (userSetting.getSavePositionHistory()) {
|
||||||
|
storager.insertMobilePosition(mobilePosition);
|
||||||
|
}
|
||||||
|
// 更新device channel 的经纬度
|
||||||
|
DeviceChannel deviceChannel = new DeviceChannel();
|
||||||
|
deviceChannel.setDeviceId(device.getDeviceId());
|
||||||
|
deviceChannel.setChannelId(channelId);
|
||||||
|
deviceChannel.setLongitude(mobilePosition.getLongitude());
|
||||||
|
deviceChannel.setLatitude(mobilePosition.getLatitude());
|
||||||
|
deviceChannel.setLongitudeWgs84(mobilePosition.getLongitudeWgs84());
|
||||||
|
deviceChannel.setLatitudeWgs84(mobilePosition.getLatitudeWgs84());
|
||||||
|
deviceChannel.setLongitudeGcj02(mobilePosition.getLongitudeGcj02());
|
||||||
|
deviceChannel.setLatitudeGcj02(mobilePosition.getLatitudeGcj02());
|
||||||
|
deviceChannel.setGpsTime(mobilePosition.getTime());
|
||||||
|
storager.updateChannelPosition(deviceChannel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!StringUtils.isEmpty(deviceAlarm.getDeviceId())) {
|
if (!StringUtils.isEmpty(deviceAlarm.getDeviceId())) {
|
||||||
@ -177,6 +201,7 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme
|
|||||||
|
|
||||||
|
|
||||||
DeviceAlarm deviceAlarm = new DeviceAlarm();
|
DeviceAlarm deviceAlarm = new DeviceAlarm();
|
||||||
|
deviceAlarm.setCreateTime(DateUtil.getNow());
|
||||||
deviceAlarm.setDeviceId(parentPlatform.getServerGBId());
|
deviceAlarm.setDeviceId(parentPlatform.getServerGBId());
|
||||||
deviceAlarm.setChannelId(channelId);
|
deviceAlarm.setChannelId(channelId);
|
||||||
deviceAlarm.setAlarmPriority(getText(rootElement, "AlarmPriority"));
|
deviceAlarm.setAlarmPriority(getText(rootElement, "AlarmPriority"));
|
||||||
|
|||||||
@ -1,16 +1,14 @@
|
|||||||
package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.notify.cmd;
|
package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.notify.cmd;
|
||||||
|
|
||||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.BaiduPoint;
|
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.MobilePosition;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
|
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler;
|
import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.notify.NotifyMessageHandler;
|
import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.notify.NotifyMessageHandler;
|
||||||
import com.genersoft.iot.vmp.gb28181.utils.Coordtransform;
|
import com.genersoft.iot.vmp.gb28181.utils.Coordtransform;
|
||||||
import com.genersoft.iot.vmp.gb28181.utils.NumericUtil;
|
import com.genersoft.iot.vmp.gb28181.utils.NumericUtil;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||||
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
import com.genersoft.iot.vmp.utils.GpsUtil;
|
import com.genersoft.iot.vmp.utils.GpsUtil;
|
||||||
import org.dom4j.DocumentException;
|
import org.dom4j.DocumentException;
|
||||||
import org.dom4j.Element;
|
import org.dom4j.Element;
|
||||||
@ -56,6 +54,7 @@ public class MobilePositionNotifyMessageHandler extends SIPRequestProcessorParen
|
|||||||
rootElement = getRootElement(evt, device.getCharset());
|
rootElement = getRootElement(evt, device.getCharset());
|
||||||
|
|
||||||
MobilePosition mobilePosition = new MobilePosition();
|
MobilePosition mobilePosition = new MobilePosition();
|
||||||
|
mobilePosition.setCreateTime(DateUtil.getNow());
|
||||||
if (!StringUtils.isEmpty(device.getName())) {
|
if (!StringUtils.isEmpty(device.getName())) {
|
||||||
mobilePosition.setDeviceName(device.getName());
|
mobilePosition.setDeviceName(device.getName());
|
||||||
}
|
}
|
||||||
@ -80,16 +79,39 @@ public class MobilePositionNotifyMessageHandler extends SIPRequestProcessorParen
|
|||||||
mobilePosition.setAltitude(0.0);
|
mobilePosition.setAltitude(0.0);
|
||||||
}
|
}
|
||||||
mobilePosition.setReportSource("Mobile Position");
|
mobilePosition.setReportSource("Mobile Position");
|
||||||
// 默认来源坐标系为WGS-84处理
|
if ("WGS84".equals(device.getGeoCoordSys())) {
|
||||||
Double[] gcj02Point = Coordtransform.WGS84ToGCJ02(mobilePosition.getLongitude(), mobilePosition.getLatitude());
|
mobilePosition.setLongitudeWgs84(mobilePosition.getLongitude());
|
||||||
logger.info("GCJ02坐标:" + gcj02Point[0] + ", " + gcj02Point[1]);
|
mobilePosition.setLatitudeWgs84(mobilePosition.getLatitude());
|
||||||
mobilePosition.setGeodeticSystem("GCJ-02");
|
Double[] position = Coordtransform.WGS84ToGCJ02(mobilePosition.getLongitude(), mobilePosition.getLatitude());
|
||||||
mobilePosition.setCnLng(gcj02Point[0] + "");
|
mobilePosition.setLongitudeGcj02(position[0]);
|
||||||
mobilePosition.setCnLat(gcj02Point[1] + "");
|
mobilePosition.setLatitudeGcj02(position[1]);
|
||||||
if (!userSetting.getSavePositionHistory()) {
|
}else if ("GCJ02".equals(device.getGeoCoordSys())) {
|
||||||
storager.clearMobilePositionsByDeviceId(device.getDeviceId());
|
mobilePosition.setLongitudeGcj02(mobilePosition.getLongitude());
|
||||||
|
mobilePosition.setLatitudeGcj02(mobilePosition.getLatitude());
|
||||||
|
Double[] position = Coordtransform.GCJ02ToWGS84(mobilePosition.getLongitude(), mobilePosition.getLatitude());
|
||||||
|
mobilePosition.setLongitudeWgs84(position[0]);
|
||||||
|
mobilePosition.setLatitudeWgs84(position[1]);
|
||||||
|
}else {
|
||||||
|
mobilePosition.setLongitudeGcj02(0.00);
|
||||||
|
mobilePosition.setLatitudeGcj02(0.00);
|
||||||
|
mobilePosition.setLongitudeWgs84(0.00);
|
||||||
|
mobilePosition.setLatitudeWgs84(0.00);
|
||||||
}
|
}
|
||||||
storager.insertMobilePosition(mobilePosition);
|
if (userSetting.getSavePositionHistory()) {
|
||||||
|
storager.insertMobilePosition(mobilePosition);
|
||||||
|
}
|
||||||
|
// 更新device channel 的经纬度
|
||||||
|
DeviceChannel deviceChannel = new DeviceChannel();
|
||||||
|
deviceChannel.setDeviceId(device.getDeviceId());
|
||||||
|
deviceChannel.setChannelId(mobilePosition.getChannelId());
|
||||||
|
deviceChannel.setLongitude(mobilePosition.getLongitude());
|
||||||
|
deviceChannel.setLatitude(mobilePosition.getLatitude());
|
||||||
|
deviceChannel.setLongitudeWgs84(mobilePosition.getLongitudeWgs84());
|
||||||
|
deviceChannel.setLatitudeWgs84(mobilePosition.getLatitudeWgs84());
|
||||||
|
deviceChannel.setLongitudeGcj02(mobilePosition.getLongitudeGcj02());
|
||||||
|
deviceChannel.setLatitudeGcj02(mobilePosition.getLatitudeGcj02());
|
||||||
|
deviceChannel.setGpsTime(mobilePosition.getTime());
|
||||||
|
storager.updateChannelPosition(deviceChannel);
|
||||||
//回复 200 OK
|
//回复 200 OK
|
||||||
responseAck(evt, Response.OK);
|
responseAck(evt, Response.OK);
|
||||||
} catch (DocumentException | SipException | InvalidArgumentException | ParseException e) {
|
} catch (DocumentException | SipException | InvalidArgumentException | ParseException e) {
|
||||||
|
|||||||
@ -171,71 +171,6 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理设备位置的更新
|
|
||||||
*
|
|
||||||
* @param evt, itemDevice
|
|
||||||
*/
|
|
||||||
private void processNotifyMobilePosition(RequestEvent evt, Element itemDevice) {
|
|
||||||
try {
|
|
||||||
// 回复 200 OK
|
|
||||||
Element rootElement = getRootElement(evt);
|
|
||||||
MobilePosition mobilePosition = new MobilePosition();
|
|
||||||
Element deviceIdElement = rootElement.element("DeviceID");
|
|
||||||
String deviceId = deviceIdElement.getTextTrim().toString();
|
|
||||||
Device device = redisCatchStorage.getDevice(deviceId);
|
|
||||||
if (device != null) {
|
|
||||||
if (!StringUtils.isEmpty(device.getName())) {
|
|
||||||
mobilePosition.setDeviceName(device.getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mobilePosition.setDeviceId(XmlUtil.getText(rootElement, "DeviceID"));
|
|
||||||
|
|
||||||
String time = XmlUtil.getText(itemDevice, "Time");
|
|
||||||
if(time==null){
|
|
||||||
time = XmlUtil.getText(itemDevice, "EndTime");
|
|
||||||
}
|
|
||||||
mobilePosition.setTime(time);
|
|
||||||
String longitude = XmlUtil.getText(itemDevice, "Longitude");
|
|
||||||
if(longitude!=null) {
|
|
||||||
mobilePosition.setLongitude(Double.parseDouble(longitude));
|
|
||||||
}
|
|
||||||
String latitude = XmlUtil.getText(itemDevice, "Latitude");
|
|
||||||
if(latitude!=null) {
|
|
||||||
mobilePosition.setLatitude(Double.parseDouble(latitude));
|
|
||||||
}
|
|
||||||
if (NumericUtil.isDouble(XmlUtil.getText(itemDevice, "Speed"))) {
|
|
||||||
mobilePosition.setSpeed(Double.parseDouble(XmlUtil.getText(itemDevice, "Speed")));
|
|
||||||
} else {
|
|
||||||
mobilePosition.setSpeed(0.0);
|
|
||||||
}
|
|
||||||
if (NumericUtil.isDouble(XmlUtil.getText(itemDevice, "Direction"))) {
|
|
||||||
mobilePosition.setDirection(Double.parseDouble(XmlUtil.getText(itemDevice, "Direction")));
|
|
||||||
} else {
|
|
||||||
mobilePosition.setDirection(0.0);
|
|
||||||
}
|
|
||||||
if (NumericUtil.isDouble(XmlUtil.getText(itemDevice, "Altitude"))) {
|
|
||||||
mobilePosition.setAltitude(Double.parseDouble(XmlUtil.getText(itemDevice, "Altitude")));
|
|
||||||
} else {
|
|
||||||
mobilePosition.setAltitude(0.0);
|
|
||||||
}
|
|
||||||
mobilePosition.setReportSource("Mobile Position");
|
|
||||||
// 默认来源坐标系为WGS-84处理
|
|
||||||
Double[] gcj02Point = Coordtransform.WGS84ToGCJ02(mobilePosition.getLongitude(), mobilePosition.getLatitude());
|
|
||||||
logger.info("GCJ02坐标:" + gcj02Point[0] + ", " + gcj02Point[1]);
|
|
||||||
mobilePosition.setGeodeticSystem("GCJ-02");
|
|
||||||
mobilePosition.setCnLng(gcj02Point[0] + "");
|
|
||||||
mobilePosition.setCnLat(gcj02Point[1] + "");
|
|
||||||
if (!userSetting.getSavePositionHistory()) {
|
|
||||||
storager.clearMobilePositionsByDeviceId(deviceId);
|
|
||||||
}
|
|
||||||
storager.insertMobilePosition(mobilePosition);
|
|
||||||
responseAck(evt, Response.OK);
|
|
||||||
} catch (DocumentException | SipException | InvalidArgumentException | ParseException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public SyncStatus getChannelSyncProgress(String deviceId) {
|
public SyncStatus getChannelSyncProgress(String deviceId) {
|
||||||
if (catalogDataCatch.get(deviceId) == null) {
|
if (catalogDataCatch.get(deviceId) == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -1,16 +1,14 @@
|
|||||||
package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.cmd;
|
package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.cmd;
|
||||||
|
|
||||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.BaiduPoint;
|
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.MobilePosition;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
|
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
|
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler;
|
import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.ResponseMessageHandler;
|
import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.ResponseMessageHandler;
|
||||||
import com.genersoft.iot.vmp.gb28181.utils.Coordtransform;
|
import com.genersoft.iot.vmp.gb28181.utils.Coordtransform;
|
||||||
import com.genersoft.iot.vmp.gb28181.utils.NumericUtil;
|
import com.genersoft.iot.vmp.gb28181.utils.NumericUtil;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||||
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
import com.genersoft.iot.vmp.utils.GpsUtil;
|
import com.genersoft.iot.vmp.utils.GpsUtil;
|
||||||
import org.dom4j.DocumentException;
|
import org.dom4j.DocumentException;
|
||||||
import org.dom4j.Element;
|
import org.dom4j.Element;
|
||||||
@ -56,6 +54,7 @@ public class MobilePositionResponseMessageHandler extends SIPRequestProcessorPar
|
|||||||
rootElement = getRootElement(evt, device.getCharset());
|
rootElement = getRootElement(evt, device.getCharset());
|
||||||
|
|
||||||
MobilePosition mobilePosition = new MobilePosition();
|
MobilePosition mobilePosition = new MobilePosition();
|
||||||
|
mobilePosition.setCreateTime(DateUtil.getNow());
|
||||||
if (!StringUtils.isEmpty(device.getName())) {
|
if (!StringUtils.isEmpty(device.getName())) {
|
||||||
mobilePosition.setDeviceName(device.getName());
|
mobilePosition.setDeviceName(device.getName());
|
||||||
}
|
}
|
||||||
@ -80,16 +79,39 @@ public class MobilePositionResponseMessageHandler extends SIPRequestProcessorPar
|
|||||||
mobilePosition.setAltitude(0.0);
|
mobilePosition.setAltitude(0.0);
|
||||||
}
|
}
|
||||||
mobilePosition.setReportSource("Mobile Position");
|
mobilePosition.setReportSource("Mobile Position");
|
||||||
// 默认来源坐标系为WGS-84处理
|
if ("WGS84".equals(device.getGeoCoordSys())) {
|
||||||
Double[] gcj02Point = Coordtransform.WGS84ToGCJ02(mobilePosition.getLongitude(), mobilePosition.getLatitude());
|
mobilePosition.setLongitudeWgs84(mobilePosition.getLongitude());
|
||||||
logger.info("GCJ02坐标:" + gcj02Point[0] + ", " + gcj02Point[1]);
|
mobilePosition.setLatitudeWgs84(mobilePosition.getLatitude());
|
||||||
mobilePosition.setGeodeticSystem("GCJ-02");
|
Double[] position = Coordtransform.WGS84ToGCJ02(mobilePosition.getLongitude(), mobilePosition.getLatitude());
|
||||||
mobilePosition.setCnLng(gcj02Point[0] + "");
|
mobilePosition.setLongitudeGcj02(position[0]);
|
||||||
mobilePosition.setCnLat(gcj02Point[1] + "");
|
mobilePosition.setLatitudeGcj02(position[1]);
|
||||||
if (!userSetting.getSavePositionHistory()) {
|
}else if ("GCJ02".equals(device.getGeoCoordSys())) {
|
||||||
storager.clearMobilePositionsByDeviceId(device.getDeviceId());
|
mobilePosition.setLongitudeGcj02(mobilePosition.getLongitude());
|
||||||
|
mobilePosition.setLatitudeGcj02(mobilePosition.getLatitude());
|
||||||
|
Double[] position = Coordtransform.GCJ02ToWGS84(mobilePosition.getLongitude(), mobilePosition.getLatitude());
|
||||||
|
mobilePosition.setLongitudeWgs84(position[0]);
|
||||||
|
mobilePosition.setLatitudeWgs84(position[1]);
|
||||||
|
}else {
|
||||||
|
mobilePosition.setLongitudeGcj02(0.00);
|
||||||
|
mobilePosition.setLatitudeGcj02(0.00);
|
||||||
|
mobilePosition.setLongitudeWgs84(0.00);
|
||||||
|
mobilePosition.setLatitudeWgs84(0.00);
|
||||||
}
|
}
|
||||||
storager.insertMobilePosition(mobilePosition);
|
if (userSetting.getSavePositionHistory()) {
|
||||||
|
storager.insertMobilePosition(mobilePosition);
|
||||||
|
}
|
||||||
|
// 更新device channel 的经纬度
|
||||||
|
DeviceChannel deviceChannel = new DeviceChannel();
|
||||||
|
deviceChannel.setDeviceId(device.getDeviceId());
|
||||||
|
deviceChannel.setChannelId(mobilePosition.getChannelId());
|
||||||
|
deviceChannel.setLongitude(mobilePosition.getLongitude());
|
||||||
|
deviceChannel.setLatitude(mobilePosition.getLatitude());
|
||||||
|
deviceChannel.setLongitudeWgs84(mobilePosition.getLongitudeWgs84());
|
||||||
|
deviceChannel.setLatitudeWgs84(mobilePosition.getLatitudeWgs84());
|
||||||
|
deviceChannel.setLongitudeGcj02(mobilePosition.getLongitudeGcj02());
|
||||||
|
deviceChannel.setLatitudeGcj02(mobilePosition.getLatitudeGcj02());
|
||||||
|
deviceChannel.setGpsTime(mobilePosition.getTime());
|
||||||
|
storager.updateChannelPosition(deviceChannel);
|
||||||
//回复 200 OK
|
//回复 200 OK
|
||||||
responseAck(evt, Response.OK);
|
responseAck(evt, Response.OK);
|
||||||
} catch (DocumentException | SipException | InvalidArgumentException | ParseException e) {
|
} catch (DocumentException | SipException | InvalidArgumentException | ParseException e) {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.cmd;
|
package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.response.cmd;
|
||||||
|
|
||||||
import com.genersoft.iot.vmp.domain.req.PresetQuerySipReq;
|
import com.genersoft.iot.vmp.gb28181.bean.PresetQuerySipReq;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
|
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
||||||
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
import org.dom4j.Attribute;
|
import org.dom4j.Attribute;
|
||||||
import org.dom4j.Document;
|
import org.dom4j.Document;
|
||||||
import org.dom4j.DocumentException;
|
import org.dom4j.DocumentException;
|
||||||
@ -314,6 +315,7 @@ public class XmlUtil {
|
|||||||
} else {
|
} else {
|
||||||
deviceChannel.setLatitude(0.00);
|
deviceChannel.setLatitude(0.00);
|
||||||
}
|
}
|
||||||
|
deviceChannel.setGpsTime(DateUtil.getNow());
|
||||||
if (deviceChannel.getLongitude()*deviceChannel.getLatitude() > 0) {
|
if (deviceChannel.getLongitude()*deviceChannel.getLatitude() > 0) {
|
||||||
if ("WGS84".equals(device.getGeoCoordSys())) {
|
if ("WGS84".equals(device.getGeoCoordSys())) {
|
||||||
deviceChannel.setLongitudeWgs84(deviceChannel.getLongitude());
|
deviceChannel.setLongitudeWgs84(deviceChannel.getLongitude());
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
package com.genersoft.iot.vmp.media.zlm;
|
package com.genersoft.iot.vmp.media.zlm;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.genersoft.iot.vmp.common.StreamInfo;
|
import com.genersoft.iot.vmp.common.StreamInfo;
|
||||||
@ -21,6 +22,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@ -79,6 +81,9 @@ public class ZLMHttpHookListener {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private UserSetting userSetting;
|
private UserSetting userSetting;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IUserService userService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private VideoStreamSessionManager sessionManager;
|
private VideoStreamSessionManager sessionManager;
|
||||||
|
|
||||||
@ -151,12 +156,14 @@ public class ZLMHttpHookListener {
|
|||||||
*/
|
*/
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@PostMapping(value = "/on_play", produces = "application/json;charset=UTF-8")
|
@PostMapping(value = "/on_play", produces = "application/json;charset=UTF-8")
|
||||||
public ResponseEntity<String> onPlay(@RequestBody JSONObject json){
|
public ResponseEntity<String> onPlay(@RequestBody OnPlayHookParam param){
|
||||||
|
|
||||||
|
JSONObject json = (JSONObject)JSON.toJSON(param);
|
||||||
|
|
||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
logger.debug("[ ZLM HOOK ]on_play API调用,参数:" + json.toString());
|
logger.debug("[ ZLM HOOK ]on_play API调用,参数:" + JSON.toJSONString(param));
|
||||||
}
|
}
|
||||||
String mediaServerId = json.getString("mediaServerId");
|
String mediaServerId = param.getMediaServerId();
|
||||||
ZLMHttpHookSubscribe.Event subscribe = this.subscribe.getSubscribe(ZLMHttpHookSubscribe.HookType.on_play, json);
|
ZLMHttpHookSubscribe.Event subscribe = this.subscribe.getSubscribe(ZLMHttpHookSubscribe.HookType.on_play, json);
|
||||||
if (subscribe != null ) {
|
if (subscribe != null ) {
|
||||||
MediaServerItem mediaInfo = mediaServerService.getOne(mediaServerId);
|
MediaServerItem mediaInfo = mediaServerService.getOne(mediaServerId);
|
||||||
@ -165,9 +172,20 @@ public class ZLMHttpHookListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
JSONObject ret = new JSONObject();
|
JSONObject ret = new JSONObject();
|
||||||
|
if (!"rtp".equals(param.getApp())) {
|
||||||
|
Map<String, String> paramMap = urlParamToMap(param.getParams());
|
||||||
|
StreamAuthorityInfo streamAuthorityInfo = redisCatchStorage.getStreamAuthorityInfo(param.getApp(), param.getStream());
|
||||||
|
if (streamAuthorityInfo == null
|
||||||
|
|| (streamAuthorityInfo.getCallId() != null && !streamAuthorityInfo.getCallId().equals(paramMap.get("callId")))) {
|
||||||
|
ret.put("code", 401);
|
||||||
|
ret.put("msg", "Unauthorized");
|
||||||
|
return new ResponseEntity<>(ret.toString(),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret.put("code", 0);
|
ret.put("code", 0);
|
||||||
ret.put("msg", "success");
|
ret.put("msg", "success");
|
||||||
return new ResponseEntity<String>(ret.toString(),HttpStatus.OK);
|
return new ResponseEntity<>(ret.toString(),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -176,16 +194,49 @@ public class ZLMHttpHookListener {
|
|||||||
*/
|
*/
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@PostMapping(value = "/on_publish", produces = "application/json;charset=UTF-8")
|
@PostMapping(value = "/on_publish", produces = "application/json;charset=UTF-8")
|
||||||
public ResponseEntity<String> onPublish(@RequestBody JSONObject json) {
|
public ResponseEntity<String> onPublish(@RequestBody OnPublishHookParam param) {
|
||||||
|
|
||||||
|
JSONObject json = (JSONObject) JSON.toJSON(param);
|
||||||
|
|
||||||
logger.info("[ ZLM HOOK ]on_publish API调用,参数:" + json.toString());
|
logger.info("[ ZLM HOOK ]on_publish API调用,参数:" + json.toString());
|
||||||
JSONObject ret = new JSONObject();
|
JSONObject ret = new JSONObject();
|
||||||
|
if (!"rtp".equals(param.getApp())) {
|
||||||
|
// 推流鉴权
|
||||||
|
if (param.getParams() == null) {
|
||||||
|
logger.info("推流鉴权失败: 缺少不要参数:sign=md5(user表的pushKey)");
|
||||||
|
ret.put("code", 401);
|
||||||
|
ret.put("msg", "Unauthorized");
|
||||||
|
return new ResponseEntity<>(ret.toString(), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
Map<String, String> paramMap = urlParamToMap(param.getParams());
|
||||||
|
String sign = paramMap.get("sign");
|
||||||
|
if (sign == null) {
|
||||||
|
logger.info("推流鉴权失败: 缺少不要参数:sign=md5(user表的pushKey)");
|
||||||
|
ret.put("code", 401);
|
||||||
|
ret.put("msg", "Unauthorized");
|
||||||
|
return new ResponseEntity<>(ret.toString(), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
// 推流自定义播放鉴权码
|
||||||
|
String callId = paramMap.get("callId");
|
||||||
|
// 鉴权配置
|
||||||
|
boolean hasAuthority = userService.checkPushAuthority(callId, sign);
|
||||||
|
if (!hasAuthority) {
|
||||||
|
logger.info("推流鉴权失败: sign 无权限: callId={}. sign={}", callId, sign);
|
||||||
|
ret.put("code", 401);
|
||||||
|
ret.put("msg", "Unauthorized");
|
||||||
|
return new ResponseEntity<>(ret.toString(), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
StreamAuthorityInfo streamAuthorityInfo = StreamAuthorityInfo.getInstanceByHook(param);
|
||||||
|
streamAuthorityInfo.setCallId(callId);
|
||||||
|
streamAuthorityInfo.setSign(sign);
|
||||||
|
// 鉴权通过
|
||||||
|
redisCatchStorage.updateStreamAuthorityInfo(param.getApp(), param.getStream(), streamAuthorityInfo);
|
||||||
|
}
|
||||||
|
|
||||||
ret.put("code", 0);
|
ret.put("code", 0);
|
||||||
ret.put("msg", "success");
|
ret.put("msg", "success");
|
||||||
ret.put("enable_hls", true);
|
ret.put("enable_hls", true);
|
||||||
if (json.getInteger("originType") == 1
|
if (!"rtp".equals(param.getApp())) {
|
||||||
|| json.getInteger("originType") == 2
|
|
||||||
|| json.getInteger("originType") == 3) {
|
|
||||||
ret.put("enable_audio", true);
|
ret.put("enable_audio", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,14 +251,13 @@ public class ZLMHttpHookListener {
|
|||||||
ret.put("msg", "zlm not register");
|
ret.put("msg", "zlm not register");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String app = json.getString("app");
|
|
||||||
String stream = json.getString("stream");
|
if ("rtp".equals(param.getApp())) {
|
||||||
if ("rtp".equals(app)) {
|
|
||||||
ret.put("enable_mp4", userSetting.getRecordSip());
|
ret.put("enable_mp4", userSetting.getRecordSip());
|
||||||
}else {
|
}else {
|
||||||
ret.put("enable_mp4", userSetting.isRecordPushLive());
|
ret.put("enable_mp4", userSetting.isRecordPushLive());
|
||||||
}
|
}
|
||||||
List<SsrcTransaction> ssrcTransactionForAll = sessionManager.getSsrcTransactionForAll(null, null, null, stream);
|
List<SsrcTransaction> ssrcTransactionForAll = sessionManager.getSsrcTransactionForAll(null, null, null, param.getStream());
|
||||||
if (ssrcTransactionForAll != null && ssrcTransactionForAll.size() == 1) {
|
if (ssrcTransactionForAll != null && ssrcTransactionForAll.size() == 1) {
|
||||||
String deviceId = ssrcTransactionForAll.get(0).getDeviceId();
|
String deviceId = ssrcTransactionForAll.get(0).getDeviceId();
|
||||||
String channelId = ssrcTransactionForAll.get(0).getChannelId();
|
String channelId = ssrcTransactionForAll.get(0).getChannelId();
|
||||||
@ -221,13 +271,14 @@ public class ZLMHttpHookListener {
|
|||||||
ret.put("enable_mp4", true);
|
ret.put("enable_mp4", true);
|
||||||
ret.put("enable_audio", true);
|
ret.put("enable_audio", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ResponseEntity<String>(ret.toString(), HttpStatus.OK);
|
return new ResponseEntity<String>(ret.toString(), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 录制mp4完成后通知事件;此事件对回复不敏感。
|
* 录制mp4完成后通知事件;此事件对回复不敏感。
|
||||||
*
|
*
|
||||||
@ -312,9 +363,6 @@ public class ZLMHttpHookListener {
|
|||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
logger.debug("[ ZLM HOOK ]on_shell_login API调用,参数:" + json.toString());
|
logger.debug("[ ZLM HOOK ]on_shell_login API调用,参数:" + json.toString());
|
||||||
}
|
}
|
||||||
// TODO 如果是带有rtpstream则开启按需拉流
|
|
||||||
// String app = json.getString("app");
|
|
||||||
// String stream = json.getString("stream");
|
|
||||||
String mediaServerId = json.getString("mediaServerId");
|
String mediaServerId = json.getString("mediaServerId");
|
||||||
ZLMHttpHookSubscribe.Event subscribe = this.subscribe.getSubscribe(ZLMHttpHookSubscribe.HookType.on_shell_login, json);
|
ZLMHttpHookSubscribe.Event subscribe = this.subscribe.getSubscribe(ZLMHttpHookSubscribe.HookType.on_shell_login, json);
|
||||||
if (subscribe != null ) {
|
if (subscribe != null ) {
|
||||||
@ -351,12 +399,24 @@ public class ZLMHttpHookListener {
|
|||||||
}
|
}
|
||||||
// 流消失移除redis play
|
// 流消失移除redis play
|
||||||
String app = item.getApp();
|
String app = item.getApp();
|
||||||
String streamId = item.getStream();
|
String stream = item.getStream();
|
||||||
String schema = item.getSchema();
|
String schema = item.getSchema();
|
||||||
List<MediaItem.MediaTrack> tracks = item.getTracks();
|
List<MediaItem.MediaTrack> tracks = item.getTracks();
|
||||||
boolean regist = item.isRegist();
|
boolean regist = item.isRegist();
|
||||||
|
if (regist) {
|
||||||
|
StreamAuthorityInfo streamAuthorityInfo = redisCatchStorage.getStreamAuthorityInfo(app, stream);
|
||||||
|
if (streamAuthorityInfo == null) {
|
||||||
|
streamAuthorityInfo = StreamAuthorityInfo.getInstanceByHook(item);
|
||||||
|
}else {
|
||||||
|
streamAuthorityInfo.setOriginType(item.getOriginType());
|
||||||
|
streamAuthorityInfo.setOriginTypeStr(item.getOriginTypeStr());
|
||||||
|
}
|
||||||
|
redisCatchStorage.updateStreamAuthorityInfo(app, stream, streamAuthorityInfo);
|
||||||
|
}else {
|
||||||
|
redisCatchStorage.removeStreamAuthorityInfo(app, stream);
|
||||||
|
}
|
||||||
if ("rtmp".equals(schema)){
|
if ("rtmp".equals(schema)){
|
||||||
logger.info("on_stream_changed:注册->{}, app->{}, stream->{}", regist, app, streamId);
|
logger.info("on_stream_changed:注册->{}, app->{}, stream->{}", regist, app, stream);
|
||||||
if (regist) {
|
if (regist) {
|
||||||
mediaServerService.addCount(mediaServerId);
|
mediaServerService.addCount(mediaServerId);
|
||||||
}else {
|
}else {
|
||||||
@ -365,15 +425,15 @@ public class ZLMHttpHookListener {
|
|||||||
if (item.getOriginType() == OriginType.PULL.ordinal()
|
if (item.getOriginType() == OriginType.PULL.ordinal()
|
||||||
|| item.getOriginType() == OriginType.FFMPEG_PULL.ordinal()) {
|
|| item.getOriginType() == OriginType.FFMPEG_PULL.ordinal()) {
|
||||||
// 设置拉流代理上线/离线
|
// 设置拉流代理上线/离线
|
||||||
streamProxyService.updateStatus(regist, app, streamId);
|
streamProxyService.updateStatus(regist, app, stream);
|
||||||
}
|
}
|
||||||
if ("rtp".equals(app) && !regist ) {
|
if ("rtp".equals(app) && !regist ) {
|
||||||
StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId);
|
StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(stream);
|
||||||
if (streamInfo!=null){
|
if (streamInfo!=null){
|
||||||
redisCatchStorage.stopPlay(streamInfo);
|
redisCatchStorage.stopPlay(streamInfo);
|
||||||
storager.stopPlay(streamInfo.getDeviceID(), streamInfo.getChannelId());
|
storager.stopPlay(streamInfo.getDeviceID(), streamInfo.getChannelId());
|
||||||
}else{
|
}else{
|
||||||
streamInfo = redisCatchStorage.queryPlayback(null, null, streamId, null);
|
streamInfo = redisCatchStorage.queryPlayback(null, null, stream, null);
|
||||||
if (streamInfo != null) {
|
if (streamInfo != null) {
|
||||||
redisCatchStorage.stopPlayback(streamInfo.getDeviceID(), streamInfo.getChannelId(),
|
redisCatchStorage.stopPlayback(streamInfo.getDeviceID(), streamInfo.getChannelId(),
|
||||||
streamInfo.getStream(), null);
|
streamInfo.getStream(), null);
|
||||||
@ -387,11 +447,12 @@ public class ZLMHttpHookListener {
|
|||||||
|
|
||||||
if (mediaServerItem != null){
|
if (mediaServerItem != null){
|
||||||
if (regist) {
|
if (regist) {
|
||||||
StreamPushItem streamPushItem = null;
|
StreamAuthorityInfo streamAuthorityInfo = redisCatchStorage.getStreamAuthorityInfo(app, stream);
|
||||||
StreamInfo streamInfoByAppAndStream = mediaService.getStreamInfoByAppAndStream(mediaServerItem, app, streamId, tracks);
|
StreamInfo streamInfoByAppAndStream = mediaService.getStreamInfoByAppAndStream(mediaServerItem,
|
||||||
|
app, stream, tracks, streamAuthorityInfo.getCallId());
|
||||||
item.setStreamInfo(streamInfoByAppAndStream);
|
item.setStreamInfo(streamInfoByAppAndStream);
|
||||||
|
|
||||||
redisCatchStorage.addStream(mediaServerItem, type, app, streamId, item);
|
redisCatchStorage.addStream(mediaServerItem, type, app, stream, item);
|
||||||
if (item.getOriginType() == OriginType.RTSP_PUSH.ordinal()
|
if (item.getOriginType() == OriginType.RTSP_PUSH.ordinal()
|
||||||
|| item.getOriginType() == OriginType.RTMP_PUSH.ordinal()
|
|| item.getOriginType() == OriginType.RTMP_PUSH.ordinal()
|
||||||
|| item.getOriginType() == OriginType.RTC_PUSH.ordinal() ) {
|
|| item.getOriginType() == OriginType.RTC_PUSH.ordinal() ) {
|
||||||
@ -414,23 +475,23 @@ public class ZLMHttpHookListener {
|
|||||||
|
|
||||||
}else {
|
}else {
|
||||||
// 兼容流注销时类型从redis记录获取
|
// 兼容流注销时类型从redis记录获取
|
||||||
MediaItem mediaItem = redisCatchStorage.getStreamInfo(app, streamId, mediaServerId);
|
MediaItem mediaItem = redisCatchStorage.getStreamInfo(app, stream, mediaServerId);
|
||||||
if (mediaItem != null) {
|
if (mediaItem != null) {
|
||||||
type = OriginType.values()[mediaItem.getOriginType()].getType();
|
type = OriginType.values()[mediaItem.getOriginType()].getType();
|
||||||
redisCatchStorage.removeStream(mediaServerItem.getId(), type, app, streamId);
|
redisCatchStorage.removeStream(mediaServerItem.getId(), type, app, stream);
|
||||||
}
|
}
|
||||||
GbStream gbStream = storager.getGbStream(app, streamId);
|
GbStream gbStream = storager.getGbStream(app, stream);
|
||||||
if (gbStream != null) {
|
if (gbStream != null) {
|
||||||
// eventPublisher.catalogEventPublishForStream(null, gbStream, CatalogEvent.OFF);
|
// eventPublisher.catalogEventPublishForStream(null, gbStream, CatalogEvent.OFF);
|
||||||
}
|
}
|
||||||
zlmMediaListManager.removeMedia(app, streamId);
|
zlmMediaListManager.removeMedia(app, stream);
|
||||||
}
|
}
|
||||||
if (type != null) {
|
if (type != null) {
|
||||||
// 发送流变化redis消息
|
// 发送流变化redis消息
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("serverId", userSetting.getServerId());
|
jsonObject.put("serverId", userSetting.getServerId());
|
||||||
jsonObject.put("app", app);
|
jsonObject.put("app", app);
|
||||||
jsonObject.put("stream", streamId);
|
jsonObject.put("stream", stream);
|
||||||
jsonObject.put("register", regist);
|
jsonObject.put("register", regist);
|
||||||
jsonObject.put("mediaServerId", mediaServerId);
|
jsonObject.put("mediaServerId", mediaServerId);
|
||||||
redisCatchStorage.sendStreamChangeMsg(type, jsonObject);
|
redisCatchStorage.sendStreamChangeMsg(type, jsonObject);
|
||||||
@ -453,10 +514,8 @@ public class ZLMHttpHookListener {
|
|||||||
@ResponseBody
|
@ResponseBody
|
||||||
@PostMapping(value = "/on_stream_none_reader", produces = "application/json;charset=UTF-8")
|
@PostMapping(value = "/on_stream_none_reader", produces = "application/json;charset=UTF-8")
|
||||||
public ResponseEntity<String> onStreamNoneReader(@RequestBody JSONObject json){
|
public ResponseEntity<String> onStreamNoneReader(@RequestBody JSONObject json){
|
||||||
|
|
||||||
if (logger.isDebugEnabled()) {
|
logger.info("[ ZLM HOOK ]on_stream_none_reader API调用,参数:" + json.toString());
|
||||||
logger.debug("[ ZLM HOOK ]on_stream_none_reader API调用,参数:" + json.toString());
|
|
||||||
}
|
|
||||||
String mediaServerId = json.getString("mediaServerId");
|
String mediaServerId = json.getString("mediaServerId");
|
||||||
String streamId = json.getString("stream");
|
String streamId = json.getString("stream");
|
||||||
String app = json.getString("app");
|
String app = json.getString("app");
|
||||||
@ -568,4 +627,22 @@ public class ZLMHttpHookListener {
|
|||||||
ret.put("msg", "success");
|
ret.put("msg", "success");
|
||||||
return new ResponseEntity<String>(ret.toString(),HttpStatus.OK);
|
return new ResponseEntity<String>(ret.toString(),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Map<String, String> urlParamToMap(String params) {
|
||||||
|
HashMap<String, String> map = new HashMap<>();
|
||||||
|
if (StringUtils.isEmpty(params)) {
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
String[] paramsArray = params.split("&");
|
||||||
|
if (paramsArray.length == 0) {
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
for (String param : paramsArray) {
|
||||||
|
String[] paramArray = param.split("=");
|
||||||
|
if (paramArray.length == 2){
|
||||||
|
map.put(paramArray[0], paramArray[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
|||||||
import com.genersoft.iot.vmp.storager.dao.GbStreamMapper;
|
import com.genersoft.iot.vmp.storager.dao.GbStreamMapper;
|
||||||
import com.genersoft.iot.vmp.storager.dao.PlatformGbStreamMapper;
|
import com.genersoft.iot.vmp.storager.dao.PlatformGbStreamMapper;
|
||||||
import com.genersoft.iot.vmp.storager.dao.StreamPushMapper;
|
import com.genersoft.iot.vmp.storager.dao.StreamPushMapper;
|
||||||
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
import org.checkerframework.checker.units.qual.C;
|
import org.checkerframework.checker.units.qual.C;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -114,63 +115,42 @@ public class ZLMMediaListManager {
|
|||||||
public StreamPushItem addPush(MediaItem mediaItem) {
|
public StreamPushItem addPush(MediaItem mediaItem) {
|
||||||
// 查找此直播流是否存在redis预设gbId
|
// 查找此直播流是否存在redis预设gbId
|
||||||
StreamPushItem transform = streamPushService.transform(mediaItem);
|
StreamPushItem transform = streamPushService.transform(mediaItem);
|
||||||
// 从streamId取出查询关键值
|
StreamPushItem pushInDb = streamPushService.getPush(mediaItem.getApp(), mediaItem.getStream());
|
||||||
Pattern pattern = Pattern.compile(userSetting.getThirdPartyGBIdReg());
|
transform.setUpdateTime(DateUtil.getNow());
|
||||||
Matcher matcher = pattern.matcher(mediaItem.getStream());// 指定要匹配的字符串
|
transform.setPushTime(DateUtil.getNow());
|
||||||
String queryKey = null;
|
if (pushInDb == null) {
|
||||||
if (matcher.find()) { //此处find()每次被调用后,会偏移到下一个匹配
|
transform.setCreateTime(DateUtil.getNow());
|
||||||
queryKey = matcher.group();
|
streamPushMapper.add(transform);
|
||||||
}
|
}else {
|
||||||
if (queryKey != null) {
|
streamPushMapper.update(transform);
|
||||||
ThirdPartyGB thirdPartyGB = redisCatchStorage.queryMemberNoGBId(queryKey);
|
|
||||||
if (thirdPartyGB != null && !StringUtils.isEmpty(thirdPartyGB.getNationalStandardNo())) {
|
|
||||||
transform.setGbId(thirdPartyGB.getNationalStandardNo());
|
// if (!StringUtils.isEmpty(pushInDb.getGbId())) {
|
||||||
transform.setName(thirdPartyGB.getName());
|
// List<GbStream> gbStreamList = gbStreamMapper.selectByGBId(transform.getGbId());
|
||||||
}
|
// if (gbStreamList != null && gbStreamList.size() == 1) {
|
||||||
}
|
// transform.setGbStreamId(gbStreamList.get(0).getGbStreamId());
|
||||||
if (!StringUtils.isEmpty(transform.getGbId())) {
|
// transform.setPlatformId(gbStreamList.get(0).getPlatformId());
|
||||||
// 如果这个国标ID已经给了其他推流且流已离线,则移除其他推流
|
// transform.setCatalogId(gbStreamList.get(0).getCatalogId());
|
||||||
List<GbStream> gbStreams = gbStreamMapper.selectByGBId(transform.getGbId());
|
// transform.setGbId(gbStreamList.get(0).getGbId());
|
||||||
if (gbStreams.size() > 0) {
|
// gbStreamMapper.update(transform);
|
||||||
for (GbStream gbStream : gbStreams) {
|
// streamPushMapper.del(gbStreamList.get(0).getApp(), gbStreamList.get(0).getStream());
|
||||||
// 出现使用相同国标Id的视频流时,使用新流替换旧流,
|
// }else {
|
||||||
if (queryKey != null && gbStream.getApp().equals(mediaItem.getApp())) {
|
// transform.setCreateTime(DateUtil.getNow());
|
||||||
Matcher matcherForStream = pattern.matcher(gbStream.getStream());
|
// transform.setUpdateTime(DateUtil.getNow());
|
||||||
String queryKeyForStream = null;
|
// gbStreamMapper.add(transform);
|
||||||
if (matcherForStream.find()) { //此处find()每次被调用后,会偏移到下一个匹配
|
// }
|
||||||
queryKeyForStream = matcherForStream.group();
|
// 通知通道上线
|
||||||
}
|
// if (transform != null) {
|
||||||
if (queryKeyForStream == null || !queryKeyForStream.equals(queryKey)) {
|
// if (channelOnlineEvents.get(transform.getGbId()) != null) {
|
||||||
// 此时不是同一个流
|
// channelOnlineEvents.get(transform.getGbId()).run(transform.getApp(), transform.getStream(), transform.getServerId());
|
||||||
gbStreamMapper.del(gbStream.getApp(), gbStream.getStream());
|
// channelOnlineEvents.remove(transform.getGbId());
|
||||||
if (!gbStream.isStatus()) {
|
// }
|
||||||
streamPushMapper.del(gbStream.getApp(), gbStream.getStream());
|
// }
|
||||||
}
|
// }
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
List<GbStream> gbStreamList = gbStreamMapper.selectByGBId(transform.getGbId());
|
|
||||||
if (gbStreamList != null && gbStreamList.size() == 1) {
|
|
||||||
transform.setGbStreamId(gbStreamList.get(0).getGbStreamId());
|
|
||||||
transform.setPlatformId(gbStreamList.get(0).getPlatformId());
|
|
||||||
transform.setCatalogId(gbStreamList.get(0).getCatalogId());
|
|
||||||
transform.setGbId(gbStreamList.get(0).getGbId());
|
|
||||||
gbStreamMapper.update(transform);
|
|
||||||
streamPushMapper.del(gbStreamList.get(0).getApp(), gbStreamList.get(0).getStream());
|
|
||||||
}else {
|
|
||||||
transform.setCreateStamp(System.currentTimeMillis());
|
|
||||||
gbStreamMapper.add(transform);
|
|
||||||
}
|
|
||||||
if (transform != null) {
|
|
||||||
if (channelOnlineEvents.get(transform.getGbId()) != null) {
|
|
||||||
channelOnlineEvents.get(transform.getGbId()).run(transform.getApp(), transform.getStream(), transform.getServerId());
|
|
||||||
channelOnlineEvents.remove(transform.getGbId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
storager.updateMedia(transform);
|
|
||||||
|
|
||||||
return transform;
|
return transform;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,13 +184,13 @@ public class ZLMMediaListManager {
|
|||||||
|
|
||||||
public int removeMedia(String app, String streamId) {
|
public int removeMedia(String app, String streamId) {
|
||||||
// 查找是否关联了国标, 关联了不删除, 置为离线
|
// 查找是否关联了国标, 关联了不删除, 置为离线
|
||||||
StreamProxyItem streamProxyItem = gbStreamMapper.selectOne(app, streamId);
|
GbStream gbStream = gbStreamMapper.selectOne(app, streamId);
|
||||||
int result = 0;
|
int result;
|
||||||
if (streamProxyItem == null) {
|
if (gbStream == null) {
|
||||||
result = storager.removeMedia(app, streamId);
|
result = storager.removeMedia(app, streamId);
|
||||||
}else {
|
}else {
|
||||||
// TODO 暂不设置为离线
|
// TODO 暂不设置为离线
|
||||||
result =storager.mediaOutline(app, streamId);
|
result =storager.mediaOffline(app, streamId);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,7 +66,7 @@ public class ZLMRTPServerFactory {
|
|||||||
String stream = UUID.randomUUID().toString();
|
String stream = UUID.randomUUID().toString();
|
||||||
param.put("enable_tcp", 1);
|
param.put("enable_tcp", 1);
|
||||||
param.put("stream_id", stream);
|
param.put("stream_id", stream);
|
||||||
param.put("port", 0);
|
// param.put("port", 0);
|
||||||
JSONObject openRtpServerResultJson = zlmresTfulUtils.openRtpServer(mediaServerItem, param);
|
JSONObject openRtpServerResultJson = zlmresTfulUtils.openRtpServer(mediaServerItem, param);
|
||||||
|
|
||||||
if (openRtpServerResultJson != null) {
|
if (openRtpServerResultJson != null) {
|
||||||
@ -101,9 +101,10 @@ public class ZLMRTPServerFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> param = new HashMap<>();
|
Map<String, Object> param = new HashMap<>();
|
||||||
// 推流端口设置0则使用随机端口
|
|
||||||
param.put("enable_tcp", 1);
|
param.put("enable_tcp", 1);
|
||||||
param.put("stream_id", streamId);
|
param.put("stream_id", streamId);
|
||||||
|
// 推流端口设置0则使用随机端口
|
||||||
param.put("port", 0);
|
param.put("port", 0);
|
||||||
param.put("ssrc", ssrc);
|
param.put("ssrc", ssrc);
|
||||||
JSONObject openRtpServerResultJson = zlmresTfulUtils.openRtpServer(mediaServerItem, param);
|
JSONObject openRtpServerResultJson = zlmresTfulUtils.openRtpServer(mediaServerItem, param);
|
||||||
|
|||||||
@ -0,0 +1,17 @@
|
|||||||
|
package com.genersoft.iot.vmp.media.zlm.dto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* zlm hook事件的参数
|
||||||
|
* @author lin
|
||||||
|
*/
|
||||||
|
public class HookParam {
|
||||||
|
private String mediaServerId;
|
||||||
|
|
||||||
|
public String getMediaServerId() {
|
||||||
|
return mediaServerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMediaServerId(String mediaServerId) {
|
||||||
|
this.mediaServerId = mediaServerId;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,82 @@
|
|||||||
|
package com.genersoft.iot.vmp.media.zlm.dto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* zlm hook事件中的on_play事件的参数
|
||||||
|
* @author lin
|
||||||
|
*/
|
||||||
|
public class OnPlayHookParam extends HookParam{
|
||||||
|
private String id;
|
||||||
|
private String app;
|
||||||
|
private String stream;
|
||||||
|
private String ip;
|
||||||
|
private String params;
|
||||||
|
private int port;
|
||||||
|
private String schema;
|
||||||
|
private String vhost;
|
||||||
|
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApp() {
|
||||||
|
return app;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApp(String app) {
|
||||||
|
this.app = app;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStream() {
|
||||||
|
return stream;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStream(String stream) {
|
||||||
|
this.stream = stream;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIp() {
|
||||||
|
return ip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIp(String ip) {
|
||||||
|
this.ip = ip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParams() {
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParams(String params) {
|
||||||
|
this.params = params;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPort() {
|
||||||
|
return port;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPort(int port) {
|
||||||
|
this.port = port;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSchema() {
|
||||||
|
return schema;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSchema(String schema) {
|
||||||
|
this.schema = schema;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVhost() {
|
||||||
|
return vhost;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVhost(String vhost) {
|
||||||
|
this.vhost = vhost;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,82 @@
|
|||||||
|
package com.genersoft.iot.vmp.media.zlm.dto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* zlm hook事件中的on_publish事件的参数
|
||||||
|
* @author lin
|
||||||
|
*/
|
||||||
|
public class OnPublishHookParam extends HookParam{
|
||||||
|
private String id;
|
||||||
|
private String app;
|
||||||
|
private String stream;
|
||||||
|
private String ip;
|
||||||
|
private String params;
|
||||||
|
private int port;
|
||||||
|
private String schema;
|
||||||
|
private String vhost;
|
||||||
|
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApp() {
|
||||||
|
return app;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApp(String app) {
|
||||||
|
this.app = app;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStream() {
|
||||||
|
return stream;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStream(String stream) {
|
||||||
|
this.stream = stream;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIp() {
|
||||||
|
return ip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIp(String ip) {
|
||||||
|
this.ip = ip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParams() {
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParams(String params) {
|
||||||
|
this.params = params;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPort() {
|
||||||
|
return port;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPort(int port) {
|
||||||
|
this.port = port;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSchema() {
|
||||||
|
return schema;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSchema(String schema) {
|
||||||
|
this.schema = schema;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVhost() {
|
||||||
|
return vhost;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVhost(String vhost) {
|
||||||
|
this.vhost = vhost;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,114 @@
|
|||||||
|
package com.genersoft.iot.vmp.media.zlm.dto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流的鉴权信息
|
||||||
|
* @author lin
|
||||||
|
*/
|
||||||
|
public class StreamAuthorityInfo {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
private String app;
|
||||||
|
private String stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产生源类型,
|
||||||
|
* unknown = 0,
|
||||||
|
* rtmp_push=1,
|
||||||
|
* rtsp_push=2,
|
||||||
|
* rtp_push=3,
|
||||||
|
* pull=4,
|
||||||
|
* ffmpeg_pull=5,
|
||||||
|
* mp4_vod=6,
|
||||||
|
* device_chn=7
|
||||||
|
*/
|
||||||
|
private int originType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产生源类型的字符串描述
|
||||||
|
*/
|
||||||
|
private String originTypeStr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推流时自定义的播放鉴权ID
|
||||||
|
*/
|
||||||
|
private String callId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推流的鉴权签名
|
||||||
|
*/
|
||||||
|
private String sign;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApp() {
|
||||||
|
return app;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApp(String app) {
|
||||||
|
this.app = app;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStream() {
|
||||||
|
return stream;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStream(String stream) {
|
||||||
|
this.stream = stream;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getOriginType() {
|
||||||
|
return originType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOriginType(int originType) {
|
||||||
|
this.originType = originType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOriginTypeStr() {
|
||||||
|
return originTypeStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOriginTypeStr(String originTypeStr) {
|
||||||
|
this.originTypeStr = originTypeStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCallId() {
|
||||||
|
return callId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCallId(String callId) {
|
||||||
|
this.callId = callId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSign() {
|
||||||
|
return sign;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSign(String sign) {
|
||||||
|
this.sign = sign;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static StreamAuthorityInfo getInstanceByHook(OnPublishHookParam hookParam) {
|
||||||
|
StreamAuthorityInfo streamAuthorityInfo = new StreamAuthorityInfo();
|
||||||
|
streamAuthorityInfo.setApp(hookParam.getApp());
|
||||||
|
streamAuthorityInfo.setStream(hookParam.getStream());
|
||||||
|
streamAuthorityInfo.setId(hookParam.getId());
|
||||||
|
return streamAuthorityInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static StreamAuthorityInfo getInstanceByHook(MediaItem mediaItem) {
|
||||||
|
StreamAuthorityInfo streamAuthorityInfo = new StreamAuthorityInfo();
|
||||||
|
streamAuthorityInfo.setApp(mediaItem.getApp());
|
||||||
|
streamAuthorityInfo.setStream(mediaItem.getStream());
|
||||||
|
streamAuthorityInfo.setId(mediaItem.getMediaServerId());
|
||||||
|
streamAuthorityInfo.setOriginType(mediaItem.getOriginType());
|
||||||
|
streamAuthorityInfo.setOriginTypeStr(mediaItem.getOriginTypeStr());
|
||||||
|
return streamAuthorityInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,7 +1,9 @@
|
|||||||
package com.genersoft.iot.vmp.media.zlm.dto;
|
package com.genersoft.iot.vmp.media.zlm.dto;
|
||||||
|
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
||||||
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.springframework.util.unit.DataUnit;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -86,6 +88,21 @@ public class StreamPushItem extends GbStream implements Comparable<StreamPushIte
|
|||||||
*/
|
*/
|
||||||
private String serverId;
|
private String serverId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推流时间
|
||||||
|
*/
|
||||||
|
private String pushTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private String updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
public String getVhost() {
|
public String getVhost() {
|
||||||
return vhost;
|
return vhost;
|
||||||
}
|
}
|
||||||
@ -97,7 +114,8 @@ public class StreamPushItem extends GbStream implements Comparable<StreamPushIte
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(@NotNull StreamPushItem streamPushItem) {
|
public int compareTo(@NotNull StreamPushItem streamPushItem) {
|
||||||
return Long.valueOf(super.createStamp - streamPushItem.getCreateStamp().intValue()).intValue();
|
return Long.valueOf(DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(super.createTime)
|
||||||
|
- DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(streamPushItem.getCreateTime())).intValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class MediaSchema {
|
public static class MediaSchema {
|
||||||
@ -232,5 +250,32 @@ public class StreamPushItem extends GbStream implements Comparable<StreamPushIte
|
|||||||
public void setServerId(String serverId) {
|
public void setServerId(String serverId) {
|
||||||
this.serverId = serverId;
|
this.serverId = serverId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getPushTime() {
|
||||||
|
return pushTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPushTime(String pushTime) {
|
||||||
|
this.pushTime = pushTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdateTime(String updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCreateTime(String createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@ public interface IMediaService {
|
|||||||
* @param stream
|
* @param stream
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
StreamInfo getStreamInfoByAppAndStreamWithCheck(String app, String stream, String mediaServerId,String addr);
|
StreamInfo getStreamInfoByAppAndStreamWithCheck(String app, String stream, String mediaServerId,String addr, boolean authority);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -24,7 +24,7 @@ public interface IMediaService {
|
|||||||
* @param stream
|
* @param stream
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
StreamInfo getStreamInfoByAppAndStreamWithCheck(String app, String stream, String mediaServerId);
|
StreamInfo getStreamInfoByAppAndStreamWithCheck(String app, String stream, String mediaServerId, boolean authority);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据应用名和流ID获取播放地址, 只是地址拼接
|
* 根据应用名和流ID获取播放地址, 只是地址拼接
|
||||||
@ -32,7 +32,7 @@ public interface IMediaService {
|
|||||||
* @param stream
|
* @param stream
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
StreamInfo getStreamInfoByAppAndStream(MediaServerItem mediaServerItem, String app, String stream, Object tracks);
|
StreamInfo getStreamInfoByAppAndStream(MediaServerItem mediaServerItem, String app, String stream, Object tracks, String callId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据应用名和流ID获取播放地址, 只是地址拼接,返回的ip使用远程访问ip,适用与zlm与wvp在一台主机的情况
|
* 根据应用名和流ID获取播放地址, 只是地址拼接,返回的ip使用远程访问ip,适用与zlm与wvp在一台主机的情况
|
||||||
@ -40,6 +40,6 @@ public interface IMediaService {
|
|||||||
* @param stream
|
* @param stream
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
StreamInfo getStreamInfoByAppAndStream(MediaServerItem mediaInfo, String app, String stream, Object tracks, String addr);
|
StreamInfo getStreamInfoByAppAndStream(MediaServerItem mediaInfo, String app, String stream, Object tracks, String addr, String callId);
|
||||||
StreamInfo getStreamInfoByAppAndStream(MediaServerItem mediaInfo, String app, String stream, Object tracks, String addr, boolean isPlay);
|
StreamInfo getStreamInfoByAppAndStream(MediaServerItem mediaInfo, String app, String stream, Object tracks, String addr, boolean isPlay);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,4 +19,6 @@ public interface IUserService {
|
|||||||
List<User> getAllUsers();
|
List<User> getAllUsers();
|
||||||
|
|
||||||
int updateUsers(User user);
|
int updateUsers(User user);
|
||||||
|
|
||||||
|
boolean checkPushAuthority(String callId, String sign);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,41 @@
|
|||||||
|
package com.genersoft.iot.vmp.service.bean;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收到redis通知修改推流通道状态
|
||||||
|
* @author lin
|
||||||
|
*/
|
||||||
|
public class PushStreamStatusChangeFromRedisDto {
|
||||||
|
|
||||||
|
private boolean setAllOffline;
|
||||||
|
|
||||||
|
private List<StreamPushItemFromRedis> onlineStreams;
|
||||||
|
|
||||||
|
private List<StreamPushItemFromRedis> offlineStreams;
|
||||||
|
|
||||||
|
|
||||||
|
public boolean isSetAllOffline() {
|
||||||
|
return setAllOffline;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSetAllOffline(boolean setAllOffline) {
|
||||||
|
this.setAllOffline = setAllOffline;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<StreamPushItemFromRedis> getOnlineStreams() {
|
||||||
|
return onlineStreams;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnlineStreams(List<StreamPushItemFromRedis> onlineStreams) {
|
||||||
|
this.onlineStreams = onlineStreams;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<StreamPushItemFromRedis> getOfflineStreams() {
|
||||||
|
return offlineStreams;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOfflineStreams(List<StreamPushItemFromRedis> offlineStreams) {
|
||||||
|
this.offlineStreams = offlineStreams;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
package com.genersoft.iot.vmp.service.bean;
|
||||||
|
|
||||||
|
|
||||||
|
public class StreamPushItemFromRedis {
|
||||||
|
private String app;
|
||||||
|
private String stream;
|
||||||
|
private long timeStamp;
|
||||||
|
|
||||||
|
public String getApp() {
|
||||||
|
return app;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApp(String app) {
|
||||||
|
this.app = app;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStream() {
|
||||||
|
return stream;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStream(String stream) {
|
||||||
|
this.stream = stream;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getTimeStamp() {
|
||||||
|
return timeStamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTimeStamp(long timeStamp) {
|
||||||
|
this.timeStamp = timeStamp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -149,9 +149,9 @@ public class GbStreamServiceImpl implements IGbStreamService {
|
|||||||
if (gbStream.getGbId() != null) {
|
if (gbStream.getGbId() != null) {
|
||||||
gbStreams.add(gbStream);
|
gbStreams.add(gbStream);
|
||||||
}else {
|
}else {
|
||||||
StreamProxyItem streamProxyItem = gbStreamMapper.selectOne(gbStream.getApp(), gbStream.getStream());
|
GbStream gbStreamIndb = gbStreamMapper.selectOne(gbStream.getApp(), gbStream.getStream());
|
||||||
if (streamProxyItem != null && streamProxyItem.getGbId() != null){
|
if (gbStreamIndb != null && gbStreamIndb.getGbId() != null){
|
||||||
gbStreams.add(streamProxyItem);
|
gbStreams.add(gbStreamIndb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sendCatalogMsgs(gbStreams, type);
|
sendCatalogMsgs(gbStreams, type);
|
||||||
|
|||||||
@ -7,12 +7,15 @@ import com.genersoft.iot.vmp.common.StreamInfo;
|
|||||||
import com.genersoft.iot.vmp.conf.MediaConfig;
|
import com.genersoft.iot.vmp.conf.MediaConfig;
|
||||||
import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
|
import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
||||||
|
import com.genersoft.iot.vmp.media.zlm.dto.OnPublishHookParam;
|
||||||
|
import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo;
|
||||||
import com.genersoft.iot.vmp.service.IMediaServerService;
|
import com.genersoft.iot.vmp.service.IMediaServerService;
|
||||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||||
import com.genersoft.iot.vmp.service.IMediaService;
|
import com.genersoft.iot.vmp.service.IMediaService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class MediaServiceImpl implements IMediaService {
|
public class MediaServiceImpl implements IMediaService {
|
||||||
@ -36,20 +39,24 @@ public class MediaServiceImpl implements IMediaService {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StreamInfo getStreamInfoByAppAndStream(MediaServerItem mediaInfo, String app, String stream, Object tracks) {
|
public StreamInfo getStreamInfoByAppAndStream(MediaServerItem mediaInfo, String app, String stream, Object tracks, String callId) {
|
||||||
return getStreamInfoByAppAndStream(mediaInfo, app, stream, tracks, null);
|
return getStreamInfoByAppAndStream(mediaInfo, app, stream, tracks, null, callId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StreamInfo getStreamInfoByAppAndStreamWithCheck(String app, String stream, String mediaServerId, String addr) {
|
public StreamInfo getStreamInfoByAppAndStreamWithCheck(String app, String stream, String mediaServerId, String addr, boolean authority) {
|
||||||
StreamInfo streamInfo = null;
|
StreamInfo streamInfo = null;
|
||||||
if (mediaServerId == null) {
|
if (mediaServerId == null) {
|
||||||
mediaServerId = mediaConfig.getId();
|
mediaServerId = mediaConfig.getId();
|
||||||
}
|
}
|
||||||
MediaServerItem mediaInfo = mediaServerService.getOne(mediaServerId);;
|
MediaServerItem mediaInfo = mediaServerService.getOne(mediaServerId);
|
||||||
if (mediaInfo == null) {
|
if (mediaInfo == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
StreamAuthorityInfo streamAuthorityInfo = redisCatchStorage.getStreamAuthorityInfo(app, stream);
|
||||||
|
if (streamAuthorityInfo == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
JSONObject mediaList = zlmresTfulUtils.getMediaList(mediaInfo, app, stream);
|
JSONObject mediaList = zlmresTfulUtils.getMediaList(mediaInfo, app, stream);
|
||||||
if (mediaList != null) {
|
if (mediaList != null) {
|
||||||
if (mediaList.getInteger("code") == 0) {
|
if (mediaList.getInteger("code") == 0) {
|
||||||
@ -59,7 +66,12 @@ public class MediaServiceImpl implements IMediaService {
|
|||||||
}
|
}
|
||||||
JSONObject mediaJSON = JSON.parseObject(JSON.toJSONString(data.get(0)), JSONObject.class);
|
JSONObject mediaJSON = JSON.parseObject(JSON.toJSONString(data.get(0)), JSONObject.class);
|
||||||
JSONArray tracks = mediaJSON.getJSONArray("tracks");
|
JSONArray tracks = mediaJSON.getJSONArray("tracks");
|
||||||
streamInfo = getStreamInfoByAppAndStream(mediaInfo, app, stream, tracks);
|
if (authority) {
|
||||||
|
streamInfo = getStreamInfoByAppAndStream(mediaInfo, app, stream, tracks, streamAuthorityInfo.getCallId());
|
||||||
|
}else {
|
||||||
|
streamInfo = getStreamInfoByAppAndStream(mediaInfo, app, stream, tracks, null);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return streamInfo;
|
return streamInfo;
|
||||||
@ -68,8 +80,8 @@ public class MediaServiceImpl implements IMediaService {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StreamInfo getStreamInfoByAppAndStreamWithCheck(String app, String stream, String mediaServerId) {
|
public StreamInfo getStreamInfoByAppAndStreamWithCheck(String app, String stream, String mediaServerId, boolean authority) {
|
||||||
return getStreamInfoByAppAndStreamWithCheck(app, stream, mediaServerId, null);
|
return getStreamInfoByAppAndStreamWithCheck(app, stream, mediaServerId, null, authority);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -78,41 +90,43 @@ public class MediaServiceImpl implements IMediaService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StreamInfo getStreamInfoByAppAndStream(MediaServerItem mediaInfo, String app, String stream, Object tracks, String addr, boolean isPlay) {
|
public StreamInfo getStreamInfoByAppAndStream(MediaServerItem mediaInfo, String app, String stream, Object tracks, String addr, String callId, boolean isPlay) {
|
||||||
StreamInfo streamInfoResult = new StreamInfo();
|
StreamInfo streamInfoResult = new StreamInfo();
|
||||||
streamInfoResult.setStream(stream);
|
streamInfoResult.setStream(stream);
|
||||||
streamInfoResult.setApp(app);
|
streamInfoResult.setApp(app);
|
||||||
if (addr == null) {
|
if (addr == null) {
|
||||||
addr = mediaInfo.getStreamIp();
|
addr = mediaInfo.getStreamIp();
|
||||||
}
|
}
|
||||||
|
streamInfoResult.setIp(addr);
|
||||||
streamInfoResult.setMediaServerId(mediaInfo.getId());
|
streamInfoResult.setMediaServerId(mediaInfo.getId());
|
||||||
streamInfoResult.setRtmp(String.format("rtmp://%s:%s/%s/%s", addr, mediaInfo.getRtmpPort(), app, stream));
|
String callIdParam = StringUtils.isEmpty(callId)?"":"?callId=" + callId;
|
||||||
|
streamInfoResult.setRtmp(String.format("rtmp://%s:%s/%s/%s%s", addr, mediaInfo.getRtmpPort(), app, stream, callIdParam));
|
||||||
if (mediaInfo.getRtmpSSlPort() != 0) {
|
if (mediaInfo.getRtmpSSlPort() != 0) {
|
||||||
streamInfoResult.setRtmps(String.format("rtmps://%s:%s/%s/%s", addr, mediaInfo.getRtmpSSlPort(), app, stream));
|
streamInfoResult.setRtmps(String.format("rtmps://%s:%s/%s/%s%s", addr, mediaInfo.getRtmpSSlPort(), app, stream, callIdParam));
|
||||||
}
|
}
|
||||||
streamInfoResult.setRtsp(String.format("rtsp://%s:%s/%s/%s", addr, mediaInfo.getRtspPort(), app, stream));
|
streamInfoResult.setRtsp(String.format("rtsp://%s:%s/%s/%s%s", addr, mediaInfo.getRtspPort(), app, stream, callIdParam));
|
||||||
if (mediaInfo.getRtspSSLPort() != 0) {
|
if (mediaInfo.getRtspSSLPort() != 0) {
|
||||||
streamInfoResult.setRtsps(String.format("rtsps://%s:%s/%s/%s", addr, mediaInfo.getRtspSSLPort(), app, stream));
|
streamInfoResult.setRtsps(String.format("rtsps://%s:%s/%s/%s%s", addr, mediaInfo.getRtspSSLPort(), app, stream, callIdParam));
|
||||||
}
|
}
|
||||||
streamInfoResult.setFlv(String.format("http://%s:%s/%s/%s.live.flv", addr, mediaInfo.getHttpPort(), app, stream));
|
streamInfoResult.setFlv(String.format("http://%s:%s/%s/%s.live.flv%s", addr, mediaInfo.getHttpPort(), app, stream, callIdParam));
|
||||||
streamInfoResult.setWs_flv(String.format("ws://%s:%s/%s/%s.live.flv", addr, mediaInfo.getHttpPort(), app, stream));
|
streamInfoResult.setWs_flv(String.format("ws://%s:%s/%s/%s.live.flv%s", addr, mediaInfo.getHttpPort(), app, stream, callIdParam));
|
||||||
streamInfoResult.setHls(String.format("http://%s:%s/%s/%s/hls.m3u8", addr, mediaInfo.getHttpPort(), app, stream));
|
streamInfoResult.setHls(String.format("http://%s:%s/%s/%s/hls.m3u8%s", addr, mediaInfo.getHttpPort(), app, stream, callIdParam));
|
||||||
streamInfoResult.setWs_hls(String.format("ws://%s:%s/%s/%s/hls.m3u8", addr, mediaInfo.getHttpPort(), app, stream));
|
streamInfoResult.setWs_hls(String.format("ws://%s:%s/%s/%s/hls.m3u8%s", addr, mediaInfo.getHttpPort(), app, stream, callIdParam));
|
||||||
streamInfoResult.setFmp4(String.format("http://%s:%s/%s/%s.live.mp4", addr, mediaInfo.getHttpPort(), app, stream));
|
streamInfoResult.setFmp4(String.format("http://%s:%s/%s/%s.live.mp4%s", addr, mediaInfo.getHttpPort(), app, stream, callIdParam));
|
||||||
streamInfoResult.setWs_fmp4(String.format("ws://%s:%s/%s/%s.live.mp4", addr, mediaInfo.getHttpPort(), app, stream));
|
streamInfoResult.setWs_fmp4(String.format("ws://%s:%s/%s/%s.live.mp4%s", addr, mediaInfo.getHttpPort(), app, stream, callIdParam));
|
||||||
streamInfoResult.setTs(String.format("http://%s:%s/%s/%s.live.ts", addr, mediaInfo.getHttpPort(), app, stream));
|
streamInfoResult.setTs(String.format("http://%s:%s/%s/%s.live.ts%s", addr, mediaInfo.getHttpPort(), app, stream, callIdParam));
|
||||||
streamInfoResult.setWs_ts(String.format("ws://%s:%s/%s/%s.live.ts", addr, mediaInfo.getHttpPort(), app, stream));
|
streamInfoResult.setWs_ts(String.format("ws://%s:%s/%s/%s.live.ts%s", addr, mediaInfo.getHttpPort(), app, stream, callIdParam));
|
||||||
if (mediaInfo.getHttpSSlPort() != 0) {
|
if (mediaInfo.getHttpSSlPort() != 0) {
|
||||||
streamInfoResult.setHttps_flv(String.format("https://%s:%s/%s/%s.live.flv", addr, mediaInfo.getHttpSSlPort(), app, stream));
|
streamInfoResult.setHttps_flv(String.format("https://%s:%s/%s/%s.live.flv%s", addr, mediaInfo.getHttpSSlPort(), app, stream, callIdParam));
|
||||||
streamInfoResult.setWss_flv(String.format("wss://%s:%s/%s/%s.live.flv", addr, mediaInfo.getHttpSSlPort(), app, stream));
|
streamInfoResult.setWss_flv(String.format("wss://%s:%s/%s/%s.live.flv%s", addr, mediaInfo.getHttpSSlPort(), app, stream, callIdParam));
|
||||||
streamInfoResult.setHttps_hls(String.format("https://%s:%s/%s/%s/hls.m3u8", addr, mediaInfo.getHttpSSlPort(), app, stream));
|
streamInfoResult.setHttps_hls(String.format("https://%s:%s/%s/%s/hls.m3u8%s", addr, mediaInfo.getHttpSSlPort(), app, stream, callIdParam));
|
||||||
streamInfoResult.setWss_hls(String.format("wss://%s:%s/%s/%s/hls.m3u8", addr, mediaInfo.getHttpSSlPort(), app, stream));
|
streamInfoResult.setWss_hls(String.format("wss://%s:%s/%s/%s/hls.m3u8%s", addr, mediaInfo.getHttpSSlPort(), app, stream, callIdParam));
|
||||||
streamInfoResult.setHttps_fmp4(String.format("https://%s:%s/%s/%s.live.mp4", addr, mediaInfo.getHttpSSlPort(), app, stream));
|
streamInfoResult.setHttps_fmp4(String.format("https://%s:%s/%s/%s.live.mp4%s", addr, mediaInfo.getHttpSSlPort(), app, stream, callIdParam));
|
||||||
streamInfoResult.setWss_fmp4(String.format("wss://%s:%s/%s/%s.live.mp4", addr, mediaInfo.getHttpSSlPort(), app, stream));
|
streamInfoResult.setWss_fmp4(String.format("wss://%s:%s/%s/%s.live.mp4%s", addr, mediaInfo.getHttpSSlPort(), app, stream, callIdParam));
|
||||||
streamInfoResult.setHttps_ts(String.format("https://%s:%s/%s/%s.live.ts", addr, mediaInfo.getHttpSSlPort(), app, stream));
|
streamInfoResult.setHttps_ts(String.format("https://%s:%s/%s/%s.live.ts%s", addr, mediaInfo.getHttpSSlPort(), app, stream, callIdParam));
|
||||||
streamInfoResult.setWss_ts(String.format("wss://%s:%s/%s/%s.live.ts", addr, mediaInfo.getHttpSSlPort(), app, stream));
|
streamInfoResult.setWss_ts(String.format("wss://%s:%s/%s/%s.live.ts%s", addr, mediaInfo.getHttpSSlPort(), app, stream, callIdParam));
|
||||||
streamInfoResult.setWss_ts(String.format("wss://%s:%s/%s/%s.live.ts", addr, mediaInfo.getHttpSSlPort(), app, stream));
|
streamInfoResult.setWss_ts(String.format("wss://%s:%s/%s/%s.live.ts%s", addr, mediaInfo.getHttpSSlPort(), app, stream, callIdParam));
|
||||||
streamInfoResult.setRtc(String.format("https://%s:%s/index/api/webrtc?app=%s&stream=%s&type=%s", mediaInfo.getStreamIp(), mediaInfo.getHttpSSlPort(), app, stream, isPlay?"play":"push"));
|
streamInfoResult.setRtc(String.format("https://%s:%s/index/api/webrtc?app=%s&stream=%s&type=%s%s", mediaInfo.getStreamIp(), mediaInfo.getHttpSSlPort(), app, stream, isPlay?"play":"push", StringUtils.isEmpty(callId)?"":"&callId=" + callId));
|
||||||
}
|
}
|
||||||
|
|
||||||
streamInfoResult.setTracks(tracks);
|
streamInfoResult.setTracks(tracks);
|
||||||
|
|||||||
@ -637,7 +637,7 @@ public class PlayServiceImpl implements IPlayService {
|
|||||||
public StreamInfo onPublishHandler(MediaServerItem mediaServerItem, JSONObject resonse, String deviceId, String channelId) {
|
public StreamInfo onPublishHandler(MediaServerItem mediaServerItem, JSONObject resonse, String deviceId, String channelId) {
|
||||||
String streamId = resonse.getString("stream");
|
String streamId = resonse.getString("stream");
|
||||||
JSONArray tracks = resonse.getJSONArray("tracks");
|
JSONArray tracks = resonse.getJSONArray("tracks");
|
||||||
StreamInfo streamInfo = mediaService.getStreamInfoByAppAndStream(mediaServerItem,"rtp", streamId, tracks);
|
StreamInfo streamInfo = mediaService.getStreamInfoByAppAndStream(mediaServerItem,"rtp", streamId, tracks, null);
|
||||||
streamInfo.setDeviceID(deviceId);
|
streamInfo.setDeviceID(deviceId);
|
||||||
streamInfo.setChannelId(channelId);
|
streamInfo.setChannelId(channelId);
|
||||||
return streamInfo;
|
return streamInfo;
|
||||||
|
|||||||
@ -41,6 +41,7 @@ public class RedisAlarmMsgListener implements MessageListener {
|
|||||||
ParentPlatform platform = storage.queryParentPlatByServerGBId(gbId);
|
ParentPlatform platform = storage.queryParentPlatByServerGBId(gbId);
|
||||||
|
|
||||||
DeviceAlarm deviceAlarm = new DeviceAlarm();
|
DeviceAlarm deviceAlarm = new DeviceAlarm();
|
||||||
|
deviceAlarm.setCreateTime(DateUtil.getNow());
|
||||||
deviceAlarm.setChannelId(gbId);
|
deviceAlarm.setChannelId(gbId);
|
||||||
deviceAlarm.setAlarmDescription(alarmChannelMessage.getAlarmDescription());
|
deviceAlarm.setAlarmDescription(alarmChannelMessage.getAlarmDescription());
|
||||||
deviceAlarm.setAlarmMethod("" + alarmChannelMessage.getAlarmSn());
|
deviceAlarm.setAlarmMethod("" + alarmChannelMessage.getAlarmSn());
|
||||||
|
|||||||
@ -25,9 +25,6 @@ public class RedisGpsMsgListener implements MessageListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMessage(@NotNull Message message, byte[] bytes) {
|
public void onMessage(@NotNull Message message, byte[] bytes) {
|
||||||
if (logger.isDebugEnabled()) {
|
|
||||||
logger.debug("收到来自REDIS的GPS通知: {}", new String(message.getBody()));
|
|
||||||
}
|
|
||||||
GPSMsgInfo gpsMsgInfo = JSON.parseObject(message.getBody(), GPSMsgInfo.class);
|
GPSMsgInfo gpsMsgInfo = JSON.parseObject(message.getBody(), GPSMsgInfo.class);
|
||||||
redisCatchStorage.updateGpsMsgInfo(gpsMsgInfo);
|
redisCatchStorage.updateGpsMsgInfo(gpsMsgInfo);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -230,11 +230,12 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
|||||||
public boolean start(String app, String stream) {
|
public boolean start(String app, String stream) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
StreamProxyItem streamProxy = videoManagerStorager.queryStreamProxy(app, stream);
|
StreamProxyItem streamProxy = videoManagerStorager.queryStreamProxy(app, stream);
|
||||||
if (!streamProxy.isEnable() && streamProxy != null) {
|
if (!streamProxy.isEnable() ) {
|
||||||
JSONObject jsonObject = addStreamProxyToZlm(streamProxy);
|
JSONObject jsonObject = addStreamProxyToZlm(streamProxy);
|
||||||
if (jsonObject == null) {
|
if (jsonObject == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
System.out.println(jsonObject);
|
||||||
if (jsonObject.getInteger("code") == 0) {
|
if (jsonObject.getInteger("code") == 0) {
|
||||||
result = true;
|
result = true;
|
||||||
streamProxy.setEnable(true);
|
streamProxy.setEnable(true);
|
||||||
@ -250,7 +251,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
|||||||
StreamProxyItem streamProxyDto = videoManagerStorager.queryStreamProxy(app, stream);
|
StreamProxyItem streamProxyDto = videoManagerStorager.queryStreamProxy(app, stream);
|
||||||
if (streamProxyDto != null && streamProxyDto.isEnable()) {
|
if (streamProxyDto != null && streamProxyDto.isEnable()) {
|
||||||
JSONObject jsonObject = removeStreamProxyFromZlm(streamProxyDto);
|
JSONObject jsonObject = removeStreamProxyFromZlm(streamProxyDto);
|
||||||
if (jsonObject.getInteger("code") == 0) {
|
if (jsonObject != null && jsonObject.getInteger("code") == 0) {
|
||||||
streamProxyDto.setEnable(false);
|
streamProxyDto.setEnable(false);
|
||||||
result = videoManagerStorager.updateStreamProxy(streamProxyDto);
|
result = videoManagerStorager.updateStreamProxy(streamProxyDto);
|
||||||
}
|
}
|
||||||
@ -318,7 +319,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
|||||||
}
|
}
|
||||||
streamProxyMapper.deleteAutoRemoveItemByMediaServerId(mediaServerId);
|
streamProxyMapper.deleteAutoRemoveItemByMediaServerId(mediaServerId);
|
||||||
// 其他的流设置离线
|
// 其他的流设置离线
|
||||||
streamProxyMapper.updateStatusByMediaServerId(false, mediaServerId);
|
streamProxyMapper.updateStatusByMediaServerId(mediaServerId, false);
|
||||||
String type = "PULL";
|
String type = "PULL";
|
||||||
|
|
||||||
// 发送redis消息
|
// 发送redis消息
|
||||||
@ -345,7 +346,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int updateStatus(boolean status, String app, String stream) {
|
public int updateStatus(boolean status, String app, String stream) {
|
||||||
return streamProxyMapper.updateStatus(status, app, stream);
|
return streamProxyMapper.updateStatus(app, stream, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void syncPullStream(String mediaServerId){
|
private void syncPullStream(String mediaServerId){
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import com.genersoft.iot.vmp.service.IMediaServerService;
|
|||||||
import com.genersoft.iot.vmp.service.IStreamPushService;
|
import com.genersoft.iot.vmp.service.IStreamPushService;
|
||||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||||
import com.genersoft.iot.vmp.storager.dao.*;
|
import com.genersoft.iot.vmp.storager.dao.*;
|
||||||
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -37,6 +38,9 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private StreamPushMapper streamPushMapper;
|
private StreamPushMapper streamPushMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StreamProxyMapper streamProxyMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ParentPlatformMapper parentPlatformMapper;
|
private ParentPlatformMapper parentPlatformMapper;
|
||||||
|
|
||||||
@ -102,7 +106,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||||||
streamPushItem.setOriginType(item.getOriginType());
|
streamPushItem.setOriginType(item.getOriginType());
|
||||||
streamPushItem.setOriginTypeStr(item.getOriginTypeStr());
|
streamPushItem.setOriginTypeStr(item.getOriginTypeStr());
|
||||||
streamPushItem.setOriginUrl(item.getOriginUrl());
|
streamPushItem.setOriginUrl(item.getOriginUrl());
|
||||||
streamPushItem.setCreateStamp(item.getCreateStamp() * 1000);
|
streamPushItem.setCreateTime(DateUtil.getNow());
|
||||||
streamPushItem.setAliveSecond(item.getAliveSecond());
|
streamPushItem.setAliveSecond(item.getAliveSecond());
|
||||||
streamPushItem.setStatus(true);
|
streamPushItem.setStatus(true);
|
||||||
streamPushItem.setStreamType("push");
|
streamPushItem.setStreamType("push");
|
||||||
@ -127,7 +131,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||||||
public boolean saveToGB(GbStream stream) {
|
public boolean saveToGB(GbStream stream) {
|
||||||
stream.setStreamType("push");
|
stream.setStreamType("push");
|
||||||
stream.setStatus(true);
|
stream.setStatus(true);
|
||||||
stream.setCreateStamp(System.currentTimeMillis());
|
stream.setCreateTime(DateUtil.getNow());
|
||||||
int add = gbStreamMapper.add(stream);
|
int add = gbStreamMapper.add(stream);
|
||||||
|
|
||||||
// 查找开启了全部直播流共享的上级平台
|
// 查找开启了全部直播流共享的上级平台
|
||||||
@ -284,7 +288,8 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||||||
streamPushMapper.deleteWithoutGBId(mediaServerId);
|
streamPushMapper.deleteWithoutGBId(mediaServerId);
|
||||||
gbStreamMapper.deleteWithoutGBId("push", mediaServerId);
|
gbStreamMapper.deleteWithoutGBId("push", mediaServerId);
|
||||||
// 其他的流设置未启用
|
// 其他的流设置未启用
|
||||||
gbStreamMapper.updateStatusByMediaServerId(mediaServerId, false);
|
streamPushMapper.updateStatusByMediaServerId(mediaServerId, false);
|
||||||
|
streamProxyMapper.updateStatusByMediaServerId(mediaServerId, false);
|
||||||
// 发送流停止消息
|
// 发送流停止消息
|
||||||
String type = "PUSH";
|
String type = "PUSH";
|
||||||
// 发送redis消息
|
// 发送redis消息
|
||||||
@ -317,7 +322,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||||||
streamPushItem.setStreamType("push");
|
streamPushItem.setStreamType("push");
|
||||||
streamPushItem.setStatus(true);
|
streamPushItem.setStatus(true);
|
||||||
streamPushItem.setGbId("34020000004111" + gbId);
|
streamPushItem.setGbId("34020000004111" + gbId);
|
||||||
streamPushItem.setCreateStamp(System.currentTimeMillis());
|
streamPushItem.setCreateTime(DateUtil.getNow());
|
||||||
gbId ++;
|
gbId ++;
|
||||||
}
|
}
|
||||||
int limitCount = 30;
|
int limitCount = 30;
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import com.alibaba.excel.context.AnalysisContext;
|
|||||||
import com.alibaba.excel.event.AnalysisEventListener;
|
import com.alibaba.excel.event.AnalysisEventListener;
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||||
import com.genersoft.iot.vmp.service.IStreamPushService;
|
import com.genersoft.iot.vmp.service.IStreamPushService;
|
||||||
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.StreamPushExcelDto;
|
import com.genersoft.iot.vmp.vmanager.bean.StreamPushExcelDto;
|
||||||
import com.google.common.collect.BiMap;
|
import com.google.common.collect.BiMap;
|
||||||
import com.google.common.collect.HashBiMap;
|
import com.google.common.collect.HashBiMap;
|
||||||
@ -94,7 +95,7 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener<StreamPus
|
|||||||
streamPushItem.setGbId(streamPushExcelDto.getGbId());
|
streamPushItem.setGbId(streamPushExcelDto.getGbId());
|
||||||
streamPushItem.setStatus(false);
|
streamPushItem.setStatus(false);
|
||||||
streamPushItem.setStreamType("push");
|
streamPushItem.setStreamType("push");
|
||||||
streamPushItem.setCreateStamp(System.currentTimeMillis());
|
streamPushItem.setCreateTime(DateUtil.getNow());
|
||||||
streamPushItem.setMediaServerId(defaultMediaServerId);
|
streamPushItem.setMediaServerId(defaultMediaServerId);
|
||||||
streamPushItem.setName(streamPushExcelDto.getName());
|
streamPushItem.setName(streamPushExcelDto.getName());
|
||||||
streamPushItem.setOriginType(2);
|
streamPushItem.setOriginType(2);
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import com.genersoft.iot.vmp.storager.dao.UserMapper;
|
|||||||
import com.genersoft.iot.vmp.storager.dao.dto.User;
|
import com.genersoft.iot.vmp.storager.dao.dto.User;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -55,4 +56,12 @@ public class UserServiceImpl implements IUserService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkPushAuthority(String callId, String sign) {
|
||||||
|
if (StringUtils.isEmpty(callId)) {
|
||||||
|
return userMapper.checkPushAuthorityByCallId(sign).size() > 0;
|
||||||
|
}else {
|
||||||
|
return userMapper.checkPushAuthorityByCallIdAndSign(callId, sign).size() > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,9 +3,7 @@ package com.genersoft.iot.vmp.storager;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.genersoft.iot.vmp.common.StreamInfo;
|
import com.genersoft.iot.vmp.common.StreamInfo;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.MediaItem;
|
import com.genersoft.iot.vmp.media.zlm.dto.*;
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
|
||||||
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
|
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
|
||||||
import com.genersoft.iot.vmp.service.bean.MessageForPushChannel;
|
import com.genersoft.iot.vmp.service.bean.MessageForPushChannel;
|
||||||
import com.genersoft.iot.vmp.service.bean.SSRCInfo;
|
import com.genersoft.iot.vmp.service.bean.SSRCInfo;
|
||||||
@ -213,4 +211,26 @@ public interface IRedisCatchStorage {
|
|||||||
*/
|
*/
|
||||||
public boolean deviceIsOnline(String deviceId);
|
public boolean deviceIsOnline(String deviceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 存储推流的鉴权信息
|
||||||
|
* @param app 应用名
|
||||||
|
* @param stream 流
|
||||||
|
* @param streamAuthorityInfo 鉴权信息
|
||||||
|
*/
|
||||||
|
void updateStreamAuthorityInfo(String app, String stream, StreamAuthorityInfo streamAuthorityInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移除推流的鉴权信息
|
||||||
|
* @param app 应用名
|
||||||
|
* @param streamId 流
|
||||||
|
*/
|
||||||
|
void removeStreamAuthorityInfo(String app, String streamId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取推流的鉴权信息
|
||||||
|
* @param app 应用名
|
||||||
|
* @param stream 流
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
StreamAuthorityInfo getStreamAuthorityInfo(String app, String stream);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -372,14 +372,16 @@ public interface IVideoManagerStorage {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置流离线
|
* 设置流离线
|
||||||
* @param app
|
|
||||||
* @param streamId
|
|
||||||
*/
|
*/
|
||||||
int mediaOutline(String app, String streamId);
|
int mediaOffline(String app, String streamId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置流上线
|
||||||
|
*/
|
||||||
|
int mediaOnline(String app, String streamId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置平台在线/离线
|
* 设置平台在线/离线
|
||||||
* @param online
|
|
||||||
*/
|
*/
|
||||||
void updateParentPlatformStatus(String platformGbID, boolean online);
|
void updateParentPlatformStatus(String platformGbID, boolean online);
|
||||||
|
|
||||||
@ -463,5 +465,5 @@ public interface IVideoManagerStorage {
|
|||||||
|
|
||||||
List<ChannelSourceInfo> getChannelSource(String platformId, String gbId);
|
List<ChannelSourceInfo> getChannelSource(String platformId, String gbId);
|
||||||
|
|
||||||
void updateChannelPotion(String deviceId, String channelId, double longitude, double latitude);
|
void updateChannelPosition(DeviceChannel deviceChannel);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,8 +15,8 @@ import java.util.List;
|
|||||||
@Repository
|
@Repository
|
||||||
public interface DeviceAlarmMapper {
|
public interface DeviceAlarmMapper {
|
||||||
|
|
||||||
@Insert("INSERT INTO device_alarm (deviceId, channelId, alarmPriority, alarmMethod, alarmTime, alarmDescription, longitude, latitude, alarmType ) " +
|
@Insert("INSERT INTO device_alarm (deviceId, channelId, alarmPriority, alarmMethod, alarmTime, alarmDescription, longitude, latitude, alarmType , createTime ) " +
|
||||||
"VALUES ('${deviceId}', '${channelId}', '${alarmPriority}', '${alarmMethod}', '${alarmTime}', '${alarmDescription}', ${longitude}, ${latitude}, '${alarmType}')")
|
"VALUES ('${deviceId}', '${channelId}', '${alarmPriority}', '${alarmMethod}', '${alarmTime}', '${alarmDescription}', ${longitude}, ${latitude}, '${alarmType}', '${createTime}')")
|
||||||
int add(DeviceAlarm alarm);
|
int add(DeviceAlarm alarm);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -19,11 +19,11 @@ public interface DeviceChannelMapper {
|
|||||||
@Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " +
|
@Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " +
|
||||||
"address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " +
|
"address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " +
|
||||||
"ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " +
|
"ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " +
|
||||||
"longitudeWgs84, latitudeWgs84, createTime, updateTime, businessGroupId) " +
|
"longitudeWgs84, latitudeWgs84, createTime, updateTime, businessGroupId, gpsTime) " +
|
||||||
"VALUES ('${channelId}', '${deviceId}', '${name}', '${manufacture}', '${model}', '${owner}', '${civilCode}', '${block}'," +
|
"VALUES ('${channelId}', '${deviceId}', '${name}', '${manufacture}', '${model}', '${owner}', '${civilCode}', '${block}'," +
|
||||||
"'${address}', ${parental}, '${parentId}', ${safetyWay}, ${registerWay}, '${certNum}', ${certifiable}, ${errCode}, '${secrecy}', " +
|
"'${address}', ${parental}, '${parentId}', ${safetyWay}, ${registerWay}, '${certNum}', ${certifiable}, ${errCode}, '${secrecy}', " +
|
||||||
"'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status}, '${streamId}', ${longitude}, ${latitude}, ${longitudeGcj02}, " +
|
"'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status}, '${streamId}', ${longitude}, ${latitude}, ${longitudeGcj02}, " +
|
||||||
"${latitudeGcj02}, ${longitudeWgs84}, ${latitudeWgs84},'${createTime}', '${updateTime}', '${businessGroupId}')")
|
"${latitudeGcj02}, ${longitudeWgs84}, ${latitudeWgs84},'${createTime}', '${updateTime}', '${businessGroupId}', '${gpsTime}')")
|
||||||
int add(DeviceChannel channel);
|
int add(DeviceChannel channel);
|
||||||
|
|
||||||
@Update(value = {" <script>" +
|
@Update(value = {" <script>" +
|
||||||
@ -58,6 +58,7 @@ public interface DeviceChannelMapper {
|
|||||||
"<if test='longitudeWgs84 != null'>, longitudeWgs84=${longitudeWgs84}</if>" +
|
"<if test='longitudeWgs84 != null'>, longitudeWgs84=${longitudeWgs84}</if>" +
|
||||||
"<if test='latitudeWgs84 != null'>, latitudeWgs84=${latitudeWgs84}</if>" +
|
"<if test='latitudeWgs84 != null'>, latitudeWgs84=${latitudeWgs84}</if>" +
|
||||||
"<if test='businessGroupId != null'>, businessGroupId=#{businessGroupId}</if>" +
|
"<if test='businessGroupId != null'>, businessGroupId=#{businessGroupId}</if>" +
|
||||||
|
"<if test='gpsTime != null'>, gpsTime=#{gpsTime}</if>" +
|
||||||
"WHERE deviceId='${deviceId}' AND channelId='${channelId}'"+
|
"WHERE deviceId='${deviceId}' AND channelId='${channelId}'"+
|
||||||
" </script>"})
|
" </script>"})
|
||||||
int update(DeviceChannel channel);
|
int update(DeviceChannel channel);
|
||||||
@ -147,7 +148,7 @@ public interface DeviceChannelMapper {
|
|||||||
"(channelId, deviceId, name, manufacture, model, owner, civilCode, block, subCount, " +
|
"(channelId, deviceId, name, manufacture, model, owner, civilCode, block, subCount, " +
|
||||||
" address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " +
|
" address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " +
|
||||||
" ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " +
|
" ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " +
|
||||||
" longitudeWgs84, latitudeWgs84, createTime, updateTime, businessGroupId) " +
|
" longitudeWgs84, latitudeWgs84, createTime, updateTime, businessGroupId, gpsTime) " +
|
||||||
"values " +
|
"values " +
|
||||||
"<foreach collection='addChannels' index='index' item='item' separator=','> " +
|
"<foreach collection='addChannels' index='index' item='item' separator=','> " +
|
||||||
"('${item.channelId}', '${item.deviceId}', '${item.name}', '${item.manufacture}', '${item.model}', " +
|
"('${item.channelId}', '${item.deviceId}', '${item.name}', '${item.manufacture}', '${item.model}', " +
|
||||||
@ -157,7 +158,7 @@ public interface DeviceChannelMapper {
|
|||||||
"'${item.ipAddress}', ${item.port}, '${item.password}', ${item.PTZType}, ${item.status}, " +
|
"'${item.ipAddress}', ${item.port}, '${item.password}', ${item.PTZType}, ${item.status}, " +
|
||||||
"'${item.streamId}', ${item.longitude}, ${item.latitude},${item.longitudeGcj02}, " +
|
"'${item.streamId}', ${item.longitude}, ${item.latitude},${item.longitudeGcj02}, " +
|
||||||
"${item.latitudeGcj02},${item.longitudeWgs84}, ${item.latitudeWgs84},'${item.createTime}', '${item.updateTime}', " +
|
"${item.latitudeGcj02},${item.longitudeWgs84}, ${item.latitudeWgs84},'${item.createTime}', '${item.updateTime}', " +
|
||||||
"'${item.businessGroupId}') " +
|
"'${item.businessGroupId}', '${item.gpsTime}') " +
|
||||||
"</foreach> " +
|
"</foreach> " +
|
||||||
"ON DUPLICATE KEY UPDATE " +
|
"ON DUPLICATE KEY UPDATE " +
|
||||||
"updateTime=VALUES(updateTime), " +
|
"updateTime=VALUES(updateTime), " +
|
||||||
@ -189,7 +190,8 @@ public interface DeviceChannelMapper {
|
|||||||
"latitudeGcj02=VALUES(latitudeGcj02), " +
|
"latitudeGcj02=VALUES(latitudeGcj02), " +
|
||||||
"longitudeWgs84=VALUES(longitudeWgs84), " +
|
"longitudeWgs84=VALUES(longitudeWgs84), " +
|
||||||
"latitudeWgs84=VALUES(latitudeWgs84), " +
|
"latitudeWgs84=VALUES(latitudeWgs84), " +
|
||||||
"businessGroupId=VALUES(businessGroupId) " +
|
"businessGroupId=VALUES(businessGroupId), " +
|
||||||
|
"gpsTime=VALUES(gpsTime)" +
|
||||||
"</script>")
|
"</script>")
|
||||||
int batchAdd(List<DeviceChannel> addChannels);
|
int batchAdd(List<DeviceChannel> addChannels);
|
||||||
|
|
||||||
@ -228,6 +230,7 @@ public interface DeviceChannelMapper {
|
|||||||
"<if test='item.longitudeWgs84 != null'>, longitudeWgs84=${item.longitudeWgs84}</if>" +
|
"<if test='item.longitudeWgs84 != null'>, longitudeWgs84=${item.longitudeWgs84}</if>" +
|
||||||
"<if test='item.latitudeWgs84 != null'>, latitudeWgs84=${item.latitudeWgs84}</if>" +
|
"<if test='item.latitudeWgs84 != null'>, latitudeWgs84=${item.latitudeWgs84}</if>" +
|
||||||
"<if test='item.businessGroupId != null'>, businessGroupId=#{item.businessGroupId}</if>" +
|
"<if test='item.businessGroupId != null'>, businessGroupId=#{item.businessGroupId}</if>" +
|
||||||
|
"<if test='item.gpsTime != null'>, gpsTime=#{item.gpsTime}</if>" +
|
||||||
"WHERE deviceId='${item.deviceId}' AND channelId='${item.channelId}'"+
|
"WHERE deviceId='${item.deviceId}' AND channelId='${item.channelId}'"+
|
||||||
"</foreach>" +
|
"</foreach>" +
|
||||||
"</script>"})
|
"</script>"})
|
||||||
@ -276,8 +279,20 @@ public interface DeviceChannelMapper {
|
|||||||
" and channelId = #{channelId}")
|
" and channelId = #{channelId}")
|
||||||
int updateChannelSubCount(String deviceId, String channelId);
|
int updateChannelSubCount(String deviceId, String channelId);
|
||||||
|
|
||||||
@Update(value = {"UPDATE device_channel SET latitude=${latitude}, longitude=${longitude} WHERE deviceId=#{deviceId} AND channelId=#{channelId}"})
|
@Update(value = {" <script>" +
|
||||||
void updatePotion(String deviceId, String channelId, double longitude, double latitude);
|
"UPDATE device_channel " +
|
||||||
|
"SET " +
|
||||||
|
"latitude=${latitude}, " +
|
||||||
|
"longitude=${longitude}, " +
|
||||||
|
"longitudeGcj02=${longitudeGcj02}, " +
|
||||||
|
"latitudeGcj02=${latitudeGcj02}, " +
|
||||||
|
"longitudeWgs84=${longitudeWgs84}, " +
|
||||||
|
"latitudeWgs84=${latitudeWgs84}, " +
|
||||||
|
"gpsTime='${gpsTime}' " +
|
||||||
|
"WHERE deviceId=#{deviceId} " +
|
||||||
|
" <if test='channelId != null' > AND channelId=#{channelId}</if>" +
|
||||||
|
" </script>"})
|
||||||
|
void updatePosition(DeviceChannel deviceChannel);
|
||||||
|
|
||||||
@Select("SELECT * FROM device_channel WHERE length(trim(streamId)) > 0")
|
@Select("SELECT * FROM device_channel WHERE length(trim(streamId)) > 0")
|
||||||
List<DeviceChannel> getAllChannelInPlay();
|
List<DeviceChannel> getAllChannelInPlay();
|
||||||
@ -313,4 +328,6 @@ public interface DeviceChannelMapper {
|
|||||||
|
|
||||||
@Select("select * from device_channel where deviceId=#{deviceId} and SUBSTRING(channelId, 11, 3)=#{typeCode}")
|
@Select("select * from device_channel where deviceId=#{deviceId} and SUBSTRING(channelId, 11, 3)=#{typeCode}")
|
||||||
List<DeviceChannel> getBusinessGroups(String deviceId, String typeCode);
|
List<DeviceChannel> getBusinessGroups(String deviceId, String typeCode);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,19 +4,18 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.MobilePosition;
|
import com.genersoft.iot.vmp.gb28181.bean.MobilePosition;
|
||||||
import org.apache.ibatis.annotations.*;
|
import org.apache.ibatis.annotations.*;
|
||||||
//import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
//@Repository
|
|
||||||
public interface DeviceMobilePositionMapper {
|
public interface DeviceMobilePositionMapper {
|
||||||
|
|
||||||
@Insert("INSERT INTO device_mobile_position (deviceId,channelId, deviceName, time, longitude, latitude, altitude, speed, direction, reportSource, geodeticSystem, cnLng, cnLat) " +
|
@Insert("INSERT INTO device_mobile_position (deviceId,channelId, deviceName, time, longitude, latitude, altitude, speed, direction, reportSource, longitudeGcj02, latitudeGcj02, longitudeWgs84, latitudeWgs84, createTime) " +
|
||||||
"VALUES ('${deviceId}','${channelId}', '${deviceName}', '${time}', ${longitude}, ${latitude}, ${altitude}, ${speed}, ${direction}, '${reportSource}', '${geodeticSystem}', '${cnLng}', '${cnLat}')")
|
"VALUES ('${deviceId}','${channelId}', '${deviceName}', '${time}', ${longitude}, ${latitude}, ${altitude}, ${speed}, ${direction}, '${reportSource}', ${longitudeGcj02}, ${latitudeGcj02}, ${longitudeWgs84}, ${latitudeWgs84}, '${createTime}')")
|
||||||
int insertNewPosition(MobilePosition mobilePosition);
|
int insertNewPosition(MobilePosition mobilePosition);
|
||||||
|
|
||||||
@Select(value = {" <script>" +
|
@Select(value = {" <script>" +
|
||||||
"SELECT * FROM device_mobile_position" +
|
"SELECT * FROM device_mobile_position" +
|
||||||
" WHERE deviceId = #{deviceId} and channelId = #{channelId} " +
|
" WHERE deviceId = #{deviceId}" +
|
||||||
|
"<if test=\"channelId != null\"> and channelId = #{channelId}</if>" +
|
||||||
"<if test=\"startTime != null\"> AND time>=#{startTime}</if>" +
|
"<if test=\"startTime != null\"> AND time>=#{startTime}</if>" +
|
||||||
"<if test=\"endTime != null\"> AND time<=#{endTime}</if>" +
|
"<if test=\"endTime != null\"> AND time<=#{endTime}</if>" +
|
||||||
" ORDER BY time ASC" +
|
" ORDER BY time ASC" +
|
||||||
|
|||||||
@ -15,10 +15,10 @@ import java.util.List;
|
|||||||
public interface GbStreamMapper {
|
public interface GbStreamMapper {
|
||||||
|
|
||||||
@Insert("REPLACE INTO gb_stream (app, stream, gbId, name, " +
|
@Insert("REPLACE INTO gb_stream (app, stream, gbId, name, " +
|
||||||
"longitude, latitude, streamType, mediaServerId, status, createStamp) VALUES" +
|
"longitude, latitude, streamType, mediaServerId, status, createTime) VALUES" +
|
||||||
"('${app}', '${stream}', '${gbId}', '${name}', " +
|
"('${app}', '${stream}', '${gbId}', '${name}', " +
|
||||||
"'${longitude}', '${latitude}', '${streamType}', " +
|
"'${longitude}', '${latitude}', '${streamType}', " +
|
||||||
"'${mediaServerId}', ${status}, ${createStamp})")
|
"'${mediaServerId}', ${status}, '${createTime}')")
|
||||||
@Options(useGeneratedKeys = true, keyProperty = "gbStreamId", keyColumn = "gbStreamId")
|
@Options(useGeneratedKeys = true, keyProperty = "gbStreamId", keyColumn = "gbStreamId")
|
||||||
int add(GbStream gbStream);
|
int add(GbStream gbStream);
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ public interface GbStreamMapper {
|
|||||||
List<GbStream> selectAll(String platformId, String catalogId, String query, Boolean pushing, String mediaServerId);
|
List<GbStream> selectAll(String platformId, String catalogId, String query, Boolean pushing, String mediaServerId);
|
||||||
|
|
||||||
@Select("SELECT * FROM gb_stream WHERE app=#{app} AND stream=#{stream}")
|
@Select("SELECT * FROM gb_stream WHERE app=#{app} AND stream=#{stream}")
|
||||||
StreamProxyItem selectOne(String app, String stream);
|
GbStream selectOne(String app, String stream);
|
||||||
|
|
||||||
@Select("SELECT * FROM gb_stream WHERE gbId=#{gbId}")
|
@Select("SELECT * FROM gb_stream WHERE gbId=#{gbId}")
|
||||||
List<GbStream> selectByGBId(String gbId);
|
List<GbStream> selectByGBId(String gbId);
|
||||||
@ -88,16 +88,6 @@ public interface GbStreamMapper {
|
|||||||
"ON gs.gbStreamId = pgs.gbStreamId WHERE pgs.gbStreamId is NULL")
|
"ON gs.gbStreamId = pgs.gbStreamId WHERE pgs.gbStreamId is NULL")
|
||||||
List<GbStream> queryStreamNotInPlatform();
|
List<GbStream> queryStreamNotInPlatform();
|
||||||
|
|
||||||
@Update("UPDATE gb_stream " +
|
|
||||||
"SET status=${status} " +
|
|
||||||
"WHERE app=#{app} AND stream=#{stream}")
|
|
||||||
int setStatus(String app, String stream, boolean status);
|
|
||||||
|
|
||||||
@Update("UPDATE gb_stream " +
|
|
||||||
"SET status=${status} " +
|
|
||||||
"WHERE mediaServerId=#{mediaServerId} ")
|
|
||||||
void updateStatusByMediaServerId(String mediaServerId, boolean status);
|
|
||||||
|
|
||||||
@Delete("DELETE FROM gb_stream WHERE streamType=#{type} AND gbId=NULL AND mediaServerId=#{mediaServerId}")
|
@Delete("DELETE FROM gb_stream WHERE streamType=#{type} AND gbId=NULL AND mediaServerId=#{mediaServerId}")
|
||||||
void deleteWithoutGBId(String type, String mediaServerId);
|
void deleteWithoutGBId(String type, String mediaServerId);
|
||||||
|
|
||||||
@ -120,12 +110,12 @@ public interface GbStreamMapper {
|
|||||||
@Insert("<script> " +
|
@Insert("<script> " +
|
||||||
"INSERT IGNORE into gb_stream " +
|
"INSERT IGNORE into gb_stream " +
|
||||||
"(app, stream, gbId, name, " +
|
"(app, stream, gbId, name, " +
|
||||||
"longitude, latitude, streamType, mediaServerId, status, createStamp)" +
|
"longitude, latitude, streamType, mediaServerId, status, createTime)" +
|
||||||
"values " +
|
"values " +
|
||||||
"<foreach collection='subList' index='index' item='item' separator=','> " +
|
"<foreach collection='subList' index='index' item='item' separator=','> " +
|
||||||
"('${item.app}', '${item.stream}', '${item.gbId}', '${item.name}', " +
|
"('${item.app}', '${item.stream}', '${item.gbId}', '${item.name}', " +
|
||||||
"'${item.longitude}', '${item.latitude}', '${item.streamType}', " +
|
"'${item.longitude}', '${item.latitude}', '${item.streamType}', " +
|
||||||
"'${item.mediaServerId}', ${item.status}, ${item.createStamp}) "+
|
"'${item.mediaServerId}', ${item.status}, '${item.createTime}') "+
|
||||||
"</foreach> " +
|
"</foreach> " +
|
||||||
"</script>")
|
"</script>")
|
||||||
@Options(useGeneratedKeys = true, keyProperty = "gbStreamId", keyColumn = "gbStreamId")
|
@Options(useGeneratedKeys = true, keyProperty = "gbStreamId", keyColumn = "gbStreamId")
|
||||||
|
|||||||
@ -16,10 +16,10 @@ public interface ParentPlatformMapper {
|
|||||||
|
|
||||||
@Insert("INSERT INTO parent_platform (enable, name, serverGBId, serverGBDomain, serverIP, serverPort, deviceGBId, deviceIp, " +
|
@Insert("INSERT INTO parent_platform (enable, name, serverGBId, serverGBDomain, serverIP, serverPort, deviceGBId, deviceIp, " +
|
||||||
" devicePort, username, password, expires, keepTimeout, transport, characterSet, ptz, rtcp, " +
|
" devicePort, username, password, expires, keepTimeout, transport, characterSet, ptz, rtcp, " +
|
||||||
" status, shareAllLiveStream, startOfflinePush, catalogId, administrativeDivision, catalogGroup) " +
|
" status, shareAllLiveStream, startOfflinePush, catalogId, administrativeDivision, catalogGroup, createTime, updateTime) " +
|
||||||
" VALUES (${enable}, '${name}', '${serverGBId}', '${serverGBDomain}', '${serverIP}', ${serverPort}, '${deviceGBId}', '${deviceIp}', " +
|
" VALUES (${enable}, '${name}', '${serverGBId}', '${serverGBDomain}', '${serverIP}', ${serverPort}, '${deviceGBId}', '${deviceIp}', " +
|
||||||
" '${devicePort}', '${username}', '${password}', '${expires}', '${keepTimeout}', '${transport}', '${characterSet}', ${ptz}, ${rtcp}, " +
|
" '${devicePort}', '${username}', '${password}', '${expires}', '${keepTimeout}', '${transport}', '${characterSet}', ${ptz}, ${rtcp}, " +
|
||||||
" ${status}, ${shareAllLiveStream}, ${startOfflinePush}, #{catalogId}, #{administrativeDivision}, #{catalogGroup})")
|
" ${status}, ${shareAllLiveStream}, ${startOfflinePush}, #{catalogId}, #{administrativeDivision}, #{catalogGroup}, #{createTime}, #{updateTime})")
|
||||||
int addParentPlatform(ParentPlatform parentPlatform);
|
int addParentPlatform(ParentPlatform parentPlatform);
|
||||||
|
|
||||||
@Update("UPDATE parent_platform " +
|
@Update("UPDATE parent_platform " +
|
||||||
@ -45,6 +45,8 @@ public interface ParentPlatformMapper {
|
|||||||
"startOfflinePush=${startOfflinePush}, " +
|
"startOfflinePush=${startOfflinePush}, " +
|
||||||
"catalogGroup=#{catalogGroup}, " +
|
"catalogGroup=#{catalogGroup}, " +
|
||||||
"administrativeDivision=#{administrativeDivision}, " +
|
"administrativeDivision=#{administrativeDivision}, " +
|
||||||
|
"createTime=#{createTime}, " +
|
||||||
|
"updateTime=#{updateTime}, " +
|
||||||
"catalogId=#{catalogId} " +
|
"catalogId=#{catalogId} " +
|
||||||
"WHERE id=#{id}")
|
"WHERE id=#{id}")
|
||||||
int updateParentPlatform(ParentPlatform parentPlatform);
|
int updateParentPlatform(ParentPlatform parentPlatform);
|
||||||
@ -86,10 +88,10 @@ public interface ParentPlatformMapper {
|
|||||||
|
|
||||||
@Update(value = {" <script>" +
|
@Update(value = {" <script>" +
|
||||||
"UPDATE parent_platform " +
|
"UPDATE parent_platform " +
|
||||||
"SET catalogId=#{catalogId}" +
|
"SET catalogId=#{catalogId}, updateTime=#{updateTime}" +
|
||||||
"WHERE serverGBId=#{platformId}"+
|
"WHERE serverGBId=#{platformId}"+
|
||||||
"</script>"})
|
"</script>"})
|
||||||
int setDefaultCatalog(String platformId, String catalogId);
|
int setDefaultCatalog(String platformId, String catalogId, String updateTime);
|
||||||
|
|
||||||
@Select("select 'channel' as name, count(pgc.platformId) count from platform_gb_channel pgc left join device_channel dc on dc.id = pgc.deviceChannelId where pgc.platformId=#{platformId} and dc.channelId =#{gbId} " +
|
@Select("select 'channel' as name, count(pgc.platformId) count from platform_gb_channel pgc left join device_channel dc on dc.id = pgc.deviceChannelId where pgc.platformId=#{platformId} and dc.channelId =#{gbId} " +
|
||||||
"union " +
|
"union " +
|
||||||
|
|||||||
@ -62,12 +62,12 @@ public interface StreamProxyMapper {
|
|||||||
@Update("UPDATE stream_proxy " +
|
@Update("UPDATE stream_proxy " +
|
||||||
"SET status=#{status} " +
|
"SET status=#{status} " +
|
||||||
"WHERE mediaServerId=#{mediaServerId}")
|
"WHERE mediaServerId=#{mediaServerId}")
|
||||||
void updateStatusByMediaServerId(boolean status, String mediaServerId);
|
void updateStatusByMediaServerId(String mediaServerId, boolean status);
|
||||||
|
|
||||||
@Update("UPDATE stream_proxy " +
|
@Update("UPDATE stream_proxy " +
|
||||||
"SET status=${status} " +
|
"SET status=${status} " +
|
||||||
"WHERE app=#{app} AND stream=#{stream}")
|
"WHERE app=#{app} AND stream=#{stream}")
|
||||||
int updateStatus(boolean status, String app, String stream);
|
int updateStatus(String app, String stream, boolean status);
|
||||||
|
|
||||||
@Delete("DELETE FROM stream_proxy WHERE enable_remove_none_reader=true AND mediaServerId=#{mediaServerId}")
|
@Delete("DELETE FROM stream_proxy WHERE enable_remove_none_reader=true AND mediaServerId=#{mediaServerId}")
|
||||||
void deleteAutoRemoveItemByMediaServerId(String mediaServerId);
|
void deleteAutoRemoveItemByMediaServerId(String mediaServerId);
|
||||||
|
|||||||
@ -14,21 +14,23 @@ import java.util.List;
|
|||||||
public interface StreamPushMapper {
|
public interface StreamPushMapper {
|
||||||
|
|
||||||
@Insert("INSERT INTO stream_push (app, stream, totalReaderCount, originType, originTypeStr, " +
|
@Insert("INSERT INTO stream_push (app, stream, totalReaderCount, originType, originTypeStr, " +
|
||||||
"createStamp, aliveSecond, mediaServerId, serverId) VALUES" +
|
"pushTime, aliveSecond, mediaServerId, serverId, updateTime, createTime) VALUES" +
|
||||||
"('${app}', '${stream}', '${totalReaderCount}', '${originType}', '${originTypeStr}', " +
|
"('${app}', '${stream}', '${totalReaderCount}', '${originType}', '${originTypeStr}', " +
|
||||||
"'${createStamp}', '${aliveSecond}', '${mediaServerId}' , '${serverId}' )")
|
"'${pushTime}', '${aliveSecond}', '${mediaServerId}' , '${serverId}' , '${updateTime}' , '${createTime}' )")
|
||||||
int add(StreamPushItem streamPushItem);
|
int add(StreamPushItem streamPushItem);
|
||||||
|
|
||||||
@Update("UPDATE stream_push " +
|
|
||||||
"SET app=#{app}," +
|
@Update(value = {" <script>" +
|
||||||
"stream=#{stream}," +
|
"UPDATE stream_push " +
|
||||||
"mediaServerId=#{mediaServerId}," +
|
"SET updateTime='${updateTime}'" +
|
||||||
"totalReaderCount=#{totalReaderCount}, " +
|
"<if test=\"mediaServerId != null\">, mediaServerId='${mediaServerId}'</if>" +
|
||||||
"originType=#{originType}," +
|
"<if test=\"totalReaderCount != null\">, totalReaderCount='${totalReaderCount}'</if>" +
|
||||||
"originTypeStr=#{originTypeStr}, " +
|
"<if test=\"originType != null\">, originType=${originType}</if>" +
|
||||||
"createStamp=#{createStamp}, " +
|
"<if test=\"originTypeStr != null\">, originTypeStr='${originTypeStr}'</if>" +
|
||||||
"aliveSecond=#{aliveSecond} " +
|
"<if test=\"pushTime != null\">, pushTime='${pushTime}'</if>" +
|
||||||
"WHERE app=#{app} AND stream=#{stream}")
|
"<if test=\"aliveSecond != null\">, aliveSecond='${aliveSecond}'</if>" +
|
||||||
|
"WHERE app=#{app} AND stream=#{stream}"+
|
||||||
|
" </script>"})
|
||||||
int update(StreamPushItem streamPushItem);
|
int update(StreamPushItem streamPushItem);
|
||||||
|
|
||||||
@Delete("DELETE FROM stream_push WHERE app=#{app} AND stream=#{stream}")
|
@Delete("DELETE FROM stream_push WHERE app=#{app} AND stream=#{stream}")
|
||||||
@ -62,7 +64,7 @@ public interface StreamPushMapper {
|
|||||||
@Select(value = {" <script>" +
|
@Select(value = {" <script>" +
|
||||||
"SELECT " +
|
"SELECT " +
|
||||||
"st.*, " +
|
"st.*, " +
|
||||||
"gs.gbId, gs.status, gs.name, gs.longitude, gs.latitude, gs.gbStreamId " +
|
"gs.gbId, gs.name, gs.longitude, gs.latitude, gs.gbStreamId " +
|
||||||
"from " +
|
"from " +
|
||||||
"stream_push st " +
|
"stream_push st " +
|
||||||
"LEFT JOIN gb_stream gs " +
|
"LEFT JOIN gb_stream gs " +
|
||||||
@ -70,25 +72,25 @@ public interface StreamPushMapper {
|
|||||||
"WHERE " +
|
"WHERE " +
|
||||||
"1=1 " +
|
"1=1 " +
|
||||||
" <if test='query != null'> AND (st.app LIKE '%${query}%' OR st.stream LIKE '%${query}%' OR gs.gbId LIKE '%${query}%' OR gs.name LIKE '%${query}%')</if> " +
|
" <if test='query != null'> AND (st.app LIKE '%${query}%' OR st.stream LIKE '%${query}%' OR gs.gbId LIKE '%${query}%' OR gs.name LIKE '%${query}%')</if> " +
|
||||||
" <if test='pushing == true' > AND (gs.gbId is null OR gs.status=1)</if>" +
|
" <if test='pushing == true' > AND (gs.gbId is null OR st.status=1)</if>" +
|
||||||
" <if test='pushing == false' > AND gs.status=0</if>" +
|
" <if test='pushing == false' > AND st.status=0</if>" +
|
||||||
" <if test='mediaServerId != null' > AND st.mediaServerId=#{mediaServerId} </if>" +
|
" <if test='mediaServerId != null' > AND st.mediaServerId=#{mediaServerId} </if>" +
|
||||||
"order by st.createStamp desc" +
|
"order by st.createTime desc" +
|
||||||
" </script>"})
|
" </script>"})
|
||||||
List<StreamPushItem> selectAllForList(String query, Boolean pushing, String mediaServerId);
|
List<StreamPushItem> selectAllForList(String query, Boolean pushing, String mediaServerId);
|
||||||
|
|
||||||
@Select("SELECT st.*, gs.gbId, gs.status, gs.name, gs.longitude, gs.latitude FROM stream_push st LEFT JOIN gb_stream gs on st.app = gs.app AND st.stream = gs.stream order by st.createStamp desc")
|
@Select("SELECT st.*, gs.gbId, gs.name, gs.longitude, gs.latitude FROM stream_push st LEFT JOIN gb_stream gs on st.app = gs.app AND st.stream = gs.stream order by st.createTime desc")
|
||||||
List<StreamPushItem> selectAll();
|
List<StreamPushItem> selectAll();
|
||||||
|
|
||||||
@Select("SELECT st.*, gs.gbId, gs.status, gs.name, gs.longitude, gs.latitude FROM stream_push st LEFT JOIN gb_stream gs on st.app = gs.app AND st.stream = gs.stream WHERE st.app=#{app} AND st.stream=#{stream}")
|
@Select("SELECT st.*, gs.gbId, gs.name, gs.longitude, gs.latitude FROM stream_push st LEFT JOIN gb_stream gs on st.app = gs.app AND st.stream = gs.stream WHERE st.app=#{app} AND st.stream=#{stream}")
|
||||||
StreamPushItem selectOne(String app, String stream);
|
StreamPushItem selectOne(String app, String stream);
|
||||||
|
|
||||||
@Insert("<script>" +
|
@Insert("<script>" +
|
||||||
"Insert IGNORE INTO stream_push (app, stream, totalReaderCount, originType, originTypeStr, " +
|
"Insert IGNORE INTO stream_push (app, stream, totalReaderCount, originType, originTypeStr, " +
|
||||||
"createStamp, aliveSecond, mediaServerId) " +
|
"createTime, aliveSecond, mediaServerId) " +
|
||||||
"VALUES <foreach collection='streamPushItems' item='item' index='index' separator=','>" +
|
"VALUES <foreach collection='streamPushItems' item='item' index='index' separator=','>" +
|
||||||
"( '${item.app}', '${item.stream}', '${item.totalReaderCount}', #{item.originType}, " +
|
"( '${item.app}', '${item.stream}', '${item.totalReaderCount}', #{item.originType}, " +
|
||||||
"'${item.originTypeStr}',#{item.createStamp}, #{item.aliveSecond}, '${item.mediaServerId}' )" +
|
"'${item.originTypeStr}',#{item.createTime}, #{item.aliveSecond}, '${item.mediaServerId}' )" +
|
||||||
" </foreach>" +
|
" </foreach>" +
|
||||||
"</script>")
|
"</script>")
|
||||||
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
|
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
|
||||||
@ -106,4 +108,13 @@ public interface StreamPushMapper {
|
|||||||
@Select("SELECT sp.* FROM stream_push sp left join gb_stream gs on gs.app = sp.app and gs.stream= sp.stream WHERE sp.mediaServerId=#{mediaServerId} and gs.gbId is null")
|
@Select("SELECT sp.* FROM stream_push sp left join gb_stream gs on gs.app = sp.app and gs.stream= sp.stream WHERE sp.mediaServerId=#{mediaServerId} and gs.gbId is null")
|
||||||
List<StreamPushItem> selectAllByMediaServerIdWithOutGbID(String mediaServerId);
|
List<StreamPushItem> selectAllByMediaServerIdWithOutGbID(String mediaServerId);
|
||||||
|
|
||||||
|
@Update("UPDATE stream_push " +
|
||||||
|
"SET status=${status} " +
|
||||||
|
"WHERE app=#{app} AND stream=#{stream}")
|
||||||
|
int updateStatus(String app, String stream, boolean status);
|
||||||
|
|
||||||
|
@Update("UPDATE stream_push " +
|
||||||
|
"SET status=#{status} " +
|
||||||
|
"WHERE mediaServerId=#{mediaServerId}")
|
||||||
|
void updateStatusByMediaServerId(String mediaServerId, boolean status);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,13 +10,14 @@ import java.util.List;
|
|||||||
@Repository
|
@Repository
|
||||||
public interface UserMapper {
|
public interface UserMapper {
|
||||||
|
|
||||||
@Insert("INSERT INTO user (username, password, roleId, createTime, updateTime) VALUES" +
|
@Insert("INSERT INTO user (username, password, roleId, pushKey, createTime, updateTime) VALUES" +
|
||||||
"('${username}', '${password}', '${role.id}', '${createTime}', '${updateTime}')")
|
"('${username}', '${password}', '${role.id}', '${pushKey}', '${createTime}', '${updateTime}')")
|
||||||
int add(User user);
|
int add(User user);
|
||||||
|
|
||||||
@Update(value = {" <script>" +
|
@Update(value = {" <script>" +
|
||||||
"UPDATE user " +
|
"UPDATE user " +
|
||||||
"SET updateTime='${updateTime}' " +
|
"SET updateTime='${updateTime}' " +
|
||||||
|
"<if test=\"pushKey != null\">, pushKey='${pushKey}'</if>" +
|
||||||
"<if test=\"role != null\">, roleId='${role.id}'</if>" +
|
"<if test=\"role != null\">, roleId='${role.id}'</if>" +
|
||||||
"<if test=\"password != null\">, password='${password}'</if>" +
|
"<if test=\"password != null\">, password='${password}'</if>" +
|
||||||
"<if test=\"username != null\">, username='${username}'</if>" +
|
"<if test=\"username != null\">, username='${username}'</if>" +
|
||||||
@ -48,4 +49,10 @@ public interface UserMapper {
|
|||||||
@Select("select u.*, r.id as roleID, r.name as roleName, r.authority as roleAuthority , r.createTime as roleCreateTime , r.updateTime as roleUpdateTime FROM user u, user_role r WHERE u.roleId=r.id")
|
@Select("select u.*, r.id as roleID, r.name as roleName, r.authority as roleAuthority , r.createTime as roleCreateTime , r.updateTime as roleUpdateTime FROM user u, user_role r WHERE u.roleId=r.id")
|
||||||
@ResultMap(value="roleMap")
|
@ResultMap(value="roleMap")
|
||||||
List<User> selectAll();
|
List<User> selectAll();
|
||||||
|
|
||||||
|
@Select("select * from (select user.*, concat('${callId}_', pushKey) as str1 from user) as u where md5(u.str1) = '${sign}'")
|
||||||
|
List<User> checkPushAuthorityByCallIdAndSign(String callId, String sign);
|
||||||
|
|
||||||
|
@Select("select * from user where md5(pushKey) = '${sign}'")
|
||||||
|
List<User> checkPushAuthorityByCallId(String sign);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ public class User {
|
|||||||
private String password;
|
private String password;
|
||||||
private String createTime;
|
private String createTime;
|
||||||
private String updateTime;
|
private String updateTime;
|
||||||
|
private String pushKey;
|
||||||
private Role role;
|
private Role role;
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
@ -56,4 +57,12 @@ public class User {
|
|||||||
public void setRole(Role role) {
|
public void setRole(Role role) {
|
||||||
this.role = role;
|
this.role = role;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPushKey() {
|
||||||
|
return pushKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPushKey(String pushKey) {
|
||||||
|
this.pushKey = pushKey;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,8 @@ import com.genersoft.iot.vmp.conf.UserSetting;
|
|||||||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.MediaItem;
|
import com.genersoft.iot.vmp.media.zlm.dto.MediaItem;
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
||||||
|
import com.genersoft.iot.vmp.media.zlm.dto.OnPublishHookParam;
|
||||||
|
import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo;
|
||||||
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
|
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
|
||||||
import com.genersoft.iot.vmp.service.bean.MessageForPushChannel;
|
import com.genersoft.iot.vmp.service.bean.MessageForPushChannel;
|
||||||
import com.genersoft.iot.vmp.service.bean.ThirdPartyGB;
|
import com.genersoft.iot.vmp.service.bean.ThirdPartyGB;
|
||||||
@ -20,6 +22,7 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@ -598,6 +601,26 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateStreamAuthorityInfo(String app, String stream, StreamAuthorityInfo streamAuthorityInfo) {
|
||||||
|
String key = VideoManagerConstants.MEDIA_STREAM_AUTHORITY + userSetting.getServerId() + "_" + app+ "_" + stream;
|
||||||
|
redis.set(key, streamAuthorityInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeStreamAuthorityInfo(String app, String stream) {
|
||||||
|
String key = VideoManagerConstants.MEDIA_STREAM_AUTHORITY + userSetting.getServerId() + "_" + app+ "_" + stream ;
|
||||||
|
redis.del(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StreamAuthorityInfo getStreamAuthorityInfo(String app, String stream) {
|
||||||
|
String key = VideoManagerConstants.MEDIA_STREAM_AUTHORITY + userSetting.getServerId() + "_" + app+ "_" + stream ;
|
||||||
|
return (StreamAuthorityInfo) redis.get(key);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MediaItem getStreamInfo(String app, String streamId, String mediaServerId) {
|
public MediaItem getStreamInfo(String app, String streamId, String mediaServerId) {
|
||||||
String scanKey = VideoManagerConstants.WVP_SERVER_STREAM_PREFIX + userSetting.getServerId() + "_*_" + app + "_" + streamId + "_" + mediaServerId;
|
String scanKey = VideoManagerConstants.WVP_SERVER_STREAM_PREFIX + userSetting.getServerId() + "_*_" + app + "_" + streamId + "_" + mediaServerId;
|
||||||
@ -682,4 +705,6 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
|||||||
public boolean deviceIsOnline(String deviceId) {
|
public boolean deviceIsOnline(String deviceId) {
|
||||||
return getDevice(deviceId).getOnline() == 1;
|
return getDevice(deviceId).getOnline() == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -472,6 +472,9 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public synchronized boolean insertMobilePosition(MobilePosition mobilePosition) {
|
public synchronized boolean insertMobilePosition(MobilePosition mobilePosition) {
|
||||||
|
if (mobilePosition.getDeviceId().equals(mobilePosition.getChannelId())) {
|
||||||
|
mobilePosition.setChannelId(null);
|
||||||
|
}
|
||||||
return deviceMobilePositionMapper.insertNewPosition(mobilePosition) > 0;
|
return deviceMobilePositionMapper.insertNewPosition(mobilePosition) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -711,7 +714,6 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
|||||||
streamProxyItem.setStatus(true);
|
streamProxyItem.setStatus(true);
|
||||||
String now = DateUtil.getNow();
|
String now = DateUtil.getNow();
|
||||||
streamProxyItem.setCreateTime(now);
|
streamProxyItem.setCreateTime(now);
|
||||||
streamProxyItem.setCreateStamp(System.currentTimeMillis());
|
|
||||||
try {
|
try {
|
||||||
if (streamProxyMapper.add(streamProxyItem) > 0) {
|
if (streamProxyMapper.add(streamProxyItem) > 0) {
|
||||||
if (!StringUtils.isEmpty(streamProxyItem.getGbId())) {
|
if (!StringUtils.isEmpty(streamProxyItem.getGbId())) {
|
||||||
@ -846,7 +848,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
|||||||
streamPushMapper.addAll(streamPushItems);
|
streamPushMapper.addAll(streamPushItems);
|
||||||
// TODO 待优化
|
// TODO 待优化
|
||||||
for (int i = 0; i < streamPushItems.size(); i++) {
|
for (int i = 0; i < streamPushItems.size(); i++) {
|
||||||
int onlineResult = gbStreamMapper.setStatus(streamPushItems.get(i).getApp(), streamPushItems.get(i).getStream(), true);
|
int onlineResult = mediaOnline(streamPushItems.get(i).getApp(), streamPushItems.get(i).getStream());
|
||||||
if (onlineResult > 0) {
|
if (onlineResult > 0) {
|
||||||
// 发送上线通知
|
// 发送上线通知
|
||||||
eventPublisher.catalogEventPublishForStream(null, streamPushItems.get(i), CatalogEvent.ON);
|
eventPublisher.catalogEventPublishForStream(null, streamPushItems.get(i), CatalogEvent.ON);
|
||||||
@ -854,11 +856,13 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateMedia(StreamPushItem streamPushItem) {
|
public void updateMedia(StreamPushItem streamPushItem) {
|
||||||
streamPushMapper.del(streamPushItem.getApp(), streamPushItem.getStream());
|
streamPushMapper.del(streamPushItem.getApp(), streamPushItem.getStream());
|
||||||
streamPushMapper.add(streamPushItem);
|
streamPushMapper.add(streamPushItem);
|
||||||
gbStreamMapper.setStatus(streamPushItem.getApp(), streamPushItem.getStream(), true);
|
mediaOffline(streamPushItem.getApp(), streamPushItem.getStream());
|
||||||
|
|
||||||
if(!StringUtils.isEmpty(streamPushItem.getGbId() )){
|
if(!StringUtils.isEmpty(streamPushItem.getGbId() )){
|
||||||
// 查找开启了全部直播流共享的上级平台
|
// 查找开启了全部直播流共享的上级平台
|
||||||
@ -895,8 +899,26 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int mediaOutline(String app, String streamId) {
|
public int mediaOffline(String app, String stream) {
|
||||||
return gbStreamMapper.setStatus(app, streamId, false);
|
GbStream gbStream = gbStreamMapper.selectOne(app, stream);
|
||||||
|
int result;
|
||||||
|
if ("proxy".equals(gbStream.getStreamType())) {
|
||||||
|
result = streamProxyMapper.updateStatus(app, stream, false);
|
||||||
|
}else {
|
||||||
|
result = streamPushMapper.updateStatus(app, stream, false);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int mediaOnline(String app, String stream) {
|
||||||
|
GbStream gbStream = gbStreamMapper.selectOne(app, stream);
|
||||||
|
int result;
|
||||||
|
if ("proxy".equals(gbStream.getStreamType())) {
|
||||||
|
result = streamProxyMapper.updateStatus(app, stream, true);
|
||||||
|
}else {
|
||||||
|
result = streamPushMapper.updateStatus(app, stream, true);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1006,7 +1028,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int setDefaultCatalog(String platformId, String catalogId) {
|
public int setDefaultCatalog(String platformId, String catalogId) {
|
||||||
return platformMapper.setDefaultCatalog(platformId, catalogId);
|
return platformMapper.setDefaultCatalog(platformId, catalogId, DateUtil.getNow());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1119,7 +1141,14 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateChannelPotion(String deviceId, String channelId, double longitude, double latitude) {
|
public void updateChannelPosition(DeviceChannel deviceChannel) {
|
||||||
deviceChannelMapper.updatePotion(deviceId, channelId, longitude, latitude);
|
if (deviceChannel.getChannelId().equals(deviceChannel.getDeviceId())) {
|
||||||
|
deviceChannel.setChannelId(null);
|
||||||
|
}
|
||||||
|
if (deviceChannel.getGpsTime() == null) {
|
||||||
|
deviceChannel.setGpsTime(DateUtil.getNow());
|
||||||
|
}
|
||||||
|
|
||||||
|
deviceChannelMapper.updatePosition(deviceChannel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import oshi.hardware.NetworkIF;
|
|||||||
import oshi.software.os.OperatingSystem;
|
import oshi.software.os.OperatingSystem;
|
||||||
import oshi.util.FormatUtil;
|
import oshi.util.FormatUtil;
|
||||||
|
|
||||||
import java.text.DecimalFormat;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|||||||
@ -63,12 +63,13 @@ public class MobilePositionController {
|
|||||||
@ApiOperation("查询历史轨迹")
|
@ApiOperation("查询历史轨迹")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
@ApiImplicitParam(name = "deviceId", value = "设备ID", required = true, dataTypeClass = String.class),
|
||||||
@ApiImplicitParam(name = "start", value = "开始时间", required = true, dataTypeClass = String.class),
|
@ApiImplicitParam(name = "channelId", value = "通道ID", required = false, dataTypeClass = String.class),
|
||||||
@ApiImplicitParam(name = "end", value = "结束时间", required = true, dataTypeClass = String.class),
|
@ApiImplicitParam(name = "start", value = "开始时间", required = false, dataTypeClass = String.class),
|
||||||
|
@ApiImplicitParam(name = "end", value = "结束时间", required = false, dataTypeClass = String.class),
|
||||||
})
|
})
|
||||||
@GetMapping("/history/{deviceId}/{channelId}")
|
@GetMapping("/history/{deviceId}")
|
||||||
public ResponseEntity<WVPResult<List<MobilePosition>>> positions(@PathVariable String deviceId,
|
public ResponseEntity<WVPResult<List<MobilePosition>>> positions(@PathVariable String deviceId,
|
||||||
@PathVariable String channelId,
|
@RequestParam(required = false) String channelId,
|
||||||
@RequestParam(required = false) String start,
|
@RequestParam(required = false) String start,
|
||||||
@RequestParam(required = false) String end) {
|
@RequestParam(required = false) String end) {
|
||||||
// if (logger.isDebugEnabled()) {
|
// if (logger.isDebugEnabled()) {
|
||||||
|
|||||||
@ -1,9 +1,14 @@
|
|||||||
package com.genersoft.iot.vmp.vmanager.gb28181.media;
|
package com.genersoft.iot.vmp.vmanager.gb28181.media;
|
||||||
|
|
||||||
import com.genersoft.iot.vmp.common.StreamInfo;
|
import com.genersoft.iot.vmp.common.StreamInfo;
|
||||||
|
import com.genersoft.iot.vmp.conf.security.SecurityUtils;
|
||||||
|
import com.genersoft.iot.vmp.conf.security.dto.LoginUser;
|
||||||
|
import com.genersoft.iot.vmp.media.zlm.dto.OnPublishHookParam;
|
||||||
|
import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo;
|
||||||
import com.genersoft.iot.vmp.service.IMediaServerService;
|
import com.genersoft.iot.vmp.service.IMediaServerService;
|
||||||
import com.genersoft.iot.vmp.service.IStreamPushService;
|
import com.genersoft.iot.vmp.service.IStreamPushService;
|
||||||
import com.genersoft.iot.vmp.service.IMediaService;
|
import com.genersoft.iot.vmp.service.IMediaService;
|
||||||
|
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@ -16,6 +21,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
|
||||||
@Api(tags = "媒体流相关")
|
@Api(tags = "媒体流相关")
|
||||||
@Controller
|
@Controller
|
||||||
@ -26,17 +33,11 @@ public class MediaController {
|
|||||||
private final static Logger logger = LoggerFactory.getLogger(MediaController.class);
|
private final static Logger logger = LoggerFactory.getLogger(MediaController.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IVideoManagerStorage storager;
|
private IRedisCatchStorage redisCatchStorage;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IStreamPushService streamPushService;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IMediaService mediaService;
|
private IMediaService mediaService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IMediaServerService mediaServerService;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据应用名和流id获取播放地址
|
* 根据应用名和流id获取播放地址
|
||||||
@ -52,13 +53,47 @@ public class MediaController {
|
|||||||
})
|
})
|
||||||
@GetMapping(value = "/stream_info_by_app_and_stream")
|
@GetMapping(value = "/stream_info_by_app_and_stream")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public WVPResult<StreamInfo> getStreamInfoByAppAndStream(@RequestParam String app, @RequestParam String stream, @RequestParam(required = false) String mediaServerId){
|
public WVPResult<StreamInfo> getStreamInfoByAppAndStream(HttpServletRequest request, @RequestParam String app,
|
||||||
StreamInfo streamInfoByAppAndStreamWithCheck = mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream, mediaServerId);
|
@RequestParam String stream,
|
||||||
|
@RequestParam(required = false) String mediaServerId,
|
||||||
|
@RequestParam(required = false) String callId,
|
||||||
|
@RequestParam(required = false) Boolean useSourceIpAsStreamIp){
|
||||||
|
boolean authority = false;
|
||||||
|
if (callId != null) {
|
||||||
|
// 权限校验
|
||||||
|
StreamAuthorityInfo streamAuthorityInfo = redisCatchStorage.getStreamAuthorityInfo(app, stream);
|
||||||
|
if (streamAuthorityInfo.getCallId().equals(callId)) {
|
||||||
|
authority = true;
|
||||||
|
}else {
|
||||||
|
WVPResult<StreamInfo> result = new WVPResult<>();
|
||||||
|
result.setCode(401);
|
||||||
|
result.setMsg("fail");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
// 是否登陆用户, 登陆用户返回完整信息
|
||||||
|
LoginUser userInfo = SecurityUtils.getUserInfo();
|
||||||
|
if (userInfo!= null) {
|
||||||
|
authority = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StreamInfo streamInfo;
|
||||||
|
|
||||||
|
if (useSourceIpAsStreamIp != null && useSourceIpAsStreamIp) {
|
||||||
|
String host = request.getHeader("Host");
|
||||||
|
String localAddr = host.split(":")[0];
|
||||||
|
logger.info("使用{}作为返回流的ip", localAddr);
|
||||||
|
streamInfo = mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream, mediaServerId, localAddr, authority);
|
||||||
|
}else {
|
||||||
|
streamInfo = mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream, mediaServerId, authority);
|
||||||
|
}
|
||||||
|
|
||||||
WVPResult<StreamInfo> result = new WVPResult<>();
|
WVPResult<StreamInfo> result = new WVPResult<>();
|
||||||
if (streamInfoByAppAndStreamWithCheck != null){
|
if (streamInfo != null){
|
||||||
result.setCode(0);
|
result.setCode(0);
|
||||||
result.setMsg("scccess");
|
result.setMsg("scccess");
|
||||||
result.setData(streamInfoByAppAndStreamWithCheck);
|
result.setData(streamInfo);
|
||||||
}else {
|
}else {
|
||||||
result.setCode(-1);
|
result.setCode(-1);
|
||||||
result.setMsg("fail");
|
result.setMsg("fail");
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder;
|
|||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
||||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||||
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||||
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
|
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
|
||||||
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.UpdateChannelParam;
|
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.UpdateChannelParam;
|
||||||
@ -169,6 +170,8 @@ public class PlatformController {
|
|||||||
wvpResult.setMsg("平台 " + parentPlatform.getServerGBId() + " 已存在");
|
wvpResult.setMsg("平台 " + parentPlatform.getServerGBId() + " 已存在");
|
||||||
return new ResponseEntity<>(wvpResult, HttpStatus.OK);
|
return new ResponseEntity<>(wvpResult, HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
parentPlatform.setCreateTime(DateUtil.getNow());
|
||||||
|
parentPlatform.setUpdateTime(DateUtil.getNow());
|
||||||
boolean updateResult = storager.updateParentPlatform(parentPlatform);
|
boolean updateResult = storager.updateParentPlatform(parentPlatform);
|
||||||
|
|
||||||
if (updateResult) {
|
if (updateResult) {
|
||||||
@ -232,7 +235,7 @@ public class PlatformController {
|
|||||||
}
|
}
|
||||||
parentPlatform.setCharacterSet(parentPlatform.getCharacterSet().toUpperCase());
|
parentPlatform.setCharacterSet(parentPlatform.getCharacterSet().toUpperCase());
|
||||||
ParentPlatform parentPlatformOld = storager.queryParentPlatByServerGBId(parentPlatform.getServerGBId());
|
ParentPlatform parentPlatformOld = storager.queryParentPlatByServerGBId(parentPlatform.getServerGBId());
|
||||||
|
parentPlatform.setUpdateTime(DateUtil.getNow());
|
||||||
boolean updateResult = storager.updateParentPlatform(parentPlatform);
|
boolean updateResult = storager.updateParentPlatform(parentPlatform);
|
||||||
|
|
||||||
if (updateResult) {
|
if (updateResult) {
|
||||||
|
|||||||
@ -197,7 +197,7 @@ public class PlayController {
|
|||||||
JSONObject data = jsonObject.getJSONObject("data");
|
JSONObject data = jsonObject.getJSONObject("data");
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
result.put("key", data.getString("key"));
|
result.put("key", data.getString("key"));
|
||||||
StreamInfo streamInfoResult = mediaService.getStreamInfoByAppAndStreamWithCheck("convert", streamId, mediaInfo.getId());
|
StreamInfo streamInfoResult = mediaService.getStreamInfoByAppAndStreamWithCheck("convert", streamId, mediaInfo.getId(), false);
|
||||||
result.put("data", streamInfoResult);
|
result.put("data", streamInfoResult);
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
|
|||||||
@ -131,6 +131,9 @@ public class StreamProxyController {
|
|||||||
public Object start(String app, String stream){
|
public Object start(String app, String stream){
|
||||||
logger.info("启用代理: " + app + "/" + stream);
|
logger.info("启用代理: " + app + "/" + stream);
|
||||||
boolean result = streamProxyService.start(app, stream);
|
boolean result = streamProxyService.start(app, stream);
|
||||||
|
if (!result) {
|
||||||
|
logger.info("启用代理失败: " + app + "/" + stream);
|
||||||
|
}
|
||||||
return result?"success":"fail";
|
return result?"success":"fail";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,11 +3,16 @@ package com.genersoft.iot.vmp.vmanager.streamPush;
|
|||||||
import com.alibaba.excel.EasyExcel;
|
import com.alibaba.excel.EasyExcel;
|
||||||
import com.alibaba.excel.ExcelReader;
|
import com.alibaba.excel.ExcelReader;
|
||||||
import com.alibaba.excel.read.metadata.ReadSheet;
|
import com.alibaba.excel.read.metadata.ReadSheet;
|
||||||
|
import com.genersoft.iot.vmp.common.StreamInfo;
|
||||||
|
import com.genersoft.iot.vmp.conf.security.SecurityUtils;
|
||||||
|
import com.genersoft.iot.vmp.conf.security.dto.LoginUser;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
|
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
||||||
|
import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo;
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||||
import com.genersoft.iot.vmp.service.IMediaServerService;
|
import com.genersoft.iot.vmp.service.IMediaServerService;
|
||||||
|
import com.genersoft.iot.vmp.service.IMediaService;
|
||||||
import com.genersoft.iot.vmp.service.IStreamPushService;
|
import com.genersoft.iot.vmp.service.IStreamPushService;
|
||||||
import com.genersoft.iot.vmp.service.impl.StreamPushUploadFileHandler;
|
import com.genersoft.iot.vmp.service.impl.StreamPushUploadFileHandler;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.BatchGBStreamParam;
|
import com.genersoft.iot.vmp.vmanager.bean.BatchGBStreamParam;
|
||||||
@ -30,6 +35,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import org.springframework.web.context.request.async.DeferredResult;
|
import org.springframework.web.context.request.async.DeferredResult;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -54,6 +60,9 @@ public class StreamPushController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private DeferredResultHolder resultHolder;
|
private DeferredResultHolder resultHolder;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMediaService mediaService;
|
||||||
|
|
||||||
@ApiOperation("推流列表查询")
|
@ApiOperation("推流列表查询")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name="page", value = "当前页", required = true, dataTypeClass = Integer.class),
|
@ApiImplicitParam(name="page", value = "当前页", required = true, dataTypeClass = Integer.class),
|
||||||
@ -237,5 +246,43 @@ public class StreamPushController {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取推流播放地址
|
||||||
|
* @param app 应用名
|
||||||
|
* @param stream 流id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取推流播放地址")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "app", value = "应用名", dataTypeClass = String.class),
|
||||||
|
@ApiImplicitParam(name = "stream", value = "流id", dataTypeClass = String.class),
|
||||||
|
@ApiImplicitParam(name = "mediaServerId", value = "媒体服务器id", dataTypeClass = String.class, required = false),
|
||||||
|
})
|
||||||
|
@GetMapping(value = "/getPlayUrl")
|
||||||
|
@ResponseBody
|
||||||
|
public WVPResult<StreamInfo> getPlayUrl(HttpServletRequest request, @RequestParam String app,
|
||||||
|
@RequestParam String stream,
|
||||||
|
@RequestParam(required = false) String mediaServerId){
|
||||||
|
boolean authority = false;
|
||||||
|
// 是否登陆用户, 登陆用户返回完整信息
|
||||||
|
LoginUser userInfo = SecurityUtils.getUserInfo();
|
||||||
|
if (userInfo!= null) {
|
||||||
|
authority = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
StreamInfo streamInfo = mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream, mediaServerId, authority);
|
||||||
|
|
||||||
|
WVPResult<StreamInfo> result = new WVPResult<>();
|
||||||
|
if (streamInfo != null){
|
||||||
|
result.setCode(0);
|
||||||
|
result.setMsg("scccess");
|
||||||
|
result.setData(streamInfo);
|
||||||
|
}else {
|
||||||
|
result.setCode(-1);
|
||||||
|
result.setMsg("fail");
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -185,8 +185,6 @@ user-settings:
|
|||||||
record-sip: true
|
record-sip: true
|
||||||
# 是否将日志存储进数据库
|
# 是否将日志存储进数据库
|
||||||
logInDatebase: true
|
logInDatebase: true
|
||||||
# 第三方匹配,用于从stream钟获取有效信息
|
|
||||||
thirdPartyGBIdReg: "[\\s\\S]*"
|
|
||||||
|
|
||||||
# 在线文档: swagger-ui(生产环境建议关闭)
|
# 在线文档: swagger-ui(生产环境建议关闭)
|
||||||
swagger-ui:
|
swagger-ui:
|
||||||
|
|||||||
@ -187,7 +187,7 @@ export default {
|
|||||||
this.getListLoading = true;
|
this.getListLoading = true;
|
||||||
this.$axios({
|
this.$axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '/api/media/stream_info_by_app_and_stream',
|
url: '/api/push/getPlayUrl',
|
||||||
params: {
|
params: {
|
||||||
app: row.app,
|
app: row.app,
|
||||||
stream: row.stream,
|
stream: row.stream,
|
||||||
|
|||||||
@ -87,7 +87,7 @@
|
|||||||
<el-divider direction="vertical"></el-divider>
|
<el-divider direction="vertical"></el-divider>
|
||||||
<el-button size="medium" icon="el-icon-switch-button" type="text" v-if="scope.row.enable" @click="stop(scope.row)">停用</el-button>
|
<el-button size="medium" icon="el-icon-switch-button" type="text" v-if="scope.row.enable" @click="stop(scope.row)">停用</el-button>
|
||||||
<el-divider direction="vertical"></el-divider>
|
<el-divider direction="vertical"></el-divider>
|
||||||
<el-button size="medium" icon="el-icon-check" type="text" :loading="startBtnLaoding" v-if="!scope.row.enable" @click="start(scope.row)">启用</el-button>
|
<el-button size="medium" icon="el-icon-check" type="text" :loading="scope.row.startBtnLoading" v-if="!scope.row.enable" @click="start(scope.row)">启用</el-button>
|
||||||
<el-divider v-if="!scope.row.enable" direction="vertical"></el-divider>
|
<el-divider v-if="!scope.row.enable" direction="vertical"></el-divider>
|
||||||
<el-button size="medium" icon="el-icon-delete" type="text" style="color: #f56c6c" @click="deleteStreamProxy(scope.row)">删除</el-button>
|
<el-button size="medium" icon="el-icon-delete" type="text" style="color: #f56c6c" @click="deleteStreamProxy(scope.row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -132,7 +132,7 @@
|
|||||||
count:15,
|
count:15,
|
||||||
total:0,
|
total:0,
|
||||||
getListLoading: false,
|
getListLoading: false,
|
||||||
startBtnLaoding: false
|
startBtnLoading: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -169,7 +169,10 @@
|
|||||||
}
|
}
|
||||||
}).then(function (res) {
|
}).then(function (res) {
|
||||||
that.total = res.data.total;
|
that.total = res.data.total;
|
||||||
that.streamProxyList = res.data.list;
|
for (let i = 0; i < res.data.list.length; i++) {
|
||||||
|
res.data.list[i]["startBtnLoading"] = false;
|
||||||
|
}
|
||||||
|
that.streamProxyList = res.data.list;
|
||||||
that.getListLoading = false;
|
that.getListLoading = false;
|
||||||
}).catch(function (error) {
|
}).catch(function (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
@ -263,7 +266,7 @@
|
|||||||
start: function(row){
|
start: function(row){
|
||||||
let that = this;
|
let that = this;
|
||||||
this.getListLoading = true;
|
this.getListLoading = true;
|
||||||
this.startBtnLaoding = true;
|
this.$set(row, 'startBtnLoading', true)
|
||||||
this.$axios({
|
this.$axios({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url:`/api/proxy/start`,
|
url:`/api/proxy/start`,
|
||||||
@ -273,7 +276,7 @@
|
|||||||
}
|
}
|
||||||
}).then(function (res) {
|
}).then(function (res) {
|
||||||
that.getListLoading = false;
|
that.getListLoading = false;
|
||||||
that.startBtnLaoding = false;
|
that.$set(row, 'startBtnLoading', false)
|
||||||
if (res.data == "success"){
|
if (res.data == "success"){
|
||||||
that.initData()
|
that.initData()
|
||||||
}else {
|
}else {
|
||||||
@ -287,7 +290,7 @@
|
|||||||
}).catch(function (error) {
|
}).catch(function (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
that.getListLoading = false;
|
that.getListLoading = false;
|
||||||
that.startBtnLaoding = false;
|
that.$set(row, 'startBtnLoading', false)
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
stop: function(row){
|
stop: function(row){
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import VectorSource from 'ol/source/Vector';
|
|||||||
import Tile from 'ol/layer/Tile';
|
import Tile from 'ol/layer/Tile';
|
||||||
import VectorLayer from 'ol/layer/Vector';
|
import VectorLayer from 'ol/layer/Vector';
|
||||||
import Style from 'ol/style/Style';
|
import Style from 'ol/style/Style';
|
||||||
|
import Stroke from 'ol/style/Stroke';
|
||||||
import Icon from 'ol/style/Icon';
|
import Icon from 'ol/style/Icon';
|
||||||
import View from 'ol/View';
|
import View from 'ol/View';
|
||||||
import Feature from 'ol/Feature';
|
import Feature from 'ol/Feature';
|
||||||
@ -230,7 +231,12 @@ export default {
|
|||||||
}
|
}
|
||||||
let line = new LineString(points)
|
let line = new LineString(points)
|
||||||
let lineFeature = new Feature(line);
|
let lineFeature = new Feature(line);
|
||||||
|
lineFeature.setStyle(new Style({
|
||||||
|
stroke: new Stroke({
|
||||||
|
width: 4 ,
|
||||||
|
color: "#0c6d6a",
|
||||||
|
})
|
||||||
|
}))
|
||||||
let source = new VectorSource();
|
let source = new VectorSource();
|
||||||
source.addFeature(lineFeature);
|
source.addFeature(lineFeature);
|
||||||
let vectorLayer = new VectorLayer({
|
let vectorLayer = new VectorLayer({
|
||||||
|
|||||||
@ -10,8 +10,8 @@
|
|||||||
@close="close()"
|
@close="close()"
|
||||||
>
|
>
|
||||||
<div v-loading="isLoging">
|
<div v-loading="isLoging">
|
||||||
<el-date-picker v-model="searchFrom" type="datetime" placeholder="选择开始日期时间" default-time="00:00:00" size="mini" style="width: 11rem;" align="right" :picker-options="pickerOptions"></el-date-picker>
|
<el-date-picker v-model="searchFrom" type="datetime" placeholder="选择开始日期时间" default-time="00:00:00" value-format="yyyy-MM-dd HH:mm:ss" size="mini" style="width: 11rem;" align="right" :picker-options="pickerOptions"></el-date-picker>
|
||||||
<el-date-picker v-model="searchTo" type="datetime" placeholder="选择结束日期时间" default-time="00:00:00" size="mini" style="width: 11rem;" align="right" :picker-options="pickerOptions"></el-date-picker>
|
<el-date-picker v-model="searchTo" type="datetime" placeholder="选择结束日期时间" default-time="00:00:00" value-format="yyyy-MM-dd HH:mm:ss" size="mini" style="width: 11rem;" align="right" :picker-options="pickerOptions"></el-date-picker>
|
||||||
<el-button icon="el-icon-search" size="mini" type="primary" @click="onSubmit">查询</el-button>
|
<el-button icon="el-icon-search" size="mini" type="primary" @click="onSubmit">查询</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -72,7 +72,11 @@ export default {
|
|||||||
onSubmit: function () {
|
onSubmit: function () {
|
||||||
console.log("onSubmit");
|
console.log("onSubmit");
|
||||||
this.isLoging = true;
|
this.isLoging = true;
|
||||||
this.$axios.get(`/api/position/history/${this.channel.deviceId}/${this.channel.channelId}`, {
|
let url = `/api/position/history/${this.channel.deviceId}?start=${this.searchFrom}&end=${this.searchTo}`;
|
||||||
|
if (this.channel.channelId) {
|
||||||
|
url+="&channelId=${this.channel.channelId}"
|
||||||
|
}
|
||||||
|
this.$axios.get(url, {
|
||||||
}).then((res)=> {
|
}).then((res)=> {
|
||||||
this.isLoging = false;
|
this.isLoging = false;
|
||||||
if (typeof this.callback == "function") {
|
if (typeof this.callback == "function") {
|
||||||
|
|||||||
@ -186,6 +186,14 @@ export default {
|
|||||||
this.deviceService.getAllSubChannel(false, data.deviceId, data.channelId, this.channelsHandler)
|
this.deviceService.getAllSubChannel(false, data.deviceId, data.channelId, this.channelsHandler)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "查询轨迹",
|
||||||
|
icon: "el-icon-map-location",
|
||||||
|
disabled: false,
|
||||||
|
onClick: () => {
|
||||||
|
this.getTrace(data)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
event, // 鼠标事件信息
|
event, // 鼠标事件信息
|
||||||
@ -320,8 +328,8 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
let positions = [];
|
let positions = [];
|
||||||
for (let i = 0; i < channelPositions.length; i++) {
|
for (let i = 0; i < channelPositions.length; i++) {
|
||||||
if (channelPositions[i].cnLng * channelPositions[i].cnLat > 0) {
|
if (channelPositions[i][this.longitudeStr] * channelPositions[i][this.latitudeStr] > 0) {
|
||||||
positions.push([channelPositions[i].cnLng, channelPositions[i].cnLat])
|
positions.push([channelPositions[i][this.longitudeStr], channelPositions[i][this.latitudeStr]])
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,17 +13,20 @@
|
|||||||
<el-menu-item index="/cloudRecord">云端录像</el-menu-item>
|
<el-menu-item index="/cloudRecord">云端录像</el-menu-item>
|
||||||
<el-menu-item index="/mediaServerManger">节点管理</el-menu-item>
|
<el-menu-item index="/mediaServerManger">节点管理</el-menu-item>
|
||||||
<el-menu-item index="/parentPlatformList/15/1">国标级联</el-menu-item>
|
<el-menu-item index="/parentPlatformList/15/1">国标级联</el-menu-item>
|
||||||
<el-menu-item @click="openDoc">在线文档</el-menu-item>
|
|
||||||
<!-- <el-submenu index="/setting">-->
|
<!-- <el-submenu index="/setting">-->
|
||||||
<!-- <template slot="title">系统设置</template>-->
|
<!-- <template slot="title">系统设置</template>-->
|
||||||
<!-- <el-menu-item index="/setting/web">WEB服务</el-menu-item>-->
|
<!-- <el-menu-item index="/setting/web">WEB服务</el-menu-item>-->
|
||||||
<!-- <el-menu-item index="/setting/sip">国标服务</el-menu-item>-->
|
<!-- <el-menu-item index="/setting/sip">国标服务</el-menu-item>-->
|
||||||
<!-- <el-menu-item index="/setting/media">媒体服务</el-menu-item>-->
|
<!-- <el-menu-item index="/setting/media">媒体服务</el-menu-item>-->
|
||||||
<!-- </el-submenu>-->
|
<!-- </el-submenu>-->
|
||||||
<el-switch v-model="alarmNotify" active-text="报警信息推送" @change="alarmNotifyChannge"></el-switch>
|
|
||||||
<!-- <el-menu-item style="float: right;" @click="loginout">退出</el-menu-item>-->
|
<!-- <el-menu-item style="float: right;" @click="loginout">退出</el-menu-item>-->
|
||||||
<el-submenu index="" style="float: right;">
|
<el-submenu index="" style="float: right;">
|
||||||
<template slot="title">欢迎,{{ this.$cookies.get("session").username }}</template>
|
<template slot="title">欢迎,{{ this.$cookies.get("session").username }}</template>
|
||||||
|
<el-menu-item @click="openDoc">在线文档</el-menu-item>
|
||||||
|
<el-menu-item >
|
||||||
|
<el-switch v-model="alarmNotify" inactive-text="报警信息推送" @change="alarmNotifyChannge"></el-switch>
|
||||||
|
</el-menu-item>
|
||||||
<el-menu-item @click="changePassword">修改密码</el-menu-item>
|
<el-menu-item @click="changePassword">修改密码</el-menu-item>
|
||||||
<el-menu-item @click="loginout">注销</el-menu-item>
|
<el-menu-item @click="loginout">注销</el-menu-item>
|
||||||
</el-submenu>
|
</el-submenu>
|
||||||
@ -145,7 +148,10 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
#UiHeader .el-switch__label {
|
#UiHeader .el-switch__label {
|
||||||
color: white;
|
color: white ;
|
||||||
|
}
|
||||||
|
.el-menu--popup .el-menu-item .el-switch .el-switch__label {
|
||||||
|
color: white !important;
|
||||||
}
|
}
|
||||||
#UiHeader .el-switch__label.is-active{
|
#UiHeader .el-switch__label.is-active{
|
||||||
color: #409EFF;
|
color: #409EFF;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user