Commit 8aa0bdf539582b9d710503121d911bb166ca7c8e

Authored by 648540858
1 parent 10cb5839

数据库优化

Showing 29 changed files with 246 additions and 69 deletions
sql/mysql.sql
@@ -50,7 +50,7 @@ CREATE TABLE `device` ( @@ -50,7 +50,7 @@ CREATE TABLE `device` (
50 `treeType` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, 50 `treeType` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
51 PRIMARY KEY (`id`) USING BTREE, 51 PRIMARY KEY (`id`) USING BTREE,
52 UNIQUE KEY `device_deviceId_uindex` (`deviceId`) USING BTREE 52 UNIQUE KEY `device_deviceId_uindex` (`deviceId`) USING BTREE
53 -) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; 53 +) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
54 /*!40101 SET character_set_client = @saved_cs_client */; 54 /*!40101 SET character_set_client = @saved_cs_client */;
55 55
56 -- 56 --
@@ -80,6 +80,7 @@ CREATE TABLE `device_alarm` ( @@ -80,6 +80,7 @@ CREATE TABLE `device_alarm` (
80 `longitude` double DEFAULT NULL, 80 `longitude` double DEFAULT NULL,
81 `latitude` double DEFAULT NULL, 81 `latitude` double DEFAULT NULL,
82 `alarmType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, 82 `alarmType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  83 + `createTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
83 PRIMARY KEY (`id`) USING BTREE 84 PRIMARY KEY (`id`) USING BTREE
84 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; 85 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
85 /*!40101 SET character_set_client = @saved_cs_client */; 86 /*!40101 SET character_set_client = @saved_cs_client */;
@@ -137,10 +138,11 @@ CREATE TABLE `device_channel` ( @@ -137,10 +138,11 @@ CREATE TABLE `device_channel` (
137 `longitudeWgs84` double DEFAULT NULL, 138 `longitudeWgs84` double DEFAULT NULL,
138 `latitudeWgs84` double DEFAULT NULL, 139 `latitudeWgs84` double DEFAULT NULL,
139 `businessGroupId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, 140 `businessGroupId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  141 + `gpsTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
140 PRIMARY KEY (`id`) USING BTREE, 142 PRIMARY KEY (`id`) USING BTREE,
141 UNIQUE KEY `device_channel_id_uindex` (`id`) USING BTREE, 143 UNIQUE KEY `device_channel_id_uindex` (`id`) USING BTREE,
142 UNIQUE KEY `device_channel_pk` (`channelId`,`deviceId`) USING BTREE 144 UNIQUE KEY `device_channel_pk` (`channelId`,`deviceId`) USING BTREE
143 -) ENGINE=InnoDB AUTO_INCREMENT=19317 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; 145 +) ENGINE=InnoDB AUTO_INCREMENT=19324 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
144 /*!40101 SET character_set_client = @saved_cs_client */; 146 /*!40101 SET character_set_client = @saved_cs_client */;
145 147
146 -- 148 --
@@ -175,8 +177,9 @@ CREATE TABLE `device_mobile_position` ( @@ -175,8 +177,9 @@ CREATE TABLE `device_mobile_position` (
175 `latitudeGcj02` double DEFAULT NULL, 177 `latitudeGcj02` double DEFAULT NULL,
176 `longitudeWgs84` double DEFAULT NULL, 178 `longitudeWgs84` double DEFAULT NULL,
177 `latitudeWgs84` double DEFAULT NULL, 179 `latitudeWgs84` double DEFAULT NULL,
  180 + `createTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
178 PRIMARY KEY (`id`) USING BTREE 181 PRIMARY KEY (`id`) USING BTREE
179 -) ENGINE=InnoDB AUTO_INCREMENT=1508 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; 182 +) ENGINE=InnoDB AUTO_INCREMENT=5649 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
180 /*!40101 SET character_set_client = @saved_cs_client */; 183 /*!40101 SET character_set_client = @saved_cs_client */;
181 184
182 -- 185 --
@@ -206,11 +209,12 @@ CREATE TABLE `gb_stream` ( @@ -206,11 +209,12 @@ CREATE TABLE `gb_stream` (
206 `streamType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, 209 `streamType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
207 `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, 210 `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
208 `status` int DEFAULT NULL, 211 `status` int DEFAULT NULL,
209 - `createStamp` bigint DEFAULT NULL, 212 + `createTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
  213 + `gpsTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
210 PRIMARY KEY (`gbStreamId`) USING BTREE, 214 PRIMARY KEY (`gbStreamId`) USING BTREE,
211 UNIQUE KEY `app` (`app`,`stream`) USING BTREE, 215 UNIQUE KEY `app` (`app`,`stream`) USING BTREE,
212 UNIQUE KEY `gbId` (`gbId`) USING BTREE 216 UNIQUE KEY `gbId` (`gbId`) USING BTREE
213 -) ENGINE=InnoDB AUTO_INCREMENT=301679 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; 217 +) ENGINE=InnoDB AUTO_INCREMENT=301681 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
214 /*!40101 SET character_set_client = @saved_cs_client */; 218 /*!40101 SET character_set_client = @saved_cs_client */;
215 219
216 -- 220 --
@@ -240,7 +244,7 @@ CREATE TABLE `log` ( @@ -240,7 +244,7 @@ CREATE TABLE `log` (
240 `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, 244 `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
241 `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, 245 `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
242 PRIMARY KEY (`id`) USING BTREE 246 PRIMARY KEY (`id`) USING BTREE
243 -) ENGINE=InnoDB AUTO_INCREMENT=22051 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; 247 +) ENGINE=InnoDB AUTO_INCREMENT=29943 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
244 /*!40101 SET character_set_client = @saved_cs_client */; 248 /*!40101 SET character_set_client = @saved_cs_client */;
245 249
246 -- 250 --
@@ -329,10 +333,12 @@ CREATE TABLE `parent_platform` ( @@ -329,10 +333,12 @@ CREATE TABLE `parent_platform` (
329 `startOfflinePush` int DEFAULT '0', 333 `startOfflinePush` int DEFAULT '0',
330 `administrativeDivision` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, 334 `administrativeDivision` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
331 `catalogGroup` int DEFAULT '1', 335 `catalogGroup` int DEFAULT '1',
  336 + `createTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
  337 + `updateTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
332 PRIMARY KEY (`id`) USING BTREE, 338 PRIMARY KEY (`id`) USING BTREE,
333 UNIQUE KEY `parent_platform_id_uindex` (`id`) USING BTREE, 339 UNIQUE KEY `parent_platform_id_uindex` (`id`) USING BTREE,
334 UNIQUE KEY `parent_platform_pk` (`serverGBId`) USING BTREE 340 UNIQUE KEY `parent_platform_pk` (`serverGBId`) USING BTREE
335 -) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; 341 +) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
336 /*!40101 SET character_set_client = @saved_cs_client */; 342 /*!40101 SET character_set_client = @saved_cs_client */;
337 343
338 -- 344 --
@@ -446,9 +452,10 @@ CREATE TABLE `stream_proxy` ( @@ -446,9 +452,10 @@ CREATE TABLE `stream_proxy` (
446 `enable_remove_none_reader` bit(1) NOT NULL, 452 `enable_remove_none_reader` bit(1) NOT NULL,
447 `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, 453 `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
448 `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, 454 `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  455 + `updateTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
449 PRIMARY KEY (`id`) USING BTREE, 456 PRIMARY KEY (`id`) USING BTREE,
450 UNIQUE KEY `stream_proxy_pk` (`app`,`stream`) USING BTREE 457 UNIQUE KEY `stream_proxy_pk` (`app`,`stream`) USING BTREE
451 -) ENGINE=InnoDB AUTO_INCREMENT=61 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; 458 +) ENGINE=InnoDB AUTO_INCREMENT=65 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
452 /*!40101 SET character_set_client = @saved_cs_client */; 459 /*!40101 SET character_set_client = @saved_cs_client */;
453 460
454 -- 461 --
@@ -474,10 +481,12 @@ CREATE TABLE `stream_push` ( @@ -474,10 +481,12 @@ CREATE TABLE `stream_push` (
474 `totalReaderCount` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, 481 `totalReaderCount` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
475 `originType` int DEFAULT NULL, 482 `originType` int DEFAULT NULL,
476 `originTypeStr` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, 483 `originTypeStr` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
477 - `createStamp` bigint DEFAULT NULL, 484 + `createTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
478 `aliveSecond` int DEFAULT NULL, 485 `aliveSecond` int DEFAULT NULL,
479 `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, 486 `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
480 `serverId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, 487 `serverId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
  488 + `pushTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
  489 + `updateTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
481 PRIMARY KEY (`id`) USING BTREE, 490 PRIMARY KEY (`id`) USING BTREE,
482 UNIQUE KEY `stream_push_pk` (`app`,`stream`) USING BTREE 491 UNIQUE KEY `stream_push_pk` (`app`,`stream`) USING BTREE
483 ) ENGINE=InnoDB AUTO_INCREMENT=305304 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; 492 ) ENGINE=InnoDB AUTO_INCREMENT=305304 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
@@ -557,4 +566,4 @@ UNLOCK TABLES; @@ -557,4 +566,4 @@ UNLOCK TABLES;
557 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 566 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
558 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 567 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
559 568
560 --- Dump completed on 2022-07-04 1:07:19 569 +-- Dump completed on 2022-07-06 9:43:54
sql/update.sql
1 alter table stream_push 1 alter table stream_push
2 add serverId varchar(50) not null; 2 add serverId varchar(50) not null;
  3 +
3 alter table device 4 alter table device
4 add geoCoordSys varchar(50) not null; 5 add geoCoordSys varchar(50) not null;
5 alter table device 6 alter table device
6 add treeType varchar(50) not null; 7 add treeType varchar(50) not null;
7 update device set device.geoCoordSys='WGS84'; 8 update device set device.geoCoordSys='WGS84';
8 update device set device.treeType='CivilCode'; 9 update device set device.treeType='CivilCode';
  10 +
9 alter table device_channel 11 alter table device_channel
10 add longitudeGcj02 double default null; 12 add longitudeGcj02 double default null;
11 alter table device_channel 13 alter table device_channel
@@ -16,15 +18,43 @@ alter table device_channel @@ -16,15 +18,43 @@ alter table device_channel
16 add latitudeWgs84 double default null; 18 add latitudeWgs84 double default null;
17 alter table device_channel 19 alter table device_channel
18 add businessGroupId varchar(50) default null; 20 add businessGroupId varchar(50) default null;
  21 +alter table device_channel
  22 + add gpsTime varchar(50) default null;
19 23
20 24
21 -alter table device_mobile_position change cnLng longitudeGcj02 double default null;  
22 -alter table device_mobile_position change cnLat latitudeGcj02 double default null; 25 +alter table device_mobile_position
  26 + change cnLng longitudeGcj02 double default null;
  27 +alter table device_mobile_position
  28 + change cnLat latitudeGcj02 double default null;
23 alter table device_mobile_position 29 alter table device_mobile_position
24 add longitudeWgs84 double default null; 30 add longitudeWgs84 double default null;
25 alter table device_mobile_position 31 alter table device_mobile_position
26 add latitudeWgs84 double default null; 32 add latitudeWgs84 double default null;
27 -alter table device_mobile_position drop geodeticSystem; 33 +alter table device_mobile_position
  34 + drop geodeticSystem;
  35 +alter table device_mobile_position
  36 + add createTime varchar(50) default null;
  37 +
  38 +alter table device_alarm
  39 + add createTime varchar(50) default null;
  40 +
  41 +alter table gb_stream
  42 + change createStamp createTime varchar(50) default null;
  43 +
  44 +alter table parent_platform
  45 + add createTime varchar(50) default null;
  46 +alter table parent_platform
  47 + add updateTime varchar(50) default null;
  48 +
  49 +alter table stream_proxy
  50 + add updateTime varchar(50) default null;
  51 +
  52 +alter table stream_push
  53 + add pushTime varchar(50) default null;
  54 +alter table stream_push
  55 + add updateTime varchar(50) default null;
  56 +alter table stream_push
  57 + change createStamp createTime varchar(50) default null;
28 58
29 59
30 60
src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceAlarm.java
@@ -77,6 +77,8 @@ public class DeviceAlarm { @@ -77,6 +77,8 @@ public class DeviceAlarm {
77 */ 77 */
78 private String alarmType; 78 private String alarmType;
79 79
  80 + private String createTime;
  81 +
80 82
81 public String getId() { 83 public String getId() {
82 return id; 84 return id;
@@ -157,4 +159,12 @@ public class DeviceAlarm { @@ -157,4 +159,12 @@ public class DeviceAlarm {
157 public void setChannelId(String channelId) { 159 public void setChannelId(String channelId) {
158 this.channelId = channelId; 160 this.channelId = channelId;
159 } 161 }
  162 +
  163 + public String getCreateTime() {
  164 + return createTime;
  165 + }
  166 +
  167 + public void setCreateTime(String createTime) {
  168 + this.createTime = createTime;
  169 + }
160 } 170 }
src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java
@@ -199,6 +199,11 @@ public class DeviceChannel { @@ -199,6 +199,11 @@ public class DeviceChannel {
199 */ 199 */
200 private String businessGroupId; 200 private String businessGroupId;
201 201
  202 + /**
  203 + * GPS的更新时间
  204 + */
  205 + private String gpsTime;
  206 +
202 public int getId() { 207 public int getId() {
203 return id; 208 return id;
204 } 209 }
@@ -519,4 +524,12 @@ public class DeviceChannel { @@ -519,4 +524,12 @@ public class DeviceChannel {
519 public void setBusinessGroupId(String businessGroupId) { 524 public void setBusinessGroupId(String businessGroupId) {
520 this.businessGroupId = businessGroupId; 525 this.businessGroupId = businessGroupId;
521 } 526 }
  527 +
  528 + public String getGpsTime() {
  529 + return gpsTime;
  530 + }
  531 +
  532 + public void setGpsTime(String gpsTime) {
  533 + this.gpsTime = gpsTime;
  534 + }
522 } 535 }
src/main/java/com/genersoft/iot/vmp/gb28181/bean/GbStream.java
@@ -15,10 +15,8 @@ public class GbStream extends PlatformGbStream{ @@ -15,10 +15,8 @@ public class GbStream extends PlatformGbStream{
15 private double latitude; 15 private double latitude;
16 private String streamType; 16 private String streamType;
17 private boolean status; 17 private boolean status;
18 - /**  
19 - * GMT unix系统时间戳,单位秒  
20 - */  
21 - public Long createStamp; 18 +
  19 + public String createTime;
22 20
23 @Override 21 @Override
24 public Integer getGbStreamId() { 22 public Integer getGbStreamId() {
@@ -102,12 +100,11 @@ public class GbStream extends PlatformGbStream{ @@ -102,12 +100,11 @@ public class GbStream extends PlatformGbStream{
102 this.mediaServerId = mediaServerId; 100 this.mediaServerId = mediaServerId;
103 } 101 }
104 102
105 -  
106 - public Long getCreateStamp() {  
107 - return createStamp; 103 + public String getCreateTime() {
  104 + return createTime;
108 } 105 }
109 106
110 - public void setCreateStamp(Long createStamp) {  
111 - this.createStamp = createStamp; 107 + public void setCreateTime(String createTime) {
  108 + this.createTime = createTime;
112 } 109 }
113 } 110 }
src/main/java/com/genersoft/iot/vmp/gb28181/bean/MobilePosition.java
@@ -77,6 +77,11 @@ public class MobilePosition { @@ -77,6 +77,11 @@ public class MobilePosition {
77 */ 77 */
78 private double latitudeWgs84; 78 private double latitudeWgs84;
79 79
  80 + /**
  81 + * 创建时间
  82 + */
  83 + private String createTime;
  84 +
80 85
81 public String getDeviceId() { 86 public String getDeviceId() {
82 return deviceId; 87 return deviceId;
@@ -189,4 +194,12 @@ public class MobilePosition { @@ -189,4 +194,12 @@ public class MobilePosition {
189 public void setLatitudeWgs84(double latitudeWgs84) { 194 public void setLatitudeWgs84(double latitudeWgs84) {
190 this.latitudeWgs84 = latitudeWgs84; 195 this.latitudeWgs84 = latitudeWgs84;
191 } 196 }
  197 +
  198 + public String getCreateTime() {
  199 + return createTime;
  200 + }
  201 +
  202 + public void setCreateTime(String createTime) {
  203 + this.createTime = createTime;
  204 + }
192 } 205 }
src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java
@@ -144,6 +144,16 @@ public class ParentPlatform { @@ -144,6 +144,16 @@ public class ParentPlatform {
144 */ 144 */
145 private String administrativeDivision; 145 private String administrativeDivision;
146 146
  147 + /**
  148 + * 更新时间
  149 + */
  150 + private String updateTime;
  151 +
  152 + /**
  153 + * 创建时间
  154 + */
  155 + private String createTime;
  156 +
147 public Integer getId() { 157 public Integer getId() {
148 return id; 158 return id;
149 } 159 }
@@ -368,4 +378,20 @@ public class ParentPlatform { @@ -368,4 +378,20 @@ public class ParentPlatform {
368 public void setAdministrativeDivision(String administrativeDivision) { 378 public void setAdministrativeDivision(String administrativeDivision) {
369 this.administrativeDivision = administrativeDivision; 379 this.administrativeDivision = administrativeDivision;
370 } 380 }
  381 +
  382 + public String getUpdateTime() {
  383 + return updateTime;
  384 + }
  385 +
  386 + public void setUpdateTime(String updateTime) {
  387 + this.updateTime = updateTime;
  388 + }
  389 +
  390 + public String getCreateTime() {
  391 + return createTime;
  392 + }
  393 +
  394 + public void setCreateTime(String createTime) {
  395 + this.createTime = createTime;
  396 + }
371 } 397 }
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java
@@ -140,6 +140,7 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements @@ -140,6 +140,7 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements
140 Element rootElement = getRootElement(evt); 140 Element rootElement = getRootElement(evt);
141 141
142 MobilePosition mobilePosition = new MobilePosition(); 142 MobilePosition mobilePosition = new MobilePosition();
  143 + mobilePosition.setCreateTime(DateUtil.getNow());
143 Element deviceIdElement = rootElement.element("DeviceID"); 144 Element deviceIdElement = rootElement.element("DeviceID");
144 String channelId = deviceIdElement.getTextTrim().toString(); 145 String channelId = deviceIdElement.getTextTrim().toString();
145 Device device = redisCatchStorage.getDevice(deviceId); 146 Device device = redisCatchStorage.getDevice(deviceId);
@@ -205,6 +206,7 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements @@ -205,6 +206,7 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements
205 deviceChannel.setLatitudeWgs84(mobilePosition.getLatitudeWgs84()); 206 deviceChannel.setLatitudeWgs84(mobilePosition.getLatitudeWgs84());
206 deviceChannel.setLongitudeGcj02(mobilePosition.getLongitudeGcj02()); 207 deviceChannel.setLongitudeGcj02(mobilePosition.getLongitudeGcj02());
207 deviceChannel.setLatitudeGcj02(mobilePosition.getLatitudeGcj02()); 208 deviceChannel.setLatitudeGcj02(mobilePosition.getLatitudeGcj02());
  209 + deviceChannel.setGpsTime(mobilePosition.getTime());
208 storager.updateChannelPosition(deviceChannel); 210 storager.updateChannelPosition(deviceChannel);
209 // 发送redis消息。 通知位置信息的变化 211 // 发送redis消息。 通知位置信息的变化
210 JSONObject jsonObject = new JSONObject(); 212 JSONObject jsonObject = new JSONObject();
@@ -273,6 +275,7 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements @@ -273,6 +275,7 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements
273 logger.info("[收到Notify-Alarm]:{}/{}", device.getDeviceId(), deviceAlarm.getChannelId()); 275 logger.info("[收到Notify-Alarm]:{}/{}", device.getDeviceId(), deviceAlarm.getChannelId());
274 if ("4".equals(deviceAlarm.getAlarmMethod())) { 276 if ("4".equals(deviceAlarm.getAlarmMethod())) {
275 MobilePosition mobilePosition = new MobilePosition(); 277 MobilePosition mobilePosition = new MobilePosition();
  278 + mobilePosition.setCreateTime(DateUtil.getNow());
276 mobilePosition.setDeviceId(deviceAlarm.getDeviceId()); 279 mobilePosition.setDeviceId(deviceAlarm.getDeviceId());
277 mobilePosition.setTime(deviceAlarm.getAlarmTime()); 280 mobilePosition.setTime(deviceAlarm.getAlarmTime());
278 mobilePosition.setLongitude(deviceAlarm.getLongitude()); 281 mobilePosition.setLongitude(deviceAlarm.getLongitude());
@@ -309,6 +312,7 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements @@ -309,6 +312,7 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements
309 deviceChannel.setLatitudeWgs84(mobilePosition.getLatitudeWgs84()); 312 deviceChannel.setLatitudeWgs84(mobilePosition.getLatitudeWgs84());
310 deviceChannel.setLongitudeGcj02(mobilePosition.getLongitudeGcj02()); 313 deviceChannel.setLongitudeGcj02(mobilePosition.getLongitudeGcj02());
311 deviceChannel.setLatitudeGcj02(mobilePosition.getLatitudeGcj02()); 314 deviceChannel.setLatitudeGcj02(mobilePosition.getLatitudeGcj02());
  315 + deviceChannel.setGpsTime(mobilePosition.getTime());
312 storager.updateChannelPosition(deviceChannel); 316 storager.updateChannelPosition(deviceChannel);
313 } 317 }
314 // TODO: 需要实现存储报警信息、报警分类 318 // TODO: 需要实现存储报警信息、报警分类
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java
@@ -81,6 +81,7 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme @@ -81,6 +81,7 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme
81 String channelId = deviceIdElement.getText().toString(); 81 String channelId = deviceIdElement.getText().toString();
82 82
83 DeviceAlarm deviceAlarm = new DeviceAlarm(); 83 DeviceAlarm deviceAlarm = new DeviceAlarm();
  84 + deviceAlarm.setCreateTime(DateUtil.getNow());
84 deviceAlarm.setDeviceId(device.getDeviceId()); 85 deviceAlarm.setDeviceId(device.getDeviceId());
85 deviceAlarm.setChannelId(channelId); 86 deviceAlarm.setChannelId(channelId);
86 deviceAlarm.setAlarmPriority(getText(rootElement, "AlarmPriority")); 87 deviceAlarm.setAlarmPriority(getText(rootElement, "AlarmPriority"));
@@ -112,6 +113,7 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme @@ -112,6 +113,7 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme
112 if (!StringUtils.isEmpty(deviceAlarm.getAlarmMethod())) { 113 if (!StringUtils.isEmpty(deviceAlarm.getAlarmMethod())) {
113 if ( deviceAlarm.getAlarmMethod().contains(DeviceAlarmMethod.GPS.getVal() + "")) { 114 if ( deviceAlarm.getAlarmMethod().contains(DeviceAlarmMethod.GPS.getVal() + "")) {
114 MobilePosition mobilePosition = new MobilePosition(); 115 MobilePosition mobilePosition = new MobilePosition();
  116 + mobilePosition.setCreateTime(DateUtil.getNow());
115 mobilePosition.setDeviceId(deviceAlarm.getDeviceId()); 117 mobilePosition.setDeviceId(deviceAlarm.getDeviceId());
116 mobilePosition.setTime(deviceAlarm.getAlarmTime()); 118 mobilePosition.setTime(deviceAlarm.getAlarmTime());
117 mobilePosition.setLongitude(deviceAlarm.getLongitude()); 119 mobilePosition.setLongitude(deviceAlarm.getLongitude());
@@ -148,6 +150,7 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme @@ -148,6 +150,7 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme
148 deviceChannel.setLatitudeWgs84(mobilePosition.getLatitudeWgs84()); 150 deviceChannel.setLatitudeWgs84(mobilePosition.getLatitudeWgs84());
149 deviceChannel.setLongitudeGcj02(mobilePosition.getLongitudeGcj02()); 151 deviceChannel.setLongitudeGcj02(mobilePosition.getLongitudeGcj02());
150 deviceChannel.setLatitudeGcj02(mobilePosition.getLatitudeGcj02()); 152 deviceChannel.setLatitudeGcj02(mobilePosition.getLatitudeGcj02());
  153 + deviceChannel.setGpsTime(mobilePosition.getTime());
151 storager.updateChannelPosition(deviceChannel); 154 storager.updateChannelPosition(deviceChannel);
152 } 155 }
153 } 156 }
@@ -198,6 +201,7 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme @@ -198,6 +201,7 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme
198 201
199 202
200 DeviceAlarm deviceAlarm = new DeviceAlarm(); 203 DeviceAlarm deviceAlarm = new DeviceAlarm();
  204 + deviceAlarm.setCreateTime(DateUtil.getNow());
201 deviceAlarm.setDeviceId(parentPlatform.getServerGBId()); 205 deviceAlarm.setDeviceId(parentPlatform.getServerGBId());
202 deviceAlarm.setChannelId(channelId); 206 deviceAlarm.setChannelId(channelId);
203 deviceAlarm.setAlarmPriority(getText(rootElement, "AlarmPriority")); 207 deviceAlarm.setAlarmPriority(getText(rootElement, "AlarmPriority"));
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MobilePositionNotifyMessageHandler.java
@@ -8,6 +8,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.notify. @@ -8,6 +8,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.notify.
8 import com.genersoft.iot.vmp.gb28181.utils.Coordtransform; 8 import com.genersoft.iot.vmp.gb28181.utils.Coordtransform;
9 import com.genersoft.iot.vmp.gb28181.utils.NumericUtil; 9 import com.genersoft.iot.vmp.gb28181.utils.NumericUtil;
10 import com.genersoft.iot.vmp.storager.IVideoManagerStorage; 10 import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
  11 +import com.genersoft.iot.vmp.utils.DateUtil;
11 import com.genersoft.iot.vmp.utils.GpsUtil; 12 import com.genersoft.iot.vmp.utils.GpsUtil;
12 import org.dom4j.DocumentException; 13 import org.dom4j.DocumentException;
13 import org.dom4j.Element; 14 import org.dom4j.Element;
@@ -53,6 +54,7 @@ public class MobilePositionNotifyMessageHandler extends SIPRequestProcessorParen @@ -53,6 +54,7 @@ public class MobilePositionNotifyMessageHandler extends SIPRequestProcessorParen
53 rootElement = getRootElement(evt, device.getCharset()); 54 rootElement = getRootElement(evt, device.getCharset());
54 55
55 MobilePosition mobilePosition = new MobilePosition(); 56 MobilePosition mobilePosition = new MobilePosition();
  57 + mobilePosition.setCreateTime(DateUtil.getNow());
56 if (!StringUtils.isEmpty(device.getName())) { 58 if (!StringUtils.isEmpty(device.getName())) {
57 mobilePosition.setDeviceName(device.getName()); 59 mobilePosition.setDeviceName(device.getName());
58 } 60 }
@@ -108,6 +110,7 @@ public class MobilePositionNotifyMessageHandler extends SIPRequestProcessorParen @@ -108,6 +110,7 @@ public class MobilePositionNotifyMessageHandler extends SIPRequestProcessorParen
108 deviceChannel.setLatitudeWgs84(mobilePosition.getLatitudeWgs84()); 110 deviceChannel.setLatitudeWgs84(mobilePosition.getLatitudeWgs84());
109 deviceChannel.setLongitudeGcj02(mobilePosition.getLongitudeGcj02()); 111 deviceChannel.setLongitudeGcj02(mobilePosition.getLongitudeGcj02());
110 deviceChannel.setLatitudeGcj02(mobilePosition.getLatitudeGcj02()); 112 deviceChannel.setLatitudeGcj02(mobilePosition.getLatitudeGcj02());
  113 + deviceChannel.setGpsTime(mobilePosition.getTime());
111 storager.updateChannelPosition(deviceChannel); 114 storager.updateChannelPosition(deviceChannel);
112 //回复 200 OK 115 //回复 200 OK
113 responseAck(evt, Response.OK); 116 responseAck(evt, Response.OK);
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/MobilePositionResponseMessageHandler.java
@@ -8,6 +8,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.respons @@ -8,6 +8,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.respons
8 import com.genersoft.iot.vmp.gb28181.utils.Coordtransform; 8 import com.genersoft.iot.vmp.gb28181.utils.Coordtransform;
9 import com.genersoft.iot.vmp.gb28181.utils.NumericUtil; 9 import com.genersoft.iot.vmp.gb28181.utils.NumericUtil;
10 import com.genersoft.iot.vmp.storager.IVideoManagerStorage; 10 import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
  11 +import com.genersoft.iot.vmp.utils.DateUtil;
11 import com.genersoft.iot.vmp.utils.GpsUtil; 12 import com.genersoft.iot.vmp.utils.GpsUtil;
12 import org.dom4j.DocumentException; 13 import org.dom4j.DocumentException;
13 import org.dom4j.Element; 14 import org.dom4j.Element;
@@ -53,6 +54,7 @@ public class MobilePositionResponseMessageHandler extends SIPRequestProcessorPar @@ -53,6 +54,7 @@ public class MobilePositionResponseMessageHandler extends SIPRequestProcessorPar
53 rootElement = getRootElement(evt, device.getCharset()); 54 rootElement = getRootElement(evt, device.getCharset());
54 55
55 MobilePosition mobilePosition = new MobilePosition(); 56 MobilePosition mobilePosition = new MobilePosition();
  57 + mobilePosition.setCreateTime(DateUtil.getNow());
56 if (!StringUtils.isEmpty(device.getName())) { 58 if (!StringUtils.isEmpty(device.getName())) {
57 mobilePosition.setDeviceName(device.getName()); 59 mobilePosition.setDeviceName(device.getName());
58 } 60 }
@@ -108,6 +110,7 @@ public class MobilePositionResponseMessageHandler extends SIPRequestProcessorPar @@ -108,6 +110,7 @@ public class MobilePositionResponseMessageHandler extends SIPRequestProcessorPar
108 deviceChannel.setLatitudeWgs84(mobilePosition.getLatitudeWgs84()); 110 deviceChannel.setLatitudeWgs84(mobilePosition.getLatitudeWgs84());
109 deviceChannel.setLongitudeGcj02(mobilePosition.getLongitudeGcj02()); 111 deviceChannel.setLongitudeGcj02(mobilePosition.getLongitudeGcj02());
110 deviceChannel.setLatitudeGcj02(mobilePosition.getLatitudeGcj02()); 112 deviceChannel.setLatitudeGcj02(mobilePosition.getLatitudeGcj02());
  113 + deviceChannel.setGpsTime(mobilePosition.getTime());
111 storager.updateChannelPosition(deviceChannel); 114 storager.updateChannelPosition(deviceChannel);
112 //回复 200 OK 115 //回复 200 OK
113 responseAck(evt, Response.OK); 116 responseAck(evt, Response.OK);
src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray; @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
4 import com.alibaba.fastjson.JSONObject; 4 import com.alibaba.fastjson.JSONObject;
5 import com.genersoft.iot.vmp.gb28181.bean.Device; 5 import com.genersoft.iot.vmp.gb28181.bean.Device;
6 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; 6 import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
  7 +import com.genersoft.iot.vmp.utils.DateUtil;
7 import org.dom4j.Attribute; 8 import org.dom4j.Attribute;
8 import org.dom4j.Document; 9 import org.dom4j.Document;
9 import org.dom4j.DocumentException; 10 import org.dom4j.DocumentException;
@@ -314,6 +315,7 @@ public class XmlUtil { @@ -314,6 +315,7 @@ public class XmlUtil {
314 } else { 315 } else {
315 deviceChannel.setLatitude(0.00); 316 deviceChannel.setLatitude(0.00);
316 } 317 }
  318 + deviceChannel.setGpsTime(DateUtil.getNow());
317 if (deviceChannel.getLongitude()*deviceChannel.getLatitude() > 0) { 319 if (deviceChannel.getLongitude()*deviceChannel.getLatitude() > 0) {
318 if ("WGS84".equals(device.getGeoCoordSys())) { 320 if ("WGS84".equals(device.getGeoCoordSys())) {
319 deviceChannel.setLongitudeWgs84(deviceChannel.getLongitude()); 321 deviceChannel.setLongitudeWgs84(deviceChannel.getLongitude());
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
@@ -339,9 +339,7 @@ public class ZLMHttpHookListener { @@ -339,9 +339,7 @@ public class ZLMHttpHookListener {
339 @PostMapping(value = "/on_stream_changed", produces = "application/json;charset=UTF-8") 339 @PostMapping(value = "/on_stream_changed", produces = "application/json;charset=UTF-8")
340 public ResponseEntity<String> onStreamChanged(@RequestBody MediaItem item){ 340 public ResponseEntity<String> onStreamChanged(@RequestBody MediaItem item){
341 341
342 - if (logger.isDebugEnabled()) {  
343 - logger.debug("[ ZLM HOOK ]on_stream_changed API调用,参数:" + JSONObject.toJSONString(item));  
344 - } 342 + logger.info("[ ZLM HOOK ]on_stream_changed API调用,参数:" + JSONObject.toJSONString(item));
345 String mediaServerId = item.getMediaServerId(); 343 String mediaServerId = item.getMediaServerId();
346 JSONObject json = (JSONObject) JSON.toJSON(item); 344 JSONObject json = (JSONObject) JSON.toJSON(item);
347 ZLMHttpHookSubscribe.Event subscribe = this.subscribe.getSubscribe(ZLMHttpHookSubscribe.HookType.on_stream_changed, json); 345 ZLMHttpHookSubscribe.Event subscribe = this.subscribe.getSubscribe(ZLMHttpHookSubscribe.HookType.on_stream_changed, json);
@@ -389,7 +387,6 @@ public class ZLMHttpHookListener { @@ -389,7 +387,6 @@ public class ZLMHttpHookListener {
389 387
390 if (mediaServerItem != null){ 388 if (mediaServerItem != null){
391 if (regist) { 389 if (regist) {
392 - StreamPushItem streamPushItem = null;  
393 StreamInfo streamInfoByAppAndStream = mediaService.getStreamInfoByAppAndStream(mediaServerItem, app, streamId, tracks); 390 StreamInfo streamInfoByAppAndStream = mediaService.getStreamInfoByAppAndStream(mediaServerItem, app, streamId, tracks);
394 item.setStreamInfo(streamInfoByAppAndStream); 391 item.setStreamInfo(streamInfoByAppAndStream);
395 392
@@ -455,10 +452,8 @@ public class ZLMHttpHookListener { @@ -455,10 +452,8 @@ public class ZLMHttpHookListener {
455 @ResponseBody 452 @ResponseBody
456 @PostMapping(value = "/on_stream_none_reader", produces = "application/json;charset=UTF-8") 453 @PostMapping(value = "/on_stream_none_reader", produces = "application/json;charset=UTF-8")
457 public ResponseEntity<String> onStreamNoneReader(@RequestBody JSONObject json){ 454 public ResponseEntity<String> onStreamNoneReader(@RequestBody JSONObject json){
458 -  
459 - if (logger.isDebugEnabled()) {  
460 - logger.debug("[ ZLM HOOK ]on_stream_none_reader API调用,参数:" + json.toString());  
461 - } 455 +
  456 + logger.info("[ ZLM HOOK ]on_stream_none_reader API调用,参数:" + json.toString());
462 String mediaServerId = json.getString("mediaServerId"); 457 String mediaServerId = json.getString("mediaServerId");
463 String streamId = json.getString("stream"); 458 String streamId = json.getString("stream");
464 String app = json.getString("app"); 459 String app = json.getString("app");
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaListManager.java
@@ -12,6 +12,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorage; @@ -12,6 +12,7 @@ import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
12 import com.genersoft.iot.vmp.storager.dao.GbStreamMapper; 12 import com.genersoft.iot.vmp.storager.dao.GbStreamMapper;
13 import com.genersoft.iot.vmp.storager.dao.PlatformGbStreamMapper; 13 import com.genersoft.iot.vmp.storager.dao.PlatformGbStreamMapper;
14 import com.genersoft.iot.vmp.storager.dao.StreamPushMapper; 14 import com.genersoft.iot.vmp.storager.dao.StreamPushMapper;
  15 +import com.genersoft.iot.vmp.utils.DateUtil;
15 import org.checkerframework.checker.units.qual.C; 16 import org.checkerframework.checker.units.qual.C;
16 import org.slf4j.Logger; 17 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory; 18 import org.slf4j.LoggerFactory;
@@ -159,7 +160,8 @@ public class ZLMMediaListManager { @@ -159,7 +160,8 @@ public class ZLMMediaListManager {
159 gbStreamMapper.update(transform); 160 gbStreamMapper.update(transform);
160 streamPushMapper.del(gbStreamList.get(0).getApp(), gbStreamList.get(0).getStream()); 161 streamPushMapper.del(gbStreamList.get(0).getApp(), gbStreamList.get(0).getStream());
161 }else { 162 }else {
162 - transform.setCreateStamp(System.currentTimeMillis()); 163 + transform.setCreateTime(DateUtil.getNow());
  164 + transform.setUpdateTime(DateUtil.getNow());
163 gbStreamMapper.add(transform); 165 gbStreamMapper.add(transform);
164 } 166 }
165 if (transform != null) { 167 if (transform != null) {
src/main/java/com/genersoft/iot/vmp/media/zlm/dto/StreamPushItem.java
1 package com.genersoft.iot.vmp.media.zlm.dto; 1 package com.genersoft.iot.vmp.media.zlm.dto;
2 2
3 import com.genersoft.iot.vmp.gb28181.bean.GbStream; 3 import com.genersoft.iot.vmp.gb28181.bean.GbStream;
  4 +import com.genersoft.iot.vmp.utils.DateUtil;
4 import org.jetbrains.annotations.NotNull; 5 import org.jetbrains.annotations.NotNull;
  6 +import org.springframework.util.unit.DataUnit;
5 7
6 import java.util.List; 8 import java.util.List;
7 9
@@ -86,6 +88,21 @@ public class StreamPushItem extends GbStream implements Comparable&lt;StreamPushIte @@ -86,6 +88,21 @@ public class StreamPushItem extends GbStream implements Comparable&lt;StreamPushIte
86 */ 88 */
87 private String serverId; 89 private String serverId;
88 90
  91 + /**
  92 + * 推流时间
  93 + */
  94 + private String pushTime;
  95 +
  96 + /**
  97 + * 更新时间
  98 + */
  99 + private String updateTime;
  100 +
  101 + /**
  102 + * 创建时间
  103 + */
  104 + private String createTime;
  105 +
89 public String getVhost() { 106 public String getVhost() {
90 return vhost; 107 return vhost;
91 } 108 }
@@ -97,7 +114,8 @@ public class StreamPushItem extends GbStream implements Comparable&lt;StreamPushIte @@ -97,7 +114,8 @@ public class StreamPushItem extends GbStream implements Comparable&lt;StreamPushIte
97 114
98 @Override 115 @Override
99 public int compareTo(@NotNull StreamPushItem streamPushItem) { 116 public int compareTo(@NotNull StreamPushItem streamPushItem) {
100 - return Long.valueOf(super.createStamp - streamPushItem.getCreateStamp().intValue()).intValue(); 117 + return Long.valueOf(DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(super.createTime)
  118 + - DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(streamPushItem.getCreateTime())).intValue();
101 } 119 }
102 120
103 public static class MediaSchema { 121 public static class MediaSchema {
@@ -232,5 +250,32 @@ public class StreamPushItem extends GbStream implements Comparable&lt;StreamPushIte @@ -232,5 +250,32 @@ public class StreamPushItem extends GbStream implements Comparable&lt;StreamPushIte
232 public void setServerId(String serverId) { 250 public void setServerId(String serverId) {
233 this.serverId = serverId; 251 this.serverId = serverId;
234 } 252 }
  253 +
  254 +
  255 + public String getPushTime() {
  256 + return pushTime;
  257 + }
  258 +
  259 + public void setPushTime(String pushTime) {
  260 + this.pushTime = pushTime;
  261 + }
  262 +
  263 + public String getUpdateTime() {
  264 + return updateTime;
  265 + }
  266 +
  267 + public void setUpdateTime(String updateTime) {
  268 + this.updateTime = updateTime;
  269 + }
  270 +
  271 + @Override
  272 + public String getCreateTime() {
  273 + return createTime;
  274 + }
  275 +
  276 + @Override
  277 + public void setCreateTime(String createTime) {
  278 + this.createTime = createTime;
  279 + }
235 } 280 }
236 281
src/main/java/com/genersoft/iot/vmp/service/impl/RedisAlarmMsgListener.java
@@ -41,6 +41,7 @@ public class RedisAlarmMsgListener implements MessageListener { @@ -41,6 +41,7 @@ public class RedisAlarmMsgListener implements MessageListener {
41 ParentPlatform platform = storage.queryParentPlatByServerGBId(gbId); 41 ParentPlatform platform = storage.queryParentPlatByServerGBId(gbId);
42 42
43 DeviceAlarm deviceAlarm = new DeviceAlarm(); 43 DeviceAlarm deviceAlarm = new DeviceAlarm();
  44 + deviceAlarm.setCreateTime(DateUtil.getNow());
44 deviceAlarm.setChannelId(gbId); 45 deviceAlarm.setChannelId(gbId);
45 deviceAlarm.setAlarmDescription(alarmChannelMessage.getAlarmDescription()); 46 deviceAlarm.setAlarmDescription(alarmChannelMessage.getAlarmDescription());
46 deviceAlarm.setAlarmMethod("" + alarmChannelMessage.getAlarmSn()); 47 deviceAlarm.setAlarmMethod("" + alarmChannelMessage.getAlarmSn());
src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java
@@ -230,11 +230,12 @@ public class StreamProxyServiceImpl implements IStreamProxyService { @@ -230,11 +230,12 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
230 public boolean start(String app, String stream) { 230 public boolean start(String app, String stream) {
231 boolean result = false; 231 boolean result = false;
232 StreamProxyItem streamProxy = videoManagerStorager.queryStreamProxy(app, stream); 232 StreamProxyItem streamProxy = videoManagerStorager.queryStreamProxy(app, stream);
233 - if (!streamProxy.isEnable() && streamProxy != null) { 233 + if (!streamProxy.isEnable() ) {
234 JSONObject jsonObject = addStreamProxyToZlm(streamProxy); 234 JSONObject jsonObject = addStreamProxyToZlm(streamProxy);
235 if (jsonObject == null) { 235 if (jsonObject == null) {
236 return false; 236 return false;
237 } 237 }
  238 + System.out.println(jsonObject);
238 if (jsonObject.getInteger("code") == 0) { 239 if (jsonObject.getInteger("code") == 0) {
239 result = true; 240 result = true;
240 streamProxy.setEnable(true); 241 streamProxy.setEnable(true);
@@ -250,7 +251,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService { @@ -250,7 +251,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
250 StreamProxyItem streamProxyDto = videoManagerStorager.queryStreamProxy(app, stream); 251 StreamProxyItem streamProxyDto = videoManagerStorager.queryStreamProxy(app, stream);
251 if (streamProxyDto != null && streamProxyDto.isEnable()) { 252 if (streamProxyDto != null && streamProxyDto.isEnable()) {
252 JSONObject jsonObject = removeStreamProxyFromZlm(streamProxyDto); 253 JSONObject jsonObject = removeStreamProxyFromZlm(streamProxyDto);
253 - if (jsonObject.getInteger("code") == 0) { 254 + if (jsonObject != null && jsonObject.getInteger("code") == 0) {
254 streamProxyDto.setEnable(false); 255 streamProxyDto.setEnable(false);
255 result = videoManagerStorager.updateStreamProxy(streamProxyDto); 256 result = videoManagerStorager.updateStreamProxy(streamProxyDto);
256 } 257 }
src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java
@@ -15,6 +15,7 @@ import com.genersoft.iot.vmp.service.IMediaServerService; @@ -15,6 +15,7 @@ import com.genersoft.iot.vmp.service.IMediaServerService;
15 import com.genersoft.iot.vmp.service.IStreamPushService; 15 import com.genersoft.iot.vmp.service.IStreamPushService;
16 import com.genersoft.iot.vmp.storager.IRedisCatchStorage; 16 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
17 import com.genersoft.iot.vmp.storager.dao.*; 17 import com.genersoft.iot.vmp.storager.dao.*;
  18 +import com.genersoft.iot.vmp.utils.DateUtil;
18 import com.github.pagehelper.PageHelper; 19 import com.github.pagehelper.PageHelper;
19 import com.github.pagehelper.PageInfo; 20 import com.github.pagehelper.PageInfo;
20 import org.slf4j.Logger; 21 import org.slf4j.Logger;
@@ -102,7 +103,7 @@ public class StreamPushServiceImpl implements IStreamPushService { @@ -102,7 +103,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
102 streamPushItem.setOriginType(item.getOriginType()); 103 streamPushItem.setOriginType(item.getOriginType());
103 streamPushItem.setOriginTypeStr(item.getOriginTypeStr()); 104 streamPushItem.setOriginTypeStr(item.getOriginTypeStr());
104 streamPushItem.setOriginUrl(item.getOriginUrl()); 105 streamPushItem.setOriginUrl(item.getOriginUrl());
105 - streamPushItem.setCreateStamp(item.getCreateStamp() * 1000); 106 + streamPushItem.setCreateTime(DateUtil.getNow());
106 streamPushItem.setAliveSecond(item.getAliveSecond()); 107 streamPushItem.setAliveSecond(item.getAliveSecond());
107 streamPushItem.setStatus(true); 108 streamPushItem.setStatus(true);
108 streamPushItem.setStreamType("push"); 109 streamPushItem.setStreamType("push");
@@ -127,7 +128,7 @@ public class StreamPushServiceImpl implements IStreamPushService { @@ -127,7 +128,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
127 public boolean saveToGB(GbStream stream) { 128 public boolean saveToGB(GbStream stream) {
128 stream.setStreamType("push"); 129 stream.setStreamType("push");
129 stream.setStatus(true); 130 stream.setStatus(true);
130 - stream.setCreateStamp(System.currentTimeMillis()); 131 + stream.setCreateTime(DateUtil.getNow());
131 int add = gbStreamMapper.add(stream); 132 int add = gbStreamMapper.add(stream);
132 133
133 // 查找开启了全部直播流共享的上级平台 134 // 查找开启了全部直播流共享的上级平台
@@ -317,7 +318,7 @@ public class StreamPushServiceImpl implements IStreamPushService { @@ -317,7 +318,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
317 streamPushItem.setStreamType("push"); 318 streamPushItem.setStreamType("push");
318 streamPushItem.setStatus(true); 319 streamPushItem.setStatus(true);
319 streamPushItem.setGbId("34020000004111" + gbId); 320 streamPushItem.setGbId("34020000004111" + gbId);
320 - streamPushItem.setCreateStamp(System.currentTimeMillis()); 321 + streamPushItem.setCreateTime(DateUtil.getNow());
321 gbId ++; 322 gbId ++;
322 } 323 }
323 int limitCount = 30; 324 int limitCount = 30;
src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushUploadFileHandler.java
@@ -4,6 +4,7 @@ import com.alibaba.excel.context.AnalysisContext; @@ -4,6 +4,7 @@ import com.alibaba.excel.context.AnalysisContext;
4 import com.alibaba.excel.event.AnalysisEventListener; 4 import com.alibaba.excel.event.AnalysisEventListener;
5 import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; 5 import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
6 import com.genersoft.iot.vmp.service.IStreamPushService; 6 import com.genersoft.iot.vmp.service.IStreamPushService;
  7 +import com.genersoft.iot.vmp.utils.DateUtil;
7 import com.genersoft.iot.vmp.vmanager.bean.StreamPushExcelDto; 8 import com.genersoft.iot.vmp.vmanager.bean.StreamPushExcelDto;
8 import com.google.common.collect.BiMap; 9 import com.google.common.collect.BiMap;
9 import com.google.common.collect.HashBiMap; 10 import com.google.common.collect.HashBiMap;
@@ -94,7 +95,7 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener&lt;StreamPus @@ -94,7 +95,7 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener&lt;StreamPus
94 streamPushItem.setGbId(streamPushExcelDto.getGbId()); 95 streamPushItem.setGbId(streamPushExcelDto.getGbId());
95 streamPushItem.setStatus(false); 96 streamPushItem.setStatus(false);
96 streamPushItem.setStreamType("push"); 97 streamPushItem.setStreamType("push");
97 - streamPushItem.setCreateStamp(System.currentTimeMillis()); 98 + streamPushItem.setCreateTime(DateUtil.getNow());
98 streamPushItem.setMediaServerId(defaultMediaServerId); 99 streamPushItem.setMediaServerId(defaultMediaServerId);
99 streamPushItem.setName(streamPushExcelDto.getName()); 100 streamPushItem.setName(streamPushExcelDto.getName());
100 streamPushItem.setOriginType(2); 101 streamPushItem.setOriginType(2);
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceAlarmMapper.java
@@ -15,8 +15,8 @@ import java.util.List; @@ -15,8 +15,8 @@ import java.util.List;
15 @Repository 15 @Repository
16 public interface DeviceAlarmMapper { 16 public interface DeviceAlarmMapper {
17 17
18 - @Insert("INSERT INTO device_alarm (deviceId, channelId, alarmPriority, alarmMethod, alarmTime, alarmDescription, longitude, latitude, alarmType ) " +  
19 - "VALUES ('${deviceId}', '${channelId}', '${alarmPriority}', '${alarmMethod}', '${alarmTime}', '${alarmDescription}', ${longitude}, ${latitude}, '${alarmType}')") 18 + @Insert("INSERT INTO device_alarm (deviceId, channelId, alarmPriority, alarmMethod, alarmTime, alarmDescription, longitude, latitude, alarmType , createTime ) " +
  19 + "VALUES ('${deviceId}', '${channelId}', '${alarmPriority}', '${alarmMethod}', '${alarmTime}', '${alarmDescription}', ${longitude}, ${latitude}, '${alarmType}', '${createTime}')")
20 int add(DeviceAlarm alarm); 20 int add(DeviceAlarm alarm);
21 21
22 22
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
@@ -19,11 +19,11 @@ public interface DeviceChannelMapper { @@ -19,11 +19,11 @@ public interface DeviceChannelMapper {
19 @Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " + 19 @Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " +
20 "address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " + 20 "address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " +
21 "ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " + 21 "ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " +
22 - "longitudeWgs84, latitudeWgs84, createTime, updateTime, businessGroupId) " + 22 + "longitudeWgs84, latitudeWgs84, createTime, updateTime, businessGroupId, gpsTime) " +
23 "VALUES ('${channelId}', '${deviceId}', '${name}', '${manufacture}', '${model}', '${owner}', '${civilCode}', '${block}'," + 23 "VALUES ('${channelId}', '${deviceId}', '${name}', '${manufacture}', '${model}', '${owner}', '${civilCode}', '${block}'," +
24 "'${address}', ${parental}, '${parentId}', ${safetyWay}, ${registerWay}, '${certNum}', ${certifiable}, ${errCode}, '${secrecy}', " + 24 "'${address}', ${parental}, '${parentId}', ${safetyWay}, ${registerWay}, '${certNum}', ${certifiable}, ${errCode}, '${secrecy}', " +
25 "'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status}, '${streamId}', ${longitude}, ${latitude}, ${longitudeGcj02}, " + 25 "'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status}, '${streamId}', ${longitude}, ${latitude}, ${longitudeGcj02}, " +
26 - "${latitudeGcj02}, ${longitudeWgs84}, ${latitudeWgs84},'${createTime}', '${updateTime}', '${businessGroupId}')") 26 + "${latitudeGcj02}, ${longitudeWgs84}, ${latitudeWgs84},'${createTime}', '${updateTime}', '${businessGroupId}', '${gpsTime}')")
27 int add(DeviceChannel channel); 27 int add(DeviceChannel channel);
28 28
29 @Update(value = {" <script>" + 29 @Update(value = {" <script>" +
@@ -58,6 +58,7 @@ public interface DeviceChannelMapper { @@ -58,6 +58,7 @@ public interface DeviceChannelMapper {
58 "<if test='longitudeWgs84 != null'>, longitudeWgs84=${longitudeWgs84}</if>" + 58 "<if test='longitudeWgs84 != null'>, longitudeWgs84=${longitudeWgs84}</if>" +
59 "<if test='latitudeWgs84 != null'>, latitudeWgs84=${latitudeWgs84}</if>" + 59 "<if test='latitudeWgs84 != null'>, latitudeWgs84=${latitudeWgs84}</if>" +
60 "<if test='businessGroupId != null'>, businessGroupId=#{businessGroupId}</if>" + 60 "<if test='businessGroupId != null'>, businessGroupId=#{businessGroupId}</if>" +
  61 + "<if test='gpsTime != null'>, gpsTime=#{gpsTime}</if>" +
61 "WHERE deviceId='${deviceId}' AND channelId='${channelId}'"+ 62 "WHERE deviceId='${deviceId}' AND channelId='${channelId}'"+
62 " </script>"}) 63 " </script>"})
63 int update(DeviceChannel channel); 64 int update(DeviceChannel channel);
@@ -147,7 +148,7 @@ public interface DeviceChannelMapper { @@ -147,7 +148,7 @@ public interface DeviceChannelMapper {
147 "(channelId, deviceId, name, manufacture, model, owner, civilCode, block, subCount, " + 148 "(channelId, deviceId, name, manufacture, model, owner, civilCode, block, subCount, " +
148 " address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " + 149 " address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " +
149 " ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " + 150 " ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " +
150 - " longitudeWgs84, latitudeWgs84, createTime, updateTime, businessGroupId) " + 151 + " longitudeWgs84, latitudeWgs84, createTime, updateTime, businessGroupId, gpsTime) " +
151 "values " + 152 "values " +
152 "<foreach collection='addChannels' index='index' item='item' separator=','> " + 153 "<foreach collection='addChannels' index='index' item='item' separator=','> " +
153 "('${item.channelId}', '${item.deviceId}', '${item.name}', '${item.manufacture}', '${item.model}', " + 154 "('${item.channelId}', '${item.deviceId}', '${item.name}', '${item.manufacture}', '${item.model}', " +
@@ -157,7 +158,7 @@ public interface DeviceChannelMapper { @@ -157,7 +158,7 @@ public interface DeviceChannelMapper {
157 "'${item.ipAddress}', ${item.port}, '${item.password}', ${item.PTZType}, ${item.status}, " + 158 "'${item.ipAddress}', ${item.port}, '${item.password}', ${item.PTZType}, ${item.status}, " +
158 "'${item.streamId}', ${item.longitude}, ${item.latitude},${item.longitudeGcj02}, " + 159 "'${item.streamId}', ${item.longitude}, ${item.latitude},${item.longitudeGcj02}, " +
159 "${item.latitudeGcj02},${item.longitudeWgs84}, ${item.latitudeWgs84},'${item.createTime}', '${item.updateTime}', " + 160 "${item.latitudeGcj02},${item.longitudeWgs84}, ${item.latitudeWgs84},'${item.createTime}', '${item.updateTime}', " +
160 - "'${item.businessGroupId}') " + 161 + "'${item.businessGroupId}', '${item.gpsTime}') " +
161 "</foreach> " + 162 "</foreach> " +
162 "ON DUPLICATE KEY UPDATE " + 163 "ON DUPLICATE KEY UPDATE " +
163 "updateTime=VALUES(updateTime), " + 164 "updateTime=VALUES(updateTime), " +
@@ -189,7 +190,8 @@ public interface DeviceChannelMapper { @@ -189,7 +190,8 @@ public interface DeviceChannelMapper {
189 "latitudeGcj02=VALUES(latitudeGcj02), " + 190 "latitudeGcj02=VALUES(latitudeGcj02), " +
190 "longitudeWgs84=VALUES(longitudeWgs84), " + 191 "longitudeWgs84=VALUES(longitudeWgs84), " +
191 "latitudeWgs84=VALUES(latitudeWgs84), " + 192 "latitudeWgs84=VALUES(latitudeWgs84), " +
192 - "businessGroupId=VALUES(businessGroupId) " + 193 + "businessGroupId=VALUES(businessGroupId), " +
  194 + "gpsTime=VALUES(gpsTime)" +
193 "</script>") 195 "</script>")
194 int batchAdd(List<DeviceChannel> addChannels); 196 int batchAdd(List<DeviceChannel> addChannels);
195 197
@@ -228,6 +230,7 @@ public interface DeviceChannelMapper { @@ -228,6 +230,7 @@ public interface DeviceChannelMapper {
228 "<if test='item.longitudeWgs84 != null'>, longitudeWgs84=${item.longitudeWgs84}</if>" + 230 "<if test='item.longitudeWgs84 != null'>, longitudeWgs84=${item.longitudeWgs84}</if>" +
229 "<if test='item.latitudeWgs84 != null'>, latitudeWgs84=${item.latitudeWgs84}</if>" + 231 "<if test='item.latitudeWgs84 != null'>, latitudeWgs84=${item.latitudeWgs84}</if>" +
230 "<if test='item.businessGroupId != null'>, businessGroupId=#{item.businessGroupId}</if>" + 232 "<if test='item.businessGroupId != null'>, businessGroupId=#{item.businessGroupId}</if>" +
  233 + "<if test='item.gpsTime != null'>, gpsTime=#{item.gpsTime}</if>" +
231 "WHERE deviceId='${item.deviceId}' AND channelId='${item.channelId}'"+ 234 "WHERE deviceId='${item.deviceId}' AND channelId='${item.channelId}'"+
232 "</foreach>" + 235 "</foreach>" +
233 "</script>"}) 236 "</script>"})
@@ -281,10 +284,11 @@ public interface DeviceChannelMapper { @@ -281,10 +284,11 @@ public interface DeviceChannelMapper {
281 "SET " + 284 "SET " +
282 "latitude=${latitude}, " + 285 "latitude=${latitude}, " +
283 "longitude=${longitude}, " + 286 "longitude=${longitude}, " +
284 - "longitudeGcj02=${longitudeGcj02}," +  
285 - "latitudeGcj02=${latitudeGcj02}," +  
286 - "longitudeWgs84=${longitudeWgs84}," +  
287 - "latitudeWgs84=${latitudeWgs84} " + 287 + "longitudeGcj02=${longitudeGcj02}, " +
  288 + "latitudeGcj02=${latitudeGcj02}, " +
  289 + "longitudeWgs84=${longitudeWgs84}, " +
  290 + "latitudeWgs84=${latitudeWgs84}, " +
  291 + "gpsTime='${gpsTime}' " +
288 "WHERE deviceId=#{deviceId} " + 292 "WHERE deviceId=#{deviceId} " +
289 " <if test='channelId != null' > AND channelId=#{channelId}</if>" + 293 " <if test='channelId != null' > AND channelId=#{channelId}</if>" +
290 " </script>"}) 294 " </script>"})
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMobilePositionMapper.java
@@ -8,8 +8,8 @@ import org.apache.ibatis.annotations.*; @@ -8,8 +8,8 @@ import org.apache.ibatis.annotations.*;
8 @Mapper 8 @Mapper
9 public interface DeviceMobilePositionMapper { 9 public interface DeviceMobilePositionMapper {
10 10
11 - @Insert("INSERT INTO device_mobile_position (deviceId,channelId, deviceName, time, longitude, latitude, altitude, speed, direction, reportSource, longitudeGcj02, latitudeGcj02, longitudeWgs84, latitudeWgs84) " +  
12 - "VALUES ('${deviceId}','${channelId}', '${deviceName}', '${time}', ${longitude}, ${latitude}, ${altitude}, ${speed}, ${direction}, '${reportSource}', ${longitudeGcj02}, ${latitudeGcj02}, ${longitudeWgs84}, ${latitudeWgs84})") 11 + @Insert("INSERT INTO device_mobile_position (deviceId,channelId, deviceName, time, longitude, latitude, altitude, speed, direction, reportSource, longitudeGcj02, latitudeGcj02, longitudeWgs84, latitudeWgs84, createTime) " +
  12 + "VALUES ('${deviceId}','${channelId}', '${deviceName}', '${time}', ${longitude}, ${latitude}, ${altitude}, ${speed}, ${direction}, '${reportSource}', ${longitudeGcj02}, ${latitudeGcj02}, ${longitudeWgs84}, ${latitudeWgs84}, '${createTime}')")
13 int insertNewPosition(MobilePosition mobilePosition); 13 int insertNewPosition(MobilePosition mobilePosition);
14 14
15 @Select(value = {" <script>" + 15 @Select(value = {" <script>" +
src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java
@@ -15,10 +15,10 @@ import java.util.List; @@ -15,10 +15,10 @@ import java.util.List;
15 public interface GbStreamMapper { 15 public interface GbStreamMapper {
16 16
17 @Insert("REPLACE INTO gb_stream (app, stream, gbId, name, " + 17 @Insert("REPLACE INTO gb_stream (app, stream, gbId, name, " +
18 - "longitude, latitude, streamType, mediaServerId, status, createStamp) VALUES" + 18 + "longitude, latitude, streamType, mediaServerId, status, createTime) VALUES" +
19 "('${app}', '${stream}', '${gbId}', '${name}', " + 19 "('${app}', '${stream}', '${gbId}', '${name}', " +
20 "'${longitude}', '${latitude}', '${streamType}', " + 20 "'${longitude}', '${latitude}', '${streamType}', " +
21 - "'${mediaServerId}', ${status}, ${createStamp})") 21 + "'${mediaServerId}', ${status}, '${createTime}')")
22 @Options(useGeneratedKeys = true, keyProperty = "gbStreamId", keyColumn = "gbStreamId") 22 @Options(useGeneratedKeys = true, keyProperty = "gbStreamId", keyColumn = "gbStreamId")
23 int add(GbStream gbStream); 23 int add(GbStream gbStream);
24 24
@@ -120,12 +120,12 @@ public interface GbStreamMapper { @@ -120,12 +120,12 @@ public interface GbStreamMapper {
120 @Insert("<script> " + 120 @Insert("<script> " +
121 "INSERT IGNORE into gb_stream " + 121 "INSERT IGNORE into gb_stream " +
122 "(app, stream, gbId, name, " + 122 "(app, stream, gbId, name, " +
123 - "longitude, latitude, streamType, mediaServerId, status, createStamp)" + 123 + "longitude, latitude, streamType, mediaServerId, status, createTime)" +
124 "values " + 124 "values " +
125 "<foreach collection='subList' index='index' item='item' separator=','> " + 125 "<foreach collection='subList' index='index' item='item' separator=','> " +
126 "('${item.app}', '${item.stream}', '${item.gbId}', '${item.name}', " + 126 "('${item.app}', '${item.stream}', '${item.gbId}', '${item.name}', " +
127 "'${item.longitude}', '${item.latitude}', '${item.streamType}', " + 127 "'${item.longitude}', '${item.latitude}', '${item.streamType}', " +
128 - "'${item.mediaServerId}', ${item.status}, ${item.createStamp}) "+ 128 + "'${item.mediaServerId}', ${item.status}, '${item.createTime}') "+
129 "</foreach> " + 129 "</foreach> " +
130 "</script>") 130 "</script>")
131 @Options(useGeneratedKeys = true, keyProperty = "gbStreamId", keyColumn = "gbStreamId") 131 @Options(useGeneratedKeys = true, keyProperty = "gbStreamId", keyColumn = "gbStreamId")
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, startOfflinePush, catalogId, administrativeDivision, catalogGroup) " + 19 + " status, shareAllLiveStream, startOfflinePush, catalogId, administrativeDivision, catalogGroup, createTime, updateTime) " +
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}, ${startOfflinePush}, #{catalogId}, #{administrativeDivision}, #{catalogGroup})") 22 + " ${status}, ${shareAllLiveStream}, ${startOfflinePush}, #{catalogId}, #{administrativeDivision}, #{catalogGroup}, #{createTime}, #{updateTime})")
23 int addParentPlatform(ParentPlatform parentPlatform); 23 int addParentPlatform(ParentPlatform parentPlatform);
24 24
25 @Update("UPDATE parent_platform " + 25 @Update("UPDATE parent_platform " +
@@ -45,6 +45,8 @@ public interface ParentPlatformMapper { @@ -45,6 +45,8 @@ public interface ParentPlatformMapper {
45 "startOfflinePush=${startOfflinePush}, " + 45 "startOfflinePush=${startOfflinePush}, " +
46 "catalogGroup=#{catalogGroup}, " + 46 "catalogGroup=#{catalogGroup}, " +
47 "administrativeDivision=#{administrativeDivision}, " + 47 "administrativeDivision=#{administrativeDivision}, " +
  48 + "createTime=#{createTime}, " +
  49 + "updateTime=#{updateTime}, " +
48 "catalogId=#{catalogId} " + 50 "catalogId=#{catalogId} " +
49 "WHERE id=#{id}") 51 "WHERE id=#{id}")
50 int updateParentPlatform(ParentPlatform parentPlatform); 52 int updateParentPlatform(ParentPlatform parentPlatform);
@@ -86,10 +88,10 @@ public interface ParentPlatformMapper { @@ -86,10 +88,10 @@ public interface ParentPlatformMapper {
86 88
87 @Update(value = {" <script>" + 89 @Update(value = {" <script>" +
88 "UPDATE parent_platform " + 90 "UPDATE parent_platform " +
89 - "SET catalogId=#{catalogId}" + 91 + "SET catalogId=#{catalogId}, updateTime=#{updateTime}" +
90 "WHERE serverGBId=#{platformId}"+ 92 "WHERE serverGBId=#{platformId}"+
91 "</script>"}) 93 "</script>"})
92 - int setDefaultCatalog(String platformId, String catalogId); 94 + int setDefaultCatalog(String platformId, String catalogId, String updateTime);
93 95
94 @Select("select 'channel' as name, count(pgc.platformId) count from platform_gb_channel pgc left join device_channel dc on dc.id = pgc.deviceChannelId where pgc.platformId=#{platformId} and dc.channelId =#{gbId} " + 96 @Select("select 'channel' as name, count(pgc.platformId) count from platform_gb_channel pgc left join device_channel dc on dc.id = pgc.deviceChannelId where pgc.platformId=#{platformId} and dc.channelId =#{gbId} " +
95 "union " + 97 "union " +
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
@@ -714,7 +714,6 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { @@ -714,7 +714,6 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
714 streamProxyItem.setStatus(true); 714 streamProxyItem.setStatus(true);
715 String now = DateUtil.getNow(); 715 String now = DateUtil.getNow();
716 streamProxyItem.setCreateTime(now); 716 streamProxyItem.setCreateTime(now);
717 - streamProxyItem.setCreateStamp(System.currentTimeMillis());  
718 try { 717 try {
719 if (streamProxyMapper.add(streamProxyItem) > 0) { 718 if (streamProxyMapper.add(streamProxyItem) > 0) {
720 if (!StringUtils.isEmpty(streamProxyItem.getGbId())) { 719 if (!StringUtils.isEmpty(streamProxyItem.getGbId())) {
@@ -1009,7 +1008,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { @@ -1009,7 +1008,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
1009 1008
1010 @Override 1009 @Override
1011 public int setDefaultCatalog(String platformId, String catalogId) { 1010 public int setDefaultCatalog(String platformId, String catalogId) {
1012 - return platformMapper.setDefaultCatalog(platformId, catalogId); 1011 + return platformMapper.setDefaultCatalog(platformId, catalogId, DateUtil.getNow());
1013 } 1012 }
1014 1013
1015 @Override 1014 @Override
@@ -1126,6 +1125,10 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { @@ -1126,6 +1125,10 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
1126 if (deviceChannel.getChannelId().equals(deviceChannel.getDeviceId())) { 1125 if (deviceChannel.getChannelId().equals(deviceChannel.getDeviceId())) {
1127 deviceChannel.setChannelId(null); 1126 deviceChannel.setChannelId(null);
1128 } 1127 }
  1128 + if (deviceChannel.getGpsTime() == null) {
  1129 + deviceChannel.setGpsTime(DateUtil.getNow());
  1130 + }
  1131 +
1129 deviceChannelMapper.updatePosition(deviceChannel); 1132 deviceChannelMapper.updatePosition(deviceChannel);
1130 } 1133 }
1131 } 1134 }
src/main/java/com/genersoft/iot/vmp/utils/SystemInfoUtils.java
@@ -8,7 +8,6 @@ import oshi.hardware.NetworkIF; @@ -8,7 +8,6 @@ import oshi.hardware.NetworkIF;
8 import oshi.software.os.OperatingSystem; 8 import oshi.software.os.OperatingSystem;
9 import oshi.util.FormatUtil; 9 import oshi.util.FormatUtil;
10 10
11 -import java.text.DecimalFormat;  
12 import java.util.HashMap; 11 import java.util.HashMap;
13 import java.util.List; 12 import java.util.List;
14 import java.util.Map; 13 import java.util.Map;
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/platform/PlatformController.java
@@ -11,6 +11,7 @@ import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder; @@ -11,6 +11,7 @@ import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder;
11 import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; 11 import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
12 import com.genersoft.iot.vmp.storager.IRedisCatchStorage; 12 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
13 import com.genersoft.iot.vmp.storager.IVideoManagerStorage; 13 import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
  14 +import com.genersoft.iot.vmp.utils.DateUtil;
14 import com.genersoft.iot.vmp.vmanager.bean.WVPResult; 15 import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
15 import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce; 16 import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
16 import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.UpdateChannelParam; 17 import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.UpdateChannelParam;
@@ -169,6 +170,8 @@ public class PlatformController { @@ -169,6 +170,8 @@ public class PlatformController {
169 wvpResult.setMsg("平台 " + parentPlatform.getServerGBId() + " 已存在"); 170 wvpResult.setMsg("平台 " + parentPlatform.getServerGBId() + " 已存在");
170 return new ResponseEntity<>(wvpResult, HttpStatus.OK); 171 return new ResponseEntity<>(wvpResult, HttpStatus.OK);
171 } 172 }
  173 + parentPlatform.setCreateTime(DateUtil.getNow());
  174 + parentPlatform.setUpdateTime(DateUtil.getNow());
172 boolean updateResult = storager.updateParentPlatform(parentPlatform); 175 boolean updateResult = storager.updateParentPlatform(parentPlatform);
173 176
174 if (updateResult) { 177 if (updateResult) {
@@ -232,7 +235,7 @@ public class PlatformController { @@ -232,7 +235,7 @@ public class PlatformController {
232 } 235 }
233 parentPlatform.setCharacterSet(parentPlatform.getCharacterSet().toUpperCase()); 236 parentPlatform.setCharacterSet(parentPlatform.getCharacterSet().toUpperCase());
234 ParentPlatform parentPlatformOld = storager.queryParentPlatByServerGBId(parentPlatform.getServerGBId()); 237 ParentPlatform parentPlatformOld = storager.queryParentPlatByServerGBId(parentPlatform.getServerGBId());
235 - 238 + parentPlatform.setUpdateTime(DateUtil.getNow());
236 boolean updateResult = storager.updateParentPlatform(parentPlatform); 239 boolean updateResult = storager.updateParentPlatform(parentPlatform);
237 240
238 if (updateResult) { 241 if (updateResult) {
src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java
@@ -131,6 +131,9 @@ public class StreamProxyController { @@ -131,6 +131,9 @@ public class StreamProxyController {
131 public Object start(String app, String stream){ 131 public Object start(String app, String stream){
132 logger.info("启用代理: " + app + "/" + stream); 132 logger.info("启用代理: " + app + "/" + stream);
133 boolean result = streamProxyService.start(app, stream); 133 boolean result = streamProxyService.start(app, stream);
  134 + if (!result) {
  135 + logger.info("启用代理失败: " + app + "/" + stream);
  136 + }
134 return result?"success":"fail"; 137 return result?"success":"fail";
135 } 138 }
136 139
web_src/src/components/StreamProxyList.vue
@@ -87,7 +87,7 @@ @@ -87,7 +87,7 @@
87 <el-divider direction="vertical"></el-divider> 87 <el-divider direction="vertical"></el-divider>
88 <el-button size="medium" icon="el-icon-switch-button" type="text" v-if="scope.row.enable" @click="stop(scope.row)">停用</el-button> 88 <el-button size="medium" icon="el-icon-switch-button" type="text" v-if="scope.row.enable" @click="stop(scope.row)">停用</el-button>
89 <el-divider direction="vertical"></el-divider> 89 <el-divider direction="vertical"></el-divider>
90 - <el-button size="medium" icon="el-icon-check" type="text" :loading="startBtnLaoding" v-if="!scope.row.enable" @click="start(scope.row)">启用</el-button> 90 + <el-button size="medium" icon="el-icon-check" type="text" :loading="scope.row.startBtnLoading" v-if="!scope.row.enable" @click="start(scope.row)">启用</el-button>
91 <el-divider v-if="!scope.row.enable" direction="vertical"></el-divider> 91 <el-divider v-if="!scope.row.enable" direction="vertical"></el-divider>
92 <el-button size="medium" icon="el-icon-delete" type="text" style="color: #f56c6c" @click="deleteStreamProxy(scope.row)">删除</el-button> 92 <el-button size="medium" icon="el-icon-delete" type="text" style="color: #f56c6c" @click="deleteStreamProxy(scope.row)">删除</el-button>
93 </template> 93 </template>
@@ -132,7 +132,7 @@ @@ -132,7 +132,7 @@
132 count:15, 132 count:15,
133 total:0, 133 total:0,
134 getListLoading: false, 134 getListLoading: false,
135 - startBtnLaoding: false 135 + startBtnLoading: false
136 }; 136 };
137 }, 137 },
138 computed: { 138 computed: {
@@ -169,7 +169,10 @@ @@ -169,7 +169,10 @@
169 } 169 }
170 }).then(function (res) { 170 }).then(function (res) {
171 that.total = res.data.total; 171 that.total = res.data.total;
172 - that.streamProxyList = res.data.list; 172 + for (let i = 0; i < res.data.list.length; i++) {
  173 + res.data.list[i]["startBtnLoading"] = false;
  174 + }
  175 + that.streamProxyList = res.data.list;
173 that.getListLoading = false; 176 that.getListLoading = false;
174 }).catch(function (error) { 177 }).catch(function (error) {
175 console.log(error); 178 console.log(error);
@@ -263,7 +266,7 @@ @@ -263,7 +266,7 @@
263 start: function(row){ 266 start: function(row){
264 let that = this; 267 let that = this;
265 this.getListLoading = true; 268 this.getListLoading = true;
266 - this.startBtnLaoding = true; 269 + this.$set(row, 'startBtnLoading', true)
267 this.$axios({ 270 this.$axios({
268 method: 'get', 271 method: 'get',
269 url:`/api/proxy/start`, 272 url:`/api/proxy/start`,
@@ -273,7 +276,7 @@ @@ -273,7 +276,7 @@
273 } 276 }
274 }).then(function (res) { 277 }).then(function (res) {
275 that.getListLoading = false; 278 that.getListLoading = false;
276 - that.startBtnLaoding = false; 279 + that.$set(row, 'startBtnLoading', false)
277 if (res.data == "success"){ 280 if (res.data == "success"){
278 that.initData() 281 that.initData()
279 }else { 282 }else {
@@ -287,7 +290,7 @@ @@ -287,7 +290,7 @@
287 }).catch(function (error) { 290 }).catch(function (error) {
288 console.log(error); 291 console.log(error);
289 that.getListLoading = false; 292 that.getListLoading = false;
290 - that.startBtnLaoding = false; 293 + that.$set(row, 'startBtnLoading', false)
291 }); 294 });
292 }, 295 },
293 stop: function(row){ 296 stop: function(row){