Commit 7d1116c8928770cd7703c83955d77f1e6a430ce3

Authored by mk1990
Committed by GitHub
2 parents 22e1d92a 3501046e

Merge branch '648540858:wvp-28181-2.0' into wvp-28181-2.0

Showing 37 changed files with 1903 additions and 1735 deletions

Too many changes to show.

To preserve performance only 37 of 49 files are displayed.

README.md
@@ -134,10 +134,10 @@ QQ遘∽ソ。荳闊ャ荳榊屓, 邊セ蜉帶怏髯.谺「霑主、ァ螳カ蝨ィ鄒、驥瑚ョィ隶コ.隗牙セ鈴。ケ逶ョ蟇ケ菴 @@ -134,10 +134,10 @@ QQ遘∽ソ。荳闊ャ荳榊屓, 邊セ蜉帶怏髯.谺「霑主、ァ螳カ蝨ィ鄒、驥瑚ョィ隶コ.隗牙セ鈴。ケ逶ョ蟇ケ菴
134 諢溯ー「菴懆dexter langhuihui](https://github.com/langhuihui) 蠑貅占ソ吩ケ亥・ス逕ィ逧ЦEB謦ュ謾セ蝎ィ縲 134 諢溯ー「菴懆dexter langhuihui](https://github.com/langhuihui) 蠑貅占ソ吩ケ亥・ス逕ィ逧ЦEB謦ュ謾セ蝎ィ縲
135 諢溯ー「菴懆Kyle](https://gitee.com/kkkkk5G) 蠑貅蝉コ・ス逕ィ逧燕遶ッ鬘オ髱「 135 諢溯ー「菴懆Kyle](https://gitee.com/kkkkk5G) 蠑貅蝉コ・ス逕ィ逧燕遶ッ鬘オ髱「
136 諢溯ー「蜷ス榊、ァ菴ャ逧オ槫勧莉・蜿雁ッケ鬘ケ逶ョ逧欠豁」荳主クョ蜉ゥ縲ょ桁諡ャ菴ク埼剞莠惹サ」遐∬エ。迪ョ縲琉鬚伜渚鬥医∬オ謐占オ遲牙推遘肴婿蠑冗噪謾ッ謖シ∽サ・荳区賜蜷堺ク榊蜈亥錘 136 諢溯ー「蜷ス榊、ァ菴ャ逧オ槫勧莉・蜿雁ッケ鬘ケ逶ョ逧欠豁」荳主クョ蜉ゥ縲ょ桁諡ャ菴ク埼剞莠惹サ」遐∬エ。迪ョ縲琉鬚伜渚鬥医∬オ謐占オ遲牙推遘肴婿蠑冗噪謾ッ謖シ∽サ・荳区賜蜷堺ク榊蜈亥錘
137 -[lawrencehj](https://github.com/lawrencehj) @髯クー-蛻帛・ァ第橿 [swwhaha](https://github.com/swwheihei) 137 +[lawrencehj](https://github.com/lawrencehj) [Smallwhitepig](https://github.com/Smallwhitepig) [swwhaha](https://github.com/swwheihei)
138 [hotcoffie](https://github.com/hotcoffie) [xiaomu](https://github.com/nikmu) [TristingChen](https://github.com/TristingChen) 138 [hotcoffie](https://github.com/hotcoffie) [xiaomu](https://github.com/nikmu) [TristingChen](https://github.com/TristingChen)
139 [chenparty](https://github.com/chenparty) [Hotleave](https://github.com/hotleave) [ydwxb](https://github.com/ydwxb) 139 [chenparty](https://github.com/chenparty) [Hotleave](https://github.com/hotleave) [ydwxb](https://github.com/ydwxb)
140 -[ydpd](https://github.com/ydpd) [szy833](https://github.com/szy833) [ydwxb](https://github.com/ydwxb) 140 +[ydpd](https://github.com/ydpd) [szy833](https://github.com/szy833) [ydwxb](https://github.com/ydwxb) [Albertzhu666](https://github.com/Albertzhu666)
141 141
142 ps: 蛻壼「槫刈莠ソ吩クェ蜷榊黒瑚け螳夐@貍丈コク莠帛、ァ菴ャ梧ャ「霑主、ァ菴ャ閨皮ウサ謌第キサ蜉縲 142 ps: 蛻壼「槫刈莠ソ吩クェ蜷榊黒瑚け螳夐@貍丈コク莠帛、ァ菴ャ梧ャ「霑主、ァ菴ャ閨皮ウサ謌第キサ蜉縲
143 143
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 11
12 <groupId>com.genersoft</groupId> 12 <groupId>com.genersoft</groupId>
13 <artifactId>wvp-pro</artifactId> 13 <artifactId>wvp-pro</artifactId>
14 - <version>2.0.2</version> 14 + <version>2.1.1</version>
15 <name>web video platform</name> 15 <name>web video platform</name>
16 <description>国标28181视频平台</description> 16 <description>国标28181视频平台</description>
17 17
sql/clean.sql 0 → 100644
  1 +delete from device;
  2 +delete from device_alarm;
  3 +delete from device_channel;
  4 +delete from device_mobile_position;
  5 +delete from gb_stream;
  6 +delete from log;
  7 +delete from media_server;
  8 +delete from parent_platform;
  9 +delete from platform_catalog;
  10 +delete from platform_gb_channel;
  11 +delete from platform_gb_stream;
  12 +delete from stream_proxy;
  13 +delete from stream_push;
0 \ No newline at end of file 14 \ No newline at end of file
sql/mysql.sql
1 --- MySQL dump 10.13 Distrib 8.0.28, for Linux (x86_64) 1 +-- MariaDB dump 10.19 Distrib 10.7.3-MariaDB, for Linux (x86_64)
2 -- 2 --
3 --- Host: 127.0.0.1 Database: wvp 3 +-- Host: 127.0.0.1 Database: wvp3
4 -- ------------------------------------------------------ 4 -- ------------------------------------------------------
5 --- Server version 8.0.28-0ubuntu0.20.04.3 5 +-- Server version 8.0.0-dmr
6 6
7 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 7 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
8 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 8 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
9 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 9 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
10 -/*!50503 SET NAMES utf8mb4 */; 10 +/*!40101 SET NAMES utf8mb4 */;
11 /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 11 /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
12 /*!40103 SET TIME_ZONE='+00:00' */; 12 /*!40103 SET TIME_ZONE='+00:00' */;
13 /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 13 /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
@@ -21,33 +21,34 @@ @@ -21,33 +21,34 @@
21 21
22 DROP TABLE IF EXISTS `device`; 22 DROP TABLE IF EXISTS `device`;
23 /*!40101 SET @saved_cs_client = @@character_set_client */; 23 /*!40101 SET @saved_cs_client = @@character_set_client */;
24 -/*!50503 SET character_set_client = utf8mb4 */; 24 +/*!40101 SET character_set_client = utf8 */;
25 CREATE TABLE `device` ( 25 CREATE TABLE `device` (
26 - `id` int NOT NULL AUTO_INCREMENT,  
27 - `deviceId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,  
28 - `name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,  
29 - `manufacturer` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,  
30 - `model` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,  
31 - `firmware` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,  
32 - `transport` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
33 - `streamMode` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
34 - `online` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
35 - `registerTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
36 - `keepaliveTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
37 - `ip` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,  
38 - `createTime` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,  
39 - `updateTime` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,  
40 - `port` int NOT NULL,  
41 - `expires` int NOT NULL,  
42 - `subscribeCycleForCatalog` int NOT NULL,  
43 - `subscribeCycleForMobilePosition` int NOT NULL,  
44 - `mobilePositionSubmissionInterval` int DEFAULT 5 NOT NULL,  
45 - `subscribeCycleForAlarm` int NOT NULL,  
46 - `hostAddress` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,  
47 - `charset` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, 26 + `id` int(11) NOT NULL AUTO_INCREMENT,
  27 + `deviceId` varchar(50) NOT NULL,
  28 + `name` varchar(255) DEFAULT NULL,
  29 + `manufacturer` varchar(255) DEFAULT NULL,
  30 + `model` varchar(255) DEFAULT NULL,
  31 + `firmware` varchar(255) DEFAULT NULL,
  32 + `transport` varchar(50) DEFAULT NULL,
  33 + `streamMode` varchar(50) DEFAULT NULL,
  34 + `online` varchar(50) DEFAULT NULL,
  35 + `registerTime` varchar(50) DEFAULT NULL,
  36 + `keepaliveTime` varchar(50) DEFAULT NULL,
  37 + `ip` varchar(50) NOT NULL,
  38 + `createTime` varchar(50) NOT NULL,
  39 + `updateTime` varchar(50) NOT NULL,
  40 + `port` int(11) NOT NULL,
  41 + `expires` int(11) NOT NULL,
  42 + `subscribeCycleForCatalog` int(11) NOT NULL,
  43 + `subscribeCycleForMobilePosition` int(11) NOT NULL,
  44 + `mobilePositionSubmissionInterval` int(11) NOT NULL DEFAULT '5',
  45 + `subscribeCycleForAlarm` int(11) NOT NULL,
  46 + `hostAddress` varchar(50) NOT NULL,
  47 + `charset` varchar(50) NOT NULL,
  48 + `ssrcCheck` int(11) DEFAULT '0',
48 PRIMARY KEY (`id`), 49 PRIMARY KEY (`id`),
49 UNIQUE KEY `device_deviceId_uindex` (`deviceId`) 50 UNIQUE KEY `device_deviceId_uindex` (`deviceId`)
50 -) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 51 +) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8mb4;
51 /*!40101 SET character_set_client = @saved_cs_client */; 52 /*!40101 SET character_set_client = @saved_cs_client */;
52 53
53 -- 54 --
@@ -65,20 +66,20 @@ UNLOCK TABLES; @@ -65,20 +66,20 @@ UNLOCK TABLES;
65 66
66 DROP TABLE IF EXISTS `device_alarm`; 67 DROP TABLE IF EXISTS `device_alarm`;
67 /*!40101 SET @saved_cs_client = @@character_set_client */; 68 /*!40101 SET @saved_cs_client = @@character_set_client */;
68 -/*!50503 SET character_set_client = utf8mb4 */; 69 +/*!40101 SET character_set_client = utf8 */;
69 CREATE TABLE `device_alarm` ( 70 CREATE TABLE `device_alarm` (
70 - `id` int NOT NULL AUTO_INCREMENT,  
71 - `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
72 - `channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
73 - `alarmPriority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
74 - `alarmMethod` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,  
75 - `alarmTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
76 - `alarmDescription` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, 71 + `id` int(11) NOT NULL AUTO_INCREMENT,
  72 + `deviceId` varchar(50) NOT NULL,
  73 + `channelId` varchar(50) NOT NULL,
  74 + `alarmPriority` varchar(50) NOT NULL,
  75 + `alarmMethod` varchar(50) DEFAULT NULL,
  76 + `alarmTime` varchar(50) NOT NULL,
  77 + `alarmDescription` varchar(255) DEFAULT NULL,
77 `longitude` double DEFAULT NULL, 78 `longitude` double DEFAULT NULL,
78 `latitude` double DEFAULT NULL, 79 `latitude` double DEFAULT NULL,
79 - `alarmType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, 80 + `alarmType` varchar(50) DEFAULT NULL,
80 PRIMARY KEY (`id`) USING BTREE 81 PRIMARY KEY (`id`) USING BTREE
81 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; 82 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
82 /*!40101 SET character_set_client = @saved_cs_client */; 83 /*!40101 SET character_set_client = @saved_cs_client */;
83 84
84 -- 85 --
@@ -96,43 +97,43 @@ UNLOCK TABLES; @@ -96,43 +97,43 @@ UNLOCK TABLES;
96 97
97 DROP TABLE IF EXISTS `device_channel`; 98 DROP TABLE IF EXISTS `device_channel`;
98 /*!40101 SET @saved_cs_client = @@character_set_client */; 99 /*!40101 SET @saved_cs_client = @@character_set_client */;
99 -/*!50503 SET character_set_client = utf8mb4 */; 100 +/*!40101 SET character_set_client = utf8 */;
100 CREATE TABLE `device_channel` ( 101 CREATE TABLE `device_channel` (
101 - `id` int NOT NULL AUTO_INCREMENT,  
102 - `channelId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,  
103 - `name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,  
104 - `manufacture` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
105 - `model` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
106 - `owner` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
107 - `civilCode` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
108 - `block` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
109 - `address` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
110 - `parentId` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
111 - `safetyWay` int DEFAULT NULL,  
112 - `registerWay` int DEFAULT NULL,  
113 - `certNum` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
114 - `certifiable` int DEFAULT NULL,  
115 - `errCode` int DEFAULT NULL,  
116 - `endTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
117 - `secrecy` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
118 - `ipAddress` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
119 - `port` int DEFAULT NULL,  
120 - `password` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,  
121 - `PTZType` int DEFAULT NULL,  
122 - `status` int DEFAULT NULL, 102 + `id` int(11) NOT NULL AUTO_INCREMENT,
  103 + `channelId` varchar(50) NOT NULL,
  104 + `name` varchar(255) DEFAULT NULL,
  105 + `manufacture` varchar(50) DEFAULT NULL,
  106 + `model` varchar(50) DEFAULT NULL,
  107 + `owner` varchar(50) DEFAULT NULL,
  108 + `civilCode` varchar(50) DEFAULT NULL,
  109 + `block` varchar(50) DEFAULT NULL,
  110 + `address` varchar(50) DEFAULT NULL,
  111 + `parentId` varchar(50) DEFAULT NULL,
  112 + `safetyWay` int(11) DEFAULT NULL,
  113 + `registerWay` int(11) DEFAULT NULL,
  114 + `certNum` varchar(50) DEFAULT NULL,
  115 + `certifiable` int(11) DEFAULT NULL,
  116 + `errCode` int(11) DEFAULT NULL,
  117 + `endTime` varchar(50) DEFAULT NULL,
  118 + `secrecy` varchar(50) DEFAULT NULL,
  119 + `ipAddress` varchar(50) DEFAULT NULL,
  120 + `port` int(11) DEFAULT NULL,
  121 + `password` varchar(255) DEFAULT NULL,
  122 + `PTZType` int(11) DEFAULT NULL,
  123 + `status` int(11) DEFAULT NULL,
123 `longitude` double DEFAULT NULL, 124 `longitude` double DEFAULT NULL,
124 `latitude` double DEFAULT NULL, 125 `latitude` double DEFAULT NULL,
125 - `streamId` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
126 - `deviceId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,  
127 - `parental` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, 126 + `streamId` varchar(50) DEFAULT NULL,
  127 + `deviceId` varchar(50) NOT NULL,
  128 + `parental` varchar(50) DEFAULT NULL,
128 `hasAudio` bit(1) DEFAULT NULL, 129 `hasAudio` bit(1) DEFAULT NULL,
129 - `createTime` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,  
130 - `updateTime` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,  
131 - `subCount` int DEFAULT '0', 130 + `createTime` varchar(50) NOT NULL,
  131 + `updateTime` varchar(50) NOT NULL,
  132 + `subCount` int(11) DEFAULT '0',
132 PRIMARY KEY (`id`), 133 PRIMARY KEY (`id`),
133 UNIQUE KEY `device_channel_id_uindex` (`id`), 134 UNIQUE KEY `device_channel_id_uindex` (`id`),
134 UNIQUE KEY `device_channel_pk` (`channelId`,`deviceId`) 135 UNIQUE KEY `device_channel_pk` (`channelId`,`deviceId`)
135 -) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 136 +) ENGINE=InnoDB AUTO_INCREMENT=81657 DEFAULT CHARSET=utf8mb4;
136 /*!40101 SET character_set_client = @saved_cs_client */; 137 /*!40101 SET character_set_client = @saved_cs_client */;
137 138
138 -- 139 --
@@ -150,24 +151,24 @@ UNLOCK TABLES; @@ -150,24 +151,24 @@ UNLOCK TABLES;
150 151
151 DROP TABLE IF EXISTS `device_mobile_position`; 152 DROP TABLE IF EXISTS `device_mobile_position`;
152 /*!40101 SET @saved_cs_client = @@character_set_client */; 153 /*!40101 SET @saved_cs_client = @@character_set_client */;
153 -/*!50503 SET character_set_client = utf8mb4 */; 154 +/*!40101 SET character_set_client = utf8 */;
154 CREATE TABLE `device_mobile_position` ( 155 CREATE TABLE `device_mobile_position` (
155 - `id` int NOT NULL AUTO_INCREMENT,  
156 - `deviceId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,  
157 - `channelId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,  
158 - `deviceName` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,  
159 - `time` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, 156 + `id` int(11) NOT NULL AUTO_INCREMENT,
  157 + `deviceId` varchar(50) NOT NULL,
  158 + `channelId` varchar(50) NOT NULL,
  159 + `deviceName` varchar(255) DEFAULT NULL,
  160 + `time` varchar(50) NOT NULL,
160 `longitude` double NOT NULL, 161 `longitude` double NOT NULL,
161 `latitude` double NOT NULL, 162 `latitude` double NOT NULL,
162 `altitude` double DEFAULT NULL, 163 `altitude` double DEFAULT NULL,
163 `speed` double DEFAULT NULL, 164 `speed` double DEFAULT NULL,
164 `direction` double DEFAULT NULL, 165 `direction` double DEFAULT NULL,
165 - `reportSource` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
166 - `geodeticSystem` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
167 - `cnLng` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
168 - `cnLat` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, 166 + `reportSource` varchar(50) DEFAULT NULL,
  167 + `geodeticSystem` varchar(50) DEFAULT NULL,
  168 + `cnLng` varchar(50) DEFAULT NULL,
  169 + `cnLat` varchar(50) DEFAULT NULL,
169 PRIMARY KEY (`id`) 170 PRIMARY KEY (`id`)
170 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 171 +) ENGINE=InnoDB AUTO_INCREMENT=6108 DEFAULT CHARSET=utf8mb4;
171 /*!40101 SET character_set_client = @saved_cs_client */; 172 /*!40101 SET character_set_client = @saved_cs_client */;
172 173
173 -- 174 --
@@ -185,23 +186,23 @@ UNLOCK TABLES; @@ -185,23 +186,23 @@ UNLOCK TABLES;
185 186
186 DROP TABLE IF EXISTS `gb_stream`; 187 DROP TABLE IF EXISTS `gb_stream`;
187 /*!40101 SET @saved_cs_client = @@character_set_client */; 188 /*!40101 SET @saved_cs_client = @@character_set_client */;
188 -/*!50503 SET character_set_client = utf8mb4 */; 189 +/*!40101 SET character_set_client = utf8 */;
189 CREATE TABLE `gb_stream` ( 190 CREATE TABLE `gb_stream` (
190 - `gbStreamId` int NOT NULL AUTO_INCREMENT,  
191 - `app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
192 - `stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
193 - `gbId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
194 - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, 191 + `gbStreamId` int(11) NOT NULL AUTO_INCREMENT,
  192 + `app` varchar(255) NOT NULL,
  193 + `stream` varchar(255) NOT NULL,
  194 + `gbId` varchar(50) NOT NULL,
  195 + `name` varchar(255) DEFAULT NULL,
195 `longitude` double DEFAULT NULL, 196 `longitude` double DEFAULT NULL,
196 `latitude` double DEFAULT NULL, 197 `latitude` double DEFAULT NULL,
197 - `streamType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,  
198 - `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,  
199 - `status` int DEFAULT NULL,  
200 - `createStamp` bigint DEFAULT NULL, 198 + `streamType` varchar(50) DEFAULT NULL,
  199 + `mediaServerId` varchar(50) DEFAULT NULL,
  200 + `status` int(11) DEFAULT NULL,
  201 + `createStamp` bigint(20) DEFAULT NULL,
201 PRIMARY KEY (`gbStreamId`) USING BTREE, 202 PRIMARY KEY (`gbStreamId`) USING BTREE,
202 UNIQUE KEY `app` (`app`,`stream`) USING BTREE, 203 UNIQUE KEY `app` (`app`,`stream`) USING BTREE,
203 UNIQUE KEY `gbId` (`gbId`) USING BTREE 204 UNIQUE KEY `gbId` (`gbId`) USING BTREE
204 -) ENGINE=InnoDB AUTO_INCREMENT=300766 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; 205 +) ENGINE=InnoDB AUTO_INCREMENT=300769 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
205 /*!40101 SET character_set_client = @saved_cs_client */; 206 /*!40101 SET character_set_client = @saved_cs_client */;
206 207
207 -- 208 --
@@ -219,19 +220,19 @@ UNLOCK TABLES; @@ -219,19 +220,19 @@ UNLOCK TABLES;
219 220
220 DROP TABLE IF EXISTS `log`; 221 DROP TABLE IF EXISTS `log`;
221 /*!40101 SET @saved_cs_client = @@character_set_client */; 222 /*!40101 SET @saved_cs_client = @@character_set_client */;
222 -/*!50503 SET character_set_client = utf8mb4 */; 223 +/*!40101 SET character_set_client = utf8 */;
223 CREATE TABLE `log` ( 224 CREATE TABLE `log` (
224 - `id` int NOT NULL AUTO_INCREMENT,  
225 - `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
226 - `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
227 - `uri` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
228 - `address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
229 - `result` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
230 - `timing` bigint NOT NULL,  
231 - `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
232 - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, 225 + `id` int(11) NOT NULL AUTO_INCREMENT,
  226 + `name` varchar(50) NOT NULL,
  227 + `type` varchar(50) NOT NULL,
  228 + `uri` varchar(200) NOT NULL,
  229 + `address` varchar(50) NOT NULL,
  230 + `result` varchar(50) NOT NULL,
  231 + `timing` bigint(20) NOT NULL,
  232 + `username` varchar(50) NOT NULL,
  233 + `createTime` varchar(50) NOT NULL,
233 PRIMARY KEY (`id`) USING BTREE 234 PRIMARY KEY (`id`) USING BTREE
234 -) ENGINE=InnoDB AUTO_INCREMENT=962 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; 235 +) ENGINE=InnoDB AUTO_INCREMENT=1552 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
235 /*!40101 SET character_set_client = @saved_cs_client */; 236 /*!40101 SET character_set_client = @saved_cs_client */;
236 237
237 -- 238 --
@@ -249,34 +250,34 @@ UNLOCK TABLES; @@ -249,34 +250,34 @@ UNLOCK TABLES;
249 250
250 DROP TABLE IF EXISTS `media_server`; 251 DROP TABLE IF EXISTS `media_server`;
251 /*!40101 SET @saved_cs_client = @@character_set_client */; 252 /*!40101 SET @saved_cs_client = @@character_set_client */;
252 -/*!50503 SET character_set_client = utf8mb4 */; 253 +/*!40101 SET character_set_client = utf8 */;
253 CREATE TABLE `media_server` ( 254 CREATE TABLE `media_server` (
254 - `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
255 - `ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
256 - `hookIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
257 - `sdpIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
258 - `streamIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
259 - `httpPort` int NOT NULL,  
260 - `httpSSlPort` int NOT NULL,  
261 - `rtmpPort` int NOT NULL,  
262 - `rtmpSSlPort` int NOT NULL,  
263 - `rtpProxyPort` int NOT NULL,  
264 - `rtspPort` int NOT NULL,  
265 - `rtspSSLPort` int NOT NULL,  
266 - `autoConfig` int NOT NULL,  
267 - `secret` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
268 - `streamNoneReaderDelayMS` int NOT NULL,  
269 - `rtpEnable` int NOT NULL,  
270 - `rtpPortRange` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
271 - `sendRtpPortRange` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
272 - `recordAssistPort` int NOT NULL,  
273 - `defaultServer` int NOT NULL,  
274 - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
275 - `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
276 - `hookAliveInterval` int NOT NULL, 255 + `id` varchar(255) NOT NULL,
  256 + `ip` varchar(50) NOT NULL,
  257 + `hookIp` varchar(50) NOT NULL,
  258 + `sdpIp` varchar(50) NOT NULL,
  259 + `streamIp` varchar(50) NOT NULL,
  260 + `httpPort` int(11) NOT NULL,
  261 + `httpSSlPort` int(11) NOT NULL,
  262 + `rtmpPort` int(11) NOT NULL,
  263 + `rtmpSSlPort` int(11) NOT NULL,
  264 + `rtpProxyPort` int(11) NOT NULL,
  265 + `rtspPort` int(11) NOT NULL,
  266 + `rtspSSLPort` int(11) NOT NULL,
  267 + `autoConfig` int(11) NOT NULL,
  268 + `secret` varchar(50) NOT NULL,
  269 + `streamNoneReaderDelayMS` int(11) NOT NULL,
  270 + `rtpEnable` int(11) NOT NULL,
  271 + `rtpPortRange` varchar(50) NOT NULL,
  272 + `sendRtpPortRange` varchar(50) NOT NULL,
  273 + `recordAssistPort` int(11) NOT NULL,
  274 + `defaultServer` int(11) NOT NULL,
  275 + `createTime` varchar(50) NOT NULL,
  276 + `updateTime` varchar(50) NOT NULL,
  277 + `hookAliveInterval` int(11) NOT NULL,
277 PRIMARY KEY (`id`) USING BTREE, 278 PRIMARY KEY (`id`) USING BTREE,
278 UNIQUE KEY `media_server_i` (`ip`,`httpPort`) USING BTREE 279 UNIQUE KEY `media_server_i` (`ip`,`httpPort`) USING BTREE
279 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; 280 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
280 /*!40101 SET character_set_client = @saved_cs_client */; 281 /*!40101 SET character_set_client = @saved_cs_client */;
281 282
282 -- 283 --
@@ -294,33 +295,36 @@ UNLOCK TABLES; @@ -294,33 +295,36 @@ UNLOCK TABLES;
294 295
295 DROP TABLE IF EXISTS `parent_platform`; 296 DROP TABLE IF EXISTS `parent_platform`;
296 /*!40101 SET @saved_cs_client = @@character_set_client */; 297 /*!40101 SET @saved_cs_client = @@character_set_client */;
297 -/*!50503 SET character_set_client = utf8mb4 */; 298 +/*!40101 SET character_set_client = utf8 */;
298 CREATE TABLE `parent_platform` ( 299 CREATE TABLE `parent_platform` (
299 - `id` int NOT NULL AUTO_INCREMENT,  
300 - `enable` int DEFAULT NULL,  
301 - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,  
302 - `serverGBId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
303 - `serverGBDomain` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,  
304 - `serverIP` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,  
305 - `serverPort` int DEFAULT NULL,  
306 - `deviceGBId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
307 - `deviceIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,  
308 - `devicePort` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,  
309 - `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,  
310 - `password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,  
311 - `expires` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,  
312 - `keepTimeout` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,  
313 - `transport` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,  
314 - `characterSet` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,  
315 - `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
316 - `ptz` int DEFAULT NULL,  
317 - `rtcp` int DEFAULT NULL, 300 + `id` int(11) NOT NULL AUTO_INCREMENT,
  301 + `enable` int(11) DEFAULT NULL,
  302 + `name` varchar(255) DEFAULT NULL,
  303 + `serverGBId` varchar(50) NOT NULL,
  304 + `serverGBDomain` varchar(50) DEFAULT NULL,
  305 + `serverIP` varchar(50) DEFAULT NULL,
  306 + `serverPort` int(11) DEFAULT NULL,
  307 + `deviceGBId` varchar(50) NOT NULL,
  308 + `deviceIp` varchar(50) DEFAULT NULL,
  309 + `devicePort` varchar(50) DEFAULT NULL,
  310 + `username` varchar(255) DEFAULT NULL,
  311 + `password` varchar(50) DEFAULT NULL,
  312 + `expires` varchar(50) DEFAULT NULL,
  313 + `keepTimeout` varchar(50) DEFAULT NULL,
  314 + `transport` varchar(50) DEFAULT NULL,
  315 + `characterSet` varchar(50) DEFAULT NULL,
  316 + `catalogId` varchar(50) NOT NULL,
  317 + `ptz` int(11) DEFAULT NULL,
  318 + `rtcp` int(11) DEFAULT NULL,
318 `status` bit(1) DEFAULT NULL, 319 `status` bit(1) DEFAULT NULL,
319 - `shareAllLiveStream` int DEFAULT NULL, 320 + `shareAllLiveStream` int(11) DEFAULT NULL,
  321 + `startOfflinePush` int(11) DEFAULT '0',
  322 + `administrativeDivision` varchar(50) NOT NULL,
  323 + `catalogGroup` int(11) DEFAULT '1',
320 PRIMARY KEY (`id`), 324 PRIMARY KEY (`id`),
321 UNIQUE KEY `parent_platform_id_uindex` (`id`), 325 UNIQUE KEY `parent_platform_id_uindex` (`id`),
322 UNIQUE KEY `parent_platform_pk` (`serverGBId`) 326 UNIQUE KEY `parent_platform_pk` (`serverGBId`)
323 -) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; 327 +) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
324 /*!40101 SET character_set_client = @saved_cs_client */; 328 /*!40101 SET character_set_client = @saved_cs_client */;
325 329
326 -- 330 --
@@ -338,14 +342,14 @@ UNLOCK TABLES; @@ -338,14 +342,14 @@ UNLOCK TABLES;
338 342
339 DROP TABLE IF EXISTS `platform_catalog`; 343 DROP TABLE IF EXISTS `platform_catalog`;
340 /*!40101 SET @saved_cs_client = @@character_set_client */; 344 /*!40101 SET @saved_cs_client = @@character_set_client */;
341 -/*!50503 SET character_set_client = utf8mb4 */; 345 +/*!40101 SET character_set_client = utf8 */;
342 CREATE TABLE `platform_catalog` ( 346 CREATE TABLE `platform_catalog` (
343 - `id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
344 - `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
345 - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
346 - `parentId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, 347 + `id` varchar(50) NOT NULL,
  348 + `platformId` varchar(50) NOT NULL,
  349 + `name` varchar(255) NOT NULL,
  350 + `parentId` varchar(50) DEFAULT NULL,
347 PRIMARY KEY (`id`) USING BTREE 351 PRIMARY KEY (`id`) USING BTREE
348 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; 352 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
349 /*!40101 SET character_set_client = @saved_cs_client */; 353 /*!40101 SET character_set_client = @saved_cs_client */;
350 354
351 -- 355 --
@@ -363,14 +367,14 @@ UNLOCK TABLES; @@ -363,14 +367,14 @@ UNLOCK TABLES;
363 367
364 DROP TABLE IF EXISTS `platform_gb_channel`; 368 DROP TABLE IF EXISTS `platform_gb_channel`;
365 /*!40101 SET @saved_cs_client = @@character_set_client */; 369 /*!40101 SET @saved_cs_client = @@character_set_client */;
366 -/*!50503 SET character_set_client = utf8mb4 */; 370 +/*!40101 SET character_set_client = utf8 */;
367 CREATE TABLE `platform_gb_channel` ( 371 CREATE TABLE `platform_gb_channel` (
368 - `id` int NOT NULL AUTO_INCREMENT,  
369 - `platformId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,  
370 - `catalogId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,  
371 - `deviceChannelId` int NOT NULL, 372 + `id` int(11) NOT NULL AUTO_INCREMENT,
  373 + `platformId` varchar(50) NOT NULL,
  374 + `catalogId` varchar(50) NOT NULL,
  375 + `deviceChannelId` int(11) NOT NULL,
372 PRIMARY KEY (`id`) 376 PRIMARY KEY (`id`)
373 -) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 377 +) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4;
374 /*!40101 SET character_set_client = @saved_cs_client */; 378 /*!40101 SET character_set_client = @saved_cs_client */;
375 379
376 -- 380 --
@@ -388,15 +392,15 @@ UNLOCK TABLES; @@ -388,15 +392,15 @@ UNLOCK TABLES;
388 392
389 DROP TABLE IF EXISTS `platform_gb_stream`; 393 DROP TABLE IF EXISTS `platform_gb_stream`;
390 /*!40101 SET @saved_cs_client = @@character_set_client */; 394 /*!40101 SET @saved_cs_client = @@character_set_client */;
391 -/*!50503 SET character_set_client = utf8mb4 */; 395 +/*!40101 SET character_set_client = utf8 */;
392 CREATE TABLE `platform_gb_stream` ( 396 CREATE TABLE `platform_gb_stream` (
393 - `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
394 - `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
395 - `gbStreamId` int NOT NULL,  
396 - `id` int NOT NULL AUTO_INCREMENT, 397 + `platformId` varchar(50) NOT NULL,
  398 + `catalogId` varchar(50) NOT NULL,
  399 + `gbStreamId` int(11) NOT NULL,
  400 + `id` int(11) NOT NULL AUTO_INCREMENT,
397 PRIMARY KEY (`id`), 401 PRIMARY KEY (`id`),
398 UNIQUE KEY `platform_gb_stream_pk` (`platformId`,`catalogId`,`gbStreamId`) 402 UNIQUE KEY `platform_gb_stream_pk` (`platformId`,`catalogId`,`gbStreamId`)
399 -) ENGINE=InnoDB AUTO_INCREMENT=301207 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; 403 +) ENGINE=InnoDB AUTO_INCREMENT=301210 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
400 /*!40101 SET character_set_client = @saved_cs_client */; 404 /*!40101 SET character_set_client = @saved_cs_client */;
401 405
402 -- 406 --
@@ -414,29 +418,29 @@ UNLOCK TABLES; @@ -414,29 +418,29 @@ UNLOCK TABLES;
414 418
415 DROP TABLE IF EXISTS `stream_proxy`; 419 DROP TABLE IF EXISTS `stream_proxy`;
416 /*!40101 SET @saved_cs_client = @@character_set_client */; 420 /*!40101 SET @saved_cs_client = @@character_set_client */;
417 -/*!50503 SET character_set_client = utf8mb4 */; 421 +/*!40101 SET character_set_client = utf8 */;
418 CREATE TABLE `stream_proxy` ( 422 CREATE TABLE `stream_proxy` (
419 - `id` int NOT NULL AUTO_INCREMENT,  
420 - `type` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,  
421 - `app` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,  
422 - `stream` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,  
423 - `url` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,  
424 - `src_url` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,  
425 - `dst_url` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,  
426 - `timeout_ms` int DEFAULT NULL,  
427 - `ffmpeg_cmd_key` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,  
428 - `rtp_type` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
429 - `mediaServerId` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, 423 + `id` int(11) NOT NULL AUTO_INCREMENT,
  424 + `type` varchar(50) NOT NULL,
  425 + `app` varchar(255) NOT NULL,
  426 + `stream` varchar(255) NOT NULL,
  427 + `url` varchar(255) DEFAULT NULL,
  428 + `src_url` varchar(255) DEFAULT NULL,
  429 + `dst_url` varchar(255) DEFAULT NULL,
  430 + `timeout_ms` int(11) DEFAULT NULL,
  431 + `ffmpeg_cmd_key` varchar(255) DEFAULT NULL,
  432 + `rtp_type` varchar(50) DEFAULT NULL,
  433 + `mediaServerId` varchar(50) DEFAULT NULL,
430 `enable_hls` bit(1) DEFAULT NULL, 434 `enable_hls` bit(1) DEFAULT NULL,
431 `enable_mp4` bit(1) DEFAULT NULL, 435 `enable_mp4` bit(1) DEFAULT NULL,
432 `enable` bit(1) NOT NULL, 436 `enable` bit(1) NOT NULL,
433 `status` bit(1) NOT NULL, 437 `status` bit(1) NOT NULL,
434 `enable_remove_none_reader` bit(1) NOT NULL, 438 `enable_remove_none_reader` bit(1) NOT NULL,
435 - `createTime` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,  
436 - `name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, 439 + `createTime` varchar(50) NOT NULL,
  440 + `name` varchar(255) DEFAULT NULL,
437 PRIMARY KEY (`id`), 441 PRIMARY KEY (`id`),
438 UNIQUE KEY `stream_proxy_pk` (`app`,`stream`) 442 UNIQUE KEY `stream_proxy_pk` (`app`,`stream`)
439 -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 443 +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4;
440 /*!40101 SET character_set_client = @saved_cs_client */; 444 /*!40101 SET character_set_client = @saved_cs_client */;
441 445
442 -- 446 --
@@ -454,20 +458,20 @@ UNLOCK TABLES; @@ -454,20 +458,20 @@ UNLOCK TABLES;
454 458
455 DROP TABLE IF EXISTS `stream_push`; 459 DROP TABLE IF EXISTS `stream_push`;
456 /*!40101 SET @saved_cs_client = @@character_set_client */; 460 /*!40101 SET @saved_cs_client = @@character_set_client */;
457 -/*!50503 SET character_set_client = utf8mb4 */; 461 +/*!40101 SET character_set_client = utf8 */;
458 CREATE TABLE `stream_push` ( 462 CREATE TABLE `stream_push` (
459 - `id` int NOT NULL AUTO_INCREMENT,  
460 - `app` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,  
461 - `stream` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,  
462 - `totalReaderCount` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
463 - `originType` int DEFAULT NULL,  
464 - `originTypeStr` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,  
465 - `createStamp` bigint DEFAULT NULL,  
466 - `aliveSecond` int DEFAULT NULL,  
467 - `mediaServerId` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, 463 + `id` int(11) NOT NULL AUTO_INCREMENT,
  464 + `app` varchar(255) NOT NULL,
  465 + `stream` varchar(255) NOT NULL,
  466 + `totalReaderCount` varchar(50) DEFAULT NULL,
  467 + `originType` int(11) DEFAULT NULL,
  468 + `originTypeStr` varchar(50) DEFAULT NULL,
  469 + `createStamp` bigint(20) DEFAULT NULL,
  470 + `aliveSecond` int(11) DEFAULT NULL,
  471 + `mediaServerId` varchar(50) DEFAULT NULL,
468 PRIMARY KEY (`id`), 472 PRIMARY KEY (`id`),
469 UNIQUE KEY `stream_push_pk` (`app`,`stream`) 473 UNIQUE KEY `stream_push_pk` (`app`,`stream`)
470 -) ENGINE=InnoDB AUTO_INCREMENT=300799 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; 474 +) ENGINE=InnoDB AUTO_INCREMENT=300838 DEFAULT CHARSET=utf8mb4;
471 /*!40101 SET character_set_client = @saved_cs_client */; 475 /*!40101 SET character_set_client = @saved_cs_client */;
472 476
473 -- 477 --
@@ -485,17 +489,17 @@ UNLOCK TABLES; @@ -485,17 +489,17 @@ UNLOCK TABLES;
485 489
486 DROP TABLE IF EXISTS `user`; 490 DROP TABLE IF EXISTS `user`;
487 /*!40101 SET @saved_cs_client = @@character_set_client */; 491 /*!40101 SET @saved_cs_client = @@character_set_client */;
488 -/*!50503 SET character_set_client = utf8mb4 */; 492 +/*!40101 SET character_set_client = utf8 */;
489 CREATE TABLE `user` ( 493 CREATE TABLE `user` (
490 - `id` int NOT NULL AUTO_INCREMENT,  
491 - `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
492 - `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
493 - `roleId` int NOT NULL,  
494 - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
495 - `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, 494 + `id` int(11) NOT NULL AUTO_INCREMENT,
  495 + `username` varchar(255) NOT NULL,
  496 + `password` varchar(255) NOT NULL,
  497 + `roleId` int(11) NOT NULL,
  498 + `createTime` varchar(50) NOT NULL,
  499 + `updateTime` varchar(50) NOT NULL,
496 PRIMARY KEY (`id`) USING BTREE, 500 PRIMARY KEY (`id`) USING BTREE,
497 UNIQUE KEY `user_username_uindex` (`username`) USING BTREE 501 UNIQUE KEY `user_username_uindex` (`username`) USING BTREE
498 -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; 502 +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
499 /*!40101 SET character_set_client = @saved_cs_client */; 503 /*!40101 SET character_set_client = @saved_cs_client */;
500 504
501 -- 505 --
@@ -504,7 +508,8 @@ CREATE TABLE `user` ( @@ -504,7 +508,8 @@ CREATE TABLE `user` (
504 508
505 LOCK TABLES `user` WRITE; 509 LOCK TABLES `user` WRITE;
506 /*!40000 ALTER TABLE `user` DISABLE KEYS */; 510 /*!40000 ALTER TABLE `user` DISABLE KEYS */;
507 -INSERT INTO `user` VALUES (1,'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021 - 04 - 13 14:14:57','2021 - 04 - 13 14:14:57'); 511 +INSERT INTO `user` VALUES
  512 + (1,'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021 - 04 - 13 14:14:57','2021 - 04 - 13 14:14:57');
508 /*!40000 ALTER TABLE `user` ENABLE KEYS */; 513 /*!40000 ALTER TABLE `user` ENABLE KEYS */;
509 UNLOCK TABLES; 514 UNLOCK TABLES;
510 515
@@ -514,15 +519,15 @@ UNLOCK TABLES; @@ -514,15 +519,15 @@ UNLOCK TABLES;
514 519
515 DROP TABLE IF EXISTS `user_role`; 520 DROP TABLE IF EXISTS `user_role`;
516 /*!40101 SET @saved_cs_client = @@character_set_client */; 521 /*!40101 SET @saved_cs_client = @@character_set_client */;
517 -/*!50503 SET character_set_client = utf8mb4 */; 522 +/*!40101 SET character_set_client = utf8 */;
518 CREATE TABLE `user_role` ( 523 CREATE TABLE `user_role` (
519 - `id` int NOT NULL AUTO_INCREMENT,  
520 - `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
521 - `authority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
522 - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,  
523 - `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, 524 + `id` int(11) NOT NULL AUTO_INCREMENT,
  525 + `name` varchar(50) NOT NULL,
  526 + `authority` varchar(50) NOT NULL,
  527 + `createTime` varchar(50) NOT NULL,
  528 + `updateTime` varchar(50) NOT NULL,
524 PRIMARY KEY (`id`) USING BTREE 529 PRIMARY KEY (`id`) USING BTREE
525 -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; 530 +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
526 /*!40101 SET character_set_client = @saved_cs_client */; 531 /*!40101 SET character_set_client = @saved_cs_client */;
527 532
528 -- 533 --
@@ -531,7 +536,8 @@ CREATE TABLE `user_role` ( @@ -531,7 +536,8 @@ CREATE TABLE `user_role` (
531 536
532 LOCK TABLES `user_role` WRITE; 537 LOCK TABLES `user_role` WRITE;
533 /*!40000 ALTER TABLE `user_role` DISABLE KEYS */; 538 /*!40000 ALTER TABLE `user_role` DISABLE KEYS */;
534 -INSERT INTO `user_role` VALUES (1,'admin','0','2021-04-13 14:14:57','2021-04-13 14:14:57'); 539 +INSERT INTO `user_role` VALUES
  540 + (1,'admin','0','2021-04-13 14:14:57','2021-04-13 14:14:57');
535 /*!40000 ALTER TABLE `user_role` ENABLE KEYS */; 541 /*!40000 ALTER TABLE `user_role` ENABLE KEYS */;
536 UNLOCK TABLES; 542 UNLOCK TABLES;
537 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 543 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -544,4 +550,4 @@ UNLOCK TABLES; @@ -544,4 +550,4 @@ UNLOCK TABLES;
544 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 550 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
545 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 551 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
546 552
547 --- Dump completed on 2022-03-07 8:26:30 553 +-- Dump completed on 2022-04-18 10:50:27
sql/update.sql
1 -alter table device  
2 - add subscribeCycleForMobilePosition int null; 1 +alter table parent_platform
  2 + add startOfflinePush int default 0 null;
3 3
4 -alter table device  
5 - add mobilePositionSubmissionInterval int default 5 null; 4 +alter table parent_platform
  5 + add administrativeDivision varchar(50) not null;
  6 +
  7 +alter table parent_platform
  8 + add catalogGroup int default 1 null;
6 9
7 alter table device 10 alter table device
8 - add subscribeCycleForAlarm int null;  
9 \ No newline at end of file 11 \ No newline at end of file
  12 + add ssrcCheck int default 0 null;
  13 +
src/main/java/com/genersoft/iot/vmp/gb28181/bean/Device.java
@@ -129,6 +129,11 @@ public class Device { @@ -129,6 +129,11 @@ public class Device {
129 */ 129 */
130 private int subscribeCycleForAlarm; 130 private int subscribeCycleForAlarm;
131 131
  132 + /**
  133 + * 是否开启ssrc校验,默认关闭,开启可以防止串流
  134 + */
  135 + private boolean ssrcCheck;
  136 +
132 137
133 public String getDeviceId() { 138 public String getDeviceId() {
134 return deviceId; 139 return deviceId;
@@ -321,4 +326,12 @@ public class Device { @@ -321,4 +326,12 @@ public class Device {
321 public void setSubscribeCycleForAlarm(int subscribeCycleForAlarm) { 326 public void setSubscribeCycleForAlarm(int subscribeCycleForAlarm) {
322 this.subscribeCycleForAlarm = subscribeCycleForAlarm; 327 this.subscribeCycleForAlarm = subscribeCycleForAlarm;
323 } 328 }
  329 +
  330 + public boolean isSsrcCheck() {
  331 + return ssrcCheck;
  332 + }
  333 +
  334 + public void setSsrcCheck(boolean ssrcCheck) {
  335 + this.ssrcCheck = ssrcCheck;
  336 + }
324 } 337 }
src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java
@@ -169,6 +169,11 @@ public class DeviceChannel { @@ -169,6 +169,11 @@ public class DeviceChannel {
169 */ 169 */
170 private boolean hasAudio; 170 private boolean hasAudio;
171 171
  172 + /**
  173 + * 标记通道的类型,0->国标通道 1->直播流通道 2->业务分组/虚拟组织/行政区划
  174 + */
  175 + private int channelType;
  176 +
172 public int getId() { 177 public int getId() {
173 return id; 178 return id;
174 } 179 }
@@ -441,4 +446,12 @@ public class DeviceChannel { @@ -441,4 +446,12 @@ public class DeviceChannel {
441 public void setUpdateTime(String updateTime) { 446 public void setUpdateTime(String updateTime) {
442 this.updateTime = updateTime; 447 this.updateTime = updateTime;
443 } 448 }
  449 +
  450 + public int getChannelType() {
  451 + return channelType;
  452 + }
  453 +
  454 + public void setChannelType(int channelType) {
  455 + this.channelType = channelType;
  456 + }
444 } 457 }
src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java
@@ -129,6 +129,21 @@ public class ParentPlatform { @@ -129,6 +129,21 @@ public class ParentPlatform {
129 */ 129 */
130 private boolean mobilePositionSubscribe; 130 private boolean mobilePositionSubscribe;
131 131
  132 + /**
  133 + * 点播未推流的设备时是否使用redis通知拉起
  134 + */
  135 + private boolean startOfflinePush;
  136 +
  137 + /**
  138 + * 目录分组-每次向上级发送通道信息时单个包携带的通道数量,取值1,2,4,8
  139 + */
  140 + private int catalogGroup;
  141 +
  142 + /**
  143 + * 行政区划
  144 + */
  145 + private String administrativeDivision;
  146 +
132 public Integer getId() { 147 public Integer getId() {
133 return id; 148 return id;
134 } 149 }
@@ -329,4 +344,28 @@ public class ParentPlatform { @@ -329,4 +344,28 @@ public class ParentPlatform {
329 public void setMobilePositionSubscribe(boolean mobilePositionSubscribe) { 344 public void setMobilePositionSubscribe(boolean mobilePositionSubscribe) {
330 this.mobilePositionSubscribe = mobilePositionSubscribe; 345 this.mobilePositionSubscribe = mobilePositionSubscribe;
331 } 346 }
  347 +
  348 + public boolean isStartOfflinePush() {
  349 + return startOfflinePush;
  350 + }
  351 +
  352 + public void setStartOfflinePush(boolean startOfflinePush) {
  353 + this.startOfflinePush = startOfflinePush;
  354 + }
  355 +
  356 + public int getCatalogGroup() {
  357 + return catalogGroup;
  358 + }
  359 +
  360 + public void setCatalogGroup(int catalogGroup) {
  361 + this.catalogGroup = catalogGroup;
  362 + }
  363 +
  364 + public String getAdministrativeDivision() {
  365 + return administrativeDivision;
  366 + }
  367 +
  368 + public void setAdministrativeDivision(String administrativeDivision) {
  369 + this.administrativeDivision = administrativeDivision;
  370 + }
332 } 371 }
src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java
@@ -85,6 +85,12 @@ public class CatalogDataCatch { @@ -85,6 +85,12 @@ public class CatalogDataCatch {
85 return syncStatus; 85 return syncStatus;
86 } 86 }
87 87
  88 + public boolean isSyncRunning(String deviceId) {
  89 + CatalogData catalogData = data.get(deviceId);
  90 + if (catalogData == null) return false;
  91 + return !catalogData.getStatus().equals(CatalogData.CatalogDataStatus.end);
  92 + }
  93 +
88 @Scheduled(fixedRate = 5 * 1000) //每5秒执行一次, 发现数据5秒未更新则移除数据并认为数据接收超时 94 @Scheduled(fixedRate = 5 * 1000) //每5秒执行一次, 发现数据5秒未更新则移除数据并认为数据接收超时
89 private void timerTask(){ 95 private void timerTask(){
90 Set<String> keys = data.keySet(); 96 Set<String> keys = data.keySet();
src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/CatalogSubscribeTask.java
@@ -10,6 +10,8 @@ import org.springframework.scheduling.annotation.Async; @@ -10,6 +10,8 @@ import org.springframework.scheduling.annotation.Async;
10 import javax.sip.Dialog; 10 import javax.sip.Dialog;
11 import javax.sip.DialogState; 11 import javax.sip.DialogState;
12 import javax.sip.ResponseEvent; 12 import javax.sip.ResponseEvent;
  13 +import java.util.Timer;
  14 +import java.util.TimerTask;
13 15
14 /** 16 /**
15 * 目录订阅任务 17 * 目录订阅任务
@@ -20,6 +22,8 @@ public class CatalogSubscribeTask implements ISubscribeTask { @@ -20,6 +22,8 @@ public class CatalogSubscribeTask implements ISubscribeTask {
20 private final ISIPCommander sipCommander; 22 private final ISIPCommander sipCommander;
21 private Dialog dialog; 23 private Dialog dialog;
22 24
  25 + private Timer timer ;
  26 +
23 public CatalogSubscribeTask(Device device, ISIPCommander sipCommander) { 27 public CatalogSubscribeTask(Device device, ISIPCommander sipCommander) {
24 this.device = device; 28 this.device = device;
25 this.sipCommander = sipCommander; 29 this.sipCommander = sipCommander;
@@ -27,6 +31,10 @@ public class CatalogSubscribeTask implements ISubscribeTask { @@ -27,6 +31,10 @@ public class CatalogSubscribeTask implements ISubscribeTask {
27 31
28 @Override 32 @Override
29 public void run() { 33 public void run() {
  34 + if (timer != null ) {
  35 + timer.cancel();
  36 + timer = null;
  37 + }
30 sipCommander.catalogSubscribe(device, dialog, eventResult -> { 38 sipCommander.catalogSubscribe(device, dialog, eventResult -> {
31 if (eventResult.dialog != null || eventResult.dialog.getState().equals(DialogState.CONFIRMED)) { 39 if (eventResult.dialog != null || eventResult.dialog.getState().equals(DialogState.CONFIRMED)) {
32 dialog = eventResult.dialog; 40 dialog = eventResult.dialog;
@@ -43,6 +51,13 @@ public class CatalogSubscribeTask implements ISubscribeTask { @@ -43,6 +51,13 @@ public class CatalogSubscribeTask implements ISubscribeTask {
43 dialog = null; 51 dialog = null;
44 // 失败 52 // 失败
45 logger.warn("[目录订阅]失败,信令发送失败: {}-{} ", device.getDeviceId(), eventResult.msg); 53 logger.warn("[目录订阅]失败,信令发送失败: {}-{} ", device.getDeviceId(), eventResult.msg);
  54 + timer = new Timer();
  55 + timer.schedule(new TimerTask() {
  56 + @Override
  57 + public void run() {
  58 + CatalogSubscribeTask.this.run();
  59 + }
  60 + }, 2000);
46 }); 61 });
47 } 62 }
48 63
@@ -56,9 +71,13 @@ public class CatalogSubscribeTask implements ISubscribeTask { @@ -56,9 +71,13 @@ public class CatalogSubscribeTask implements ISubscribeTask {
56 * TERMINATED-> Terminated Dialog状态-终止 71 * TERMINATED-> Terminated Dialog状态-终止
57 */ 72 */
58 logger.info("取消目录订阅时dialog状态为{}", DialogState.CONFIRMED); 73 logger.info("取消目录订阅时dialog状态为{}", DialogState.CONFIRMED);
  74 + if (timer != null ) {
  75 + timer.cancel();
  76 + timer = null;
  77 + }
59 if (dialog != null && dialog.getState().equals(DialogState.CONFIRMED)) { 78 if (dialog != null && dialog.getState().equals(DialogState.CONFIRMED)) {
60 device.setSubscribeCycleForCatalog(0); 79 device.setSubscribeCycleForCatalog(0);
61 - sipCommander.mobilePositionSubscribe(device, dialog, eventResult -> { 80 + sipCommander.catalogSubscribe(device, dialog, eventResult -> {
62 ResponseEvent event = (ResponseEvent) eventResult.event; 81 ResponseEvent event = (ResponseEvent) eventResult.event;
63 if (event.getResponse().getRawContent() != null) { 82 if (event.getResponse().getRawContent() != null) {
64 // 成功 83 // 成功
src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/MobilePositionSubscribeHandlerTask.java
@@ -29,7 +29,6 @@ public class MobilePositionSubscribeHandlerTask implements ISubscribeTask { @@ -29,7 +29,6 @@ public class MobilePositionSubscribeHandlerTask implements ISubscribeTask {
29 private String key; 29 private String key;
30 30
31 public MobilePositionSubscribeHandlerTask(IRedisCatchStorage redisCatchStorage, ISIPCommanderForPlatform sipCommanderForPlatform, IVideoManagerStorage storager, String platformId, String sn, String key, SubscribeHolder subscribeInfo) { 31 public MobilePositionSubscribeHandlerTask(IRedisCatchStorage redisCatchStorage, ISIPCommanderForPlatform sipCommanderForPlatform, IVideoManagerStorage storager, String platformId, String sn, String key, SubscribeHolder subscribeInfo) {
32 - System.out.println("MobilePositionSubscribeHandlerTask 初始化");  
33 this.redisCatchStorage = redisCatchStorage; 32 this.redisCatchStorage = redisCatchStorage;
34 this.storager = storager; 33 this.storager = storager;
35 this.platform = storager.queryParentPlatByServerGBId(platformId); 34 this.platform = storager.queryParentPlatByServerGBId(platformId);
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
@@ -32,6 +32,7 @@ import javax.sip.header.*; @@ -32,6 +32,7 @@ import javax.sip.header.*;
32 import javax.sip.message.Request; 32 import javax.sip.message.Request;
33 import java.lang.reflect.Field; 33 import java.lang.reflect.Field;
34 import java.text.ParseException; 34 import java.text.ParseException;
  35 +import java.util.ArrayList;
35 import java.util.HashSet; 36 import java.util.HashSet;
36 import java.util.List; 37 import java.util.List;
37 import java.util.UUID; 38 import java.util.UUID;
@@ -215,7 +216,11 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { @@ -215,7 +216,11 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
215 return false; 216 return false;
216 } 217 }
217 try { 218 try {
218 - String catalogXml = getCatalogXml(channel, sn, parentPlatform, size); 219 + List<DeviceChannel> channels = new ArrayList<>();
  220 + if (channel != null) {
  221 + channels.add(channel);
  222 + }
  223 + String catalogXml = getCatalogXml(channels, sn, parentPlatform, size);
219 224
220 // callid 225 // callid
221 CallIdHeader callIdHeader = parentPlatform.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() 226 CallIdHeader callIdHeader = parentPlatform.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId()
@@ -239,7 +244,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { @@ -239,7 +244,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
239 sendCatalogResponse(channels, parentPlatform, sn, fromTag, 0); 244 sendCatalogResponse(channels, parentPlatform, sn, fromTag, 0);
240 return true; 245 return true;
241 } 246 }
242 - private String getCatalogXml(DeviceChannel channel, String sn, ParentPlatform parentPlatform, int size) { 247 + private String getCatalogXml(List<DeviceChannel> channels, String sn, ParentPlatform parentPlatform, int size) {
243 String characterSet = parentPlatform.getCharacterSet(); 248 String characterSet = parentPlatform.getCharacterSet();
244 StringBuffer catalogXml = new StringBuffer(600); 249 StringBuffer catalogXml = new StringBuffer(600);
245 catalogXml.append("<?xml version=\"1.0\" encoding=\"" + characterSet +"\"?>\r\n"); 250 catalogXml.append("<?xml version=\"1.0\" encoding=\"" + characterSet +"\"?>\r\n");
@@ -248,34 +253,38 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { @@ -248,34 +253,38 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
248 catalogXml.append("<SN>" +sn + "</SN>\r\n"); 253 catalogXml.append("<SN>" +sn + "</SN>\r\n");
249 catalogXml.append("<DeviceID>" + parentPlatform.getDeviceGBId() + "</DeviceID>\r\n"); 254 catalogXml.append("<DeviceID>" + parentPlatform.getDeviceGBId() + "</DeviceID>\r\n");
250 catalogXml.append("<SumNum>" + size + "</SumNum>\r\n"); 255 catalogXml.append("<SumNum>" + size + "</SumNum>\r\n");
251 - catalogXml.append("<DeviceList Num=\"1\">\r\n");  
252 - catalogXml.append("<Item>\r\n");  
253 - if (channel != null) {  
254 - catalogXml.append("<DeviceID>" + channel.getChannelId() + "</DeviceID>\r\n");  
255 - catalogXml.append("<Name>" + channel.getName() + "</Name>\r\n");  
256 - catalogXml.append("<Manufacturer>" + channel.getManufacture() + "</Manufacturer>\r\n");  
257 - catalogXml.append("<Model>" + channel.getModel() + "</Model>\r\n");  
258 - catalogXml.append("<Owner>" + channel.getOwner() + "</Owner>\r\n");  
259 - catalogXml.append("<CivilCode>" + channel.getCivilCode() + "</CivilCode>\r\n");  
260 - catalogXml.append("<Address>" + channel.getAddress() + "</Address>\r\n");  
261 - catalogXml.append("<Parental>" + channel.getParental() + "</Parental>\r\n");  
262 - if (channel.getParentId() != null) {  
263 - catalogXml.append("<ParentID>" + channel.getParentId() + "</ParentID>\r\n"); 256 + catalogXml.append("<DeviceList Num=\"" + channels.size() +"\">\r\n");
  257 + if (channels.size() > 0) {
  258 + for (DeviceChannel channel : channels) {
  259 + catalogXml.append("<Item>\r\n");
  260 + catalogXml.append("<DeviceID>" + channel.getChannelId() + "</DeviceID>\r\n");
  261 + catalogXml.append("<Name>" + channel.getName() + "</Name>\r\n");
  262 + catalogXml.append("<Manufacturer>" + channel.getManufacture() + "</Manufacturer>\r\n");
  263 + catalogXml.append("<Parental>" + channel.getParental() + "</Parental>\r\n");
  264 + if (channel.getParentId() != null) {
  265 + catalogXml.append("<ParentID>" + channel.getParentId() + "</ParentID>\r\n");
  266 + }
  267 + catalogXml.append("<RegisterWay>" + channel.getRegisterWay() + "</RegisterWay>\r\n");
  268 + catalogXml.append("<Status>" + (channel.getStatus() == 0?"OFF":"ON") + "</Status>\r\n");
  269 + catalogXml.append("<Secrecy>" + channel.getSecrecy() + "</Secrecy>\r\n");
  270 + if (channel.getChannelType() != 2) { // 业务分组/虚拟组织/行政区划 不设置以下字段
  271 + catalogXml.append("<Model>" + channel.getModel() + "</Model>\r\n");
  272 + catalogXml.append("<Owner>" + channel.getOwner() + "</Owner>\r\n");
  273 + catalogXml.append("<CivilCode>" + channel.getCivilCode() + "</CivilCode>\r\n");
  274 + catalogXml.append("<Address>" + channel.getAddress() + "</Address>\r\n");
  275 + catalogXml.append("<Longitude>" + channel.getLongitude() + "</Longitude>\r\n");
  276 + catalogXml.append("<Latitude>" + channel.getLatitude() + "</Latitude>\r\n");
  277 + catalogXml.append("<IPAddress>" + channel.getIpAddress() + "</IPAddress>\r\n");
  278 + catalogXml.append("<Port>" + channel.getPort() + "</Port>\r\n");
  279 + catalogXml.append("<Info>\r\n");
  280 + catalogXml.append("<PTZType>" + channel.getPTZType() + "</PTZType>\r\n");
  281 + catalogXml.append("</Info>\r\n");
  282 + }
  283 +
  284 + catalogXml.append("</Item>\r\n");
264 } 285 }
265 - catalogXml.append("<Secrecy>" + channel.getSecrecy() + "</Secrecy>\r\n");  
266 - catalogXml.append("<RegisterWay>" + channel.getRegisterWay() + "</RegisterWay>\r\n");  
267 - catalogXml.append("<Status>" + (channel.getStatus() == 0?"OFF":"ON") + "</Status>\r\n");  
268 - catalogXml.append("<Longitude>" + channel.getLongitude() + "</Longitude>\r\n");  
269 - catalogXml.append("<Latitude>" + channel.getLatitude() + "</Latitude>\r\n");  
270 - catalogXml.append("<IPAddress>" + channel.getIpAddress() + "</IPAddress>\r\n");  
271 - catalogXml.append("<Port>" + channel.getPort() + "</Port>\r\n");  
272 - catalogXml.append("<Info>\r\n");  
273 - catalogXml.append("<PTZType>" + channel.getPTZType() + "</PTZType>\r\n");  
274 - catalogXml.append("</Info>\r\n");  
275 } 286 }
276 287
277 -  
278 - catalogXml.append("</Item>\r\n");  
279 catalogXml.append("</DeviceList>\r\n"); 288 catalogXml.append("</DeviceList>\r\n");
280 catalogXml.append("</Response>\r\n"); 289 catalogXml.append("</Response>\r\n");
281 return catalogXml.toString(); 290 return catalogXml.toString();
@@ -286,15 +295,20 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { @@ -286,15 +295,20 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
286 return; 295 return;
287 } 296 }
288 try { 297 try {
289 - DeviceChannel deviceChannel = channels.get(index);  
290 - String catalogXml = getCatalogXml(deviceChannel, sn, parentPlatform, channels.size()); 298 + List<DeviceChannel> deviceChannels;
  299 + if (index + parentPlatform.getCatalogGroup() < channels.size()) {
  300 + deviceChannels = channels.subList(index, index + parentPlatform.getCatalogGroup());
  301 + }else {
  302 + deviceChannels = channels.subList(index, channels.size());
  303 + }
  304 + String catalogXml = getCatalogXml(deviceChannels, sn, parentPlatform, channels.size());
291 // callid 305 // callid
292 CallIdHeader callIdHeader = parentPlatform.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() 306 CallIdHeader callIdHeader = parentPlatform.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId()
293 : udpSipProvider.getNewCallId(); 307 : udpSipProvider.getNewCallId();
294 308
295 Request request = headerProviderPlarformProvider.createMessageRequest(parentPlatform, catalogXml, fromTag, callIdHeader); 309 Request request = headerProviderPlarformProvider.createMessageRequest(parentPlatform, catalogXml, fromTag, callIdHeader);
296 transmitRequest(parentPlatform, request, null, eventResult -> { 310 transmitRequest(parentPlatform, request, null, eventResult -> {
297 - int indexNext = index + 1; 311 + int indexNext = index + parentPlatform.getCatalogGroup();
298 sendCatalogResponse(channels, parentPlatform, sn, fromTag, indexNext); 312 sendCatalogResponse(channels, parentPlatform, sn, fromTag, indexNext);
299 }); 313 });
300 } catch (SipException | ParseException | InvalidArgumentException e) { 314 } catch (SipException | ParseException | InvalidArgumentException e) {
@@ -432,13 +446,21 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { @@ -432,13 +446,21 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
432 if (index >= deviceChannels.size()) { 446 if (index >= deviceChannels.size()) {
433 return true; 447 return true;
434 } 448 }
  449 + List<DeviceChannel> channels;
  450 + if (index + parentPlatform.getCatalogGroup() < deviceChannels.size()) {
  451 + channels = deviceChannels.subList(index, index + parentPlatform.getCatalogGroup());
  452 + }else {
  453 + channels = deviceChannels.subList(index, deviceChannels.size());
  454 + }
435 try { 455 try {
436 Integer finalIndex = index; 456 Integer finalIndex = index;
437 - String catalogXmlContent = getCatalogXmlContentForCatalogAddOrUpdate(parentPlatform, deviceChannels.get(index ), deviceChannels.size(), type, subscribeInfo); 457 + String catalogXmlContent = getCatalogXmlContentForCatalogAddOrUpdate(parentPlatform, channels,
  458 + deviceChannels.size(), type, subscribeInfo);
438 sendNotify(parentPlatform, catalogXmlContent, subscribeInfo, eventResult -> { 459 sendNotify(parentPlatform, catalogXmlContent, subscribeInfo, eventResult -> {
439 logger.error("发送NOTIFY通知消息失败。错误:{} {}", eventResult.statusCode, eventResult.msg); 460 logger.error("发送NOTIFY通知消息失败。错误:{} {}", eventResult.statusCode, eventResult.msg);
440 }, (eventResult -> { 461 }, (eventResult -> {
441 - sendNotifyForCatalogAddOrUpdate(type, parentPlatform, deviceChannels, subscribeInfo, finalIndex + 1); 462 + sendNotifyForCatalogAddOrUpdate(type, parentPlatform, deviceChannels, subscribeInfo,
  463 + finalIndex + parentPlatform.getCatalogGroup());
442 })); 464 }));
443 } catch (SipException | ParseException e) { 465 } catch (SipException | ParseException e) {
444 e.printStackTrace(); 466 e.printStackTrace();
@@ -500,11 +522,9 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { @@ -500,11 +522,9 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
500 522
501 } 523 }
502 524
503 - private String getCatalogXmlContentForCatalogAddOrUpdate(ParentPlatform parentPlatform, DeviceChannel channel, int sumNum, String type, SubscribeInfo subscribeInfo) { 525 + private String getCatalogXmlContentForCatalogAddOrUpdate(ParentPlatform parentPlatform, List<DeviceChannel> channels, int sumNum, String type, SubscribeInfo subscribeInfo) {
504 StringBuffer catalogXml = new StringBuffer(600); 526 StringBuffer catalogXml = new StringBuffer(600);
505 - if (parentPlatform.getServerGBId().equals(channel.getParentId())) {  
506 - channel.setParentId(parentPlatform.getDeviceGBId());  
507 - } 527 +
508 String characterSet = parentPlatform.getCharacterSet(); 528 String characterSet = parentPlatform.getCharacterSet();
509 catalogXml.append("<?xml version=\"1.0\" encoding=\"" + characterSet + "\"?>\r\n"); 529 catalogXml.append("<?xml version=\"1.0\" encoding=\"" + characterSet + "\"?>\r\n");
510 catalogXml.append("<Notify>\r\n"); 530 catalogXml.append("<Notify>\r\n");
@@ -512,26 +532,35 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { @@ -512,26 +532,35 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
512 catalogXml.append("<SN>" + (int) ((Math.random() * 9 + 1) * 100000) + "</SN>\r\n"); 532 catalogXml.append("<SN>" + (int) ((Math.random() * 9 + 1) * 100000) + "</SN>\r\n");
513 catalogXml.append("<DeviceID>" + parentPlatform.getDeviceGBId() + "</DeviceID>\r\n"); 533 catalogXml.append("<DeviceID>" + parentPlatform.getDeviceGBId() + "</DeviceID>\r\n");
514 catalogXml.append("<SumNum>1</SumNum>\r\n"); 534 catalogXml.append("<SumNum>1</SumNum>\r\n");
515 - catalogXml.append("<DeviceList Num=\"1\">\r\n");  
516 - catalogXml.append("<Item>\r\n");  
517 - catalogXml.append("<DeviceID>" + channel.getChannelId() + "</DeviceID>\r\n");  
518 - catalogXml.append("<Name>" + channel.getName() + "</Name>\r\n");  
519 - catalogXml.append("<Manufacturer>" + channel.getManufacture() + "</Manufacturer>\r\n");  
520 - catalogXml.append("<Model>" + channel.getModel() + "</Model>\r\n");  
521 - catalogXml.append("<Owner>0</Owner>\r\n");  
522 - catalogXml.append("<CivilCode>CivilCode</CivilCode>\r\n");  
523 - catalogXml.append("<Address>" + channel.getAddress() + "</Address>\r\n");  
524 - catalogXml.append("<Parental>" + channel.getParental() + "</Parental>\r\n");  
525 - if (channel.getParentId() != null) {  
526 - catalogXml.append("<ParentID>" + channel.getParentId() + "</ParentID>\r\n");  
527 - }  
528 - catalogXml.append("<Secrecy>" + channel.getSecrecy() + "</Secrecy>\r\n");  
529 - catalogXml.append("<RegisterWay>" + channel.getRegisterWay() + "</RegisterWay>\r\n");  
530 - catalogXml.append("<Status>" + (channel.getStatus() == 0 ? "OFF" : "ON") + "</Status>\r\n");  
531 - if (!"presence".equals(subscribeInfo.getEventType())) {  
532 - catalogXml.append("<Event>" + type + "</Event>\r\n");  
533 - }  
534 - catalogXml.append("</Item>\r\n"); 535 + catalogXml.append("<DeviceList Num=\"" + channels.size() + "\">\r\n");
  536 + if (channels.size() > 0) {
  537 + for (DeviceChannel channel : channels) {
  538 + if (parentPlatform.getServerGBId().equals(channel.getParentId())) {
  539 + channel.setParentId(parentPlatform.getDeviceGBId());
  540 + }
  541 + catalogXml.append("<Item>\r\n");
  542 + catalogXml.append("<DeviceID>" + channel.getChannelId() + "</DeviceID>\r\n");
  543 + catalogXml.append("<Name>" + channel.getName() + "</Name>\r\n");
  544 + catalogXml.append("<Manufacturer>" + channel.getManufacture() + "</Manufacturer>\r\n");
  545 + catalogXml.append("<Parental>" + channel.getParental() + "</Parental>\r\n");
  546 + if (channel.getParentId() != null) {
  547 + catalogXml.append("<ParentID>" + channel.getParentId() + "</ParentID>\r\n");
  548 + }
  549 + catalogXml.append("<Secrecy>" + channel.getSecrecy() + "</Secrecy>\r\n");
  550 + catalogXml.append("<RegisterWay>" + channel.getRegisterWay() + "</RegisterWay>\r\n");
  551 + catalogXml.append("<Status>" + (channel.getStatus() == 0 ? "OFF" : "ON") + "</Status>\r\n");
  552 + if (channel.getChannelType() == 2) { // 业务分组/虚拟组织/行政区划 不设置以下属性
  553 + catalogXml.append("<Model>" + channel.getModel() + "</Model>\r\n");
  554 + catalogXml.append("<Owner>0</Owner>\r\n");
  555 + catalogXml.append("<CivilCode>CivilCode</CivilCode>\r\n");
  556 + catalogXml.append("<Address>" + channel.getAddress() + "</Address>\r\n");
  557 + }
  558 + if (!"presence".equals(subscribeInfo.getEventType())) {
  559 + catalogXml.append("<Event>" + type + "</Event>\r\n");
  560 + }
  561 + catalogXml.append("</Item>\r\n");
  562 + }
  563 + }
535 catalogXml.append("</DeviceList>\r\n"); 564 catalogXml.append("</DeviceList>\r\n");
536 catalogXml.append("</Notify>\r\n"); 565 catalogXml.append("</Notify>\r\n");
537 return catalogXml.toString(); 566 return catalogXml.toString();
@@ -553,13 +582,20 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { @@ -553,13 +582,20 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
553 if (index >= deviceChannels.size()) { 582 if (index >= deviceChannels.size()) {
554 return true; 583 return true;
555 } 584 }
  585 + List<DeviceChannel> channels;
  586 + if (index + parentPlatform.getCatalogGroup() < deviceChannels.size()) {
  587 + channels = deviceChannels.subList(index, index + parentPlatform.getCatalogGroup());
  588 + }else {
  589 + channels = deviceChannels.subList(index, deviceChannels.size());
  590 + }
556 try { 591 try {
557 Integer finalIndex = index; 592 Integer finalIndex = index;
558 - String catalogXmlContent = getCatalogXmlContentForCatalogOther(parentPlatform, deviceChannels.get(index), type); 593 + String catalogXmlContent = getCatalogXmlContentForCatalogOther(parentPlatform, channels, type);
559 sendNotify(parentPlatform, catalogXmlContent, subscribeInfo, eventResult -> { 594 sendNotify(parentPlatform, catalogXmlContent, subscribeInfo, eventResult -> {
560 logger.error("发送NOTIFY通知消息失败。错误:{} {}", eventResult.statusCode, eventResult.msg); 595 logger.error("发送NOTIFY通知消息失败。错误:{} {}", eventResult.statusCode, eventResult.msg);
561 }, (eventResult -> { 596 }, (eventResult -> {
562 - sendNotifyForCatalogOther(type, parentPlatform, deviceChannels, subscribeInfo, finalIndex + 1); 597 + sendNotifyForCatalogOther(type, parentPlatform, deviceChannels, subscribeInfo,
  598 + finalIndex + parentPlatform.getCatalogGroup());
563 })); 599 }));
564 } catch (SipException e) { 600 } catch (SipException e) {
565 e.printStackTrace(); 601 e.printStackTrace();
@@ -574,10 +610,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { @@ -574,10 +610,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
574 return true; 610 return true;
575 } 611 }
576 612
577 - private String getCatalogXmlContentForCatalogOther(ParentPlatform parentPlatform, DeviceChannel channel, String type) {  
578 - if (parentPlatform.getServerGBId().equals(channel.getParentId())) {  
579 - channel.setParentId(parentPlatform.getDeviceGBId());  
580 - } 613 + private String getCatalogXmlContentForCatalogOther(ParentPlatform parentPlatform, List<DeviceChannel> channels, String type) {
  614 +
581 String characterSet = parentPlatform.getCharacterSet(); 615 String characterSet = parentPlatform.getCharacterSet();
582 StringBuffer catalogXml = new StringBuffer(600); 616 StringBuffer catalogXml = new StringBuffer(600);
583 catalogXml.append("<?xml version=\"1.0\" encoding=\"" + characterSet + "\"?>\r\n"); 617 catalogXml.append("<?xml version=\"1.0\" encoding=\"" + characterSet + "\"?>\r\n");
@@ -586,11 +620,18 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { @@ -586,11 +620,18 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
586 catalogXml.append("<SN>" + (int) ((Math.random() * 9 + 1) * 100000) + "</SN>\r\n"); 620 catalogXml.append("<SN>" + (int) ((Math.random() * 9 + 1) * 100000) + "</SN>\r\n");
587 catalogXml.append("<DeviceID>" + parentPlatform.getDeviceGBId() + "</DeviceID>\r\n"); 621 catalogXml.append("<DeviceID>" + parentPlatform.getDeviceGBId() + "</DeviceID>\r\n");
588 catalogXml.append("<SumNum>1</SumNum>\r\n"); 622 catalogXml.append("<SumNum>1</SumNum>\r\n");
589 - catalogXml.append("<DeviceList Num=\"1\">\r\n");  
590 - catalogXml.append("<Item>\r\n");  
591 - catalogXml.append("<DeviceID>" + channel.getChannelId() + "</DeviceID>\r\n");  
592 - catalogXml.append("<Event>" + type + "</Event>\r\n");  
593 - catalogXml.append("</Item>\r\n"); 623 + catalogXml.append("<DeviceList Num=\" " + channels.size() + " \">\r\n");
  624 + if (channels.size() > 0) {
  625 + for (DeviceChannel channel : channels) {
  626 + if (parentPlatform.getServerGBId().equals(channel.getParentId())) {
  627 + channel.setParentId(parentPlatform.getDeviceGBId());
  628 + }
  629 + catalogXml.append("<Item>\r\n");
  630 + catalogXml.append("<DeviceID>" + channel.getChannelId() + "</DeviceID>\r\n");
  631 + catalogXml.append("<Event>" + type + "</Event>\r\n");
  632 + catalogXml.append("</Item>\r\n");
  633 + }
  634 + }
594 catalogXml.append("</DeviceList>\r\n"); 635 catalogXml.append("</DeviceList>\r\n");
595 catalogXml.append("</Notify>\r\n"); 636 catalogXml.append("</Notify>\r\n");
596 return catalogXml.toString(); 637 return catalogXml.toString();
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
@@ -397,6 +397,10 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements @@ -397,6 +397,10 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
397 logger.info("[ app={}, stream={} ]通道离线,启用流后开始推流",gbStream.getApp(), gbStream.getStream()); 397 logger.info("[ app={}, stream={} ]通道离线,启用流后开始推流",gbStream.getApp(), gbStream.getStream());
398 responseAck(evt, Response.BAD_REQUEST, "channel [" + gbStream.getGbId() + "] offline"); 398 responseAck(evt, Response.BAD_REQUEST, "channel [" + gbStream.getGbId() + "] offline");
399 }else if ("push".equals(gbStream.getStreamType())) { 399 }else if ("push".equals(gbStream.getStreamType())) {
  400 + if (!platform.isStartOfflinePush()) {
  401 + responseAck(evt, Response.TEMPORARILY_UNAVAILABLE, "channel unavailable");
  402 + return;
  403 + }
400 // 发送redis消息以使设备上线 404 // 发送redis消息以使设备上线
401 logger.info("[ app={}, stream={} ]通道离线,发送redis信息控制设备开始推流",gbStream.getApp(), gbStream.getStream()); 405 logger.info("[ app={}, stream={} ]通道离线,发送redis信息控制设备开始推流",gbStream.getApp(), gbStream.getStream());
402 MessageForPushChannel messageForPushChannel = new MessageForPushChannel(); 406 MessageForPushChannel messageForPushChannel = new MessageForPushChannel();
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java
@@ -3,7 +3,6 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl; @@ -3,7 +3,6 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl;
3 import com.genersoft.iot.vmp.common.VideoManagerConstants; 3 import com.genersoft.iot.vmp.common.VideoManagerConstants;
4 import com.genersoft.iot.vmp.conf.SipConfig; 4 import com.genersoft.iot.vmp.conf.SipConfig;
5 import com.genersoft.iot.vmp.gb28181.auth.DigestServerAuthenticationHelper; 5 import com.genersoft.iot.vmp.gb28181.auth.DigestServerAuthenticationHelper;
6 -import com.genersoft.iot.vmp.gb28181.auth.RegisterLogicHandler;  
7 import com.genersoft.iot.vmp.gb28181.bean.Device; 6 import com.genersoft.iot.vmp.gb28181.bean.Device;
8 import com.genersoft.iot.vmp.gb28181.bean.WvpSipDate; 7 import com.genersoft.iot.vmp.gb28181.bean.WvpSipDate;
9 import com.genersoft.iot.vmp.gb28181.event.EventPublisher; 8 import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
@@ -42,166 +41,157 @@ import java.util.Locale; @@ -42,166 +41,157 @@ import java.util.Locale;
42 @Component 41 @Component
43 public class RegisterRequestProcessor extends SIPRequestProcessorParent implements InitializingBean, ISIPRequestProcessor { 42 public class RegisterRequestProcessor extends SIPRequestProcessorParent implements InitializingBean, ISIPRequestProcessor {
44 43
45 - private Logger logger = LoggerFactory.getLogger(RegisterRequestProcessor.class);  
46 -  
47 - public String method = "REGISTER";  
48 -  
49 - @Autowired  
50 - private SipConfig sipConfig;  
51 -  
52 - @Autowired  
53 - private RegisterLogicHandler handler;  
54 -  
55 - @Autowired  
56 - private IRedisCatchStorage redisCatchStorage;  
57 -  
58 - @Autowired  
59 - private IVideoManagerStorage storager;  
60 -  
61 - @Autowired  
62 - private EventPublisher publisher;  
63 -  
64 - @Autowired  
65 - private SIPProcessorObserver sipProcessorObserver;  
66 -  
67 - @Override  
68 - public void afterPropertiesSet() throws Exception {  
69 - // 添加消息处理的订阅  
70 - sipProcessorObserver.addRequestProcessor(method, this);  
71 - }  
72 -  
73 - /**  
74 - * 收到注册请求 处理  
75 - * @param evt  
76 - */  
77 - @Override  
78 - public void process(RequestEvent evt) {  
79 - try {  
80 - RequestEventExt evtExt = (RequestEventExt)evt;  
81 - String requestAddress = evtExt.getRemoteIpAddress() + ":" + evtExt.getRemotePort();  
82 - logger.info("[{}] 收到注册请求,开始处理", requestAddress);  
83 - Request request = evt.getRequest();  
84 - ExpiresHeader expiresHeader = (ExpiresHeader) request.getHeader(Expires.NAME);  
85 - Response response = null;  
86 - boolean passwordCorrect = false;  
87 - // 注册标志 0:未携带授权头或者密码错误 1:注册成功 2:注销成功  
88 - int registerFlag = 0;  
89 - FromHeader fromHeader = (FromHeader) request.getHeader(FromHeader.NAME);  
90 - AddressImpl address = (AddressImpl) fromHeader.getAddress();  
91 - SipUri uri = (SipUri) address.getURI();  
92 - String deviceId = uri.getUser();  
93 - Device deviceInRedis = redisCatchStorage.getDevice(deviceId);  
94 - Device device = storager.queryVideoDevice(deviceId);  
95 - if (deviceInRedis != null && device == null) {  
96 - // redis 存在脏数据  
97 - redisCatchStorage.clearCatchByDeviceId(deviceId);  
98 - }  
99 - AuthorizationHeader authorhead = (AuthorizationHeader) request.getHeader(AuthorizationHeader.NAME);  
100 - // 校验密码是否正确  
101 - if (authorhead != null) {  
102 - passwordCorrect = new DigestServerAuthenticationHelper().doAuthenticatePlainTextPassword(request,  
103 - sipConfig.getPassword());  
104 - }  
105 - if (StringUtils.isEmpty(sipConfig.getPassword())){  
106 - passwordCorrect = true;  
107 - }  
108 -  
109 - // 未携带授权头或者密码错误 回复401  
110 - if (authorhead == null ) {  
111 -  
112 - logger.info("[{}] 未携带授权头 回复401", requestAddress);  
113 - response = getMessageFactory().createResponse(Response.UNAUTHORIZED, request);  
114 - new DigestServerAuthenticationHelper().generateChallenge(getHeaderFactory(), response, sipConfig.getDomain());  
115 - }else {  
116 - if (!passwordCorrect){  
117 - // 注册失败  
118 - response = getMessageFactory().createResponse(Response.FORBIDDEN, request);  
119 - response.setReasonPhrase("wrong password");  
120 - logger.info("[{}] 密码/SIP服务器ID错误, 回复403", requestAddress);  
121 - }else {  
122 - // 携带授权头并且密码正确  
123 - response = getMessageFactory().createResponse(Response.OK, request);  
124 - // 添加date头  
125 - SIPDateHeader dateHeader = new SIPDateHeader();  
126 - // 使用自己修改的  
127 - WvpSipDate wvpSipDate = new WvpSipDate(Calendar.getInstance(Locale.ENGLISH).getTimeInMillis());  
128 - dateHeader.setDate(wvpSipDate);  
129 - response.addHeader(dateHeader);  
130 -  
131 -  
132 - if (expiresHeader == null) {  
133 - response = getMessageFactory().createResponse(Response.BAD_REQUEST, request);  
134 - ServerTransaction serverTransaction = getServerTransaction(evt);  
135 - serverTransaction.sendResponse(response);  
136 - if (serverTransaction.getDialog() != null) serverTransaction.getDialog().delete();  
137 - return;  
138 - }  
139 - // 添加Contact头  
140 - response.addHeader(request.getHeader(ContactHeader.NAME));  
141 - // 添加Expires头  
142 - response.addHeader(request.getExpires());  
143 -  
144 - // 获取到通信地址等信息  
145 - ViaHeader viaHeader = (ViaHeader) request.getHeader(ViaHeader.NAME);  
146 - String received = viaHeader.getReceived();  
147 - int rPort = viaHeader.getRPort();  
148 - // 解析本地地址替代  
149 - if (StringUtils.isEmpty(received) || rPort == -1) {  
150 - received = viaHeader.getHost();  
151 - rPort = viaHeader.getPort();  
152 - }  
153 - //  
154 -  
155 - if (device == null) {  
156 - device = new Device();  
157 - device.setStreamMode("UDP");  
158 - device.setCharset("GB2312");  
159 - device.setDeviceId(deviceId);  
160 - device.setFirsRegister(true);  
161 - }else {  
162 - if (device.getOnline() == 0) {  
163 - device.setFirsRegister(true);  
164 - }  
165 - }  
166 - device.setIp(received);  
167 - device.setPort(rPort);  
168 - device.setHostAddress(received.concat(":").concat(String.valueOf(rPort)));  
169 - // 注销成功  
170 - if (expiresHeader.getExpires() == 0) {  
171 - registerFlag = 2;  
172 - }  
173 - // 注册成功  
174 - else {  
175 - device.setExpires(expiresHeader.getExpires());  
176 - registerFlag = 1;  
177 - // 判断TCP还是UDP  
178 - boolean isTcp = false;  
179 - ViaHeader reqViaHeader = (ViaHeader) request.getHeader(ViaHeader.NAME);  
180 - String transport = reqViaHeader.getTransport();  
181 - if (transport.equals("TCP")) {  
182 - isTcp = true;  
183 - }  
184 - device.setTransport(isTcp ? "TCP" : "UDP");  
185 - }  
186 - }  
187 - }  
188 -  
189 - ServerTransaction serverTransaction = getServerTransaction(evt);  
190 - serverTransaction.sendResponse(response);  
191 - if (serverTransaction.getDialog() != null) serverTransaction.getDialog().delete();  
192 - // 注册成功  
193 - // 保存到redis  
194 - if (registerFlag == 1 ) {  
195 - logger.info("[{}] 注册成功! deviceId:" + device.getDeviceId(), requestAddress);  
196 - publisher.onlineEventPublish(device, VideoManagerConstants.EVENT_ONLINE_REGISTER, expiresHeader.getExpires());  
197 - } else if (registerFlag == 2) {  
198 - logger.info("[{}] 注销成功! deviceId:" + device.getDeviceId(), requestAddress);  
199 - publisher.outlineEventPublish(device.getDeviceId(), VideoManagerConstants.EVENT_OUTLINE_UNREGISTER);  
200 - }  
201 - } catch (SipException | InvalidArgumentException | NoSuchAlgorithmException | ParseException e) {  
202 - e.printStackTrace();  
203 - }  
204 -  
205 - } 44 + private final Logger logger = LoggerFactory.getLogger(RegisterRequestProcessor.class);
  45 +
  46 + public String method = "REGISTER";
  47 +
  48 + @Autowired
  49 + private SipConfig sipConfig;
  50 +
  51 + @Autowired
  52 + private IRedisCatchStorage redisCatchStorage;
  53 +
  54 + @Autowired
  55 + private IVideoManagerStorage storager;
  56 +
  57 + @Autowired
  58 + private EventPublisher publisher;
  59 +
  60 + @Autowired
  61 + private SIPProcessorObserver sipProcessorObserver;
  62 +
  63 + @Override
  64 + public void afterPropertiesSet() throws Exception {
  65 + // 添加消息处理的订阅
  66 + sipProcessorObserver.addRequestProcessor(method, this);
  67 + }
  68 +
  69 + /**
  70 + * 收到注册请求 处理
  71 + *
  72 + * @param evt
  73 + */
  74 + @Override
  75 + public void process(RequestEvent evt) {
  76 + try {
  77 + RequestEventExt evtExt = (RequestEventExt) evt;
  78 + String requestAddress = evtExt.getRemoteIpAddress() + ":" + evtExt.getRemotePort();
  79 + logger.info("[{}] 收到注册请求,开始处理", requestAddress);
  80 + Request request = evt.getRequest();
  81 + ExpiresHeader expiresHeader = (ExpiresHeader) request.getHeader(Expires.NAME);
  82 + Response response = null;
  83 + boolean passwordCorrect = false;
  84 + // 注册标志 0:未携带授权头或者密码错误 1:注册成功 2:注销成功
  85 + int registerFlag = 0;
  86 + FromHeader fromHeader = (FromHeader) request.getHeader(FromHeader.NAME);
  87 + AddressImpl address = (AddressImpl) fromHeader.getAddress();
  88 + SipUri uri = (SipUri) address.getURI();
  89 + String deviceId = uri.getUser();
  90 +
  91 + AuthorizationHeader authHead = (AuthorizationHeader) request.getHeader(AuthorizationHeader.NAME);
  92 + if (authHead == null) {
  93 + logger.info("[{}] 未携带授权头 回复401", requestAddress);
  94 + response = getMessageFactory().createResponse(Response.UNAUTHORIZED, request);
  95 + new DigestServerAuthenticationHelper().generateChallenge(getHeaderFactory(), response, sipConfig.getDomain());
  96 + sendResponse(evt, response);
  97 + return;
  98 + }
  99 +
  100 + // 校验密码是否正确
  101 + passwordCorrect = StringUtils.isEmpty(sipConfig.getPassword()) ||
  102 + new DigestServerAuthenticationHelper().doAuthenticatePlainTextPassword(request, sipConfig.getPassword());
  103 + // 未携带授权头或者密码错误 回复401
  104 +
  105 + if (!passwordCorrect) {
  106 + // 注册失败
  107 + response = getMessageFactory().createResponse(Response.FORBIDDEN, request);
  108 + response.setReasonPhrase("wrong password");
  109 + logger.info("[{}] 密码/SIP服务器ID错误, 回复403", requestAddress);
  110 + sendResponse(evt, response);
  111 + return;
  112 + }
  113 +
  114 + Device deviceInRedis = redisCatchStorage.getDevice(deviceId);
  115 + Device device = storager.queryVideoDevice(deviceId);
  116 + if (deviceInRedis != null && device == null) {
  117 + // redis 存在脏数据
  118 + redisCatchStorage.clearCatchByDeviceId(deviceId);
  119 + }
  120 + // 携带授权头并且密码正确
  121 + response = getMessageFactory().createResponse(Response.OK, request);
  122 + // 添加date头
  123 + SIPDateHeader dateHeader = new SIPDateHeader();
  124 + // 使用自己修改的
  125 + WvpSipDate wvpSipDate = new WvpSipDate(Calendar.getInstance(Locale.ENGLISH).getTimeInMillis());
  126 + dateHeader.setDate(wvpSipDate);
  127 + response.addHeader(dateHeader);
  128 +
  129 + if (expiresHeader == null) {
  130 + response = getMessageFactory().createResponse(Response.BAD_REQUEST, request);
  131 + ServerTransaction serverTransaction = getServerTransaction(evt);
  132 + serverTransaction.sendResponse(response);
  133 + if (serverTransaction.getDialog() != null) serverTransaction.getDialog().delete();
  134 + return;
  135 + }
  136 + // 添加Contact头
  137 + response.addHeader(request.getHeader(ContactHeader.NAME));
  138 + // 添加Expires头
  139 + response.addHeader(request.getExpires());
  140 +
  141 + // 获取到通信地址等信息
  142 + ViaHeader viaHeader = (ViaHeader) request.getHeader(ViaHeader.NAME);
  143 + String received = viaHeader.getReceived();
  144 + int rPort = viaHeader.getRPort();
  145 + // 解析本地地址替代
  146 + if (StringUtils.isEmpty(received) || rPort == -1) {
  147 + received = viaHeader.getHost();
  148 + rPort = viaHeader.getPort();
  149 + }
  150 + if (device == null) {
  151 + device = new Device();
  152 + device.setStreamMode("UDP");
  153 + device.setCharset("GB2312");
  154 + device.setDeviceId(deviceId);
  155 + device.setFirsRegister(true);
  156 + } else {
  157 + device.setFirsRegister(device.getOnline() == 0);
  158 + }
  159 + device.setIp(received);
  160 + device.setPort(rPort);
  161 + device.setHostAddress(received.concat(":").concat(String.valueOf(rPort)));
  162 + if (expiresHeader.getExpires() == 0) {
  163 + // 注销成功
  164 + registerFlag = 2;
  165 + } else {
  166 + // 注册成功
  167 + device.setExpires(expiresHeader.getExpires());
  168 + registerFlag = 1;
  169 + // 判断TCP还是UDP
  170 + ViaHeader reqViaHeader = (ViaHeader) request.getHeader(ViaHeader.NAME);
  171 + String transport = reqViaHeader.getTransport();
  172 + device.setTransport("TCP".equals(transport) ? "TCP" : "UDP");
  173 + }
  174 +
  175 + sendResponse(evt, response);
  176 + // 注册成功
  177 + // 保存到redis
  178 + if (registerFlag == 1) {
  179 + logger.info("[{}] 注册成功! deviceId:" + deviceId, requestAddress);
  180 + publisher.onlineEventPublish(device, VideoManagerConstants.EVENT_ONLINE_REGISTER, expiresHeader.getExpires());
  181 + } else if (registerFlag == 2) {
  182 + logger.info("[{}] 注销成功! deviceId:" + deviceId, requestAddress);
  183 + publisher.outlineEventPublish(deviceId, VideoManagerConstants.EVENT_OUTLINE_UNREGISTER);
  184 + }
  185 + } catch (SipException | InvalidArgumentException | NoSuchAlgorithmException | ParseException e) {
  186 + e.printStackTrace();
  187 + }
  188 +
  189 + }
  190 +
  191 + private void sendResponse(RequestEvent evt, Response response) throws InvalidArgumentException, SipException {
  192 + ServerTransaction serverTransaction = getServerTransaction(evt);
  193 + serverTransaction.sendResponse(response);
  194 + if (serverTransaction.getDialog() != null) serverTransaction.getDialog().delete();
  195 + }
206 196
207 } 197 }
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/CatalogNotifyMessageHandler.java
@@ -79,7 +79,7 @@ public class CatalogNotifyMessageHandler extends SIPRequestProcessorParent imple @@ -79,7 +79,7 @@ public class CatalogNotifyMessageHandler extends SIPRequestProcessorParent imple
79 deviceChannel.setParental(1); 79 deviceChannel.setParental(1);
80 deviceChannel.setParentId(catalog.getParentId()); 80 deviceChannel.setParentId(catalog.getParentId());
81 deviceChannel.setRegisterWay(1); 81 deviceChannel.setRegisterWay(1);
82 - deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0,6)); 82 + deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision());
83 deviceChannel.setModel("live"); 83 deviceChannel.setModel("live");
84 deviceChannel.setOwner("wvp-pro"); 84 deviceChannel.setOwner("wvp-pro");
85 deviceChannel.setSecrecy("0"); 85 deviceChannel.setSecrecy("0");
@@ -116,7 +116,7 @@ public class CatalogNotifyMessageHandler extends SIPRequestProcessorParent imple @@ -116,7 +116,7 @@ public class CatalogNotifyMessageHandler extends SIPRequestProcessorParent imple
116 deviceChannel.setStatus(1); 116 deviceChannel.setStatus(1);
117 deviceChannel.setParentId(gbStream.getCatalogId()); 117 deviceChannel.setParentId(gbStream.getCatalogId());
118 deviceChannel.setRegisterWay(1); 118 deviceChannel.setRegisterWay(1);
119 - deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0,6)); 119 + deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision());
120 deviceChannel.setModel("live"); 120 deviceChannel.setModel("live");
121 deviceChannel.setOwner("wvp-pro"); 121 deviceChannel.setOwner("wvp-pro");
122 deviceChannel.setParental(0); 122 deviceChannel.setParental(0);
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java
@@ -83,20 +83,17 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem @@ -83,20 +83,17 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem
83 catalog.setParentId(parentPlatform.getDeviceGBId()); 83 catalog.setParentId(parentPlatform.getDeviceGBId());
84 } 84 }
85 DeviceChannel deviceChannel = new DeviceChannel(); 85 DeviceChannel deviceChannel = new DeviceChannel();
  86 + // 通道的类型,0->国标通道 1->直播流通道 2->业务分组/虚拟组织/行政区划
  87 + deviceChannel.setChannelType(2);
86 deviceChannel.setChannelId(catalog.getId()); 88 deviceChannel.setChannelId(catalog.getId());
87 deviceChannel.setName(catalog.getName()); 89 deviceChannel.setName(catalog.getName());
88 - deviceChannel.setLongitude(0.0);  
89 - deviceChannel.setLatitude(0.0);  
90 deviceChannel.setDeviceId(parentPlatform.getDeviceGBId()); 90 deviceChannel.setDeviceId(parentPlatform.getDeviceGBId());
91 deviceChannel.setManufacture("wvp-pro"); 91 deviceChannel.setManufacture("wvp-pro");
92 deviceChannel.setStatus(1); 92 deviceChannel.setStatus(1);
93 deviceChannel.setParental(1); 93 deviceChannel.setParental(1);
94 deviceChannel.setParentId(catalog.getParentId()); 94 deviceChannel.setParentId(catalog.getParentId());
95 deviceChannel.setRegisterWay(1); 95 deviceChannel.setRegisterWay(1);
96 - deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0,6));  
97 - deviceChannel.setModel("live");  
98 - deviceChannel.setOwner("wvp-pro");  
99 - deviceChannel.setSecrecy("0"); 96 + deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision());
100 allChannels.add(deviceChannel); 97 allChannels.add(deviceChannel);
101 } 98 }
102 } 99 }
@@ -107,6 +104,8 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem @@ -107,6 +104,8 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem
107 channel.setCatalogId(parentPlatform.getDeviceGBId()); 104 channel.setCatalogId(parentPlatform.getDeviceGBId());
108 } 105 }
109 DeviceChannel deviceChannel = storage.queryChannel(channel.getDeviceId(), channel.getChannelId()); 106 DeviceChannel deviceChannel = storage.queryChannel(channel.getDeviceId(), channel.getChannelId());
  107 + // 通道的类型,0->国标通道 1->直播流通道 2->业务分组/虚拟组织/行政区划
  108 + deviceChannel.setChannelType(0);
110 deviceChannel.setParental(0); 109 deviceChannel.setParental(0);
111 deviceChannel.setParentId(channel.getCatalogId()); 110 deviceChannel.setParentId(channel.getCatalogId());
112 deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0, 6)); 111 deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0, 6));
@@ -120,6 +119,8 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem @@ -120,6 +119,8 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem
120 gbStream.setCatalogId(null); 119 gbStream.setCatalogId(null);
121 } 120 }
122 DeviceChannel deviceChannel = new DeviceChannel(); 121 DeviceChannel deviceChannel = new DeviceChannel();
  122 + // 通道的类型,0->国标通道 1->直播流通道 2->业务分组/虚拟组织/行政区划
  123 + deviceChannel.setChannelType(1);
123 deviceChannel.setChannelId(gbStream.getGbId()); 124 deviceChannel.setChannelId(gbStream.getGbId());
124 deviceChannel.setName(gbStream.getName()); 125 deviceChannel.setName(gbStream.getName());
125 deviceChannel.setLongitude(gbStream.getLongitude()); 126 deviceChannel.setLongitude(gbStream.getLongitude());
@@ -130,7 +131,7 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem @@ -130,7 +131,7 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem
130 deviceChannel.setStatus(1); 131 deviceChannel.setStatus(1);
131 deviceChannel.setParentId(gbStream.getCatalogId()); 132 deviceChannel.setParentId(gbStream.getCatalogId());
132 deviceChannel.setRegisterWay(1); 133 deviceChannel.setRegisterWay(1);
133 - deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0,6)); 134 + deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision());
134 deviceChannel.setModel("live"); 135 deviceChannel.setModel("live");
135 deviceChannel.setOwner("wvp-pro"); 136 deviceChannel.setOwner("wvp-pro");
136 deviceChannel.setParental(0); 137 deviceChannel.setParental(0);
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java
@@ -118,8 +118,8 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp @@ -118,8 +118,8 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp
118 channelList.add(deviceChannel); 118 channelList.add(deviceChannel);
119 } 119 }
120 int sn = Integer.parseInt(snElement.getText()); 120 int sn = Integer.parseInt(snElement.getText());
121 - logger.info("收到来自设备【{}】的通道: {}个,{}/{}", device.getDeviceId(), channelList.size(), catalogDataCatch.get(key) == null ? 0 :catalogDataCatch.get(key).size(), sumNum);  
122 catalogDataCatch.put(device.getDeviceId(), sn, sumNum, device, channelList); 121 catalogDataCatch.put(device.getDeviceId(), sn, sumNum, device, channelList);
  122 + logger.info("收到来自设备【{}】的通道: {}个,{}/{}", device.getDeviceId(), channelList.size(), catalogDataCatch.get(device.getDeviceId()) == null ? 0 :catalogDataCatch.get(device.getDeviceId()).size(), sumNum);
123 if (catalogDataCatch.get(device.getDeviceId()).size() == sumNum) { 123 if (catalogDataCatch.get(device.getDeviceId()).size() == sumNum) {
124 // 数据已经完整接收 124 // 数据已经完整接收
125 boolean resetChannelsResult = storager.resetChannels(device.getDeviceId(), catalogDataCatch.get(device.getDeviceId())); 125 boolean resetChannelsResult = storager.resetChannels(device.getDeviceId(), catalogDataCatch.get(device.getDeviceId()));
@@ -223,6 +223,14 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp @@ -223,6 +223,14 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp
223 } 223 }
224 } 224 }
225 225
  226 + public boolean isSyncRunning(String deviceId) {
  227 + if (catalogDataCatch.get(deviceId) == null) {
  228 + return false;
  229 + }else {
  230 + return catalogDataCatch.isSyncRunning(deviceId);
  231 + }
  232 + }
  233 +
226 public void setChannelSyncReady(Device device, int sn) { 234 public void setChannelSyncReady(Device device, int sn) {
227 catalogDataCatch.addReady(device, sn); 235 catalogDataCatch.addReady(device, sn);
228 } 236 }
src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
@@ -20,8 +20,8 @@ import java.util.*; @@ -20,8 +20,8 @@ import java.util.*;
20 20
21 /** 21 /**
22 * 基于dom4j的工具包 22 * 基于dom4j的工具包
23 - *  
24 - * 23 + *
  24 + *
25 */ 25 */
26 public class XmlUtil { 26 public class XmlUtil {
27 /** 27 /**
@@ -31,9 +31,9 @@ public class XmlUtil { @@ -31,9 +31,9 @@ public class XmlUtil {
31 31
32 /** 32 /**
33 * 解析XML为Document对象 33 * 解析XML为Document对象
34 - * 34 + *
35 * @param xml 被解析的XMl 35 * @param xml 被解析的XMl
36 - * 36 + *
37 * @return Document 37 * @return Document
38 */ 38 */
39 public static Element parseXml(String xml) { 39 public static Element parseXml(String xml) {
@@ -51,7 +51,7 @@ public class XmlUtil { @@ -51,7 +51,7 @@ public class XmlUtil {
51 51
52 /** 52 /**
53 * 获取element对象的text的值 53 * 获取element对象的text的值
54 - * 54 + *
55 * @param em 节点的对象 55 * @param em 节点的对象
56 * @param tag 节点的tag 56 * @param tag 节点的tag
57 * @return 节点 57 * @return 节点
@@ -62,12 +62,12 @@ public class XmlUtil { @@ -62,12 +62,12 @@ public class XmlUtil {
62 } 62 }
63 Element e = em.element(tag); 63 Element e = em.element(tag);
64 // 64 //
65 - return null == e ? null : e.getText(); 65 + return null == e ? null : e.getText().trim();
66 } 66 }
67 67
68 /** 68 /**
69 * 递归解析xml节点,适用于 多节点数据 69 * 递归解析xml节点,适用于 多节点数据
70 - * 70 + *
71 * @param node node 71 * @param node node
72 * @param nodeName nodeName 72 * @param nodeName nodeName
73 * @return List<Map<String, Object>> 73 * @return List<Map<String, Object>>
@@ -106,7 +106,7 @@ public class XmlUtil { @@ -106,7 +106,7 @@ public class XmlUtil {
106 106
107 /** 107 /**
108 * xml转json 108 * xml转json
109 - * 109 + *
110 * @param element 110 * @param element
111 * @param json 111 * @param json
112 */ 112 */
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java
@@ -81,7 +81,7 @@ public class ZLMRTPServerFactory { @@ -81,7 +81,7 @@ public class ZLMRTPServerFactory {
81 return result; 81 return result;
82 } 82 }
83 83
84 - public int createRTPServer(MediaServerItem mediaServerItem, String streamId) { 84 + public int createRTPServer(MediaServerItem mediaServerItem, String streamId, int ssrc) {
85 int result = -1; 85 int result = -1;
86 // 查询此rtp server 是否已经存在 86 // 查询此rtp server 是否已经存在
87 JSONObject rtpInfo = zlmresTfulUtils.getRtpInfo(mediaServerItem, streamId); 87 JSONObject rtpInfo = zlmresTfulUtils.getRtpInfo(mediaServerItem, streamId);
@@ -94,6 +94,7 @@ public class ZLMRTPServerFactory { @@ -94,6 +94,7 @@ public class ZLMRTPServerFactory {
94 param.put("enable_tcp", 1); 94 param.put("enable_tcp", 1);
95 param.put("stream_id", streamId); 95 param.put("stream_id", streamId);
96 param.put("port", 0); 96 param.put("port", 0);
  97 + param.put("ssrc", ssrc);
97 JSONObject openRtpServerResultJson = zlmresTfulUtils.openRtpServer(mediaServerItem, param); 98 JSONObject openRtpServerResultJson = zlmresTfulUtils.openRtpServer(mediaServerItem, param);
98 99
99 if (openRtpServerResultJson != null) { 100 if (openRtpServerResultJson != null) {
src/main/java/com/genersoft/iot/vmp/service/IDeviceService.java
@@ -44,6 +44,13 @@ public interface IDeviceService { @@ -44,6 +44,13 @@ public interface IDeviceService {
44 SyncStatus getChannelSyncStatus(String deviceId); 44 SyncStatus getChannelSyncStatus(String deviceId);
45 45
46 /** 46 /**
  47 + * 查看是否仍在同步
  48 + * @param deviceId 设备ID
  49 + * @return
  50 + */
  51 + Boolean isSyncRunning(String deviceId);
  52 +
  53 + /**
47 * 通道同步 54 * 通道同步
48 * @param device 55 * @param device
49 */ 56 */
src/main/java/com/genersoft/iot/vmp/service/IMediaServerService.java
@@ -44,9 +44,9 @@ public interface IMediaServerService { @@ -44,9 +44,9 @@ public interface IMediaServerService {
44 44
45 void updateVmServer(List<MediaServerItem> mediaServerItemList); 45 void updateVmServer(List<MediaServerItem> mediaServerItemList);
46 46
47 - SSRCInfo openRTPServer(MediaServerItem mediaServerItem, String streamId); 47 + SSRCInfo openRTPServer(MediaServerItem mediaServerItem, String streamId, boolean ssrcCheck);
48 48
49 - SSRCInfo openRTPServer(MediaServerItem mediaServerItem, String streamId, boolean isPlayback); 49 + SSRCInfo openRTPServer(MediaServerItem mediaServerItem, String streamId, boolean ssrcCheck, boolean isPlayback);
50 50
51 void closeRTPServer(String deviceId, String channelId, String ssrc); 51 void closeRTPServer(String deviceId, String channelId, String ssrc);
52 52
src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java
@@ -41,10 +41,6 @@ public class DeviceServiceImpl implements IDeviceService { @@ -41,10 +41,6 @@ public class DeviceServiceImpl implements IDeviceService {
41 if (device == null || device.getSubscribeCycleForCatalog() < 0) { 41 if (device == null || device.getSubscribeCycleForCatalog() < 0) {
42 return false; 42 return false;
43 } 43 }
44 - CatalogSubscribeTask task = (CatalogSubscribeTask)dynamicTask.get(device.getDeviceId() + "catalog");  
45 - if (task != null && task.getDialogState() != null && task.getDialogState().equals(DialogState.CONFIRMED)) { // 已存在不需要再次添加  
46 - return true;  
47 - }  
48 logger.info("[添加目录订阅] 设备{}", device.getDeviceId()); 44 logger.info("[添加目录订阅] 设备{}", device.getDeviceId());
49 // 添加目录订阅 45 // 添加目录订阅
50 CatalogSubscribeTask catalogSubscribeTask = new CatalogSubscribeTask(device, sipCommander); 46 CatalogSubscribeTask catalogSubscribeTask = new CatalogSubscribeTask(device, sipCommander);
@@ -71,10 +67,6 @@ public class DeviceServiceImpl implements IDeviceService { @@ -71,10 +67,6 @@ public class DeviceServiceImpl implements IDeviceService {
71 return false; 67 return false;
72 } 68 }
73 logger.info("[添加移动位置订阅] 设备{}", device.getDeviceId()); 69 logger.info("[添加移动位置订阅] 设备{}", device.getDeviceId());
74 - MobilePositionSubscribeTask task = (MobilePositionSubscribeTask)dynamicTask.get(device.getDeviceId() + "mobile_position");  
75 - if (task != null && task.getDialogState() != null && task.getDialogState().equals(DialogState.CONFIRMED)) { // 已存在不需要再次添加  
76 - return true;  
77 - }  
78 // 添加目录订阅 70 // 添加目录订阅
79 MobilePositionSubscribeTask mobilePositionSubscribeTask = new MobilePositionSubscribeTask(device, sipCommander); 71 MobilePositionSubscribeTask mobilePositionSubscribeTask = new MobilePositionSubscribeTask(device, sipCommander);
80 // 提前开始刷新订阅 72 // 提前开始刷新订阅
@@ -100,8 +92,13 @@ public class DeviceServiceImpl implements IDeviceService { @@ -100,8 +92,13 @@ public class DeviceServiceImpl implements IDeviceService {
100 } 92 }
101 93
102 @Override 94 @Override
  95 + public Boolean isSyncRunning(String deviceId) {
  96 + return catalogResponseMessageHandler.isSyncRunning(deviceId);
  97 + }
  98 +
  99 + @Override
103 public void sync(Device device) { 100 public void sync(Device device) {
104 - if (catalogResponseMessageHandler.getChannelSyncProgress(device.getDeviceId()) != null) { 101 + if (catalogResponseMessageHandler.isSyncRunning(device.getDeviceId())) {
105 logger.info("开启同步时发现同步已经存在"); 102 logger.info("开启同步时发现同步已经存在");
106 return; 103 return;
107 } 104 }
src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
@@ -117,12 +117,12 @@ public class MediaServerServiceImpl implements IMediaServerService { @@ -117,12 +117,12 @@ public class MediaServerServiceImpl implements IMediaServerService {
117 } 117 }
118 118
119 @Override 119 @Override
120 - public SSRCInfo openRTPServer(MediaServerItem mediaServerItem, String streamId) {  
121 - return openRTPServer(mediaServerItem, streamId, false); 120 + public SSRCInfo openRTPServer(MediaServerItem mediaServerItem, String streamId, boolean ssrcCheck) {
  121 + return openRTPServer(mediaServerItem, streamId, ssrcCheck,false);
122 } 122 }
123 123
124 @Override 124 @Override
125 - public SSRCInfo openRTPServer(MediaServerItem mediaServerItem, String streamId, boolean isPlayback) { 125 + public SSRCInfo openRTPServer(MediaServerItem mediaServerItem, String streamId, boolean ssrcCheck, boolean isPlayback) {
126 if (mediaServerItem == null || mediaServerItem.getId() == null) { 126 if (mediaServerItem == null || mediaServerItem.getId() == null) {
127 return null; 127 return null;
128 } 128 }
@@ -146,7 +146,7 @@ public class MediaServerServiceImpl implements IMediaServerService { @@ -146,7 +146,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
146 } 146 }
147 int rtpServerPort = mediaServerItem.getRtpProxyPort(); 147 int rtpServerPort = mediaServerItem.getRtpProxyPort();
148 if (mediaServerItem.isRtpEnable()) { 148 if (mediaServerItem.isRtpEnable()) {
149 - rtpServerPort = zlmrtpServerFactory.createRTPServer(mediaServerItem, streamId); 149 + rtpServerPort = zlmrtpServerFactory.createRTPServer(mediaServerItem, streamId, ssrcCheck?Integer.parseInt(ssrc):0);
150 } 150 }
151 redisUtil.set(key, mediaServerItem); 151 redisUtil.set(key, mediaServerItem);
152 return new SSRCInfo(rtpServerPort, ssrc, streamId); 152 return new SSRCInfo(rtpServerPort, ssrc, streamId);
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
@@ -188,7 +188,7 @@ public class PlayServiceImpl implements IPlayService { @@ -188,7 +188,7 @@ public class PlayServiceImpl implements IPlayService {
188 if (mediaServerItem.isRtpEnable()) { 188 if (mediaServerItem.isRtpEnable()) {
189 streamId = String.format("%s_%s", device.getDeviceId(), channelId); 189 streamId = String.format("%s_%s", device.getDeviceId(), channelId);
190 } 190 }
191 - SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId); 191 + SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId, device.isSsrcCheck());
192 play(mediaServerItem, ssrcInfo, device, channelId, (mediaServerItemInUse, response)->{ 192 play(mediaServerItem, ssrcInfo, device, channelId, (mediaServerItemInUse, response)->{
193 if (hookEvent != null) { 193 if (hookEvent != null) {
194 hookEvent.response(mediaServerItem, response); 194 hookEvent.response(mediaServerItem, response);
@@ -232,7 +232,7 @@ public class PlayServiceImpl implements IPlayService { @@ -232,7 +232,7 @@ public class PlayServiceImpl implements IPlayService {
232 streamId = String.format("%s_%s", device.getDeviceId(), channelId); 232 streamId = String.format("%s_%s", device.getDeviceId(), channelId);
233 } 233 }
234 if (ssrcInfo == null) { 234 if (ssrcInfo == null) {
235 - ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId); 235 + ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId, device.isSsrcCheck());
236 } 236 }
237 237
238 // 超时处理 238 // 超时处理
src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java
@@ -420,9 +420,6 @@ public class StreamPushServiceImpl implements IStreamPushService { @@ -420,9 +420,6 @@ public class StreamPushServiceImpl implements IStreamPushService {
420 continue; 420 continue;
421 } 421 }
422 streamPushItemForPlatform.setPlatformId(platFormInfoArray[0]); 422 streamPushItemForPlatform.setPlatformId(platFormInfoArray[0]);
423 - if (platFormInfoArray[0].equals("34020000002110000001")) {  
424 - System.out.println(111);  
425 - }  
426 List<GbStream> gbStreamList = platformForEvent.get(platFormInfoArray[0]); 423 List<GbStream> gbStreamList = platformForEvent.get(platFormInfoArray[0]);
427 if (gbStreamList == null) { 424 if (gbStreamList == null) {
428 gbStreamList = new ArrayList<>(); 425 gbStreamList = new ArrayList<>();
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
@@ -37,6 +37,7 @@ public interface DeviceMapper { @@ -37,6 +37,7 @@ public interface DeviceMapper {
37 "subscribeCycleForMobilePosition," + 37 "subscribeCycleForMobilePosition," +
38 "mobilePositionSubmissionInterval," + 38 "mobilePositionSubmissionInterval," +
39 "subscribeCycleForAlarm," + 39 "subscribeCycleForAlarm," +
  40 + "ssrcCheck," +
40 "online" + 41 "online" +
41 ") VALUES (" + 42 ") VALUES (" +
42 "#{deviceId}," + 43 "#{deviceId}," +
@@ -59,6 +60,7 @@ public interface DeviceMapper { @@ -59,6 +60,7 @@ public interface DeviceMapper {
59 "#{subscribeCycleForMobilePosition}," + 60 "#{subscribeCycleForMobilePosition}," +
60 "#{mobilePositionSubmissionInterval}," + 61 "#{mobilePositionSubmissionInterval}," +
61 "#{subscribeCycleForAlarm}," + 62 "#{subscribeCycleForAlarm}," +
  63 + "#{ssrcCheck}," +
62 "#{online}" + 64 "#{online}" +
63 ")") 65 ")")
64 int add(Device device); 66 int add(Device device);
@@ -84,6 +86,7 @@ public interface DeviceMapper { @@ -84,6 +86,7 @@ public interface DeviceMapper {
84 "<if test=\"subscribeCycleForMobilePosition != null\">, subscribeCycleForMobilePosition=${subscribeCycleForMobilePosition}</if>" + 86 "<if test=\"subscribeCycleForMobilePosition != null\">, subscribeCycleForMobilePosition=${subscribeCycleForMobilePosition}</if>" +
85 "<if test=\"mobilePositionSubmissionInterval != null\">, mobilePositionSubmissionInterval=${mobilePositionSubmissionInterval}</if>" + 87 "<if test=\"mobilePositionSubmissionInterval != null\">, mobilePositionSubmissionInterval=${mobilePositionSubmissionInterval}</if>" +
86 "<if test=\"subscribeCycleForAlarm != null\">, subscribeCycleForAlarm=${subscribeCycleForAlarm}</if>" + 88 "<if test=\"subscribeCycleForAlarm != null\">, subscribeCycleForAlarm=${subscribeCycleForAlarm}</if>" +
  89 + "<if test=\"ssrcCheck != null\">, ssrcCheck=${ssrcCheck}</if>" +
87 "WHERE deviceId='${deviceId}'"+ 90 "WHERE deviceId='${deviceId}'"+
88 " </script>"}) 91 " </script>"})
89 int update(Device device); 92 int update(Device device);
src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java
@@ -16,10 +16,10 @@ public interface ParentPlatformMapper { @@ -16,10 +16,10 @@ public interface ParentPlatformMapper {
16 16
17 @Insert("INSERT INTO parent_platform (enable, name, serverGBId, serverGBDomain, serverIP, serverPort, deviceGBId, deviceIp, " + 17 @Insert("INSERT INTO parent_platform (enable, name, serverGBId, serverGBDomain, serverIP, serverPort, deviceGBId, deviceIp, " +
18 " devicePort, username, password, expires, keepTimeout, transport, characterSet, ptz, rtcp, " + 18 " devicePort, username, password, expires, keepTimeout, transport, characterSet, ptz, rtcp, " +
19 - " status, shareAllLiveStream, catalogId) " + 19 + " status, shareAllLiveStream, startOfflinePush, catalogId, administrativeDivision, catalogGroup) " +
20 " VALUES (${enable}, '${name}', '${serverGBId}', '${serverGBDomain}', '${serverIP}', ${serverPort}, '${deviceGBId}', '${deviceIp}', " + 20 " VALUES (${enable}, '${name}', '${serverGBId}', '${serverGBDomain}', '${serverIP}', ${serverPort}, '${deviceGBId}', '${deviceIp}', " +
21 " '${devicePort}', '${username}', '${password}', '${expires}', '${keepTimeout}', '${transport}', '${characterSet}', ${ptz}, ${rtcp}, " + 21 " '${devicePort}', '${username}', '${password}', '${expires}', '${keepTimeout}', '${transport}', '${characterSet}', ${ptz}, ${rtcp}, " +
22 - " ${status}, ${shareAllLiveStream}, #{catalogId})") 22 + " ${status}, ${shareAllLiveStream}, ${startOfflinePush}, #{catalogId}, #{administrativeDivision}, #{catalogGroup})")
23 int addParentPlatform(ParentPlatform parentPlatform); 23 int addParentPlatform(ParentPlatform parentPlatform);
24 24
25 @Update("UPDATE parent_platform " + 25 @Update("UPDATE parent_platform " +
@@ -42,6 +42,9 @@ public interface ParentPlatformMapper { @@ -42,6 +42,9 @@ public interface ParentPlatformMapper {
42 "rtcp=#{rtcp}, " + 42 "rtcp=#{rtcp}, " +
43 "status=#{status}, " + 43 "status=#{status}, " +
44 "shareAllLiveStream=#{shareAllLiveStream}, " + 44 "shareAllLiveStream=#{shareAllLiveStream}, " +
  45 + "startOfflinePush=${startOfflinePush}, " +
  46 + "catalogGroup=#{catalogGroup}, " +
  47 + "administrativeDivision=#{administrativeDivision}, " +
45 "catalogId=#{catalogId} " + 48 "catalogId=#{catalogId} " +
46 "WHERE id=#{id}") 49 "WHERE id=#{id}")
47 int updateParentPlatform(ParentPlatform parentPlatform); 50 int updateParentPlatform(ParentPlatform parentPlatform);
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
@@ -520,6 +520,12 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { @@ -520,6 +520,12 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
520 @Override 520 @Override
521 public boolean updateParentPlatform(ParentPlatform parentPlatform) { 521 public boolean updateParentPlatform(ParentPlatform parentPlatform) {
522 int result = 0; 522 int result = 0;
  523 + if (parentPlatform.getCatalogGroup() == 0) {
  524 + parentPlatform.setCatalogGroup(1);
  525 + }
  526 + if (parentPlatform.getAdministrativeDivision() == null) {
  527 + parentPlatform.setAdministrativeDivision(parentPlatform.getAdministrativeDivision());
  528 + }
523 ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId()); 529 ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId());
524 if (parentPlatform.getId() == null ) { 530 if (parentPlatform.getId() == null ) {
525 if (parentPlatform.getCatalogId() == null) { 531 if (parentPlatform.getCatalogId() == null) {
@@ -539,6 +545,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { @@ -539,6 +545,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
539 parentPlatformCatch.setId(parentPlatform.getServerGBId()); 545 parentPlatformCatch.setId(parentPlatform.getServerGBId());
540 redisCatchStorage.delPlatformCatchInfo(parentPlatById.getServerGBId()); 546 redisCatchStorage.delPlatformCatchInfo(parentPlatById.getServerGBId());
541 } 547 }
  548 +
542 result = platformMapper.updateParentPlatform(parentPlatform); 549 result = platformMapper.updateParentPlatform(parentPlatform);
543 } 550 }
544 // 更新缓存 551 // 更新缓存
@@ -1074,7 +1081,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { @@ -1074,7 +1081,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
1074 deviceChannel.setParentId(catalog.getParentId()); 1081 deviceChannel.setParentId(catalog.getParentId());
1075 deviceChannel.setRegisterWay(1); 1082 deviceChannel.setRegisterWay(1);
1076 // 行政区划应该是Domain的前八位 1083 // 行政区划应该是Domain的前八位
1077 - deviceChannel.setCivilCode(parentPlatByServerGBId.getDeviceGBId().substring(0,6)); 1084 + deviceChannel.setCivilCode(parentPlatByServerGBId.getAdministrativeDivision());
1078 deviceChannel.setModel("live"); 1085 deviceChannel.setModel("live");
1079 deviceChannel.setOwner("wvp-pro"); 1086 deviceChannel.setOwner("wvp-pro");
1080 deviceChannel.setSecrecy("0"); 1087 deviceChannel.setSecrecy("0");
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java
@@ -164,12 +164,13 @@ public class DeviceQuery { @@ -164,12 +164,13 @@ public class DeviceQuery {
164 logger.debug("设备通道信息同步API调用,deviceId:" + deviceId); 164 logger.debug("设备通道信息同步API调用,deviceId:" + deviceId);
165 } 165 }
166 Device device = storager.queryVideoDevice(deviceId); 166 Device device = storager.queryVideoDevice(deviceId);
167 - SyncStatus syncStatus = deviceService.getChannelSyncStatus(deviceId); 167 + boolean status = deviceService.isSyncRunning(deviceId);
168 // 已存在则返回进度 168 // 已存在则返回进度
169 - if (syncStatus != null && syncStatus.getErrorMsg() == null) { 169 + if (status) {
170 WVPResult<SyncStatus> wvpResult = new WVPResult<>(); 170 WVPResult<SyncStatus> wvpResult = new WVPResult<>();
171 wvpResult.setCode(0); 171 wvpResult.setCode(0);
172 - wvpResult.setData(syncStatus); 172 + SyncStatus channelSyncStatus = deviceService.getChannelSyncStatus(deviceId);
  173 + wvpResult.setData(channelSyncStatus);
173 return wvpResult; 174 return wvpResult;
174 } 175 }
175 deviceService.sync(device); 176 deviceService.sync(device);
web_src/src/components/CloudRecord.vue
1 <template> 1 <template>
2 - <div id="app">  
3 - <el-container>  
4 - <el-header>  
5 - <uiHeader></uiHeader>  
6 - </el-header>  
7 - <el-main>  
8 - <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;">  
9 - <span v-if="!recordDetail" >云端录像</span>  
10 - <el-page-header v-if="recordDetail" @back="backToList" content="云端录像">  
11 - </el-page-header>  
12 - <div style="position: absolute; right: 5rem; top: 0.3rem;">  
13 - 节点选择:  
14 - <el-select size="mini" @change="chooseMediaChange" style="width: 16rem; margin-right: 1rem;" v-model="mediaServerId" placeholder="请选择" :disabled="recordDetail">  
15 - <el-option  
16 - v-for="item in mediaServerList"  
17 - :key="item.id"  
18 - :label="item.id"  
19 - :value="item.id">  
20 - </el-option>  
21 - </el-select>  
22 - </div>  
23 - <div style="position: absolute; right: 1rem; top: 0.3rem;">  
24 - <el-button v-if="!recordDetail" icon="el-icon-refresh-right" circle size="mini" :loading="loading" @click="getRecordList()"></el-button>  
25 - </div>  
26 - </div>  
27 - <div v-if="!recordDetail"> 2 + <div id="app" style="width: 100%">
  3 + <div class="page-header">
  4 + <div class="page-title">云端录像</div>
  5 + <div class="page-header-btn">
  6 + 节点选择:
  7 + <el-select size="mini" @change="chooseMediaChange" style="width: 16rem; margin-right: 1rem;" v-model="mediaServerId" placeholder="请选择" :disabled="recordDetail">
  8 + <el-option
  9 + v-for="item in mediaServerList"
  10 + :key="item.id"
  11 + :label="item.id"
  12 + :value="item.id">
  13 + </el-option>
  14 + </el-select>
  15 + <el-button v-if="!recordDetail" icon="el-icon-refresh-right" circle size="mini" :loading="loading" @click="getRecordList()"></el-button>
  16 + </div>
  17 + </div>
  18 + <div v-if="!recordDetail">
28 19
29 - <!--设备列表-->  
30 - <el-table :data="recordList" border style="width: 100%" :height="winHeight">  
31 - <el-table-column prop="app" label="应用名" align="center">  
32 - </el-table-column>  
33 - <el-table-column prop="stream" label="流ID" align="center">  
34 - </el-table-column>  
35 - <el-table-column prop="time" label="时间" align="center">  
36 - </el-table-column>  
37 - <el-table-column label="操作" width="360" align="center" fixed="right">  
38 - <template slot-scope="scope">  
39 - <el-button-group>  
40 - <el-button size="mini" icon="el-icon-video-camera-solid" type="primary" @click="showRecordDetail(scope.row)">查看</el-button>  
41 -<!-- <el-button size="mini" icon="el-icon-delete" type="danger" @click="deleteRecord(scope.row)">删除</el-button>-->  
42 - </el-button-group>  
43 - </template>  
44 - </el-table-column>  
45 - </el-table>  
46 - <el-pagination  
47 - style="float: right"  
48 - @size-change="handleSizeChange"  
49 - @current-change="currentChange"  
50 - :current-page="currentPage"  
51 - :page-size="count"  
52 - :page-sizes="[15, 25, 35, 50]"  
53 - layout="total, sizes, prev, pager, next"  
54 - :total="total">  
55 - </el-pagination>  
56 - </div>  
57 - <cloud-record-detail ref="cloudRecordDetail" v-if="recordDetail" :recordFile="chooseRecord" :mediaServerId="mediaServerId" :mediaServerPath="mediaServerPath" ></cloud-record-detail>  
58 - </el-main>  
59 - </el-container>  
60 - </div> 20 + <!--设备列表-->
  21 + <el-table :data="recordList" border style="width: 100%" :height="winHeight">
  22 + <el-table-column prop="app" label="应用名" align="center">
  23 + </el-table-column>
  24 + <el-table-column prop="stream" label="流ID" align="center">
  25 + </el-table-column>
  26 + <el-table-column prop="time" label="时间" align="center">
  27 + </el-table-column>
  28 + <el-table-column label="操作" width="360" align="center" fixed="right">
  29 + <template slot-scope="scope">
  30 + <el-button-group>
  31 + <el-button size="mini" icon="el-icon-video-camera-solid" type="primary" @click="showRecordDetail(scope.row)">查看</el-button>
  32 + <!-- <el-button size="mini" icon="el-icon-delete" type="danger" @click="deleteRecord(scope.row)">删除</el-button>-->
  33 + </el-button-group>
  34 + </template>
  35 + </el-table-column>
  36 + </el-table>
  37 + <el-pagination
  38 + style="float: right"
  39 + @size-change="handleSizeChange"
  40 + @current-change="currentChange"
  41 + :current-page="currentPage"
  42 + :page-size="count"
  43 + :page-sizes="[15, 25, 35, 50]"
  44 + layout="total, sizes, prev, pager, next"
  45 + :total="total">
  46 + </el-pagination>
  47 + </div>
  48 + <cloud-record-detail ref="cloudRecordDetail" v-if="recordDetail" :recordFile="chooseRecord" :mediaServerId="mediaServerId" :mediaServerPath="mediaServerPath" ></cloud-record-detail>
  49 +
  50 + </div>
61 </template> 51 </template>
62 52
63 <script> 53 <script>
64 - import uiHeader from './UiHeader.vue' 54 + import uiHeader from '../layout/UiHeader.vue'
65 import cloudRecordDetail from './CloudRecordDetail.vue' 55 import cloudRecordDetail from './CloudRecordDetail.vue'
66 import MediaServer from './service/MediaServer' 56 import MediaServer from './service/MediaServer'
67 export default { 57 export default {
web_src/src/components/CloudRecordDetail.vue
@@ -104,7 +104,7 @@ @@ -104,7 +104,7 @@
104 104
105 <script> 105 <script>
106 // TODO 根据查询的时间列表设置滑轨的最大值与最小值, 106 // TODO 根据查询的时间列表设置滑轨的最大值与最小值,
107 - import uiHeader from './UiHeader.vue' 107 + import uiHeader from '../layout/UiHeader.vue'
108 import player from './dialog/easyPlayer.vue' 108 import player from './dialog/easyPlayer.vue'
109 import moment from 'moment' 109 import moment from 'moment'
110 export default { 110 export default {
web_src/src/components/DeviceList.vue
1 <template> 1 <template>
2 - <div id="app">  
3 - <el-container>  
4 - <el-header>  
5 - <uiHeader></uiHeader>  
6 - </el-header>  
7 - <el-main>  
8 - <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;">  
9 - <span style="font-size: 1rem; font-weight: bold;">设备列表</span>  
10 - <div style="position: absolute; right: 1rem; top: 0.3rem;">  
11 - <el-button icon="el-icon-refresh-right" circle size="mini" :loading="getDeviceListLoading" @click="getDeviceList()"></el-button>  
12 - </div>  
13 - </div>  
14 - <!-- <devicePlayer ref="devicePlayer"></devicePlayer> -->  
15 - <!--设备列表-->  
16 - <el-table :data="deviceList" border style="width: 100%;font-size: 12px;" :height="winHeight">  
17 - <el-table-column prop="name" label="名称" align="center">  
18 - </el-table-column>  
19 - <el-table-column prop="deviceId" label="设备编号" width="180" align="center">  
20 - </el-table-column>  
21 - <el-table-column label="地址" width="180" align="center">  
22 - <template slot-scope="scope">  
23 - <div slot="reference" class="name-wrapper">  
24 - <el-tag size="medium">{{ scope.row.hostAddress }}</el-tag>  
25 - </div>  
26 - </template>  
27 - </el-table-column>  
28 - <el-table-column prop="manufacturer" label="厂家" align="center">  
29 - </el-table-column>  
30 - <el-table-column label="流传输模式" align="center" width="120">  
31 - <template slot-scope="scope">  
32 - <el-select size="mini" @change="transportChange(scope.row)" v-model="scope.row.streamMode" placeholder="请选择">  
33 - <el-option key="UDP" label="UDP" value="UDP"></el-option>  
34 - <el-option key="TCP-ACTIVE" label="TCP主动模式" :disabled="true" value="TCP-ACTIVE"></el-option>  
35 - <el-option key="TCP-PASSIVE" label="TCP被动模式" value="TCP-PASSIVE"></el-option>  
36 - </el-select>  
37 - </template>  
38 - </el-table-column>  
39 - <el-table-column prop="channelCount" label="通道数" align="center">  
40 - </el-table-column>  
41 - <el-table-column label="状态" width="120" align="center">  
42 - <template slot-scope="scope">  
43 - <div slot="reference" class="name-wrapper">  
44 - <el-tag size="medium" v-if="scope.row.online == 1">在线</el-tag>  
45 - <el-tag size="medium" type="info" v-if="scope.row.online == 0">离线</el-tag>  
46 - </div>  
47 - </template>  
48 - </el-table-column>  
49 - <el-table-column prop="keepaliveTime" label="最近心跳" align="center" width="140">  
50 - </el-table-column>  
51 - <el-table-column prop="registerTime" label="最近注册" align="center" width="140">  
52 - </el-table-column>  
53 - <el-table-column prop="updateTime" label="更新时间" align="center" width="140">  
54 - </el-table-column>  
55 - <el-table-column prop="createTime" label="创建时间" align="center" width="140">  
56 - </el-table-column> 2 + <div id="app" style="width: 100%">
  3 + <div class="page-header">
  4 + <div class="page-title">设备列表</div>
  5 + <div class="page-header-btn">
  6 + <el-button icon="el-icon-refresh-right" circle size="mini" :loading="getDeviceListLoading"
  7 + @click="getDeviceList()"></el-button>
  8 + </div>
  9 + </div>
  10 + <!-- <devicePlayer ref="devicePlayer"></devicePlayer> -->
  11 + <!--设备列表-->
  12 + <el-table :data="deviceList" border style="width: 100%;font-size: 12px;" :height="winHeight">
  13 + <el-table-column prop="name" label="名称" align="center">
  14 + </el-table-column>
  15 + <el-table-column prop="deviceId" label="设备编号" width="180" align="center">
  16 + </el-table-column>
  17 + <el-table-column label="地址" width="180" align="center">
  18 + <template slot-scope="scope">
  19 + <div slot="reference" class="name-wrapper">
  20 + <el-tag size="medium">{{ scope.row.hostAddress }}</el-tag>
  21 + </div>
  22 + </template>
  23 + </el-table-column>
  24 + <el-table-column prop="manufacturer" label="厂家" align="center">
  25 + </el-table-column>
  26 + <el-table-column label="流传输模式" align="center" width="120">
  27 + <template slot-scope="scope">
  28 + <el-select size="mini" @change="transportChange(scope.row)" v-model="scope.row.streamMode" placeholder="请选择">
  29 + <el-option key="UDP" label="UDP" value="UDP"></el-option>
  30 + <el-option key="TCP-ACTIVE" label="TCP主动模式" :disabled="true" value="TCP-ACTIVE"></el-option>
  31 + <el-option key="TCP-PASSIVE" label="TCP被动模式" value="TCP-PASSIVE"></el-option>
  32 + </el-select>
  33 + </template>
  34 + </el-table-column>
  35 + <el-table-column prop="channelCount" label="通道数" align="center">
  36 + </el-table-column>
  37 + <el-table-column label="状态" width="120" align="center">
  38 + <template slot-scope="scope">
  39 + <div slot="reference" class="name-wrapper">
  40 + <el-tag size="medium" v-if="scope.row.online == 1">在线</el-tag>
  41 + <el-tag size="medium" type="info" v-if="scope.row.online == 0">离线</el-tag>
  42 + </div>
  43 + </template>
  44 + </el-table-column>
  45 + <el-table-column prop="keepaliveTime" label="最近心跳" align="center" width="140">
  46 + </el-table-column>
  47 + <el-table-column prop="registerTime" label="最近注册" align="center" width="140">
  48 + </el-table-column>
  49 + <el-table-column prop="updateTime" label="更新时间" align="center" width="140">
  50 + </el-table-column>
  51 + <el-table-column prop="createTime" label="创建时间" align="center" width="140">
  52 + </el-table-column>
57 53
58 - <el-table-column label="操作" width="450" align="center" fixed="right">  
59 - <template slot-scope="scope">  
60 - <el-button size="mini" v-if="scope.row.online!=0" icon="el-icon-refresh" @click="refDevice(scope.row)" @mouseover="getTooltipContent(scope.row.deviceId)">刷新</el-button>  
61 - <el-button-group>  
62 - <el-button size="mini" icon="el-icon-video-camera-solid" v-bind:disabled="scope.row.online==0" type="primary" @click="showChannelList(scope.row)">通道</el-button>  
63 - <el-button size="mini" icon="el-icon-location" v-bind:disabled="scope.row.online==0" type="primary" @click="showDevicePosition(scope.row)">定位</el-button>  
64 - <el-button size="mini" icon="el-icon-edit" type="primary" @click="edit(scope.row)">编辑</el-button>  
65 - <el-button size="mini" icon="el-icon-delete" type="danger" @click="deleteDevice(scope.row)">删除</el-button>  
66 - </el-button-group>  
67 - </template>  
68 - </el-table-column>  
69 - </el-table>  
70 - <el-pagination  
71 - style="float: right"  
72 - @size-change="handleSizeChange"  
73 - @current-change="currentChange"  
74 - :current-page="currentPage"  
75 - :page-size="count"  
76 - :page-sizes="[15, 25, 35, 50]"  
77 - layout="total, sizes, prev, pager, next"  
78 - :total="total">  
79 - </el-pagination>  
80 - <deviceEdit ref="deviceEdit" ></deviceEdit>  
81 - <syncChannelProgress ref="syncChannelProgress" ></syncChannelProgress>  
82 - </el-main>  
83 - </el-container>  
84 - </div> 54 + <el-table-column label="操作" width="450" align="center" fixed="right">
  55 + <template slot-scope="scope">
  56 + <el-button size="mini" v-if="scope.row.online!=0" icon="el-icon-refresh" @click="refDevice(scope.row)"
  57 + @mouseover="getTooltipContent(scope.row.deviceId)">刷新
  58 + </el-button>
  59 + <el-button-group>
  60 + <el-button size="mini" icon="el-icon-video-camera-solid" v-bind:disabled="scope.row.online==0"
  61 + type="primary" @click="showChannelList(scope.row)">通道
  62 + </el-button>
  63 + <el-button size="mini" icon="el-icon-location" v-bind:disabled="scope.row.online==0" type="primary"
  64 + @click="showDevicePosition(scope.row)">定位
  65 + </el-button>
  66 + <el-button size="mini" icon="el-icon-edit" type="primary" @click="edit(scope.row)">编辑</el-button>
  67 + <el-button size="mini" icon="el-icon-delete" type="danger" @click="deleteDevice(scope.row)">删除</el-button>
  68 + </el-button-group>
  69 + </template>
  70 + </el-table-column>
  71 + </el-table>
  72 + <el-pagination
  73 + style="float: right"
  74 + @size-change="handleSizeChange"
  75 + @current-change="currentChange"
  76 + :current-page="currentPage"
  77 + :page-size="count"
  78 + :page-sizes="[15, 25, 35, 50]"
  79 + layout="total, sizes, prev, pager, next"
  80 + :total="total">
  81 + </el-pagination>
  82 + <deviceEdit ref="deviceEdit"></deviceEdit>
  83 + <syncChannelProgress ref="syncChannelProgress"></syncChannelProgress>
  84 + </div>
85 </template> 85 </template>
86 86
87 <script> 87 <script>
88 - import uiHeader from './UiHeader.vue'  
89 - import deviceEdit from './dialog/deviceEdit.vue'  
90 - import syncChannelProgress from './dialog/SyncChannelProgress.vue'  
91 - export default {  
92 - name: 'app',  
93 - components: {  
94 - uiHeader,  
95 - deviceEdit,  
96 - syncChannelProgress,  
97 - },  
98 - data() {  
99 - return {  
100 - deviceList: [], //设备列表  
101 - currentDevice: {}, //当前操作设备对象 88 +import uiHeader from '../layout/UiHeader.vue'
  89 +import deviceEdit from './dialog/deviceEdit.vue'
  90 +import syncChannelProgress from './dialog/SyncChannelProgress.vue'
102 91
103 - videoComponentList: [],  
104 - updateLooper: 0, //数据刷新轮训标志  
105 - currentDeviceChannelsLenth:0,  
106 - winHeight: window.innerHeight - 200,  
107 - currentPage:1,  
108 - count:15,  
109 - total:0,  
110 - getDeviceListLoading: false,  
111 - };  
112 - },  
113 - computed: {  
114 - getcurrentDeviceChannels: function() {  
115 - let data = this.currentDevice['channelMap'];  
116 - let channels = null;  
117 - if (data) {  
118 - channels = Object.keys(data).map(key => {  
119 - return data[key];  
120 - });  
121 - this.currentDeviceChannelsLenth = channels.length;  
122 - }  
123 - return channels;  
124 - }  
125 - },  
126 - mounted() {  
127 - this.initData();  
128 - this.updateLooper = setInterval(this.initData, 10000);  
129 - },  
130 - destroyed() {  
131 - this.$destroy('videojs');  
132 - clearTimeout(this.updateLooper);  
133 - },  
134 - methods: {  
135 - initData: function() {  
136 - this.getDeviceList();  
137 - },  
138 - currentChange: function(val){  
139 - this.currentPage = val;  
140 - this.getDeviceList();  
141 - },  
142 - handleSizeChange: function(val){  
143 - this.count = val;  
144 - this.getDeviceList();  
145 - },  
146 - getDeviceList: function() {  
147 - let that = this;  
148 - this.getDeviceListLoading = true;  
149 - this.$axios({  
150 - method: 'get',  
151 - url:`/api/device/query/devices`,  
152 - params: {  
153 - page: that.currentPage,  
154 - count: that.count  
155 - }  
156 - }).then(function (res) {  
157 - that.total = res.data.total;  
158 - that.deviceList = res.data.list;  
159 - that.getDeviceListLoading = false;  
160 - }).catch(function (error) {  
161 - console.error(error);  
162 - that.getDeviceListLoading = false;  
163 - }); 92 +export default {
  93 + name: 'app',
  94 + components: {
  95 + uiHeader,
  96 + deviceEdit,
  97 + syncChannelProgress,
  98 + },
  99 + data() {
  100 + return {
  101 + deviceList: [], //设备列表
  102 + currentDevice: {}, //当前操作设备对象
164 103
165 - },  
166 - deleteDevice: function(row) {  
167 - let msg = "确定删除此设备?"  
168 - if (row.online !== 0) {  
169 - msg = "在线设备删除后仍可通过注册再次上线。<br/>如需彻底删除请先将设备离线。<br/><strong>确定删除此设备?</strong>" 104 + videoComponentList: [],
  105 + updateLooper: 0, //数据刷新轮训标志
  106 + currentDeviceChannelsLenth: 0,
  107 + winHeight: window.innerHeight - 200,
  108 + currentPage: 1,
  109 + count: 15,
  110 + total: 0,
  111 + getDeviceListLoading: false,
  112 + };
  113 + },
  114 + computed: {
  115 + getcurrentDeviceChannels: function () {
  116 + let data = this.currentDevice['channelMap'];
  117 + let channels = null;
  118 + if (data) {
  119 + channels = Object.keys(data).map(key => {
  120 + return data[key];
  121 + });
  122 + this.currentDeviceChannelsLenth = channels.length;
  123 + }
  124 + return channels;
  125 + }
  126 + },
  127 + mounted() {
  128 + this.initData();
  129 + this.updateLooper = setInterval(this.initData, 10000);
  130 + },
  131 + destroyed() {
  132 + this.$destroy('videojs');
  133 + clearTimeout(this.updateLooper);
  134 + },
  135 + methods: {
  136 + initData: function () {
  137 + this.getDeviceList();
  138 + },
  139 + currentChange: function (val) {
  140 + this.currentPage = val;
  141 + this.getDeviceList();
  142 + },
  143 + handleSizeChange: function (val) {
  144 + this.count = val;
  145 + this.getDeviceList();
  146 + },
  147 + getDeviceList: function () {
  148 + let that = this;
  149 + this.getDeviceListLoading = true;
  150 + this.$axios({
  151 + method: 'get',
  152 + url: `/api/device/query/devices`,
  153 + params: {
  154 + page: that.currentPage,
  155 + count: that.count
170 } 156 }
171 - this.$confirm(msg, '提示', {  
172 - dangerouslyUseHTMLString : true,  
173 - confirmButtonText: '确定',  
174 - cancelButtonText: '取消',  
175 - center: true,  
176 - type: 'warning'  
177 - }).then(() => {  
178 - this.$axios({  
179 - method: 'delete',  
180 - url:`/api/device/query/devices/${row.deviceId}/delete`  
181 - }).then((res)=>{  
182 - this.getDeviceList();  
183 - }).catch((error) =>{  
184 - console.error(error);  
185 - });  
186 - }).catch(() => { 157 + }).then(function (res) {
  158 + that.total = res.data.total;
  159 + that.deviceList = res.data.list;
  160 + that.getDeviceListLoading = false;
  161 + }).catch(function (error) {
  162 + console.error(error);
  163 + that.getDeviceListLoading = false;
  164 + });
187 165
  166 + },
  167 + deleteDevice: function (row) {
  168 + let msg = "确定删除此设备?"
  169 + if (row.online !== 0) {
  170 + msg = "在线设备删除后仍可通过注册再次上线。<br/>如需彻底删除请先将设备离线。<br/><strong>确定删除此设备?</strong>"
  171 + }
  172 + this.$confirm(msg, '提示', {
  173 + dangerouslyUseHTMLString: true,
  174 + confirmButtonText: '确定',
  175 + cancelButtonText: '取消',
  176 + center: true,
  177 + type: 'warning'
  178 + }).then(() => {
  179 + this.$axios({
  180 + method: 'delete',
  181 + url: `/api/device/query/devices/${row.deviceId}/delete`
  182 + }).then((res) => {
  183 + this.getDeviceList();
  184 + }).catch((error) => {
  185 + console.error(error);
188 }); 186 });
  187 + }).catch(() => {
  188 +
  189 + });
189 190
190 191
191 - },  
192 - showChannelList: function(row) {  
193 - this.$router.push(`/channelList/${row.deviceId}/0/15/1`);  
194 - },  
195 - showDevicePosition: function(row) {  
196 - this.$router.push(`/devicePosition/${row.deviceId}/0/15/1`);  
197 - }, 192 + },
  193 + showChannelList: function (row) {
  194 + this.$router.push(`/channelList/${row.deviceId}/0/15/1`);
  195 + },
  196 + showDevicePosition: function (row) {
  197 + this.$router.push(`/devicePosition/${row.deviceId}/0/15/1`);
  198 + },
198 199
199 - //gb28181平台对接  
200 - //刷新设备信息  
201 - refDevice: function(itemData) {  
202 - console.log("刷新对应设备:" + itemData.deviceId);  
203 - let that = this;  
204 - this.$axios({  
205 - method: 'post',  
206 - url: '/api/device/query/devices/' + itemData.deviceId + '/sync'  
207 - }).then((res) => {  
208 - console.log("刷新设备结果:"+JSON.stringify(res));  
209 - if (res.data.code !==0) {  
210 - that.$message({  
211 - showClose: true,  
212 - message: res.data.msg,  
213 - type: 'error'  
214 - });  
215 - }else{  
216 - // that.$message({  
217 - // showClose: true,  
218 - // message: res.data.msg,  
219 - // type: 'success'  
220 - // });  
221 - this.$refs.syncChannelProgress.openDialog(itemData.deviceId)  
222 - }  
223 - that.initData()  
224 - }).catch((e) => {  
225 - console.error(e) 200 + //gb28181平台对接
  201 + //刷新设备信息
  202 + refDevice: function (itemData) {
  203 + console.log("刷新对应设备:" + itemData.deviceId);
  204 + let that = this;
  205 + this.$axios({
  206 + method: 'post',
  207 + url: '/api/device/query/devices/' + itemData.deviceId + '/sync'
  208 + }).then((res) => {
  209 + console.log("刷新设备结果:" + JSON.stringify(res));
  210 + if (res.data.code !== 0) {
226 that.$message({ 211 that.$message({
227 showClose: true, 212 showClose: true,
228 - message: e, 213 + message: res.data.msg,
229 type: 'error' 214 type: 'error'
230 }); 215 });
231 - }); 216 + } else {
  217 + // that.$message({
  218 + // showClose: true,
  219 + // message: res.data.msg,
  220 + // type: 'success'
  221 + // });
  222 + this.$refs.syncChannelProgress.openDialog(itemData.deviceId)
  223 + }
  224 + that.initData()
  225 + }).catch((e) => {
  226 + console.error(e)
  227 + that.$message({
  228 + showClose: true,
  229 + message: e,
  230 + type: 'error'
  231 + });
  232 + });
232 233
233 - }, 234 + },
234 235
235 - getTooltipContent: async function (deviceId){  
236 - let result = "";  
237 - await this.$axios({  
238 - method: 'get',  
239 - async: false,  
240 - url:`/api/device/query/${deviceId}/sync_status/`,  
241 - }).then((res) => {  
242 - if (res.data.code == 0) {  
243 - if (res.data.data.errorMsg !== null) {  
244 - result = res.data.data.errorMsg  
245 - } else if (res.data.msg !== null) {  
246 - result = res.data.msg  
247 - } else {  
248 - result = `同步中...[${res.data.data.current}/${res.data.data.total}]`;  
249 - }  
250 - }  
251 - })  
252 - return result;  
253 - },  
254 - //通知设备上传媒体流  
255 - sendDevicePush: function(itemData) {  
256 - // let deviceId = this.currentDevice.deviceId;  
257 - // let channelId = itemData.channelId;  
258 - // console.log("通知设备推流1:" + deviceId + " : " + channelId);  
259 - // let that = this;  
260 - // this.$axios({  
261 - // method: 'get',  
262 - // url: '/api/play/' + deviceId + '/' + channelId  
263 - // }).then(function(res) {  
264 - // let ssrc = res.data.ssrc;  
265 - // that.$refs.devicePlayer.play(ssrc,deviceId,channelId);  
266 - // }).catch(function(e) {  
267 - // });  
268 - },  
269 - transportChange: function (row) {  
270 - console.log(`修改传输方式为 ${row.streamMode}:${row.deviceId} `);  
271 - let that = this;  
272 - this.$axios({  
273 - method: 'post',  
274 - url: '/api/device/query/transport/' + row.deviceId + '/' + row.streamMode  
275 - }).then(function(res) { 236 + getTooltipContent: async function (deviceId) {
  237 + let result = "";
  238 + await this.$axios({
  239 + method: 'get',
  240 + async: false,
  241 + url: `/api/device/query/${deviceId}/sync_status/`,
  242 + }).then((res) => {
  243 + if (res.data.code == 0) {
  244 + if (res.data.data.errorMsg !== null) {
  245 + result = res.data.data.errorMsg
  246 + } else if (res.data.msg !== null) {
  247 + result = res.data.msg
  248 + } else {
  249 + result = `同步中...[${res.data.data.current}/${res.data.data.total}]`;
  250 + }
  251 + }
  252 + })
  253 + return result;
  254 + },
  255 + //通知设备上传媒体流
  256 + sendDevicePush: function (itemData) {
  257 + // let deviceId = this.currentDevice.deviceId;
  258 + // let channelId = itemData.channelId;
  259 + // console.log("通知设备推流1:" + deviceId + " : " + channelId);
  260 + // let that = this;
  261 + // this.$axios({
  262 + // method: 'get',
  263 + // url: '/api/play/' + deviceId + '/' + channelId
  264 + // }).then(function(res) {
  265 + // let ssrc = res.data.ssrc;
  266 + // that.$refs.devicePlayer.play(ssrc,deviceId,channelId);
  267 + // }).catch(function(e) {
  268 + // });
  269 + },
  270 + transportChange: function (row) {
  271 + console.log(`修改传输方式为 ${row.streamMode}:${row.deviceId} `);
  272 + let that = this;
  273 + this.$axios({
  274 + method: 'post',
  275 + url: '/api/device/query/transport/' + row.deviceId + '/' + row.streamMode
  276 + }).then(function (res) {
276 277
277 - }).catch(function(e) { 278 + }).catch(function (e) {
  279 + });
  280 + },
  281 + edit: function (row) {
  282 + this.$refs.deviceEdit.openDialog(row, () => {
  283 + this.$refs.deviceEdit.close();
  284 + this.$message({
  285 + showClose: true,
  286 + message: "设备修改成功,通道字符集将在下次更新生效",
  287 + type: "success",
278 }); 288 });
279 - },  
280 - edit: function (row) {  
281 - this.$refs.deviceEdit.openDialog(row, ()=>{  
282 - this.$refs.deviceEdit.close();  
283 - this.$message({  
284 - showClose: true,  
285 - message: "设备修改成功,通道字符集将在下次更新生效",  
286 - type: "success",  
287 - });  
288 - setTimeout(this.getDeviceList, 200) 289 + setTimeout(this.getDeviceList, 200)
289 290
290 - })  
291 - } 291 + })
  292 + }
292 293
293 - }  
294 - }; 294 + }
  295 +};
295 </script> 296 </script>
296 297
297 <style> 298 <style>
298 - .videoList {  
299 - display: flex;  
300 - flex-wrap: wrap;  
301 - align-content: flex-start;  
302 - } 299 +.videoList {
  300 + display: flex;
  301 + flex-wrap: wrap;
  302 + align-content: flex-start;
  303 +}
303 304
304 - .video-item {  
305 - position: relative;  
306 - width: 15rem;  
307 - height: 10rem;  
308 - margin-right: 1rem;  
309 - background-color: #000000;  
310 - } 305 +.video-item {
  306 + position: relative;
  307 + width: 15rem;
  308 + height: 10rem;
  309 + margin-right: 1rem;
  310 + background-color: #000000;
  311 +}
311 312
312 - .video-item-img {  
313 - position: absolute;  
314 - top: 0;  
315 - bottom: 0;  
316 - left: 0;  
317 - right: 0;  
318 - margin: auto;  
319 - width: 100%;  
320 - height: 100%;  
321 - } 313 +.video-item-img {
  314 + position: absolute;
  315 + top: 0;
  316 + bottom: 0;
  317 + left: 0;
  318 + right: 0;
  319 + margin: auto;
  320 + width: 100%;
  321 + height: 100%;
  322 +}
322 323
323 - .video-item-img:after {  
324 - content: "";  
325 - display: inline-block;  
326 - position: absolute;  
327 - z-index: 2;  
328 - top: 0;  
329 - bottom: 0;  
330 - left: 0;  
331 - right: 0;  
332 - margin: auto;  
333 - width: 3rem;  
334 - height: 3rem;  
335 - background-image: url("../assets/loading.png");  
336 - background-size: cover;  
337 - background-color: #000000;  
338 - } 324 +.video-item-img:after {
  325 + content: "";
  326 + display: inline-block;
  327 + position: absolute;
  328 + z-index: 2;
  329 + top: 0;
  330 + bottom: 0;
  331 + left: 0;
  332 + right: 0;
  333 + margin: auto;
  334 + width: 3rem;
  335 + height: 3rem;
  336 + background-image: url("../assets/loading.png");
  337 + background-size: cover;
  338 + background-color: #000000;
  339 +}
339 340
340 - .video-item-title {  
341 - position: absolute;  
342 - bottom: 0;  
343 - color: #000000;  
344 - background-color: #ffffff;  
345 - line-height: 1.5rem;  
346 - padding: 0.3rem;  
347 - width: 14.4rem;  
348 - } 341 +.video-item-title {
  342 + position: absolute;
  343 + bottom: 0;
  344 + color: #000000;
  345 + background-color: #ffffff;
  346 + line-height: 1.5rem;
  347 + padding: 0.3rem;
  348 + width: 14.4rem;
  349 +}
349 </style> 350 </style>
web_src/src/components/MediaServerManger.vue
1 <template> 1 <template>
2 - <div id="mediaServerManger">  
3 - <el-container>  
4 - <el-header>  
5 - <uiHeader></uiHeader>  
6 - </el-header>  
7 - <el-main id="msMain">  
8 - <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;">  
9 - <span style="font-size: 1rem; font-weight: bold;">节点列表</span>  
10 - </div>  
11 - <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;font-size: 14px;">  
12 - <el-button icon="el-icon-plus" size="mini" style="margin-right: 1rem;" type="primary" @click="add">添加节点</el-button>  
13 - </div> 2 + <div id="mediaServerManger" style="width: 100%">
  3 + <div class="page-header">
  4 + <div class="page-title">节点列表</div>
  5 + <div class="page-header-btn">
  6 + <el-button icon="el-icon-plus" size="mini" style="margin-right: 1rem;" type="primary" @click="add">添加节点</el-button>
  7 + </div>
  8 + </div>
14 9
15 - <el-row :gutter="12">  
16 - <el-col :span="num" v-for="item in mediaServerList" :key="item.id">  
17 - <el-card shadow="hover" :body-style="{ padding: '0px'}" class="server-card">  
18 - <div class="card-img-zlm"></div>  
19 - <div style="padding: 14px;text-align: left">  
20 - <span style="font-size: 16px">{{item.id}}</span>  
21 - <el-button v-if="!item.defaultServer" icon="el-icon-edit" style="padding: 0;float: right;" type="text" @click="edit(item)">编辑</el-button>  
22 - <el-button v-if="item.defaultServer" icon="el-icon-edit" style="padding: 0;float: right;" type="text" @click="edit(item)">查看</el-button>  
23 - <el-button icon="el-icon-delete" style="margin-right: 10px;padding: 0;float: right;" type="text" @click="del(item)">移除</el-button>  
24 - <div style="margin-top: 13px; line-height: 12px; ">  
25 - <span style="font-size: 14px; color: #999; margin-top: 5px; ">{{item.ip}}</span>  
26 - <span style="font-size: 14px; color: #999; margin-top: 5px; float: right;">{{item.createTime}}</span>  
27 - </div>  
28 - </div>  
29 - <i v-if="item.status" class="iconfont icon-online server-card-status-online" title="在线"></i>  
30 - <i v-if="!item.status" class="iconfont icon-online server-card-status-offline" title="离线"></i>  
31 - <i v-if="item.defaultServer" class="server-card-default" >默认</i>  
32 - </el-card>  
33 - </el-col>  
34 - </el-row>  
35 - <mediaServerEdit ref="mediaServerEdit" ></mediaServerEdit>  
36 - </el-main>  
37 - </el-container> 10 + <el-row :gutter="12">
  11 + <el-col :span="num" v-for="item in mediaServerList" :key="item.id">
  12 + <el-card shadow="hover" :body-style="{ padding: '0px'}" class="server-card">
  13 + <div class="card-img-zlm"></div>
  14 + <div style="padding: 14px;text-align: left">
  15 + <span style="font-size: 16px">{{item.id}}</span>
  16 + <el-button v-if="!item.defaultServer" icon="el-icon-edit" style="padding: 0;float: right;" type="text" @click="edit(item)">编辑</el-button>
  17 + <el-button v-if="item.defaultServer" icon="el-icon-edit" style="padding: 0;float: right;" type="text" @click="edit(item)">查看</el-button>
  18 + <el-button icon="el-icon-delete" style="margin-right: 10px;padding: 0;float: right;" type="text" @click="del(item)">移除</el-button>
  19 + <div style="margin-top: 13px; line-height: 12px; ">
  20 + <span style="font-size: 14px; color: #999; margin-top: 5px; ">{{item.ip}}</span>
  21 + <span style="font-size: 14px; color: #999; margin-top: 5px; float: right;">{{item.createTime}}</span>
  22 + </div>
  23 + </div>
  24 + <i v-if="item.status" class="iconfont icon-online server-card-status-online" title="在线"></i>
  25 + <i v-if="!item.status" class="iconfont icon-online server-card-status-offline" title="离线"></i>
  26 + <i v-if="item.defaultServer" class="server-card-default" >默认</i>
  27 + </el-card>
  28 + </el-col>
  29 + </el-row>
  30 + <mediaServerEdit ref="mediaServerEdit" ></mediaServerEdit>
38 </div> 31 </div>
39 </template> 32 </template>
40 33
41 <script> 34 <script>
42 - import uiHeader from './UiHeader.vue' 35 + import uiHeader from '../layout/UiHeader.vue'
43 import MediaServer from './service/MediaServer' 36 import MediaServer from './service/MediaServer'
44 import mediaServerEdit from './dialog/MediaServerEdit' 37 import mediaServerEdit from './dialog/MediaServerEdit'
45 export default { 38 export default {
web_src/src/components/ParentPlatformList.vue
1 <template> 1 <template>
2 - <div id="app">  
3 - <el-container>  
4 - <el-header>  
5 - <uiHeader></uiHeader>  
6 - </el-header>  
7 - <el-main>  
8 - <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;">  
9 - <span style="font-size: 1rem; font-weight: bold;">上级平台列表</span>  
10 - </div>  
11 - <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;font-size: 14px;">  
12 - <el-button icon="el-icon-plus" size="mini" style="margin-right: 1rem;" type="primary" @click="addParentPlatform">添加</el-button>  
13 - </div>  
14 - <!--设备列表-->  
15 - <el-table :data="platformList" border style="width: 100%" :height="winHeight">  
16 - <el-table-column prop="name" label="名称" align="center"></el-table-column>  
17 - <el-table-column prop="serverGBId" label="平台编号" width="180" align="center"></el-table-column>  
18 - <el-table-column label="是否启用" width="120" align="center">  
19 - <template slot-scope="scope">  
20 - <div slot="reference" class="name-wrapper">  
21 - <el-tag size="medium" v-if="scope.row.enable">已启用</el-tag>  
22 - <el-tag size="medium" type="info" v-if="!scope.row.enable">未启用</el-tag>  
23 - </div>  
24 - </template>  
25 - </el-table-column>  
26 - <el-table-column label="状态" width="120" align="center">  
27 - <template slot-scope="scope">  
28 - <div slot="reference" class="name-wrapper">  
29 - <el-tag size="medium" v-if="scope.row.status">在线</el-tag>  
30 - <el-tag size="medium" type="info" v-if="!scope.row.status">离线</el-tag>  
31 - </div>  
32 - </template>  
33 - </el-table-column>  
34 - <el-table-column label="地址" width="180" align="center">  
35 - <template slot-scope="scope">  
36 - <div slot="reference" class="name-wrapper">  
37 - <el-tag size="medium">{{ scope.row.serverIP}}:{{scope.row.serverPort }}</el-tag>  
38 - </div>  
39 - </template>  
40 - </el-table-column>  
41 - <el-table-column prop="deviceGBId" label="设备国标编号" width="200" align="center"></el-table-column>  
42 - <el-table-column prop="transport" label="信令传输模式" width="120" align="center"></el-table-column>  
43 - <el-table-column prop="channelCount" label="通道数" width="120" align="center"></el-table-column>  
44 - <el-table-column label="订阅信息" width="240" align="center" fixed="right">  
45 - <template slot-scope="scope">  
46 - <i v-if="scope.row.alarmSubscribe" style="font-size: 20px" title="报警订阅" class="iconfont icon-gbaojings subscribe-on " ></i>  
47 - <i v-if="!scope.row.alarmSubscribe" style="font-size: 20px" title="报警订阅" class="iconfont icon-gbaojings subscribe-off " ></i>  
48 - <i v-if="scope.row.catalogSubscribe" title="目录订阅" class="iconfont icon-gjichus subscribe-on" ></i>  
49 - <i v-if="!scope.row.catalogSubscribe" title="目录订阅" class="iconfont icon-gjichus subscribe-off" ></i>  
50 - <i v-if="scope.row.mobilePositionSubscribe" title="位置订阅" class="iconfont icon-gxunjians subscribe-on" ></i>  
51 - <i v-if="!scope.row.mobilePositionSubscribe" title="位置订阅" class="iconfont icon-gxunjians subscribe-off" ></i>  
52 - </template>  
53 - </el-table-column> 2 + <div id="app" style="width: 100%">
  3 + <div class="page-header">
  4 + <div class="page-title">上级平台列表</div>
  5 + <div class="page-header-btn">
  6 + <el-button icon="el-icon-plus" size="mini" style="margin-right: 1rem;" type="primary" @click="addParentPlatform">添加</el-button>
  7 + </div>
  8 + </div>
54 9
55 - <el-table-column label="操作" width="300" align="center" fixed="right">  
56 - <template slot-scope="scope">  
57 - <el-button size="mini" icon="el-icon-edit" @click="editPlatform(scope.row)">编辑</el-button>  
58 - <el-button size="mini" icon="el-icon-share" type="primary" @click="chooseChannel(scope.row)">选择通道</el-button>  
59 - <el-button size="mini" icon="el-icon-delete" type="danger" @click="deletePlatform(scope.row)">删除</el-button>  
60 - </template>  
61 - </el-table-column>  
62 - </el-table>  
63 - <el-pagination  
64 - style="float: right"  
65 - @size-change="handleSizeChange"  
66 - @current-change="currentChange"  
67 - :current-page="currentPage"  
68 - :page-size="count"  
69 - :page-sizes="[15, 25, 35, 50]"  
70 - layout="total, sizes, prev, pager, next"  
71 - :total="total">  
72 - </el-pagination>  
73 - <platformEdit ref="platformEdit" ></platformEdit>  
74 - <chooseChannelDialog ref="chooseChannelDialog" ></chooseChannelDialog>  
75 - </el-main>  
76 - </el-container> 10 + <!--设备列表-->
  11 + <el-table :data="platformList" border style="width: 100%" :height="winHeight">
  12 + <el-table-column prop="name" label="名称" align="center"></el-table-column>
  13 + <el-table-column prop="serverGBId" label="平台编号" align="center"></el-table-column>
  14 + <el-table-column label="是否启用" width="120" align="center">
  15 + <template slot-scope="scope">
  16 + <div slot="reference" class="name-wrapper">
  17 + <el-tag size="medium" v-if="scope.row.enable">已启用</el-tag>
  18 + <el-tag size="medium" type="info" v-if="!scope.row.enable">未启用</el-tag>
  19 + </div>
  20 + </template>
  21 + </el-table-column>
  22 + <el-table-column label="状态" width="120" align="center">
  23 + <template slot-scope="scope">
  24 + <div slot="reference" class="name-wrapper">
  25 + <el-tag size="medium" v-if="scope.row.status">在线</el-tag>
  26 + <el-tag size="medium" type="info" v-if="!scope.row.status">离线</el-tag>
  27 + </div>
  28 + </template>
  29 + </el-table-column>
  30 + <el-table-column label="地址" width="180" align="center">
  31 + <template slot-scope="scope">
  32 + <div slot="reference" class="name-wrapper">
  33 + <el-tag size="medium">{{ scope.row.serverIP}}:{{scope.row.serverPort }}</el-tag>
  34 + </div>
  35 + </template>
  36 + </el-table-column>
  37 + <el-table-column prop="deviceGBId" label="设备国标编号" width="200" align="center"></el-table-column>
  38 + <el-table-column prop="transport" label="信令传输模式" width="120" align="center"></el-table-column>
  39 + <el-table-column prop="channelCount" label="通道数" width="120" align="center"></el-table-column>
  40 + <el-table-column label="订阅信息" width="240" align="center" fixed="right">
  41 + <template slot-scope="scope">
  42 + <i v-if="scope.row.alarmSubscribe" style="font-size: 20px" title="报警订阅" class="iconfont icon-gbaojings subscribe-on " ></i>
  43 + <i v-if="!scope.row.alarmSubscribe" style="font-size: 20px" title="报警订阅" class="iconfont icon-gbaojings subscribe-off " ></i>
  44 + <i v-if="scope.row.catalogSubscribe" title="目录订阅" class="iconfont icon-gjichus subscribe-on" ></i>
  45 + <i v-if="!scope.row.catalogSubscribe" title="目录订阅" class="iconfont icon-gjichus subscribe-off" ></i>
  46 + <i v-if="scope.row.mobilePositionSubscribe" title="位置订阅" class="iconfont icon-gxunjians subscribe-on" ></i>
  47 + <i v-if="!scope.row.mobilePositionSubscribe" title="位置订阅" class="iconfont icon-gxunjians subscribe-off" ></i>
  48 + </template>
  49 + </el-table-column>
  50 +
  51 + <el-table-column label="操作" width="300" align="center" fixed="right">
  52 + <template slot-scope="scope">
  53 + <el-button size="mini" icon="el-icon-edit" @click="editPlatform(scope.row)">编辑</el-button>
  54 + <el-button size="mini" icon="el-icon-share" type="primary" @click="chooseChannel(scope.row)">选择通道</el-button>
  55 + <el-button size="mini" icon="el-icon-delete" type="danger" @click="deletePlatform(scope.row)">删除</el-button>
  56 + </template>
  57 + </el-table-column>
  58 + </el-table>
  59 + <el-pagination
  60 + style="float: right"
  61 + @size-change="handleSizeChange"
  62 + @current-change="currentChange"
  63 + :current-page="currentPage"
  64 + :page-size="count"
  65 + :page-sizes="[15, 25, 35, 50]"
  66 + layout="total, sizes, prev, pager, next"
  67 + :total="total">
  68 + </el-pagination>
  69 + <platformEdit ref="platformEdit" ></platformEdit>
  70 + <chooseChannelDialog ref="chooseChannelDialog" ></chooseChannelDialog>
77 </div> 71 </div>
78 </template> 72 </template>
79 73
80 <script> 74 <script>
81 import platformEdit from './dialog/platformEdit.vue' 75 import platformEdit from './dialog/platformEdit.vue'
82 -import uiHeader from './UiHeader.vue' 76 +import uiHeader from '../layout/UiHeader.vue'
83 import chooseChannelDialog from './dialog/chooseChannel.vue' 77 import chooseChannelDialog from './dialog/chooseChannel.vue'
84 export default { 78 export default {
85 name: 'app', 79 name: 'app',
web_src/src/components/PushVideoList.vue
1 <template> 1 <template>
2 - <div id="pushVideoList">  
3 - <el-container>  
4 - <el-header>  
5 - <uiHeader></uiHeader>  
6 - </el-header>  
7 - <el-main>  
8 - <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;">  
9 - <span style="font-size: 1rem; font-weight: bold;">推流列表</span>  
10 - </div>  
11 - <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;font-size: 14px;">  
12 -  
13 - 搜索: <el-input @input="getPushList" style="margin-right: 1rem; width: auto;" size="mini" placeholder="关键字" prefix-icon="el-icon-search" v-model="searchSrt" clearable> </el-input>  
14 -  
15 - 流媒体: <el-select size="mini" @change="getPushList" style="margin-right: 1rem;" v-model="mediaServerId" placeholder="请选择" default-first-option> 2 + <div id="pushVideoList" style="width: 100%">
  3 + <div class="page-header">
  4 + <div class="page-title">推流列表</div>
  5 + <div class="page-header-btn">
  6 + 搜索:
  7 + <el-input @input="getPushList" style="margin-right: 1rem; width: auto;" size="mini" placeholder="关键字"
  8 + prefix-icon="el-icon-search" v-model="searchSrt" clearable></el-input>
  9 + 流媒体:
  10 + <el-select size="mini" @change="getPushList" style="margin-right: 1rem;" v-model="mediaServerId"
  11 + placeholder="请选择" default-first-option>
16 <el-option label="全部" value=""></el-option> 12 <el-option label="全部" value=""></el-option>
17 <el-option 13 <el-option
18 v-for="item in mediaServerList" 14 v-for="item in mediaServerList"
@@ -21,309 +17,327 @@ @@ -21,309 +17,327 @@
21 :value="item.id"> 17 :value="item.id">
22 </el-option> 18 </el-option>
23 </el-select> 19 </el-select>
24 - 推流状态: <el-select size="mini" style="margin-right: 1rem;" @change="getPushList" v-model="pushing" placeholder="请选择" default-first-option> 20 + 推流状态:
  21 + <el-select size="mini" style="margin-right: 1rem;" @change="getPushList" v-model="pushing" placeholder="请选择"
  22 + default-first-option>
25 <el-option label="全部" value=""></el-option> 23 <el-option label="全部" value=""></el-option>
26 <el-option label="推流进行中" value="true"></el-option> 24 <el-option label="推流进行中" value="true"></el-option>
27 <el-option label="推流未进行" value="false"></el-option> 25 <el-option label="推流未进行" value="false"></el-option>
28 </el-select> 26 </el-select>
29 - <el-button icon="el-icon-upload2" size="mini" style="margin-right: 1rem;" type="primary" @click="importChannel">通道导入</el-button>  
30 - <el-button icon="el-icon-download" size="mini" style="margin-right: 1rem;" type="primary" >  
31 - <a style="color: #FFFFFF; text-align: center; text-decoration: none" href="/static/file/推流通道导入.zip" download='推流通道导入.zip' >下载模板</a>  
32 - </el-button>  
33 - <el-button icon="el-icon-delete" size="mini" style="margin-right: 1rem;" :disabled="multipleSelection.length === 0" type="danger" @click="batchDel">批量移除</el-button>  
34 - </div>  
35 - <devicePlayer ref="devicePlayer"></devicePlayer>  
36 - <addStreamTOGB ref="addStreamTOGB"></addStreamTOGB>  
37 - <el-table ref="pushListTable" :data="pushList" border style="width: 100%" :height="winHeight" @selection-change="handleSelectionChange" :row-key="(row)=> row.app + row.stream">  
38 - <el-table-column align="center" type="selection" :reserve-selection="true" width="55">  
39 - </el-table-column>  
40 - <el-table-column prop="name" label="名称" align="center">  
41 - </el-table-column>  
42 - <el-table-column prop="app" label="APP" align="center">  
43 - </el-table-column>  
44 - <el-table-column prop="stream" label="流ID" align="center">  
45 - </el-table-column>  
46 - <el-table-column prop="gbId" label="国标编码" width="200" align="center">  
47 - </el-table-column>  
48 - <el-table-column prop="mediaServerId" label="流媒体" width="200" align="center">  
49 - </el-table-column>  
50 - <el-table-column label="开始时间" align="center" width="200">  
51 - <template slot-scope="scope">  
52 - <el-button-group>  
53 - {{dateFormat(parseInt(scope.row.createStamp))}}  
54 - </el-button-group>  
55 - </template>  
56 - </el-table-column>  
57 - <el-table-column label="正在推流" align="center" width="100">  
58 - <template slot-scope="scope">  
59 - {{(scope.row.status == false && scope.row.gbId == null) || scope.row.status ?'是':'否'}}  
60 - </template>  
61 - </el-table-column> 27 + <el-button icon="el-icon-upload2" size="mini" style="margin-right: 1rem;" type="primary" @click="importChannel">
  28 + 通道导入
  29 + </el-button>
  30 + <el-button icon="el-icon-download" size="mini" style="margin-right: 1rem;" type="primary">
  31 + <a style="color: #FFFFFF; text-align: center; text-decoration: none" href="/static/file/推流通道导入.zip"
  32 + download='推流通道导入.zip'>下载模板</a>
  33 + </el-button>
  34 + <el-button icon="el-icon-delete" size="mini" style="margin-right: 1rem;"
  35 + :disabled="multipleSelection.length === 0" type="danger" @click="batchDel">批量移除
  36 + </el-button>
  37 + </div>
  38 + </div>
  39 + <devicePlayer ref="devicePlayer"></devicePlayer>
  40 + <addStreamTOGB ref="addStreamTOGB"></addStreamTOGB>
  41 + <el-table ref="pushListTable" :data="pushList" border style="width: 100%" :height="winHeight"
  42 + @selection-change="handleSelectionChange" :row-key="(row)=> row.app + row.stream">
  43 + <el-table-column align="center" type="selection" :reserve-selection="true" width="55">
  44 + </el-table-column>
  45 + <el-table-column prop="name" label="名称" align="center">
  46 + </el-table-column>
  47 + <el-table-column prop="app" label="APP" align="center">
  48 + </el-table-column>
  49 + <el-table-column prop="stream" label="流ID" align="center">
  50 + </el-table-column>
  51 + <el-table-column prop="gbId" label="国标编码" width="200" align="center">
  52 + </el-table-column>
  53 + <el-table-column prop="mediaServerId" label="流媒体" width="200" align="center">
  54 + </el-table-column>
  55 + <el-table-column label="开始时间" align="center" width="200">
  56 + <template slot-scope="scope">
  57 + <el-button-group>
  58 + {{ dateFormat(parseInt(scope.row.createStamp)) }}
  59 + </el-button-group>
  60 + </template>
  61 + </el-table-column>
  62 + <el-table-column label="正在推流" align="center" width="100">
  63 + <template slot-scope="scope">
  64 + {{ (scope.row.status == false && scope.row.gbId == null) || scope.row.status ? '是' : '否' }}
  65 + </template>
  66 + </el-table-column>
62 67
63 - <el-table-column label="操作" width="360" align="center" fixed="right">  
64 - <template slot-scope="scope">  
65 - <el-button-group>  
66 - <el-button size="mini" icon="el-icon-video-play" v-if="(scope.row.status == false && scope.row.gbId == null) || scope.row.status" @click="playPush(scope.row)">播放</el-button>  
67 - <el-button size="mini" icon="el-icon-delete" type="danger" @click="stopPush(scope.row)">移除</el-button>  
68 - <el-button size="mini" icon="el-icon-position" type="primary" v-if="!!!scope.row.gbId" @click="addToGB(scope.row)">加入国标</el-button>  
69 - <el-button size="mini" icon="el-icon-position" type="primary" v-if="!!scope.row.gbId" @click="removeFromGB(scope.row)">移出国标</el-button>  
70 - </el-button-group>  
71 - </template>  
72 - </el-table-column>  
73 - </el-table>  
74 - <el-pagination  
75 - style="float: right"  
76 - @size-change="handleSizeChange"  
77 - @current-change="currentChange"  
78 - :current-page="currentPage"  
79 - :page-size="count"  
80 - :page-sizes="[15, 25, 35, 50]"  
81 - layout="total, sizes, prev, pager, next"  
82 - :total="total">  
83 - </el-pagination>  
84 - <streamProxyEdit ref="streamProxyEdit" ></streamProxyEdit>  
85 - <importChannel ref="importChannel" ></importChannel>  
86 - </el-main>  
87 - </el-container>  
88 - </div> 68 + <el-table-column label="操作" width="360" align="center" fixed="right">
  69 + <template slot-scope="scope">
  70 + <el-button-group>
  71 + <el-button size="mini" icon="el-icon-video-play"
  72 + v-if="(scope.row.status == false && scope.row.gbId == null) || scope.row.status"
  73 + @click="playPush(scope.row)">播放
  74 + </el-button>
  75 + <el-button size="mini" icon="el-icon-delete" type="danger" @click="stopPush(scope.row)">移除</el-button>
  76 + <el-button size="mini" icon="el-icon-position" type="primary" v-if="!!!scope.row.gbId"
  77 + @click="addToGB(scope.row)">加入国标
  78 + </el-button>
  79 + <el-button size="mini" icon="el-icon-position" type="primary" v-if="!!scope.row.gbId"
  80 + @click="removeFromGB(scope.row)">移出国标
  81 + </el-button>
  82 + </el-button-group>
  83 + </template>
  84 + </el-table-column>
  85 + </el-table>
  86 + <el-pagination
  87 + style="float: right"
  88 + @size-change="handleSizeChange"
  89 + @current-change="currentChange"
  90 + :current-page="currentPage"
  91 + :page-size="count"
  92 + :page-sizes="[15, 25, 35, 50]"
  93 + layout="total, sizes, prev, pager, next"
  94 + :total="total">
  95 + </el-pagination>
  96 + <streamProxyEdit ref="streamProxyEdit"></streamProxyEdit>
  97 + <importChannel ref="importChannel"></importChannel>
  98 + </div>
89 </template> 99 </template>
90 100
91 <script> 101 <script>
92 - import streamProxyEdit from './dialog/StreamProxyEdit.vue'  
93 - import devicePlayer from './dialog/devicePlayer.vue'  
94 - import addStreamTOGB from './dialog/addStreamTOGB.vue'  
95 - import uiHeader from './UiHeader.vue'  
96 - import importChannel from './dialog/importChannel.vue'  
97 - import MediaServer from './service/MediaServer'  
98 - export default {  
99 - name: 'pushVideoList',  
100 - components: {  
101 - devicePlayer,  
102 - addStreamTOGB,  
103 - streamProxyEdit,  
104 - uiHeader,  
105 - importChannel,  
106 - },  
107 - data() {  
108 - return {  
109 - pushList: [], //设备列表  
110 - currentPusher: {}, //当前操作设备对象  
111 - updateLooper: 0, //数据刷新轮训标志  
112 - currentDeviceChannelsLenth:0,  
113 - winHeight: window.innerHeight - 250,  
114 - mediaServerObj : new MediaServer(),  
115 - currentPage:1,  
116 - count:15,  
117 - total:0,  
118 - searchSrt: "",  
119 - pushing: "",  
120 - mediaServerId: "",  
121 - mediaServerList: [],  
122 - multipleSelection: [],  
123 - getDeviceListLoading: false  
124 - };  
125 - },  
126 - computed: {  
127 - },  
128 - mounted() {  
129 - this.initData();  
130 - this.updateLooper = setInterval(this.getPushList, 2000);  
131 - },  
132 - destroyed() {  
133 - clearTimeout(this.updateLooper);  
134 - },  
135 - methods: {  
136 - initData: function() {  
137 - this.mediaServerObj.getOnlineMediaServerList((data)=>{  
138 - this.mediaServerList = data.data;  
139 - })  
140 - this.getPushList();  
141 - },  
142 - currentChange: function(val){  
143 - this.currentPage = val;  
144 - this.getPushList();  
145 - },  
146 - handleSizeChange: function(val){  
147 - this.count = val;  
148 - this.getPushList();  
149 - },  
150 - getPushList: function() {  
151 - let that = this;  
152 - this.getDeviceListLoading = true;  
153 - this.$axios({  
154 - method: 'get',  
155 - url:`/api/push/list`,  
156 - params: {  
157 - page: that.currentPage,  
158 - count: that.count,  
159 - query: that.searchSrt,  
160 - pushing: that.pushing,  
161 - mediaServerId: that.mediaServerId,  
162 - }  
163 - }).then(function (res) {  
164 - that.total = res.data.total;  
165 - that.pushList = res.data.list;  
166 - that.getDeviceListLoading = false;  
167 - }).catch(function (error) {  
168 - console.error(error);  
169 - that.getDeviceListLoading = false;  
170 - });  
171 - }, 102 +import streamProxyEdit from './dialog/StreamProxyEdit.vue'
  103 +import devicePlayer from './dialog/devicePlayer.vue'
  104 +import addStreamTOGB from './dialog/addStreamTOGB.vue'
  105 +import uiHeader from '../layout/UiHeader.vue'
  106 +import importChannel from './dialog/importChannel.vue'
  107 +import MediaServer from './service/MediaServer'
  108 +
  109 +export default {
  110 + name: 'pushVideoList',
  111 + components: {
  112 + devicePlayer,
  113 + addStreamTOGB,
  114 + streamProxyEdit,
  115 + uiHeader,
  116 + importChannel,
  117 + },
  118 + data() {
  119 + return {
  120 + pushList: [], //设备列表
  121 + currentPusher: {}, //当前操作设备对象
  122 + updateLooper: 0, //数据刷新轮训标志
  123 + currentDeviceChannelsLenth: 0,
  124 + winHeight: window.innerHeight - 250,
  125 + mediaServerObj: new MediaServer(),
  126 + currentPage: 1,
  127 + count: 15,
  128 + total: 0,
  129 + searchSrt: "",
  130 + pushing: "",
  131 + mediaServerId: "",
  132 + mediaServerList: [],
  133 + multipleSelection: [],
  134 + getDeviceListLoading: false
  135 + };
  136 + },
  137 + computed: {},
  138 + mounted() {
  139 + this.initData();
  140 + this.updateLooper = setInterval(this.getPushList, 2000);
  141 + },
  142 + destroyed() {
  143 + clearTimeout(this.updateLooper);
  144 + },
  145 + methods: {
  146 + initData: function () {
  147 + this.mediaServerObj.getOnlineMediaServerList((data) => {
  148 + this.mediaServerList = data.data;
  149 + })
  150 + this.getPushList();
  151 + },
  152 + currentChange: function (val) {
  153 + this.currentPage = val;
  154 + this.getPushList();
  155 + },
  156 + handleSizeChange: function (val) {
  157 + this.count = val;
  158 + this.getPushList();
  159 + },
  160 + getPushList: function () {
  161 + let that = this;
  162 + this.getDeviceListLoading = true;
  163 + this.$axios({
  164 + method: 'get',
  165 + url: `/api/push/list`,
  166 + params: {
  167 + page: that.currentPage,
  168 + count: that.count,
  169 + query: that.searchSrt,
  170 + pushing: that.pushing,
  171 + mediaServerId: that.mediaServerId,
  172 + }
  173 + }).then(function (res) {
  174 + that.total = res.data.total;
  175 + that.pushList = res.data.list;
  176 + that.getDeviceListLoading = false;
  177 + }).catch(function (error) {
  178 + console.error(error);
  179 + that.getDeviceListLoading = false;
  180 + });
  181 + },
172 182
173 - playPush: function(row){  
174 - let that = this;  
175 - this.getListLoading = true;  
176 - this.$axios({  
177 - method: 'get',  
178 - url: '/api/media/stream_info_by_app_and_stream',  
179 - params: {  
180 - app: row.app,  
181 - stream: row.stream,  
182 - mediaServerId: row.mediaServerId  
183 - }  
184 - }).then(function (res) {  
185 - that.getListLoading = false;  
186 - that.$refs.devicePlayer.openDialog("streamPlay", null, null, {  
187 - streamInfo: res.data.data,  
188 - hasAudio: true  
189 - });  
190 - }).catch(function (error) {  
191 - console.error(error);  
192 - that.getListLoading = false;  
193 - });  
194 - },  
195 - stopPush: function(row){ 183 + playPush: function (row) {
  184 + let that = this;
  185 + this.getListLoading = true;
  186 + this.$axios({
  187 + method: 'get',
  188 + url: '/api/media/stream_info_by_app_and_stream',
  189 + params: {
  190 + app: row.app,
  191 + stream: row.stream,
  192 + mediaServerId: row.mediaServerId
  193 + }
  194 + }).then(function (res) {
  195 + that.getListLoading = false;
  196 + that.$refs.devicePlayer.openDialog("streamPlay", null, null, {
  197 + streamInfo: res.data.data,
  198 + hasAudio: true
  199 + });
  200 + }).catch(function (error) {
  201 + console.error(error);
  202 + that.getListLoading = false;
  203 + });
  204 + },
  205 + stopPush: function (row) {
  206 + let that = this;
  207 + that.$axios({
  208 + method: "post",
  209 + url: "/api/push/stop",
  210 + params: {
  211 + app: row.app,
  212 + streamId: row.stream
  213 + }
  214 + }).then((res) => {
  215 + if (res.data == "success") {
  216 + that.initData()
  217 + }
  218 + }).catch(function (error) {
  219 + console.error(error);
  220 + });
  221 + },
  222 + addToGB: function (row) {
  223 + this.$refs.addStreamTOGB.openDialog({
  224 + app: row.app,
  225 + stream: row.stream,
  226 + mediaServerId: row.mediaServerId
  227 + }, this.initData);
  228 + },
  229 + removeFromGB: function (row) {
  230 + let that = this;
  231 + that.$axios({
  232 + method: "delete",
  233 + url: "/api/push/remove_form_gb",
  234 + data: row
  235 + }).then((res) => {
  236 + if (res.data == "success") {
  237 + that.initData()
  238 + }
  239 + }).catch(function (error) {
  240 + console.error(error);
  241 + });
  242 + },
  243 + dateFormat: function (/** timestamp=0 **/) {
  244 + let ts = arguments[0] || 0;
  245 + let t, y, m, d, h, i, s;
  246 + t = ts ? new Date(ts) : new Date();
  247 + y = t.getFullYear();
  248 + m = t.getMonth() + 1;
  249 + d = t.getDate();
  250 + h = t.getHours();
  251 + i = t.getMinutes();
  252 + s = t.getSeconds();
  253 + // 可根据需要在这里定义时间格式
  254 + return y + '-' + (m < 10 ? '0' + m : m) + '-' + (d < 10 ? '0' + d : d) + ' ' + (h < 10 ? '0' + h : h) + ':' + (i < 10 ? '0' + i : i) + ':' + (s < 10 ? '0' + s : s);
  255 + },
  256 + importChannel: function () {
  257 + this.$refs.importChannel.openDialog(() => {
  258 +
  259 + })
  260 + },
  261 + batchDel: function () {
  262 + this.$confirm(`确定删除选中的${this.multipleSelection.length}个通道?`, '提示', {
  263 + confirmButtonText: '确定',
  264 + cancelButtonText: '取消',
  265 + type: 'warning'
  266 + }).then(() => {
196 let that = this; 267 let that = this;
197 that.$axios({ 268 that.$axios({
198 - method:"post",  
199 - url:"/api/push/stop",  
200 - params: {  
201 - app: row.app,  
202 - streamId: row.stream  
203 - }  
204 - }).then((res)=>{  
205 - if (res.data == "success") {  
206 - that.initData() 269 + method: "delete",
  270 + url: "/api/push/batchStop",
  271 + data: {
  272 + gbStreams: this.multipleSelection
207 } 273 }
  274 + }).then((res) => {
  275 + this.initData();
  276 + this.$refs.pushListTable.clearSelection();
208 }).catch(function (error) { 277 }).catch(function (error) {
209 console.error(error); 278 console.error(error);
210 }); 279 });
211 - },  
212 - addToGB: function(row){  
213 - this.$refs.addStreamTOGB.openDialog({app: row.app, stream: row.stream, mediaServerId: row.mediaServerId}, this.initData);  
214 - },  
215 - removeFromGB: function(row){  
216 - let that = this;  
217 - that.$axios({  
218 - method:"delete",  
219 - url:"/api/push/remove_form_gb",  
220 - data:row  
221 - }).then((res)=>{  
222 - if (res.data == "success") {  
223 - that.initData()  
224 - }  
225 - }).catch(function (error) {  
226 - console.error(error);  
227 - });  
228 - },  
229 - dateFormat: function(/** timestamp=0 **/) {  
230 - let ts = arguments[0] || 0;  
231 - let t,y,m,d,h,i,s;  
232 - t = ts ? new Date(ts) : new Date();  
233 - y = t.getFullYear();  
234 - m = t.getMonth()+1;  
235 - d = t.getDate();  
236 - h = t.getHours();  
237 - i = t.getMinutes();  
238 - s = t.getSeconds();  
239 - // 可根据需要在这里定义时间格式  
240 - return y+'-'+(m<10?'0'+m:m)+'-'+(d<10?'0'+d:d)+' '+(h<10?'0'+h:h)+':'+(i<10?'0'+i:i)+':'+(s<10?'0'+s:s);  
241 - },  
242 - importChannel: function () {  
243 - this.$refs.importChannel.openDialog(()=>{ 280 + }).catch(() => {
244 281
245 - })  
246 - },  
247 - batchDel: function () {  
248 - this.$confirm(`确定删除选中的${this.multipleSelection.length}个通道?`, '提示', {  
249 - confirmButtonText: '确定',  
250 - cancelButtonText: '取消',  
251 - type: 'warning'  
252 - }).then(() => {  
253 - let that = this;  
254 - that.$axios({  
255 - method:"delete",  
256 - url:"/api/push/batchStop",  
257 - data: {  
258 - gbStreams: this.multipleSelection  
259 - }  
260 - }).then((res)=>{  
261 - this.initData();  
262 - this.$refs.pushListTable.clearSelection();  
263 - }).catch(function (error) {  
264 - console.error(error);  
265 - });  
266 - }).catch(() => {  
267 -  
268 - });  
269 - },  
270 - handleSelectionChange: function (val) {  
271 - this.multipleSelection = val;  
272 - },  
273 - }  
274 - }; 282 + });
  283 + },
  284 + handleSelectionChange: function (val) {
  285 + this.multipleSelection = val;
  286 + },
  287 + }
  288 +};
275 </script> 289 </script>
276 290
277 <style> 291 <style>
278 - .videoList {  
279 - display: flex;  
280 - flex-wrap: wrap;  
281 - align-content: flex-start;  
282 - } 292 +.videoList {
  293 + display: flex;
  294 + flex-wrap: wrap;
  295 + align-content: flex-start;
  296 +}
283 297
284 - .video-item {  
285 - position: relative;  
286 - width: 15rem;  
287 - height: 10rem;  
288 - margin-right: 1rem;  
289 - background-color: #000000;  
290 - } 298 +.video-item {
  299 + position: relative;
  300 + width: 15rem;
  301 + height: 10rem;
  302 + margin-right: 1rem;
  303 + background-color: #000000;
  304 +}
291 305
292 - .video-item-img {  
293 - position: absolute;  
294 - top: 0;  
295 - bottom: 0;  
296 - left: 0;  
297 - right: 0;  
298 - margin: auto;  
299 - width: 100%;  
300 - height: 100%;  
301 - } 306 +.video-item-img {
  307 + position: absolute;
  308 + top: 0;
  309 + bottom: 0;
  310 + left: 0;
  311 + right: 0;
  312 + margin: auto;
  313 + width: 100%;
  314 + height: 100%;
  315 +}
302 316
303 - .video-item-img:after {  
304 - content: "";  
305 - display: inline-block;  
306 - position: absolute;  
307 - z-index: 2;  
308 - top: 0;  
309 - bottom: 0;  
310 - left: 0;  
311 - right: 0;  
312 - margin: auto;  
313 - width: 3rem;  
314 - height: 3rem;  
315 - background-image: url("../assets/loading.png");  
316 - background-size: cover;  
317 - background-color: #000000;  
318 - } 317 +.video-item-img:after {
  318 + content: "";
  319 + display: inline-block;
  320 + position: absolute;
  321 + z-index: 2;
  322 + top: 0;
  323 + bottom: 0;
  324 + left: 0;
  325 + right: 0;
  326 + margin: auto;
  327 + width: 3rem;
  328 + height: 3rem;
  329 + background-image: url("../assets/loading.png");
  330 + background-size: cover;
  331 + background-color: #000000;
  332 +}
319 333
320 - .video-item-title {  
321 - position: absolute;  
322 - bottom: 0;  
323 - color: #000000;  
324 - background-color: #ffffff;  
325 - line-height: 1.5rem;  
326 - padding: 0.3rem;  
327 - width: 14.4rem;  
328 - } 334 +.video-item-title {
  335 + position: absolute;
  336 + bottom: 0;
  337 + color: #000000;
  338 + background-color: #ffffff;
  339 + line-height: 1.5rem;
  340 + padding: 0.3rem;
  341 + width: 14.4rem;
  342 +}
329 </style> 343 </style>
web_src/src/components/StreamProxyList.vue
1 <template> 1 <template>
2 - <div id="streamProxyList">  
3 - <el-container>  
4 - <el-header>  
5 - <uiHeader></uiHeader>  
6 - </el-header>  
7 - <el-main>  
8 - <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;">  
9 - <span style="font-size: 1rem; font-weight: bold;">拉流代理列表</span>  
10 - </div>  
11 - <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;font-size: 14px;">  
12 - <el-button icon="el-icon-plus" size="mini" style="margin-right: 1rem;" type="primary" @click="addStreamProxy">添加代理</el-button>  
13 - <el-button v-if="false" icon="el-icon-search" size="mini" style="margin-right: 1rem;" type="primary" @click="addOnvif">搜索ONVIF</el-button>  
14 - </div>  
15 - <devicePlayer ref="devicePlayer"></devicePlayer>  
16 - <el-table :data="streamProxyList" border style="width: 100%" :height="winHeight">  
17 - <el-table-column prop="name" label="名称" align="center" show-overflow-tooltip/>  
18 - <el-table-column prop="app" label="流应用名" align="center" show-overflow-tooltip/>  
19 - <el-table-column prop="stream" label="流ID" align="center" show-overflow-tooltip/>  
20 - <el-table-column label="流地址" width="400" align="center" show-overflow-tooltip >  
21 - <template slot-scope="scope">  
22 - <div slot="reference" class="name-wrapper"> 2 + <div id="streamProxyList" style="width: 100%">
  3 + <div class="page-header">
  4 + <div class="page-title">拉流代理列表</div>
  5 + <div class="page-header-btn">
  6 + <el-button icon="el-icon-plus" size="mini" style="margin-right: 1rem;" type="primary" @click="addStreamProxy">添加代理</el-button>
  7 + <el-button v-if="false" icon="el-icon-search" size="mini" style="margin-right: 1rem;" type="primary" @click="addOnvif">搜索ONVIF</el-button>
  8 + </div>
  9 + </div>
  10 + <devicePlayer ref="devicePlayer"></devicePlayer>
  11 + <el-table :data="streamProxyList" border style="width: 100%" :height="winHeight">
  12 + <el-table-column prop="name" label="名称" align="center" show-overflow-tooltip/>
  13 + <el-table-column prop="app" label="流应用名" align="center" show-overflow-tooltip/>
  14 + <el-table-column prop="stream" label="流ID" align="center" show-overflow-tooltip/>
  15 + <el-table-column label="流地址" width="400" align="center" show-overflow-tooltip >
  16 + <template slot-scope="scope">
  17 + <div slot="reference" class="name-wrapper">
23 18
24 - <el-tag size="medium" v-if="scope.row.type == 'default'">  
25 - <i class="cpoy-btn el-icon-document-copy" title="点击拷贝" v-clipboard="scope.row.url" @success="$message({type:'success', message:'成功拷贝到粘贴板'})"></i>  
26 - {{scope.row.url}}  
27 - </el-tag>  
28 - <el-tag size="medium" v-if="scope.row.type != 'default'">  
29 - <i class="cpoy-btn el-icon-document-copy" title="点击拷贝" v-clipboard="scope.row.src_url" @success="$message({type:'success', message:'成功拷贝到粘贴板'})"></i>  
30 - {{scope.row.src_url}}  
31 - </el-tag>  
32 - </div>  
33 - </template>  
34 - </el-table-column>  
35 - <el-table-column prop="mediaServerId" label="流媒体" width="150" align="center"></el-table-column>  
36 - <el-table-column label="类型" width="100" align="center">  
37 - <template slot-scope="scope">  
38 - <div slot="reference" class="name-wrapper">  
39 - <el-tag size="medium">{{scope.row.type}}</el-tag>  
40 - </div>  
41 - </template>  
42 - </el-table-column> 19 + <el-tag size="medium" v-if="scope.row.type == 'default'">
  20 + <i class="cpoy-btn el-icon-document-copy" title="点击拷贝" v-clipboard="scope.row.url" @success="$message({type:'success', message:'成功拷贝到粘贴板'})"></i>
  21 + {{scope.row.url}}
  22 + </el-tag>
  23 + <el-tag size="medium" v-if="scope.row.type != 'default'">
  24 + <i class="cpoy-btn el-icon-document-copy" title="点击拷贝" v-clipboard="scope.row.src_url" @success="$message({type:'success', message:'成功拷贝到粘贴板'})"></i>
  25 + {{scope.row.src_url}}
  26 + </el-tag>
  27 + </div>
  28 + </template>
  29 + </el-table-column>
  30 + <el-table-column prop="mediaServerId" label="流媒体" width="150" align="center"></el-table-column>
  31 + <el-table-column label="类型" width="100" align="center">
  32 + <template slot-scope="scope">
  33 + <div slot="reference" class="name-wrapper">
  34 + <el-tag size="medium">{{scope.row.type}}</el-tag>
  35 + </div>
  36 + </template>
  37 + </el-table-column>
43 38
44 - <el-table-column prop="gbId" label="国标编码" width="180" align="center" show-overflow-tooltip/>  
45 - <el-table-column label="状态" width="120" align="center">  
46 - <template slot-scope="scope">  
47 - <div slot="reference" class="name-wrapper">  
48 - <el-tag size="medium" v-if="scope.row.status">在线</el-tag>  
49 - <el-tag size="medium" type="info" v-if="!scope.row.status">离线</el-tag>  
50 - </div>  
51 - </template>  
52 - </el-table-column>  
53 - <el-table-column label="启用" width="120" align="center">  
54 - <template slot-scope="scope">  
55 - <div slot="reference" class="name-wrapper">  
56 - <el-tag size="medium" v-if="scope.row.enable">已启用</el-tag>  
57 - <el-tag size="medium" type="info" v-if="!scope.row.enable">未启用</el-tag>  
58 - </div>  
59 - </template>  
60 - </el-table-column>  
61 - <el-table-column prop="createTime" label="创建时间" align="center" width="150" show-overflow-tooltip/>  
62 - <el-table-column label="转HLS" width="120" align="center">  
63 - <template slot-scope="scope">  
64 - <div slot="reference" class="name-wrapper">  
65 - <el-tag size="medium" v-if="scope.row.enable_hls">已启用</el-tag>  
66 - <el-tag size="medium" type="info" v-if="!scope.row.enable_hls">未启用</el-tag>  
67 - </div>  
68 - </template>  
69 - </el-table-column>  
70 - <el-table-column label="MP4录制" width="120" align="center">  
71 - <template slot-scope="scope">  
72 - <div slot="reference" class="name-wrapper">  
73 - <el-tag size="medium" v-if="scope.row.enable_mp4">已启用</el-tag>  
74 - <el-tag size="medium" type="info" v-if="!scope.row.enable_mp4">未启用</el-tag>  
75 - </div>  
76 - </template>  
77 - </el-table-column>  
78 - <el-table-column label="无人观看自动删除" width="160" align="center">  
79 - <template slot-scope="scope">  
80 - <div slot="reference" class="name-wrapper">  
81 - <el-tag size="medium" v-if="scope.row.enable_remove_none_reader">已启用</el-tag>  
82 - <el-tag size="medium" type="info" v-if="!scope.row.enable_remove_none_reader">未启用</el-tag>  
83 - </div>  
84 - </template>  
85 - </el-table-column> 39 + <el-table-column prop="gbId" label="国标编码" width="180" align="center" show-overflow-tooltip/>
  40 + <el-table-column label="状态" width="120" align="center">
  41 + <template slot-scope="scope">
  42 + <div slot="reference" class="name-wrapper">
  43 + <el-tag size="medium" v-if="scope.row.status">在线</el-tag>
  44 + <el-tag size="medium" type="info" v-if="!scope.row.status">离线</el-tag>
  45 + </div>
  46 + </template>
  47 + </el-table-column>
  48 + <el-table-column label="启用" width="120" align="center">
  49 + <template slot-scope="scope">
  50 + <div slot="reference" class="name-wrapper">
  51 + <el-tag size="medium" v-if="scope.row.enable">已启用</el-tag>
  52 + <el-tag size="medium" type="info" v-if="!scope.row.enable">未启用</el-tag>
  53 + </div>
  54 + </template>
  55 + </el-table-column>
  56 + <el-table-column prop="createTime" label="创建时间" align="center" width="150" show-overflow-tooltip/>
  57 + <el-table-column label="转HLS" width="120" align="center">
  58 + <template slot-scope="scope">
  59 + <div slot="reference" class="name-wrapper">
  60 + <el-tag size="medium" v-if="scope.row.enable_hls">已启用</el-tag>
  61 + <el-tag size="medium" type="info" v-if="!scope.row.enable_hls">未启用</el-tag>
  62 + </div>
  63 + </template>
  64 + </el-table-column>
  65 + <el-table-column label="MP4录制" width="120" align="center">
  66 + <template slot-scope="scope">
  67 + <div slot="reference" class="name-wrapper">
  68 + <el-tag size="medium" v-if="scope.row.enable_mp4">已启用</el-tag>
  69 + <el-tag size="medium" type="info" v-if="!scope.row.enable_mp4">未启用</el-tag>
  70 + </div>
  71 + </template>
  72 + </el-table-column>
  73 + <el-table-column label="无人观看自动删除" width="160" align="center">
  74 + <template slot-scope="scope">
  75 + <div slot="reference" class="name-wrapper">
  76 + <el-tag size="medium" v-if="scope.row.enable_remove_none_reader">已启用</el-tag>
  77 + <el-tag size="medium" type="info" v-if="!scope.row.enable_remove_none_reader">未启用</el-tag>
  78 + </div>
  79 + </template>
  80 + </el-table-column>
86 81
87 82
88 - <el-table-column label="操作" width="360" align="center" fixed="right">  
89 - <template slot-scope="scope">  
90 - <el-button-group>  
91 - <el-button size="mini" icon="el-icon-video-play" v-if="scope.row.enable" @click="play(scope.row)">播放</el-button>  
92 - <el-button size="mini" icon="el-icon-close" type="success" v-if="scope.row.enable" @click="stop(scope.row)">停用</el-button>  
93 - <el-button size="mini" icon="el-icon-check" type="primary" :loading="startBtnLaoding" v-if="!scope.row.enable" @click="start(scope.row)">启用</el-button>  
94 - <el-button size="mini" icon="el-icon-delete" type="danger" @click="deleteStreamProxy(scope.row)">删除</el-button>  
95 - </el-button-group>  
96 - </template>  
97 - </el-table-column>  
98 - </el-table>  
99 - <el-pagination  
100 - style="float: right"  
101 - @size-change="handleSizeChange"  
102 - @current-change="currentChange"  
103 - :current-page="currentPage"  
104 - :page-size="count"  
105 - :page-sizes="[15, 25, 35, 50]"  
106 - layout="total, sizes, prev, pager, next"  
107 - :total="total">  
108 - </el-pagination>  
109 - <streamProxyEdit ref="streamProxyEdit" ></streamProxyEdit>  
110 - <onvifEdit ref="onvifEdit" ></onvifEdit>  
111 - </el-main>  
112 - </el-container> 83 + <el-table-column label="操作" width="360" align="center" fixed="right">
  84 + <template slot-scope="scope">
  85 + <el-button-group>
  86 + <el-button size="mini" icon="el-icon-video-play" v-if="scope.row.enable" @click="play(scope.row)">播放</el-button>
  87 + <el-button size="mini" icon="el-icon-close" type="success" v-if="scope.row.enable" @click="stop(scope.row)">停用</el-button>
  88 + <el-button size="mini" icon="el-icon-check" type="primary" :loading="startBtnLaoding" v-if="!scope.row.enable" @click="start(scope.row)">启用</el-button>
  89 + <el-button size="mini" icon="el-icon-delete" type="danger" @click="deleteStreamProxy(scope.row)">删除</el-button>
  90 + </el-button-group>
  91 + </template>
  92 + </el-table-column>
  93 + </el-table>
  94 + <el-pagination
  95 + style="float: right"
  96 + @size-change="handleSizeChange"
  97 + @current-change="currentChange"
  98 + :current-page="currentPage"
  99 + :page-size="count"
  100 + :page-sizes="[15, 25, 35, 50]"
  101 + layout="total, sizes, prev, pager, next"
  102 + :total="total">
  103 + </el-pagination>
  104 + <streamProxyEdit ref="streamProxyEdit" ></streamProxyEdit>
  105 + <onvifEdit ref="onvifEdit" ></onvifEdit>
113 </div> 106 </div>
114 </template> 107 </template>
115 108
@@ -117,7 +110,7 @@ @@ -117,7 +110,7 @@
117 import streamProxyEdit from './dialog/StreamProxyEdit.vue' 110 import streamProxyEdit from './dialog/StreamProxyEdit.vue'
118 import onvifEdit from './dialog/onvifEdit.vue' 111 import onvifEdit from './dialog/onvifEdit.vue'
119 import devicePlayer from './dialog/devicePlayer.vue' 112 import devicePlayer from './dialog/devicePlayer.vue'
120 - import uiHeader from './UiHeader.vue' 113 + import uiHeader from '../layout/UiHeader.vue'
121 export default { 114 export default {
122 name: 'streamProxyList', 115 name: 'streamProxyList',
123 components: { 116 components: {
web_src/src/components/channelList.vue
1 <template> 1 <template>
2 -<div id="channelList">  
3 - <el-container>  
4 - <el-header>  
5 - <uiHeader></uiHeader>  
6 - </el-header>  
7 - <el-main>  
8 - <div style="background-color: #FFFFFF; position: relative; padding: 1rem 0.5rem 0.5rem 0.5rem; text-align: center;">  
9 - <span style="font-size: 1rem; font-weight: 500; ">通道列表({{parentChannelId ==0 ? deviceId:parentChannelId}})</span> 2 + <div id="channelList" style="width: 100%">
  3 + <div class="page-header">
  4 + <div class="page-title">
  5 + <el-button icon="el-icon-arrow-left" size="mini" style="margin-right: 1rem;" type="primary" @click="showDevice">
  6 + 返回
  7 + </el-button>
  8 + 通道列表({{ parentChannelId == 0 ? deviceId : parentChannelId }})</div>
  9 + <div class="page-header-btn">
  10 + 搜索:
  11 + <el-input @input="search" style="margin-right: 1rem; width: auto;" size="mini" placeholder="关键字"
  12 + prefix-icon="el-icon-search" v-model="searchSrt" clearable></el-input>
10 13
11 - </div>  
12 - <div style="background-color: #FFFFFF; margin-bottom: 1rem; position: relative; padding: 0.5rem; text-align: left;font-size: 14px;">  
13 - <el-button icon="el-icon-arrow-left" size="mini" style="margin-right: 1rem;" type="primary" @click="showDevice">返回</el-button>  
14 - 搜索: <el-input @input="search" style="margin-right: 1rem; width: auto;" size="mini" placeholder="关键字" prefix-icon="el-icon-search" v-model="searchSrt" clearable> </el-input> 14 + 通道类型:
  15 + <el-select size="mini" @change="search" style="margin-right: 1rem;" v-model="channelType" placeholder="请选择"
  16 + default-first-option>
  17 + <el-option label="全部" value=""></el-option>
  18 + <el-option label="设备" value="false"></el-option>
  19 + <el-option label="子目录" value="true"></el-option>
  20 + </el-select>
  21 + 在线状态:
  22 + <el-select size="mini" style="margin-right: 1rem;" @change="search" v-model="online" placeholder="请选择"
  23 + default-first-option>
  24 + <el-option label="全部" value=""></el-option>
  25 + <el-option label="在线" value="true"></el-option>
  26 + <el-option label="离线" value="false"></el-option>
  27 + </el-select>
  28 + <el-checkbox size="mini" v-model="autoList" @change="autoListChange">
  29 + 自动刷新
  30 + </el-checkbox>
  31 + </div>
  32 + </div>
  33 + <devicePlayer ref="devicePlayer" v-loading="isLoging"></devicePlayer>
  34 + <!--设备列表-->
  35 + <el-table ref="channelListTable" :data="deviceChannelList" :height="winHeight" border style="width: 100%">
  36 + <el-table-column prop="channelId" label="通道编号" width="200">
  37 + </el-table-column>
  38 + <el-table-column prop="name" label="通道名称">
  39 + </el-table-column>
  40 + <el-table-column label="快照" width="80" align="center">
  41 + <template slot-scope="scope">
  42 + <img style="max-height: 3rem;max-width: 4rem;"
  43 + :id="scope.row.deviceId + '_' + scope.row.channelId"
  44 + :src="getSnap(scope.row)"
  45 + @error="getSnapErrorEvent($event.target.id)"
  46 + alt="">
  47 + <!-- <el-image-->
  48 + <!-- :id="'snapImg_' + scope.row.deviceId + '_' + scope.row.channelId"-->
  49 + <!-- :src="getSnap(scope.row)"-->
  50 + <!-- @error="getSnapErrorEvent($event, scope.row)"-->
  51 + <!-- :fit="'contain'">-->
  52 + <!-- <div slot="error" class="image-slot">-->
  53 + <!-- <i class="el-icon-picture-outline"></i>-->
  54 + <!-- </div>-->
  55 + <!-- </el-image>-->
  56 + </template>
  57 + </el-table-column>
  58 + <el-table-column prop="subCount" label="子节点数">
  59 + </el-table-column>
  60 + <el-table-column prop="manufacture" label="厂家">
  61 + </el-table-column>
  62 + <el-table-column label="位置信息" align="center">
  63 + <template slot-scope="scope">
  64 + <span>{{ scope.row.longitude }},{{ scope.row.latitude }}</span>
  65 + </template>
  66 + </el-table-column>
  67 + <el-table-column prop="ptztypeText" label="云台类型"/>
  68 + <el-table-column label="开启音频" align="center">
  69 + <template slot-scope="scope">
  70 + <el-switch @change="updateChannel(scope.row)" v-model="scope.row.hasAudio" active-color="#409EFF">
  71 + </el-switch>
  72 + </template>
  73 + </el-table-column>
  74 + <el-table-column label="状态" width="180" align="center">
  75 + <template slot-scope="scope">
  76 + <div slot="reference" class="name-wrapper">
  77 + <el-tag size="medium" v-if="scope.row.status == 1">开启</el-tag>
  78 + <el-tag size="medium" type="info" v-if="scope.row.status == 0">关闭</el-tag>
  79 + </div>
  80 + </template>
  81 + </el-table-column>
15 82
16 - 通道类型: <el-select size="mini" @change="search" style="margin-right: 1rem;" v-model="channelType" placeholder="请选择" default-first-option>  
17 - <el-option label="全部" value=""></el-option>  
18 - <el-option label="设备" value="false"></el-option>  
19 - <el-option label="子目录" value="true"></el-option>  
20 - </el-select>  
21 - 在线状态: <el-select size="mini" style="margin-right: 1rem;" @change="search" v-model="online" placeholder="请选择" default-first-option>  
22 - <el-option label="全部" value=""></el-option>  
23 - <el-option label="在线" value="true"></el-option>  
24 - <el-option label="离线" value="false"></el-option>  
25 - </el-select>  
26 - <el-checkbox size="mini" style="margin-right: 1rem; float: right;" v-model="autoList" @change="autoListChange">自动刷新</el-checkbox>  
27 - </div>  
28 - <devicePlayer ref="devicePlayer" v-loading="isLoging"></devicePlayer>  
29 - <!--设备列表-->  
30 - <el-table ref="channelListTable" :data="deviceChannelList" :height="winHeight" border style="width: 100%">  
31 - <el-table-column prop="channelId" label="通道编号" width="200">  
32 - </el-table-column>  
33 - <el-table-column prop="name" label="通道名称">  
34 - </el-table-column>  
35 - <el-table-column label="快照" width="80" align="center">  
36 - <template slot-scope="scope">  
37 - <img style="max-height: 3rem;max-width: 4rem;"  
38 - :id="scope.row.deviceId + '_' + scope.row.channelId"  
39 - :src="getSnap(scope.row)"  
40 - @error="getSnapErrorEvent($event.target.id)"  
41 - alt="">  
42 -<!-- <el-image-->  
43 -<!-- :id="'snapImg_' + scope.row.deviceId + '_' + scope.row.channelId"-->  
44 -<!-- :src="getSnap(scope.row)"-->  
45 -<!-- @error="getSnapErrorEvent($event, scope.row)"-->  
46 -<!-- :fit="'contain'">-->  
47 -<!-- <div slot="error" class="image-slot">-->  
48 -<!-- <i class="el-icon-picture-outline"></i>-->  
49 -<!-- </div>-->  
50 -<!-- </el-image>-->  
51 - </template>  
52 - </el-table-column>  
53 - <el-table-column prop="subCount" label="子节点数">  
54 - </el-table-column>  
55 - <el-table-column prop="manufacture" label="厂家">  
56 - </el-table-column>  
57 - <el-table-column label="位置信息" align="center">  
58 - <template slot-scope="scope">  
59 - <span>{{scope.row.longitude}},{{scope.row.latitude}}</span>  
60 - </template>  
61 - </el-table-column>  
62 - <el-table-column prop="ptztypeText" label="云台类型"/>  
63 - <el-table-column label="开启音频" align="center">  
64 - <template slot-scope="scope">  
65 - <el-switch @change="updateChannel(scope.row)" v-model="scope.row.hasAudio" active-color="#409EFF">  
66 - </el-switch>  
67 - </template>  
68 - </el-table-column>  
69 - <el-table-column label="状态" width="180" align="center">  
70 - <template slot-scope="scope">  
71 - <div slot="reference" class="name-wrapper">  
72 - <el-tag size="medium" v-if="scope.row.status == 1">开启</el-tag>  
73 - <el-tag size="medium" type="info" v-if="scope.row.status == 0">关闭</el-tag>  
74 - </div>  
75 - </template>  
76 - </el-table-column>  
77 83
78 -  
79 - <el-table-column label="操作" width="280" align="center" fixed="right">  
80 - <template slot-scope="scope">  
81 - <el-button-group>  
82 - <!-- <el-button size="mini" icon="el-icon-video-play" v-if="scope.row.parental == 0" @click="sendDevicePush(scope.row)">播放</el-button> -->  
83 - <el-button size="mini" icon="el-icon-video-play" @click="sendDevicePush(scope.row)">播放</el-button>  
84 - <el-button size="mini" icon="el-icon-switch-button" type="danger" v-if="!!scope.row.streamId" @click="stopDevicePush(scope.row)">停止</el-button>  
85 - <el-button size="mini" icon="el-icon-s-open" type="primary" v-if="scope.row.subCount > 0" @click="changeSubchannel(scope.row)">查看</el-button>  
86 - <el-button size="mini" icon="el-icon-video-camera" type="primary" @click="queryRecords(scope.row)">设备录象</el-button>  
87 - <!-- <el-button size="mini" @click="sendDevicePush(scope.row)">录像查询</el-button> -->  
88 - </el-button-group>  
89 - </template>  
90 - </el-table-column>  
91 - </el-table>  
92 - <el-pagination style="float: right" @size-change="handleSizeChange" @current-change="currentChange" :current-page="currentPage" :page-size="count" :page-sizes="[15, 20, 30, 50]" layout="total, sizes, prev, pager, next" :total="total">  
93 - </el-pagination>  
94 -  
95 - </el-main>  
96 - </el-container>  
97 -</div> 84 + <el-table-column label="操作" width="280" align="center" fixed="right">
  85 + <template slot-scope="scope">
  86 + <el-button-group>
  87 + <!-- <el-button size="mini" icon="el-icon-video-play" v-if="scope.row.parental == 0" @click="sendDevicePush(scope.row)">播放</el-button> -->
  88 + <el-button size="mini" icon="el-icon-video-play" @click="sendDevicePush(scope.row)">播放</el-button>
  89 + <el-button size="mini" icon="el-icon-switch-button" type="danger" v-if="!!scope.row.streamId"
  90 + @click="stopDevicePush(scope.row)">停止
  91 + </el-button>
  92 + <el-button size="mini" icon="el-icon-s-open" type="primary" v-if="scope.row.subCount > 0"
  93 + @click="changeSubchannel(scope.row)">查看
  94 + </el-button>
  95 + <el-button size="mini" icon="el-icon-video-camera" type="primary" @click="queryRecords(scope.row)">设备录象
  96 + </el-button>
  97 + <!-- <el-button size="mini" @click="sendDevicePush(scope.row)">录像查询</el-button> -->
  98 + </el-button-group>
  99 + </template>
  100 + </el-table-column>
  101 + </el-table>
  102 + <el-pagination style="float: right" @size-change="handleSizeChange" @current-change="currentChange"
  103 + :current-page="currentPage" :page-size="count" :page-sizes="[15, 20, 30, 50]"
  104 + layout="total, sizes, prev, pager, next" :total="total">
  105 + </el-pagination>
  106 + </div>
98 </template> 107 </template>
99 108
100 <script> 109 <script>
101 import devicePlayer from './dialog/devicePlayer.vue' 110 import devicePlayer from './dialog/devicePlayer.vue'
102 -import uiHeader from './UiHeader.vue' 111 +import uiHeader from '../layout/UiHeader.vue'
103 import moment from "moment"; 112 import moment from "moment";
  113 +
104 export default { 114 export default {
105 - name: 'channelList',  
106 - components: {  
107 - devicePlayer,  
108 - uiHeader  
109 - },  
110 - data() {  
111 - return {  
112 - deviceId: this.$route.params.deviceId,  
113 - parentChannelId: this.$route.params.parentChannelId,  
114 - deviceChannelList: [],  
115 - videoComponentList: [],  
116 - currentPlayerInfo: {}, //当前播放对象  
117 - updateLooper: 0, //数据刷新轮训标志  
118 - searchSrt: "",  
119 - channelType: "",  
120 - online: "",  
121 - winHeight: window.innerHeight - 250,  
122 - currentPage: parseInt(this.$route.params.page),  
123 - count: parseInt(this.$route.params.count),  
124 - total: 0,  
125 - beforeUrl: "/deviceList",  
126 - isLoging: false,  
127 - autoList: true,  
128 - loadSnap:{}  
129 - }; 115 + name: 'channelList',
  116 + components: {
  117 + devicePlayer,
  118 + uiHeader
  119 + },
  120 + data() {
  121 + return {
  122 + deviceId: this.$route.params.deviceId,
  123 + parentChannelId: this.$route.params.parentChannelId,
  124 + deviceChannelList: [],
  125 + videoComponentList: [],
  126 + currentPlayerInfo: {}, //当前播放对象
  127 + updateLooper: 0, //数据刷新轮训标志
  128 + searchSrt: "",
  129 + channelType: "",
  130 + online: "",
  131 + winHeight: window.innerHeight - 250,
  132 + currentPage: parseInt(this.$route.params.page),
  133 + count: parseInt(this.$route.params.count),
  134 + total: 0,
  135 + beforeUrl: "/deviceList",
  136 + isLoging: false,
  137 + autoList: true,
  138 + loadSnap: {}
  139 + };
  140 + },
  141 +
  142 + mounted() {
  143 + this.initData();
  144 + if (this.autoList) {
  145 + this.updateLooper = setInterval(this.initData, 5000);
  146 + }
  147 +
  148 + },
  149 + destroyed() {
  150 + this.$destroy('videojs');
  151 + clearTimeout(this.updateLooper);
  152 + },
  153 + methods: {
  154 + initData: function () {
  155 + if (typeof (this.parentChannelId) == "undefined" || this.parentChannelId == 0) {
  156 + this.getDeviceChannelList();
  157 + } else {
  158 + this.showSubchannels();
  159 + }
130 }, 160 },
  161 + initParam: function () {
  162 + this.deviceId = this.$route.params.deviceId;
  163 + this.parentChannelId = this.$route.params.parentChannelId;
  164 + this.currentPage = parseInt(this.$route.params.page);
  165 + this.count = parseInt(this.$route.params.count);
  166 + if (this.parentChannelId == "" || this.parentChannelId == 0) {
  167 + this.beforeUrl = "/deviceList"
  168 + }
131 169
132 - mounted() { 170 + },
  171 + currentChange: function (val) {
  172 + var url = `/${this.$router.currentRoute.name}/${this.deviceId}/${this.parentChannelId}/${this.count}/${val}`
  173 + this.$router.push(url).then(() => {
  174 + this.initParam();
133 this.initData(); 175 this.initData();
134 - if (this.autoList) {  
135 - this.updateLooper = setInterval(this.initData, 5000);  
136 - } 176 + })
  177 + },
  178 + handleSizeChange: function (val) {
  179 + var url = `/${this.$router.currentRoute.name}/${this.$router.params.deviceId}/${this.$router.params.parentChannelId}/${val}/1`
  180 + this.$router.push(url).then(() => {
  181 + this.initParam();
  182 + this.initData();
  183 + })
137 184
138 }, 185 },
139 - destroyed() {  
140 - this.$destroy('videojs');  
141 - clearTimeout(this.updateLooper); 186 + getDeviceChannelList: function () {
  187 + let that = this;
  188 + if (typeof (this.$route.params.deviceId) == "undefined") return;
  189 + this.$axios({
  190 + method: 'get',
  191 + url: `/api/device/query/devices/${this.$route.params.deviceId}/channels`,
  192 + params: {
  193 + page: that.currentPage,
  194 + count: that.count,
  195 + query: that.searchSrt,
  196 + online: that.online,
  197 + channelType: that.channelType
  198 + }
  199 + }).then(function (res) {
  200 + that.total = res.data.total;
  201 + that.deviceChannelList = res.data.list;
  202 + // 防止出现表格错位
  203 + that.$nextTick(() => {
  204 + that.$refs.channelListTable.doLayout();
  205 + })
  206 + }).catch(function (error) {
  207 + console.log(error);
  208 + });
142 }, 209 },
143 - methods: {  
144 - initData: function () {  
145 - if (typeof (this.parentChannelId) == "undefined" || this.parentChannelId == 0) {  
146 - this.getDeviceChannelList();  
147 - } else {  
148 - this.showSubchannels();  
149 - }  
150 - },  
151 - initParam: function () {  
152 - this.deviceId = this.$route.params.deviceId;  
153 - this.parentChannelId = this.$route.params.parentChannelId;  
154 - this.currentPage = parseInt(this.$route.params.page);  
155 - this.count = parseInt(this.$route.params.count);  
156 - if (this.parentChannelId == "" || this.parentChannelId == 0) {  
157 - this.beforeUrl = "/deviceList"  
158 - }  
159 210
160 - },  
161 - currentChange: function (val) {  
162 - var url = `/${this.$router.currentRoute.name}/${this.deviceId}/${this.parentChannelId}/${this.count}/${val}`  
163 - this.$router.push(url).then(() => {  
164 - this.initParam();  
165 - this.initData();  
166 - })  
167 - },  
168 - handleSizeChange: function (val) {  
169 - var url = `/${this.$router.currentRoute.name}/${this.$router.params.deviceId}/${this.$router.params.parentChannelId}/${val}/1`  
170 - this.$router.push(url).then(() => {  
171 - this.initParam();  
172 - this.initData();  
173 - }) 211 + //通知设备上传媒体流
  212 + sendDevicePush: function (itemData) {
  213 + let deviceId = this.deviceId;
  214 + this.isLoging = true;
  215 + let channelId = itemData.channelId;
  216 + console.log("通知设备推流1:" + deviceId + " : " + channelId);
  217 + let that = this;
  218 + this.$axios({
  219 + method: 'get',
  220 + url: '/api/play/start/' + deviceId + '/' + channelId
  221 + }).then(function (res) {
  222 + that.isLoging = false;
  223 + if (res.data.code === 0) {
174 224
175 - },  
176 - getDeviceChannelList: function () {  
177 - let that = this;  
178 - if (typeof (this.$route.params.deviceId) == "undefined") return;  
179 - this.$axios({  
180 - method: 'get',  
181 - url: `/api/device/query/devices/${this.$route.params.deviceId}/channels`,  
182 - params:{  
183 - page: that.currentPage,  
184 - count: that.count,  
185 - query: that.searchSrt,  
186 - online: that.online,  
187 - channelType: that.channelType  
188 - }  
189 - }).then(function (res) {  
190 - that.total = res.data.total;  
191 - that.deviceChannelList = res.data.list;  
192 - // 防止出现表格错位  
193 - that.$nextTick(() => {  
194 - that.$refs.channelListTable.doLayout();  
195 - })  
196 - }).catch(function (error) {  
197 - console.log(error);  
198 - });  
199 - }, 225 + setTimeout(() => {
200 226
201 - //通知设备上传媒体流  
202 - sendDevicePush: function (itemData) {  
203 - let deviceId = this.deviceId;  
204 - this.isLoging = true;  
205 - let channelId = itemData.channelId;  
206 - console.log("通知设备推流1:" + deviceId + " : " + channelId );  
207 - let that = this;  
208 - this.$axios({  
209 - method: 'get',  
210 - url: '/api/play/start/' + deviceId + '/' + channelId  
211 - }).then(function (res) {  
212 - that.isLoging = false;  
213 - if (res.data.code === 0) { 227 + let snapId = deviceId + "_" + channelId;
  228 + that.loadSnap[snapId] = 0;
  229 + that.getSnapErrorEvent(snapId)
  230 + }, 5000)
  231 + that.$refs.devicePlayer.openDialog("media", deviceId, channelId, {
  232 + streamInfo: res.data.data,
  233 + hasAudio: itemData.hasAudio
  234 + });
  235 + setTimeout(() => {
  236 + that.initData();
  237 + }, 1000)
214 238
215 - setTimeout(()=>{  
216 -  
217 - let snapId = deviceId + "_" + channelId;  
218 - that.loadSnap[snapId] = 0;  
219 - that.getSnapErrorEvent(snapId)  
220 - },5000)  
221 - that.$refs.devicePlayer.openDialog("media", deviceId, channelId, {  
222 - streamInfo: res.data.data,  
223 - hasAudio: itemData.hasAudio  
224 - });  
225 - setTimeout(()=>{  
226 - that.initData();  
227 - },1000)  
228 -  
229 - }else {  
230 - that.$message.error(res.data.msg);  
231 - }  
232 - }).catch(function (e) {});  
233 - },  
234 - queryRecords: function (itemData) {  
235 - var format = moment().format("YYYY-M-D");  
236 - let deviceId = this.deviceId;  
237 - let channelId = itemData.channelId;  
238 - this.$refs.devicePlayer.openDialog("record", deviceId, channelId, {date: format})  
239 - },  
240 - stopDevicePush: function (itemData) {  
241 - var that = this;  
242 - this.$axios({  
243 - method: 'get',  
244 - url: '/api/play/stop/' + this.deviceId + "/" + itemData.channelId  
245 - }).then(function (res) {  
246 - that.initData();  
247 - }).catch(function (error) {  
248 - if (error.response.status === 402) { // 已经停止过  
249 - that.initData();  
250 - }else {  
251 - console.log(error)  
252 - }  
253 - });  
254 - },  
255 - getSnap: function (row){  
256 - return '/static/snap/' + row.deviceId + '_' + row.channelId + '.jpg'  
257 - },  
258 - getSnapErrorEvent: function (id){ 239 + } else {
  240 + that.$message.error(res.data.msg);
  241 + }
  242 + }).catch(function (e) {
  243 + });
  244 + },
  245 + queryRecords: function (itemData) {
  246 + var format = moment().format("YYYY-M-D");
  247 + let deviceId = this.deviceId;
  248 + let channelId = itemData.channelId;
  249 + this.$refs.devicePlayer.openDialog("record", deviceId, channelId, {date: format})
  250 + },
  251 + stopDevicePush: function (itemData) {
  252 + var that = this;
  253 + this.$axios({
  254 + method: 'get',
  255 + url: '/api/play/stop/' + this.deviceId + "/" + itemData.channelId
  256 + }).then(function (res) {
  257 + that.initData();
  258 + }).catch(function (error) {
  259 + if (error.response.status === 402) { // 已经停止过
  260 + that.initData();
  261 + } else {
  262 + console.log(error)
  263 + }
  264 + });
  265 + },
  266 + getSnap: function (row) {
  267 + return '/static/snap/' + row.deviceId + '_' + row.channelId + '.jpg'
  268 + },
  269 + getSnapErrorEvent: function (id) {
259 270
260 - if (typeof (this.loadSnap[id]) != "undefined") {  
261 - console.log("下载截图" + this.loadSnap[id])  
262 - if (this.loadSnap[id] > 5) {  
263 - delete this.loadSnap[id];  
264 - return;  
265 - }  
266 - setTimeout(()=>{  
267 - this.loadSnap[id] ++  
268 - document.getElementById(id).setAttribute("src", '/static/snap/' + id + '.jpg?' + new Date().getTime())  
269 - },1000) 271 + if (typeof (this.loadSnap[id]) != "undefined") {
  272 + console.log("下载截图" + this.loadSnap[id])
  273 + if (this.loadSnap[id] > 5) {
  274 + delete this.loadSnap[id];
  275 + return;
  276 + }
  277 + setTimeout(() => {
  278 + this.loadSnap[id]++
  279 + document.getElementById(id).setAttribute("src", '/static/snap/' + id + '.jpg?' + new Date().getTime())
  280 + }, 1000)
270 281
271 - }  
272 - },  
273 - showDevice: function () {  
274 - this.$router.push(this.beforeUrl).then(() => {  
275 - this.initParam();  
276 - this.initData();  
277 - })  
278 - },  
279 - changeSubchannel(itemData) {  
280 - this.beforeUrl = this.$router.currentRoute.path; 282 + }
  283 + },
  284 + showDevice: function () {
  285 + this.$router.push(this.beforeUrl).then(() => {
  286 + this.initParam();
  287 + this.initData();
  288 + })
  289 + },
  290 + changeSubchannel(itemData) {
  291 + this.beforeUrl = this.$router.currentRoute.path;
281 292
282 - var url = `/${this.$router.currentRoute.name}/${this.$router.currentRoute.params.deviceId}/${itemData.channelId}/${this.$router.currentRoute.params.count}/1`  
283 - this.$router.push(url).then(() => {  
284 - this.searchSrt = "";  
285 - this.channelType = "";  
286 - this.online = "";  
287 - this.initParam();  
288 - this.initData();  
289 - })  
290 - },  
291 - showSubchannels: function (channelId) {  
292 - let that = this; 293 + var url = `/${this.$router.currentRoute.name}/${this.$router.currentRoute.params.deviceId}/${itemData.channelId}/${this.$router.currentRoute.params.count}/1`
  294 + this.$router.push(url).then(() => {
  295 + this.searchSrt = "";
  296 + this.channelType = "";
  297 + this.online = "";
  298 + this.initParam();
  299 + this.initData();
  300 + })
  301 + },
  302 + showSubchannels: function (channelId) {
  303 + let that = this;
293 304
294 - this.$axios({  
295 - method: 'get',  
296 - url:`/api/device/query/sub_channels/${this.deviceId}/${this.parentChannelId}/channels`,  
297 - params: {  
298 - page: that.currentPage,  
299 - count: that.count,  
300 - query: that.searchSrt,  
301 - online: that.online,  
302 - channelType: that.channelType  
303 - }  
304 - }).then(function (res) {  
305 - that.total = res.data.total;  
306 - that.deviceChannelList = res.data.list;  
307 - // 防止出现表格错位  
308 - that.$nextTick(() => {  
309 - that.$refs.channelListTable.doLayout();  
310 - })  
311 - }).catch(function (error) {  
312 - console.log(error);  
313 - });  
314 - },  
315 - search: function () {  
316 - this.currentPage = 1;  
317 - this.total = 0;  
318 - this.initData();  
319 - },  
320 - updateChannel: function (row) {  
321 - this.$axios({  
322 - method: 'post',  
323 - url: `/api/device/query/channel/update/${this.deviceId}`,  
324 - params: row  
325 - }).then(function (res) {  
326 - console.log(JSON.stringify(res));  
327 - });  
328 - },  
329 - autoListChange: function () {  
330 - if (this.autoList) {  
331 - this.updateLooper = setInterval(this.initData, 1500);  
332 - }else{  
333 - window.clearInterval(this.updateLooper);  
334 - } 305 + this.$axios({
  306 + method: 'get',
  307 + url: `/api/device/query/sub_channels/${this.deviceId}/${this.parentChannelId}/channels`,
  308 + params: {
  309 + page: that.currentPage,
  310 + count: that.count,
  311 + query: that.searchSrt,
  312 + online: that.online,
  313 + channelType: that.channelType
335 } 314 }
336 - 315 + }).then(function (res) {
  316 + that.total = res.data.total;
  317 + that.deviceChannelList = res.data.list;
  318 + // 防止出现表格错位
  319 + that.$nextTick(() => {
  320 + that.$refs.channelListTable.doLayout();
  321 + })
  322 + }).catch(function (error) {
  323 + console.log(error);
  324 + });
  325 + },
  326 + search: function () {
  327 + this.currentPage = 1;
  328 + this.total = 0;
  329 + this.initData();
  330 + },
  331 + updateChannel: function (row) {
  332 + this.$axios({
  333 + method: 'post',
  334 + url: `/api/device/query/channel/update/${this.deviceId}`,
  335 + params: row
  336 + }).then(function (res) {
  337 + console.log(JSON.stringify(res));
  338 + });
  339 + },
  340 + autoListChange: function () {
  341 + if (this.autoList) {
  342 + this.updateLooper = setInterval(this.initData, 1500);
  343 + } else {
  344 + window.clearInterval(this.updateLooper);
  345 + }
337 } 346 }
  347 +
  348 + }
338 }; 349 };
339 </script> 350 </script>
340 351
341 <style> 352 <style>
342 .videoList { 353 .videoList {
343 - display: flex;  
344 - flex-wrap: wrap;  
345 - align-content: flex-start; 354 + display: flex;
  355 + flex-wrap: wrap;
  356 + align-content: flex-start;
346 } 357 }
347 358
348 .video-item { 359 .video-item {
349 - position: relative;  
350 - width: 15rem;  
351 - height: 10rem;  
352 - margin-right: 1rem;  
353 - background-color: #000000; 360 + position: relative;
  361 + width: 15rem;
  362 + height: 10rem;
  363 + margin-right: 1rem;
  364 + background-color: #000000;
354 } 365 }
355 366
356 .video-item-img { 367 .video-item-img {
357 - position: absolute;  
358 - top: 0;  
359 - bottom: 0;  
360 - left: 0;  
361 - right: 0;  
362 - margin: auto;  
363 - width: 100%;  
364 - height: 100%; 368 + position: absolute;
  369 + top: 0;
  370 + bottom: 0;
  371 + left: 0;
  372 + right: 0;
  373 + margin: auto;
  374 + width: 100%;
  375 + height: 100%;
365 } 376 }
366 377
367 .video-item-img:after { 378 .video-item-img:after {
368 - content: "";  
369 - display: inline-block;  
370 - position: absolute;  
371 - z-index: 2;  
372 - top: 0;  
373 - bottom: 0;  
374 - left: 0;  
375 - right: 0;  
376 - margin: auto;  
377 - width: 3rem;  
378 - height: 3rem;  
379 - background-image: url("../assets/loading.png");  
380 - background-size: cover;  
381 - background-color: #000000; 379 + content: "";
  380 + display: inline-block;
  381 + position: absolute;
  382 + z-index: 2;
  383 + top: 0;
  384 + bottom: 0;
  385 + left: 0;
  386 + right: 0;
  387 + margin: auto;
  388 + width: 3rem;
  389 + height: 3rem;
  390 + background-image: url("../assets/loading.png");
  391 + background-size: cover;
  392 + background-color: #000000;
382 } 393 }
383 394
384 .video-item-title { 395 .video-item-title {
385 - position: absolute;  
386 - bottom: 0;  
387 - color: #000000;  
388 - background-color: #ffffff;  
389 - line-height: 1.5rem;  
390 - padding: 0.3rem;  
391 - width: 14.4rem; 396 + position: absolute;
  397 + bottom: 0;
  398 + color: #000000;
  399 + background-color: #ffffff;
  400 + line-height: 1.5rem;
  401 + padding: 0.3rem;
  402 + width: 14.4rem;
392 } 403 }
393 </style> 404 </style>