Browse Source

规范数据库,给各个标设置主键ID

pull/343/head
648540858 3 years ago
parent
commit
2157bb0270
  1. 498
      sql/mysql.sql
  2. 7
      sql/update.sql
  3. 13
      src/main/java/com/genersoft/iot/vmp/gb28181/bean/Device.java
  4. 9
      src/main/java/com/genersoft/iot/vmp/gb28181/bean/GbStream.java
  5. 11
      src/main/java/com/genersoft/iot/vmp/gb28181/bean/MobilePosition.java
  6. 19
      src/main/java/com/genersoft/iot/vmp/gb28181/bean/PlatformGbStream.java
  7. 5
      src/main/java/com/genersoft/iot/vmp/gb28181/event/offline/KeepaliveTimeoutListenerForPlatform.java
  8. 2
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
  9. 3
      src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java
  10. 21
      src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushUploadFileHandler.java
  11. 4
      src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
  12. 27
      src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java
  13. 2
      src/main/java/com/genersoft/iot/vmp/storager/dao/LogMapper.java
  14. 6
      src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java
  15. 3
      src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java
  16. 45
      src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java
  17. 2
      src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java
  18. 23
      src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
  19. 2
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/GbStreamController.java
  20. 1
      src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java
  21. 4
      web_src/src/components/dialog/chooseChannelForGb.vue
  22. 5
      web_src/src/components/dialog/chooseChannelForStream.vue

498
sql/mysql.sql

@ -1,8 +1,8 @@
-- MySQL dump 10.13 Distrib 8.0.27, for Linux (x86_64)
-- MySQL dump 10.13 Distrib 8.0.28, for Linux (x86_64)
--
-- Host: 192.168.1.242 Database: wvp
-- Host: 127.0.0.1 Database: wvp
-- ------------------------------------------------------
-- Server version 5.7.22
-- Server version 8.0.28-0ubuntu0.20.04.3
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@ -23,26 +23,28 @@ DROP TABLE IF EXISTS `device`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `device` (
`deviceId` varchar(50) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`manufacturer` varchar(255) DEFAULT NULL,
`model` varchar(255) DEFAULT NULL,
`firmware` varchar(255) DEFAULT NULL,
`transport` varchar(50) DEFAULT NULL,
`streamMode` varchar(50) DEFAULT NULL,
`online` varchar(50) DEFAULT NULL,
`registerTime` varchar(50) DEFAULT NULL,
`keepaliveTime` varchar(50) DEFAULT NULL,
`ip` varchar(50) NOT NULL,
`createTime` varchar(50) NOT NULL,
`updateTime` varchar(50) NOT NULL,
`port` int(11) NOT NULL,
`expires` int(11) NOT NULL,
`subscribeCycleForCatalog` int(11) NOT NULL,
`hostAddress` varchar(50) NOT NULL,
`charset` varchar(50) NOT NULL,
PRIMARY KEY (`deviceId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
`id` int NOT NULL AUTO_INCREMENT,
`deviceId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
`name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
`manufacturer` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
`model` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
`firmware` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
`transport` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
`streamMode` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
`online` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
`registerTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
`keepaliveTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
`ip` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
`createTime` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
`updateTime` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
`port` int NOT NULL,
`expires` int NOT NULL,
`subscribeCycleForCatalog` int NOT NULL,
`hostAddress` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
`charset` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `device_deviceId_uindex` (`deviceId`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@ -51,6 +53,7 @@ CREATE TABLE `device` (
LOCK TABLES `device` WRITE;
/*!40000 ALTER TABLE `device` DISABLE KEYS */;
INSERT INTO `device` VALUES (1,'34020000002000000005','DH-NVR5864-I','Dahua','DH-NVR5864-I','4.001.0000000.3,2020-10-22','UDP','UDP','1','2022-02-22 11:05:10','2022-02-22 11:42:10','192.168.1.19','2022-02-22 10:17:24','2022-02-22 11:42:10',5060,3600,0,'192.168.1.19:5060','gb2312');
/*!40000 ALTER TABLE `device` ENABLE KEYS */;
UNLOCK TABLES;
@ -62,18 +65,18 @@ DROP TABLE IF EXISTS `device_alarm`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `device_alarm` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`deviceId` varchar(50) NOT NULL,
`channelId` varchar(50) NOT NULL,
`alarmPriority` varchar(50) NOT NULL,
`alarmMethod` varchar(50) DEFAULT NULL,
`alarmTime` varchar(50) NOT NULL,
`alarmDescription` varchar(255) DEFAULT NULL,
`longitude` double DEFAULT NULL,
`latitude` double DEFAULT NULL,
`alarmType` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
`id` int NOT NULL AUTO_INCREMENT,
`deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`alarmPriority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`alarmMethod` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`alarmTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`alarmDescription` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`longitude` double DEFAULT NULL,
`latitude` double DEFAULT NULL,
`alarmType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@ -93,38 +96,38 @@ DROP TABLE IF EXISTS `device_channel`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `device_channel` (
`channelId` varchar(50) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`manufacture` varchar(50) DEFAULT NULL,
`model` varchar(50) DEFAULT NULL,
`owner` varchar(50) DEFAULT NULL,
`civilCode` varchar(50) DEFAULT NULL,
`block` varchar(50) DEFAULT NULL,
`address` varchar(50) DEFAULT NULL,
`parentId` varchar(50) DEFAULT NULL,
`safetyWay` int(11) DEFAULT NULL,
`registerWay` int(11) DEFAULT NULL,
`certNum` varchar(50) DEFAULT NULL,
`certifiable` int(11) DEFAULT NULL,
`errCode` int(11) DEFAULT NULL,
`subCount` int(11) DEFAULT 0,
`endTime` varchar(50) DEFAULT NULL,
`secrecy` varchar(50) DEFAULT NULL,
`ipAddress` varchar(50) DEFAULT NULL,
`port` int(11) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
`PTZType` int(11) DEFAULT NULL,
`status` int(11) DEFAULT NULL,
`longitude` double DEFAULT NULL,
`latitude` double DEFAULT NULL,
`streamId` varchar(50) DEFAULT NULL,
`deviceId` varchar(50) NOT NULL,
`parental` varchar(50) DEFAULT NULL,
`hasAudio` bit(1) DEFAULT NULL,
`createTime` varchar(50) NOT NULL,
`updateTime` varchar(50) NOT NULL,
PRIMARY KEY (`channelId`,`deviceId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
`channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`manufacture` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`model` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`owner` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`civilCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`block` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`parentId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`safetyWay` int DEFAULT NULL,
`registerWay` int DEFAULT NULL,
`certNum` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`certifiable` int DEFAULT NULL,
`errCode` int DEFAULT NULL,
`endTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`secrecy` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`ipAddress` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`port` int DEFAULT NULL,
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`PTZType` int DEFAULT NULL,
`status` int DEFAULT NULL,
`longitude` double DEFAULT NULL,
`latitude` double DEFAULT NULL,
`streamId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`parental` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`hasAudio` bit(1) DEFAULT NULL,
`createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`subCount` int DEFAULT '0',
PRIMARY KEY (`channelId`,`deviceId`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@ -133,6 +136,7 @@ CREATE TABLE `device_channel` (
LOCK TABLES `device_channel` WRITE;
/*!40000 ALTER TABLE `device_channel` DISABLE KEYS */;
INSERT INTO `device_channel` VALUES ('34020000001310000001','通道1','Dahua','DH-NVR5864-I','0','340200','','axy','34020000002000000005',0,1,'',0,0,NULL,'0','192.168.1.17',37777,'',0,1,0,0,NULL,'34020000002000000005','0',NULL,'','',0),('34020000001310000065','GB_Chn_065','Dahua','DH-NVR5864-I','0','340200','','axy','34020000002000000005',0,1,'',0,0,NULL,'0','',0,'',0,1,0,0,NULL,'34020000002000000005','0',NULL,'','',0);
/*!40000 ALTER TABLE `device_channel` ENABLE KEYS */;
UNLOCK TABLES;
@ -144,21 +148,22 @@ DROP TABLE IF EXISTS `device_mobile_position`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `device_mobile_position` (
`deviceId` varchar(50) NOT NULL,
`channelId` varchar(50) NOT NULL,
`deviceName` varchar(255) DEFAULT NULL,
`time` varchar(50) NOT NULL,
`longitude` double NOT NULL,
`latitude` double NOT NULL,
`altitude` double DEFAULT NULL,
`speed` double DEFAULT NULL,
`direction` double DEFAULT NULL,
`reportSource` varchar(50) DEFAULT NULL,
`geodeticSystem` varchar(50) DEFAULT NULL,
`cnLng` varchar(50) DEFAULT NULL,
`cnLat` varchar(50) DEFAULT NULL,
PRIMARY KEY (`deviceId`,`time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
`id` int NOT NULL AUTO_INCREMENT,
`deviceId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
`channelId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
`deviceName` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
`time` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
`longitude` double NOT NULL,
`latitude` double NOT NULL,
`altitude` double DEFAULT NULL,
`speed` double DEFAULT NULL,
`direction` double DEFAULT NULL,
`reportSource` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
`geodeticSystem` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
`cnLng` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
`cnLat` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@ -178,21 +183,21 @@ DROP TABLE IF EXISTS `gb_stream`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `gb_stream` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`app` varchar(255) NOT NULL,
`stream` varchar(255) NOT NULL,
`gbId` varchar(50) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`longitude` double DEFAULT NULL,
`latitude` double DEFAULT NULL,
`streamType` varchar(50) DEFAULT NULL,
`mediaServerId` varchar(50) DEFAULT NULL,
`status` int(11) DEFAULT NULL,
`createStamp` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `app` (`app`,`stream`),
UNIQUE KEY `gbId` (`gbId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
`id` int NOT NULL AUTO_INCREMENT,
`app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`gbId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`longitude` double DEFAULT NULL,
`latitude` double DEFAULT NULL,
`streamType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`status` int DEFAULT NULL,
`createStamp` bigint DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `app` (`app`,`stream`) USING BTREE,
UNIQUE KEY `gbId` (`gbId`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=77 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@ -201,6 +206,7 @@ CREATE TABLE `gb_stream` (
LOCK TABLES `gb_stream` WRITE;
/*!40000 ALTER TABLE `gb_stream` DISABLE KEYS */;
INSERT INTO `gb_stream` VALUES (74,'1000','10000000_000','34020000002000000001','测试1',0,0,'push','FQ3TF8yT83wh5Wvz',0,1645500864142),(75,'1000','10000001_000','34020000012000000002','测试2',0,0,'push','FQ3TF8yT83wh5Wvz',0,1645500864142),(76,'1000','10000002_000','34020000022000000003','测试3',0,0,'push','FQ3TF8yT83wh5Wvz',0,1645500864142);
/*!40000 ALTER TABLE `gb_stream` ENABLE KEYS */;
UNLOCK TABLES;
@ -212,17 +218,17 @@ DROP TABLE IF EXISTS `log`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`type` varchar(50) NOT NULL,
`uri` varchar(200) NOT NULL,
`address` varchar(50) NOT NULL,
`result` varchar(50) NOT NULL,
`timing` bigint(20) NOT NULL,
`username` varchar(50) NOT NULL,
`createTime` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`uri` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`result` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`timing` bigint NOT NULL,
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=206 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@ -231,6 +237,7 @@ CREATE TABLE `log` (
LOCK TABLES `log` WRITE;
/*!40000 ALTER TABLE `log` DISABLE KEYS */;
INSERT INTO `log` VALUES (163,'登录','GET','/api/user/login','127.0.0.1','200 OK',243,'admin','2022-02-22 10:18:15'),(164,'开始点播','GET','/api/play/start/34020000002000000005/34020000001310000001','127.0.0.1','200 OK',77,'admin','2022-02-22 10:18:35'),(165,'[设备查询] 同步设备通道','POST','/api/device/query/devices/34020000002000000005/sync','127.0.0.1','200 OK',10,'admin','2022-02-22 10:18:47'),(166,'开始点播','GET','/api/play/start/34020000002000000005/34020000001310000065','127.0.0.1','200 OK',19,'admin','2022-02-22 10:18:50'),(167,'停止点播','GET','/api/play/stop/34020000002000000005/34020000001310000065','127.0.0.1','200 OK',159,'admin','2022-02-22 10:19:08'),(168,'保存代理','POST','/api/proxy/save','127.0.0.1','200 OK',305,'admin','2022-02-22 10:22:02'),(169,'保存代理','POST','/api/proxy/save','127.0.0.1','200 OK',142,'admin','2022-02-22 10:22:28'),(170,'添加上级平台','POST','/api/platform/save','127.0.0.1','200 OK',11,'admin','2022-02-22 10:22:57'),(171,'登录','GET','/api/user/login','127.0.0.1','200 OK',255,'admin','2022-02-22 10:26:31'),(172,'移除代理','DELETE','/api/proxy/del','127.0.0.1','200 OK',40,'admin','2022-02-22 10:26:44'),(173,'保存代理','POST','/api/proxy/save','127.0.0.1','200 OK',139,'admin','2022-02-22 10:26:51'),(174,'登录','GET','/api/user/login','127.0.0.1','200 OK',657,'admin','2022-02-22 10:28:21'),(175,'登录','GET','/api/user/login','127.0.0.1','200 OK',302,'admin','2022-02-22 11:04:24'),(176,'移除代理','DELETE','/api/proxy/del','127.0.0.1','200 OK',33,'admin','2022-02-22 11:04:34'),(177,'移除代理','DELETE','/api/proxy/del','127.0.0.1','200 OK',17,'admin','2022-02-22 11:04:35'),(178,'保存代理','POST','/api/proxy/save','127.0.0.1','200 OK',186,'admin','2022-02-22 11:04:44'),(179,'登录','GET','/api/user/login','127.0.0.1','200 OK',258,'admin','2022-02-22 11:05:05'),(180,'保存代理','POST','/api/proxy/save','127.0.0.1','200 OK',97,'admin','2022-02-22 11:05:51'),(181,'登录','GET','/api/user/login','127.0.0.1','200 OK',300,'admin','2022-02-22 11:11:30'),(182,'保存代理','POST','/api/proxy/save','127.0.0.1','200 OK',145,'admin','2022-02-22 11:12:00'),(183,'登录','GET','/api/user/login','127.0.0.1','200 OK',264,'admin','2022-02-22 11:12:42'),(184,'保存代理','POST','/api/proxy/save','127.0.0.1','200 OK',41793,'admin','2022-02-22 11:13:42'),(185,'登录','GET','/api/user/login','127.0.0.1','200 OK',245,'admin','2022-02-22 11:13:58'),(186,'保存代理','POST','/api/proxy/save','127.0.0.1','200 OK',86,'admin','2022-02-22 11:14:11'),(187,'登录','GET','/api/user/login','127.0.0.1','200 OK',293,'admin','2022-02-22 11:31:52'),(188,'向上级平台添加国标通道','POST','/api/platform/update_channel_for_gb','127.0.0.1','200 OK',14,'admin','2022-02-22 11:34:55'),(189,'向上级平台添加国标通道','POST','/api/platform/update_channel_for_gb','127.0.0.1','200 OK',11,'admin','2022-02-22 11:35:02'),(190,'保存代理','POST','/api/proxy/save','127.0.0.1','200 OK',16,'admin','2022-02-22 11:37:00'),(191,'登录','GET','/api/user/login','127.0.0.1','200 OK',340,'admin','2022-02-22 11:38:15'),(192,'停用代理','GET','/api/proxy/stop','127.0.0.1','200 OK',16,'admin','2022-02-22 11:38:20'),(193,'停用代理','GET','/api/proxy/stop','127.0.0.1','200 OK',10,'admin','2022-02-22 11:38:28'),(194,'登录','GET','/api/user/login','127.0.0.1','200 OK',288,'admin','2022-02-22 11:39:34'),(195,'停用代理','GET','/api/proxy/stop','127.0.0.1','200 OK',29,'admin','2022-02-22 11:39:36'),(196,'启用代理','GET','/api/proxy/start','127.0.0.1','200 OK',594,'admin','2022-02-22 11:39:38'),(197,'停用代理','GET','/api/proxy/stop','127.0.0.1','200 OK',16,'admin','2022-02-22 11:39:43'),(198,'停用代理','GET','/api/proxy/stop','127.0.0.1','200 OK',27,'admin','2022-02-22 11:41:30'),(199,'停用代理','GET','/api/proxy/stop','127.0.0.1','200 OK',17,'admin','2022-02-22 11:41:42'),(200,'启用代理','GET','/api/proxy/start','127.0.0.1','200 OK',9,'admin','2022-02-22 11:41:44'),(201,'启用代理','GET','/api/proxy/start','127.0.0.1','200 OK',6,'admin','2022-02-22 11:41:47'),(202,'启用代理','GET','/api/proxy/start','127.0.0.1','200 OK',67,'admin','2022-02-22 11:41:48'),(203,'移除代理','DELETE','/api/proxy/del','127.0.0.1','200 OK',14,'admin','2022-02-22 11:41:51'),(204,'移除代理','DELETE','/api/proxy/del','127.0.0.1','200 OK',16,'admin','2022-02-22 11:41:52'),(205,'移除代理','DELETE','/api/proxy/del','127.0.0.1','200 OK',14,'admin','2022-02-22 11:41:53');
/*!40000 ALTER TABLE `log` ENABLE KEYS */;
UNLOCK TABLES;
@ -242,32 +249,32 @@ DROP TABLE IF EXISTS `media_server`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `media_server` (
`id` varchar(255) NOT NULL,
`ip` varchar(50) NOT NULL,
`hookIp` varchar(50) NOT NULL,
`sdpIp` varchar(50) NOT NULL,
`streamIp` varchar(50) NOT NULL,
`httpPort` int(11) NOT NULL,
`httpSSlPort` int(11) NOT NULL,
`rtmpPort` int(11) NOT NULL,
`rtmpSSlPort` int(11) NOT NULL,
`rtpProxyPort` int(11) NOT NULL,
`rtspPort` int(11) NOT NULL,
`rtspSSLPort` int(11) NOT NULL,
`autoConfig` int(11) NOT NULL,
`secret` varchar(50) NOT NULL,
`streamNoneReaderDelayMS` int(11) NOT NULL,
`rtpEnable` int(11) NOT NULL,
`rtpPortRange` varchar(50) NOT NULL,
`sendRtpPortRange` varchar(50) NOT NULL,
`recordAssistPort` int(11) NOT NULL,
`defaultServer` int(11) NOT NULL,
`createTime` varchar(50) NOT NULL,
`updateTime` varchar(50) NOT NULL,
`hookAliveInterval` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `media_server_i` (`ip`,`httpPort`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
`id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`hookIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`sdpIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`streamIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`httpPort` int NOT NULL,
`httpSSlPort` int NOT NULL,
`rtmpPort` int NOT NULL,
`rtmpSSlPort` int NOT NULL,
`rtpProxyPort` int NOT NULL,
`rtspPort` int NOT NULL,
`rtspSSLPort` int NOT NULL,
`autoConfig` int NOT NULL,
`secret` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`streamNoneReaderDelayMS` int NOT NULL,
`rtpEnable` int NOT NULL,
`rtpPortRange` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`sendRtpPortRange` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`recordAssistPort` int NOT NULL,
`defaultServer` int NOT NULL,
`createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`hookAliveInterval` int NOT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `media_server_i` (`ip`,`httpPort`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@ -276,6 +283,7 @@ CREATE TABLE `media_server` (
LOCK TABLES `media_server` WRITE;
/*!40000 ALTER TABLE `media_server` DISABLE KEYS */;
INSERT INTO `media_server` VALUES ('FQ3TF8yT83wh5Wvz','192.168.1.3','192.168.1.3','192.168.1.3','192.168.1.3',6080,0,10935,0,10000,10554,0,1,'035c73f7-bb6b-4889-a715-d9eb2d1925cc',18000,1,'30000,30500','30000,30500',18081,1,'2022-02-22 11:39:33','2022-02-22 11:39:33',30);
/*!40000 ALTER TABLE `media_server` ENABLE KEYS */;
UNLOCK TABLES;
@ -287,29 +295,29 @@ DROP TABLE IF EXISTS `parent_platform`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `parent_platform` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`enable` int(11) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`serverGBId` varchar(50) NOT NULL,
`serverGBDomain` varchar(50) DEFAULT NULL,
`serverIP` varchar(50) DEFAULT NULL,
`serverPort` int(11) DEFAULT NULL,
`deviceGBId` varchar(50) NOT NULL,
`deviceIp` varchar(50) DEFAULT NULL,
`devicePort` varchar(50) DEFAULT NULL,
`username` varchar(255) DEFAULT NULL,
`password` varchar(50) DEFAULT NULL,
`expires` varchar(50) DEFAULT NULL,
`keepTimeout` varchar(50) DEFAULT NULL,
`transport` varchar(50) DEFAULT NULL,
`characterSet` varchar(50) DEFAULT NULL,
`catalogId` varchar(50) NOT NULL,
`ptz` int(11) DEFAULT NULL,
`rtcp` int(11) DEFAULT NULL,
`status` bit(1) DEFAULT NULL,
`shareAllLiveStream` int(11) DEFAULT NULL,
PRIMARY KEY (`id`,`serverGBId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
`id` int NOT NULL AUTO_INCREMENT,
`enable` int DEFAULT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`serverGBId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`serverGBDomain` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`serverIP` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`serverPort` int DEFAULT NULL,
`deviceGBId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`deviceIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`devicePort` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`expires` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`keepTimeout` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`transport` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`characterSet` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`ptz` int DEFAULT NULL,
`rtcp` int DEFAULT NULL,
`status` bit(1) DEFAULT NULL,
`shareAllLiveStream` int DEFAULT NULL,
PRIMARY KEY (`id`,`serverGBId`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@ -318,6 +326,7 @@ CREATE TABLE `parent_platform` (
LOCK TABLES `parent_platform` WRITE;
/*!40000 ALTER TABLE `parent_platform` DISABLE KEYS */;
INSERT INTO `parent_platform` VALUES (4,0,'11111','111111111111111','1111111111','11.111.11.11',2342,'34020000013000000001','192.168.1.3','15060','34020000013000000001','12345678','300','60','UDP','GB2312','111111111111111',1,0,_binary '\0',0),(5,0,'2222','222222222222222','2222222222','222.22.2.2',2222,'34020000013000000001','192.168.1.3','15060','34020000013000000001','12345678','300','60','UDP','GB2312','222222222222222',1,0,_binary '\0',0);
/*!40000 ALTER TABLE `parent_platform` ENABLE KEYS */;
UNLOCK TABLES;
@ -329,12 +338,12 @@ DROP TABLE IF EXISTS `platform_catalog`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `platform_catalog` (
`id` varchar(50) NOT NULL,
`platformId` varchar(50) NOT NULL,
`name` varchar(255) NOT NULL,
`parentId` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
`id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`parentId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@ -354,13 +363,14 @@ DROP TABLE IF EXISTS `platform_gb_channel`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `platform_gb_channel` (
`channelId` varchar(50) NOT NULL,
`deviceId` varchar(50) NOT NULL,
`platformId` varchar(50) NOT NULL,
`deviceAndChannelId` varchar(50) NOT NULL,
`catalogId` varchar(50) NOT NULL,
PRIMARY KEY (`deviceAndChannelId`,`platformId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
`id` int NOT NULL AUTO_INCREMENT,
`channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`deviceAndChannelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@ -369,6 +379,7 @@ CREATE TABLE `platform_gb_channel` (
LOCK TABLES `platform_gb_channel` WRITE;
/*!40000 ALTER TABLE `platform_gb_channel` DISABLE KEYS */;
INSERT INTO `platform_gb_channel` VALUES (1,'34020000001310000001','34020000002000000005','111111111111111','34020000002000000005_34020000001310000001','111111111111111'),(2,'34020000001310000065','34020000002000000005','222222222222222','34020000002000000005_34020000001310000065','222222222222222');
/*!40000 ALTER TABLE `platform_gb_channel` ENABLE KEYS */;
UNLOCK TABLES;
@ -380,12 +391,12 @@ DROP TABLE IF EXISTS `platform_gb_stream`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `platform_gb_stream` (
`platformId` varchar(50) NOT NULL,
`app` varchar(255) NOT NULL,
`stream` varchar(255) NOT NULL,
`catalogId` varchar(50) NOT NULL,
PRIMARY KEY (`platformId`,`app`,`stream`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
`platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`gbStreamId` int NOT NULL,
`id` int NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@ -394,36 +405,10 @@ CREATE TABLE `platform_gb_stream` (
LOCK TABLES `platform_gb_stream` WRITE;
/*!40000 ALTER TABLE `platform_gb_stream` DISABLE KEYS */;
INSERT INTO `platform_gb_stream` VALUES ('111111111111111','111111111111111',70,35),('111111111111111','111111111111111',71,36),('111111111111111','111111111111111',72,37),('222222222222222','222222222222222',73,38),('111111111111111','111111111111111',74,39),('111111111111111','111111111111111',75,40),('111111111111111','111111111111111',76,41);
/*!40000 ALTER TABLE `platform_gb_stream` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user_role`
--
DROP TABLE IF EXISTS `user_role`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user_role` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`authority` varchar(50) NOT NULL,
`createTime` varchar(50) NOT NULL,
`updateTime` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user_role`
--
LOCK TABLES `user_role` WRITE;
/*!40000 ALTER TABLE `user_role` DISABLE KEYS */;
INSERT INTO `user_role` VALUES (1,'admin','0','2021-04-13 14:14:57','2021-04-13 14:14:57');
/*!40000 ALTER TABLE `user_role` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `stream_proxy`
--
@ -432,24 +417,25 @@ DROP TABLE IF EXISTS `stream_proxy`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `stream_proxy` (
`type` varchar(50) NOT NULL,
`app` varchar(255) NOT NULL,
`stream` varchar(255) NOT NULL,
`url` varchar(255) DEFAULT NULL,
`src_url` varchar(255) DEFAULT NULL,
`dst_url` varchar(255) DEFAULT NULL,
`timeout_ms` int(11) DEFAULT NULL,
`ffmpeg_cmd_key` varchar(255) DEFAULT NULL,
`rtp_type` varchar(50) DEFAULT NULL,
`mediaServerId` varchar(50) DEFAULT NULL,
`enable_hls` bit(1) DEFAULT NULL,
`enable_mp4` bit(1) DEFAULT NULL,
`enable` bit(1) NOT NULL,
`status` bit(1) NOT NULL,
`enable_remove_none_reader` bit(1) NOT NULL,
`createTime` varchar(50) NOT NULL,
PRIMARY KEY (`app`,`stream`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
`id` int NOT NULL AUTO_INCREMENT,
`type` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
`app` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
`stream` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
`url` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
`src_url` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
`dst_url` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
`timeout_ms` int DEFAULT NULL,
`ffmpeg_cmd_key` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
`rtp_type` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
`mediaServerId` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
`enable_hls` bit(1) DEFAULT NULL,
`enable_mp4` bit(1) DEFAULT NULL,
`enable` bit(1) NOT NULL,
`status` bit(1) NOT NULL,
`enable_remove_none_reader` bit(1) NOT NULL,
`createTime` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@ -469,16 +455,18 @@ DROP TABLE IF EXISTS `stream_push`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `stream_push` (
`app` varchar(255) NOT NULL,
`stream` varchar(255) NOT NULL,
`totalReaderCount` varchar(50) DEFAULT NULL,
`originType` int(11) DEFAULT NULL,
`originTypeStr` varchar(50) DEFAULT NULL,
`createStamp` bigint(20) DEFAULT NULL,
`aliveSecond` int(11) DEFAULT NULL,
`mediaServerId` varchar(50) DEFAULT NULL,
PRIMARY KEY (`app`,`stream`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
`id` int NOT NULL AUTO_INCREMENT,
`app` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
`stream` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
`totalReaderCount` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
`originType` int DEFAULT NULL,
`originTypeStr` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
`createStamp` bigint DEFAULT NULL,
`aliveSecond` int DEFAULT NULL,
`mediaServerId` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `stream_push_pk` (`app`,`stream`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@ -487,6 +475,7 @@ CREATE TABLE `stream_push` (
LOCK TABLES `stream_push` WRITE;
/*!40000 ALTER TABLE `stream_push` DISABLE KEYS */;
INSERT INTO `stream_push` VALUES (13,'1000','10000000_000','0',2,'rtsp_push',1645500864142,NULL,'FQ3TF8yT83wh5Wvz'),(14,'1000','10000001_000','0',2,'rtsp_push',1645500864142,NULL,'FQ3TF8yT83wh5Wvz'),(15,'1000','10000002_000','0',2,'rtsp_push',1645500864142,NULL,'FQ3TF8yT83wh5Wvz');
/*!40000 ALTER TABLE `stream_push` ENABLE KEYS */;
UNLOCK TABLES;
@ -498,15 +487,15 @@ DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`roleId` int(11) NOT NULL,
`createTime` varchar(50) NOT NULL,
`updateTime` varchar(50) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `user_username_uindex` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
`id` int NOT NULL AUTO_INCREMENT,
`username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`roleId` int NOT NULL,
`createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `user_username_uindex` (`username`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@ -518,6 +507,33 @@ LOCK TABLES `user` WRITE;
INSERT INTO `user` VALUES (1,'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021-04-13 14:14:57','2021-04-13 14:14:57');
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user_role`
--
DROP TABLE IF EXISTS `user_role`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user_role` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`authority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user_role`
--
LOCK TABLES `user_role` WRITE;
/*!40000 ALTER TABLE `user_role` DISABLE KEYS */;
INSERT INTO `user_role` VALUES (1,'admin','0','2021-04-13 14:14:57','2021-04-13 14:14:57');
/*!40000 ALTER TABLE `user_role` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@ -528,4 +544,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2022-01-25 15:36:42
-- Dump completed on 2022-02-22 11:43:00

7
sql/update.sql

@ -1,7 +0,0 @@
ALTER TABLE stream_proxy ADD status bit(1) not null;
# 去除子查询优化查询速度
alter table device_channel
add subCount int default 0 null;
update device_channel dc set dc.subCount = (select te.count from (SELECT count(0) as count FROM device_channel WHERE parentId = dc.channelId) te)

13
src/main/java/com/genersoft/iot/vmp/gb28181/bean/Device.java

@ -3,6 +3,11 @@ package com.genersoft.iot.vmp.gb28181.bean;
public class Device {
/**
* Id
*/
private int id;
/**
* 设备Id
*/
@ -114,7 +119,13 @@ public class Device {
*/
private int subscribeCycleForCatalog ;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getDeviceId() {
return deviceId;
@ -283,4 +294,6 @@ public class Device {
public void setSubscribeCycleForCatalog(int subscribeCycleForCatalog) {
this.subscribeCycleForCatalog = subscribeCycleForCatalog;
}
}

9
src/main/java/com/genersoft/iot/vmp/gb28181/bean/GbStream.java

@ -5,6 +5,7 @@ package com.genersoft.iot.vmp.gb28181.bean;
*/
public class GbStream extends PlatformGbStream{
private int id;
private String app;
private String stream;
private String gbId;
@ -19,6 +20,14 @@ public class GbStream extends PlatformGbStream{
*/
public Long createStamp;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getApp() {
return app;
}

11
src/main/java/com/genersoft/iot/vmp/gb28181/bean/MobilePosition.java

@ -7,6 +7,10 @@ package com.genersoft.iot.vmp.gb28181.bean;
*/
public class MobilePosition {
/**
* Id
*/
private int id;
/**
* 设备Id
*/
@ -72,6 +76,13 @@ public class MobilePosition {
*/
private String cnLat;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getDeviceId() {
return deviceId;

19
src/main/java/com/genersoft/iot/vmp/gb28181/bean/PlatformGbStream.java

@ -1,25 +1,16 @@
package com.genersoft.iot.vmp.gb28181.bean;
public class PlatformGbStream {
private String app;
private String stream;
private String gbStreamId;
private String platformId;
private String catalogId;
public String getApp() {
return app;
public String getGbStreamId() {
return gbStreamId;
}
public void setApp(String app) {
this.app = app;
}
public String getStream() {
return stream;
}
public void setStream(String stream) {
this.stream = stream;
public void setGbStreamId(String gbStreamId) {
this.gbStreamId = gbStreamId;
}
public String getPlatformId() {

5
src/main/java/com/genersoft/iot/vmp/gb28181/event/offline/KeepaliveTimeoutListenerForPlatform.java

@ -76,7 +76,10 @@ public class KeepaliveTimeoutListenerForPlatform extends RedisKeyExpirationEvent
eventResult.callId = callid;
eventResult.msg = "注册超时";
eventResult.type = "register timeout";
sipSubscribe.getErrorSubscribe(callid).response(eventResult);
if (sipSubscribe.getErrorSubscribe(callid) != null) {
sipSubscribe.getErrorSubscribe(callid).response(eventResult);
}
}
}

2
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java

@ -102,7 +102,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
sipSubscribe.addErrorSubscribe(callIdHeader.getCallId(), (event)->{
if (event != null) {
logger.info("向上级平台 [ {} ] 注册发错误: {} ",
logger.info("向上级平台 [ {} ] 注册发错误: {} ",
parentPlatform.getServerGBId(),
event.msg);
}

3
src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java

@ -373,7 +373,8 @@ public class StreamPushServiceImpl implements IStreamPushService {
return;
}
}
platformGbStreamMapper.batchAdd(platformId, catalogId, streamPushItems);
List<GbStream> gbStreamList = gbStreamMapper.selectAllForAppAndStream(streamPushItems);
platformGbStreamMapper.batchAdd(platformId, catalogId, gbStreamList);
eventPublisher.catalogEventPublishForStream(platformId, streamPushItems.toArray(new GbStream[0]), CatalogEvent.ADD);
}
}

21
src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushUploadFileHandler.java

@ -17,7 +17,7 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener<StreamPus
private List<StreamPushItem> streamPushItems = new ArrayList<>();
private Map<String, UploadData> streamPushItemsForPlatform = new HashMap<>();
private Set<String> streamPushStreamSet = new HashSet<>();
private Set<String> streamPushGBSet = new HashSet<>();
private Map<String,String> streamPushGBMap = new HashMap<>();
private List<String> errorStreamList = new ArrayList<>();
private List<String> errorGBList = new ArrayList<>();
// 读取数量计数器
@ -50,13 +50,17 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener<StreamPus
|| StringUtils.isEmpty(streamPushExcelDto.getGbId())) {
return;
}
if (streamPushGBSet.contains(streamPushExcelDto.getGbId())) {
errorGBList.add(streamPushExcelDto.getGbId());
if (streamPushGBMap.get(streamPushExcelDto.getApp() + streamPushExcelDto.getStream()) == null) {
streamPushGBMap.put(streamPushExcelDto.getApp() + streamPushExcelDto.getStream(), streamPushExcelDto.getGbId());
}else {
if (!streamPushGBMap.get(streamPushExcelDto.getApp() + streamPushExcelDto.getStream()).equals(streamPushExcelDto.getGbId())) {
errorGBList.add(streamPushExcelDto.getGbId() + "(同一组app+stream使用了不同国标ID)");
return;
}
}
if (streamPushStreamSet.contains(streamPushExcelDto.getApp() + streamPushExcelDto.getStream() + streamPushExcelDto.getPlatformId())) {
errorStreamList.add(streamPushExcelDto.getApp() + "/" + streamPushExcelDto.getStream());
}
if (streamPushGBSet.contains(streamPushExcelDto.getGbId()) || streamPushStreamSet.contains(streamPushExcelDto.getApp() + streamPushExcelDto.getStream() + streamPushExcelDto.getPlatformId())) {
errorStreamList.add(streamPushExcelDto.getApp() + "/" + streamPushExcelDto.getStream()+ "/" + streamPushExcelDto.getPlatformId() + "(同一组app+stream添加在了同一个平台下)");
return;
}
@ -95,8 +99,7 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener<StreamPus
}
streamPushGBSet.add(streamPushExcelDto.getGbId());
streamPushStreamSet.add(streamPushExcelDto.getApp()+streamPushExcelDto.getStream());
streamPushStreamSet.add(streamPushExcelDto.getApp()+streamPushExcelDto.getStream() + streamPushExcelDto.getPlatformId());
loadedSize ++;
if (loadedSize > 1000) {
saveData();
@ -111,7 +114,7 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener<StreamPus
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
// 这里也要保存数据,确保最后遗留的数据也存储到数据库
saveData();
streamPushGBSet.clear();
streamPushGBMap.clear();
streamPushStreamSet.clear();
errorDataHandler.handle(errorStreamList, errorGBList);
}

4
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java

@ -86,8 +86,6 @@ public interface DeviceChannelMapper {
@Update(value = {"UPDATE device_channel SET streamId=#{streamId} WHERE deviceId=#{deviceId} AND channelId=#{channelId}"})
void startPlay(String deviceId, String channelId, String streamId);
@Select(value = {" <script>" +
"SELECT dc.channelId, "+
"dc.deviceId, " +
@ -107,7 +105,7 @@ public interface DeviceChannelMapper {
" <if test='online == false' > AND dc.status=0</if> " +
" <if test='hasSubChannel!= null and hasSubChannel == true' > AND dc2.channelId is not null</if> " +
" <if test='hasSubChannel!= null and hasSubChannel == false' > AND dc2.channelId is null</if> " +
" <if test='catalogId == null ' > AND pgc.platformId is null AND pgc.catalogId is null</if> " +
" <if test='catalogId == null ' > AND ((pgc.platformId IS NULL AND pgc.catalogId IS NULL) or (pgc.platformId != #{platformId}))</if> " +
" <if test='catalogId != null ' > AND pgc.platformId =#{platformId} AND pgc.catalogId = #{catalogId}</if> " +
" ORDER BY dc.deviceId, dc.channelId ASC" +
" </script>"})

27
src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java

@ -38,12 +38,13 @@ public interface GbStreamMapper {
int del(String app, String stream);
@Select("<script> "+
"SELECT gs.*, pgs.platformId AS platformId, pgs.catalogId AS catalogId FROM gb_stream gs " +
"LEFT JOIN platform_gb_stream pgs ON gs.app = pgs.app AND gs.stream = pgs.stream " +
"SELECT gs.* FROM gb_stream gs " +
"WHERE " +
"1=1 " +
" <if test='catalogId != null'> AND pgs.platformId = #{platformId} AND pgs.catalogId = #{catalogId}</if> " +
" <if test='catalogId == null'> AND pgs.platformId is null AND pgs.catalogId is null</if> " +
" <if test='catalogId != null'> AND gs.id in" +
"(select pgs.gbStreamId from platform_gb_stream pgs where pgs.platformId = #{platformId} and pgs.catalogId=#{catalogId})</if> " +
" <if test='catalogId == null'> AND gs.id not in" +
"(select pgs.gbStreamId from platform_gb_stream pgs where pgs.platformId = #{platformId}) </if> " +
" <if test='query != null'> AND (gs.app LIKE '%${query}%' OR gs.stream LIKE '%${query}%' OR gs.gbId LIKE '%${query}%' OR gs.name LIKE '%${query}%')</if> " +
" <if test='pushing == true' > AND gs.status=1</if>" +
" <if test='pushing == false' > AND gs.status=0</if>" +
@ -59,18 +60,18 @@ public interface GbStreamMapper {
List<GbStream> selectByGBId(String gbId);
@Select("SELECT gs.*, pgs.platformId as platformId, pgs.catalogId as catalogId FROM gb_stream gs " +
"LEFT JOIN platform_gb_stream pgs ON gs.app = pgs.app AND gs.stream = pgs.stream " +
"LEFT JOIN platform_gb_stream pgs ON gs.id = pgs.catalogId " +
"WHERE gs.gbId = '${gbId}' AND pgs.platformId = '${platformId}'")
GbStream queryStreamInPlatform(String platformId, String gbId);
@Select("SELECT gs.*, pgs.platformId as platformId, pgs.catalogId as catalogId FROM gb_stream gs " +
"LEFT JOIN platform_gb_stream pgs ON gs.app = pgs.app AND gs.stream = pgs.stream " +
"WHERE pgs.platformId = '${platformId}'")
"LEFT JOIN platform_gb_stream pgs ON gs.id = pgs.gbStreamId " +
"WHERE pgs.platformId = #{platformId}")
List<GbStream> queryGbStreamListInPlatform(String platformId);
@Select("SELECT gs.*, pgs.platformId as platformId, pgs.catalogId as catalogId FROM gb_stream gs LEFT JOIN platform_gb_stream pgs " +
"ON gs.app = pgs.app and gs.stream = pgs.stream WHERE pgs.app is NULL and pgs.stream is NULL")
@Select("SELECT gs.* FROM gb_stream gs LEFT JOIN platform_gb_stream pgs " +
"ON gs.id = pgs.gbStreamId WHERE pgs.gbStreamId is NULL")
List<GbStream> queryStreamNotInPlatform();
@Update("UPDATE gb_stream " +
@ -124,4 +125,12 @@ public interface GbStreamMapper {
"</foreach>" +
"</script>"})
int updateStreamGPS(List<GPSMsgInfo> gpsMsgInfos);
@Select("<script> "+
"SELECT * FROM gb_stream where " +
"<foreach collection='streamPushItems' item='item' separator='or'>" +
"(app=#{item.app} and stream=#{item.stream}) " +
"</foreach>" +
"</script>")
List<GbStream> selectAllForAppAndStream(List<StreamPushItem> streamPushItems);
}

2
src/main/java/com/genersoft/iot/vmp/storager/dao/LogMapper.java

@ -21,7 +21,6 @@ public interface LogMapper {
"values ('${name}', '${type}', '${uri}', '${address}', '${result}', ${timing}, '${username}', '${createTime}')")
int add(LogDto logDto);
@Select(value = {"<script>" +
" SELECT * FROM log " +
" WHERE 1=1 " +
@ -33,7 +32,6 @@ public interface LogMapper {
" </script>"})
List<LogDto> query(String query, String type, String startTime, String endTime);
@Delete("DELETE FROM log")
int clear();
}

6
src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java

@ -54,7 +54,11 @@ public interface ParentPlatformMapper {
" +\n" +
" (SELECT count(0)\n" +
" FROM platform_gb_stream pgs\n" +
" WHERE pgs.platformId = pp.serverGBId)) as channelCount\n" +
" WHERE pgs.platformId = pp.serverGBId)\n" +
" +\n" +
" (SELECT count(0)\n" +
" FROM platform_catalog pgc\n" +
" WHERE pgc.platformId = pp.serverGBId)) as channelCount\n" +
"FROM parent_platform pp ")
List<ParentPlatform> getParentPlatformList();

3
src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java

@ -34,7 +34,6 @@ public interface PlatformChannelMapper {
"</script>")
int addChannels(String platformId, List<ChannelReduce> channelReducesToAdd);
@Delete("<script> "+
"DELETE FROM platform_gb_channel WHERE platformId='${platformId}' AND deviceAndChannelId in" +
"<foreach collection='channelReducesToDel' item='item' open='(' separator=',' close=')' > '${item.deviceId}_${item.channelId}'</foreach>" +
@ -51,12 +50,10 @@ public interface PlatformChannelMapper {
"</script>")
int cleanChannelForGB(String platformId);
@Select("SELECT * FROM device_channel WHERE deviceId = (SELECT deviceId FROM platform_gb_channel WHERE " +
"platformId='${platformId}' AND channelId='${channelId}' ) AND channelId='${channelId}'")
DeviceChannel queryChannelInParentPlatform(String platformId, String channelId);
@Select("select dc.channelId as id, dc.name as name, pgc.platformId as platformId, pgc.catalogId as parentId, 0 as childrenCount, 1 as type " +
"from device_channel dc left join platform_gb_channel pgc on dc.deviceId = pgc.deviceId and dc.channelId = pgc.channelId " +
"where pgc.platformId=#{platformId} and pgc.catalogId=#{catalogId}")

45
src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java

@ -16,22 +16,22 @@ import java.util.List;
@Repository
public interface PlatformGbStreamMapper {
@Insert("REPLACE INTO platform_gb_stream (app, stream, platformId, catalogId) VALUES" +
"('${app}', '${stream}', '${platformId}', '${catalogId}')")
@Insert("REPLACE INTO platform_gb_stream (gbStreamId, platformId, catalogId) VALUES" +
"( #{id}, #{platformId}, #{catalogId})")
int add(PlatformGbStream platformGbStream);
@Insert("<script> " +
"REPLACE into platform_gb_stream " +
"(app, stream, platformId, catalogId) " +
"(gbStreamId, platformId, catalogId) " +
"values " +
"<foreach collection='streamPushItems' index='index' item='item' separator=','> " +
"('${item.app}', '${item.stream}', '${platformId}', '${catalogId}')" +
"(#{item.id}, #{platformId}, #{catalogId})" +
"</foreach> " +
"</script>")
int batchAdd(String platformId, String catalogId, List<StreamPushItem> streamPushItems);
int batchAdd(String platformId, String catalogId, List<GbStream> streamPushItems);
@Delete("DELETE FROM platform_gb_stream WHERE app=#{app} AND stream=#{stream}")
@Delete("DELETE FROM platform_gb_stream WHERE gbStreamId = (select id from gb_stream where app=#{app} AND stream=#{stream})")
int delByAppAndStream(String app, String stream);
@Delete("DELETE FROM platform_gb_stream WHERE platformId=#{platformId}")
@ -42,27 +42,28 @@ public interface PlatformGbStreamMapper {
"FROM " +
"platform_gb_stream pgs " +
"LEFT JOIN parent_platform pp ON pp.serverGBId = pgs.platformId " +
"LEFT JOIN gb_stream gs ON gs.id = pgs.gbStreamId " +
"WHERE " +
"pgs.app =#{app} " +
"AND pgs.stream =#{stream} ")
"gs.app =#{app} " +
"AND gs.stream =#{stream} ")
List<ParentPlatform> selectByAppAndStream(String app, String stream);
@Select("SELECT pgs.*, gs.gbId FROM platform_gb_stream pgs " +
"LEFT JOIN gb_stream gs ON pgs.app = gs.app AND pgs.stream = gs.stream " +
"WHERE pgs.app=#{app} AND pgs.stream=#{stream} AND pgs.platformId=#{serverGBId}")
"LEFT JOIN gb_stream gs ON pgs.gbStreamId = gs.id " +
"WHERE gs.app=#{app} AND gs.stream=#{stream} AND pgs.platformId=#{serverGBId}")
StreamProxyItem selectOne(String app, String stream, String serverGBId);
@Select("select gs.* \n" +
"from gb_stream gs\n" +
" left join platform_gb_stream pgs\n" +
" on gs.app = pgs.app and gs.stream = pgs.stream\n" +
" on gs.id = pgs.gbStreamId\n" +
"where pgs.platformId=#{platformId} and pgs.catalogId=#{catalogId}")
List<GbStream> queryChannelInParentPlatformAndCatalog(String platformId, String catalogId);
@Select("select gs.gbId as id, gs.name as name, pgs.platformId as platformId, pgs.catalogId as catalogId , 0 as childrenCount, 2 as type\n" +
"from gb_stream gs\n" +
" left join platform_gb_stream pgs\n" +
" on gs.app = pgs.app and gs.stream = pgs.stream\n" +
" on gs.id = pgs.gbStreamId\n" +
"where pgs.platformId=#{platformId} and pgs.catalogId=#{catalogId}")
List<PlatformCatalog> queryChannelInParentPlatformAndCatalogForCatalog(String platformId, String catalogId);
@ -76,29 +77,31 @@ public interface PlatformGbStreamMapper {
"parent_platform pp " +
"left join platform_gb_stream pgs on " +
"pp.serverGBId = pgs.platformId " +
"left join gb_stream gs " +
"gs.id = pgs.gbStreamId " +
"WHERE " +
"pgs.app = #{app} " +
"AND pgs.stream = #{stream}" +
"gs.app = #{app} " +
"AND gs.stream = #{stream}" +
"AND pp.serverGBId IN" +
"<foreach collection='platforms' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
"</script> ")
List<ParentPlatform> queryPlatFormListForGBWithGBId(String app, String stream, List<String> platforms);
@Delete("DELETE FROM platform_gb_stream WHERE app=#{app} AND stream=#{stream} AND platformId=#{platformId}")
@Delete("DELETE FROM platform_gb_stream WHERE gbStreamId = (select id from gb_stream where app=#{app} AND stream=#{stream}) AND platformId=#{platformId}")
int delByAppAndStreamAndPlatform(String app, String stream, String platformId);
@Delete("<script> "+
"DELETE FROM platform_gb_stream where " +
"<foreach collection='gbStreams' item='item' separator='or'>" +
"(app=#{item.app} and stream=#{item.stream}) " +
"DELETE FROM platform_gb_stream where gbStreamId in " +
"<foreach collection='gbStreams' item='item' open='(' separator=',' close=')' >" +
"#{item.id}" +
"</foreach>" +
"</script>")
void delByGbStreams(List<GbStream> gbStreams);
@Delete("<script> "+
"DELETE FROM platform_gb_stream where " +
"<foreach collection='gbStreams' item='item' separator='or'>" +
"(app=#{item.app} and stream=#{item.stream}) and platformId=#{platformId}" +
"DELETE FROM platform_gb_stream where platformId=#{platformId} and gbStreamId in " +
"<foreach collection='gbStreams' item='item' open='(' separator=',' close=')'>" +
"#{item.id} " +
"</foreach>" +
"</script>")
void delByAppAndStreamsByPlatformId(List<GbStream> gbStreams, String platformId);

2
src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java

@ -61,7 +61,7 @@ public interface StreamPushMapper {
@Select(value = {" <script>" +
"SELECT " +
"st.*, " +
"pgs.gbId, pgs.status, pgs.name, pgs.longitude, pgs.latitude " +
"pgs.gbId, pgs.status, pgs.name, pgs.longitude, pgs.latitude , pgs.id " +
"from " +
"stream_push st " +
"LEFT JOIN gb_stream pgs " +

23
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java

@ -705,9 +705,18 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
streamProxyItem.setCreateTime(now);
streamProxyItem.setCreateStamp(System.currentTimeMillis());
try {
if (gbStreamMapper.add(streamProxyItem)<0 || streamProxyMapper.add(streamProxyItem) < 0) {
if (streamProxyMapper.add(streamProxyItem) > 0) {
if (!StringUtils.isEmpty(streamProxyItem.getGbId())) {
if (gbStreamMapper.add(streamProxyItem) > 0) {
//事务回滚
dataSourceTransactionManager.rollback(transactionStatus);
return false;
}
}
}else {
//事务回滚
dataSourceTransactionManager.rollback(transactionStatus);
return false;
}
result = true;
dataSourceTransactionManager.commit(transactionStatus); //手动提交
@ -731,10 +740,20 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
boolean result = false;
streamProxyItem.setStreamType("proxy");
try {
if (gbStreamMapper.update(streamProxyItem)<0 || streamProxyMapper.update(streamProxyItem) < 0) {
if (streamProxyMapper.update(streamProxyItem) > 0) {
if (!StringUtils.isEmpty(streamProxyItem.getGbId())) {
if (gbStreamMapper.update(streamProxyItem) > 0) {
//事务回滚
dataSourceTransactionManager.rollback(transactionStatus);
return false;
}
}
}else {
//事务回滚
dataSourceTransactionManager.rollback(transactionStatus);
return false;
}
dataSourceTransactionManager.commit(transactionStatus); //手动提交
result = true;
}catch (Exception e) {

2
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/gbStream/GbStreamController.java

@ -67,6 +67,8 @@ public class GbStreamController {
mediaServerId = null;
}
// catalogId 为null 查询未在平台下分配的数据
// catalogId 不为null 查询平台下这个,目录下的通道
return gbStreamService.getAll(page, count, platformId, catalogId, query, pushing, mediaServerId);
}

1
src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java

@ -71,6 +71,7 @@ public class StreamProxyController {
logger.info("添加代理: " + JSONObject.toJSONString(param));
if (StringUtils.isEmpty(param.getMediaServerId())) param.setMediaServerId("auto");
if (StringUtils.isEmpty(param.getType())) param.setType("default");
if (StringUtils.isEmpty(param.getGbId())) param.setGbId(null);
WVPResult<StreamInfo> result = streamProxyService.save(param);
return result;
}

4
web_src/src/components/dialog/chooseChannelForGb.vue

@ -43,8 +43,8 @@
<el-table-column label="操作" width="100" align="center" fixed="right">
<template slot-scope="scope">
<el-button-group>
<el-button size="mini" icon="el-icon-plus" v-if="!scope.row.platformId" @click="add(scope.row)">添加</el-button>
<el-button size="mini" icon="el-icon-delete" v-if="scope.row.platformId" type="danger" @click="remove(scope.row)">移除</el-button>
<el-button size="mini" icon="el-icon-plus" v-if="catalogId === null" @click="add(scope.row)">添加</el-button>
<el-button size="mini" icon="el-icon-delete" v-if="catalogId !== null" type="danger" @click="remove(scope.row)">移除</el-button>
</el-button-group>
</template>
</el-table-column>

5
web_src/src/components/dialog/chooseChannelForStream.vue

@ -47,8 +47,8 @@
<el-table-column label="操作" width="100" align="center" fixed="right" >
<template slot-scope="scope">
<el-button-group>
<el-button size="mini" icon="el-icon-plus" v-if="!scope.row.platformId" @click="add(scope.row, scope)">添加</el-button>
<el-button size="mini" icon="el-icon-delete" v-if="scope.row.platformId" type="danger" @click="remove(scope.row, scope)">移除</el-button>
<el-button size="mini" icon="el-icon-plus" v-if="catalogId === null" @click="add(scope.row, scope)">添加</el-button>
<el-button size="mini" icon="el-icon-delete" v-if="catalogId !== null" type="danger" @click="remove(scope.row, scope)">移除</el-button>
</el-button-group>
</template>
</el-table-column>
@ -76,6 +76,7 @@ export default {
props: ['platformId', 'catalogId', 'catalogName'],
created() {
this.initData();
console.log(this.catalogId)
},
components: {
getCatalog,

Loading…
Cancel
Save