Commit 943f95ba8ce02f8088f2dfcfd83a60391a8a65a6
1 parent
ec90519c
增加消息通道配置,可以通道redis在wvp上下级之间发送消息
Showing
18 changed files
with
151 additions
and
25 deletions
sql/2.6.6-2.6.7更新.sql
0 → 100755
src/main/resources/db/migration/V2.6.7_20230201__初始化.sql renamed to sql/初始化.sql
| ... | ... | @@ -47,6 +47,7 @@ CREATE TABLE `device` ( |
| 47 | 47 | `mobilePositionSubmissionInterval` int DEFAULT '5', |
| 48 | 48 | `subscribeCycleForAlarm` int DEFAULT NULL, |
| 49 | 49 | `ssrcCheck` int DEFAULT '0', |
| 50 | + `asMessageChannel` int DEFAULT '0', | |
| 50 | 51 | `geoCoordSys` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, |
| 51 | 52 | `treeType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, |
| 52 | 53 | `custom_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, |
| ... | ... | @@ -329,6 +330,7 @@ CREATE TABLE `parent_platform` ( |
| 329 | 330 | `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, |
| 330 | 331 | `ptz` int DEFAULT NULL, |
| 331 | 332 | `rtcp` int DEFAULT NULL, |
| 333 | + `asMessageChannel` int DEFAULT '0', | |
| 332 | 334 | `status` bit(1) DEFAULT NULL, |
| 333 | 335 | `startOfflinePush` int DEFAULT '0', |
| 334 | 336 | `administrativeDivision` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ... | ... |
src/main/java/com/genersoft/iot/vmp/conf/UserSetting.java
| ... | ... | @@ -48,6 +48,7 @@ public class UserSetting { |
| 48 | 48 | private Boolean syncChannelOnDeviceOnline = Boolean.FALSE; |
| 49 | 49 | |
| 50 | 50 | private Boolean sipLog = Boolean.FALSE; |
| 51 | + private Boolean sendToPlatformsWhenIdLost = Boolean.FALSE; | |
| 51 | 52 | |
| 52 | 53 | private String serverId = "000000"; |
| 53 | 54 | |
| ... | ... | @@ -218,4 +219,12 @@ public class UserSetting { |
| 218 | 219 | public void setSipLog(Boolean sipLog) { |
| 219 | 220 | this.sipLog = sipLog; |
| 220 | 221 | } |
| 222 | + | |
| 223 | + public Boolean getSendToPlatformsWhenIdLost() { | |
| 224 | + return sendToPlatformsWhenIdLost; | |
| 225 | + } | |
| 226 | + | |
| 227 | + public void setSendToPlatformsWhenIdLost(Boolean sendToPlatformsWhenIdLost) { | |
| 228 | + this.sendToPlatformsWhenIdLost = sendToPlatformsWhenIdLost; | |
| 229 | + } | |
| 221 | 230 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/bean/Device.java
| ... | ... | @@ -188,6 +188,9 @@ public class Device { |
| 188 | 188 | @Schema(description = "SIP交互IP(设备访问平台的IP)") |
| 189 | 189 | private String localIp; |
| 190 | 190 | |
| 191 | + @Schema(description = "是否作为消息通道") | |
| 192 | + private boolean asMessageChannel; | |
| 193 | + | |
| 191 | 194 | |
| 192 | 195 | public String getDeviceId() { |
| 193 | 196 | return deviceId; |
| ... | ... | @@ -428,4 +431,12 @@ public class Device { |
| 428 | 431 | public void setKeepaliveIntervalTime(int keepaliveIntervalTime) { |
| 429 | 432 | this.keepaliveIntervalTime = keepaliveIntervalTime; |
| 430 | 433 | } |
| 434 | + | |
| 435 | + public boolean isAsMessageChannel() { | |
| 436 | + return asMessageChannel; | |
| 437 | + } | |
| 438 | + | |
| 439 | + public void setAsMessageChannel(boolean asMessageChannel) { | |
| 440 | + this.asMessageChannel = asMessageChannel; | |
| 441 | + } | |
| 431 | 442 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java
| ... | ... | @@ -189,6 +189,9 @@ public class ParentPlatform { |
| 189 | 189 | @Schema(description = "树类型 国标规定了两种树的展现方式 行政区划 CivilCode 和业务分组:BusinessGrou") |
| 190 | 190 | private String treeType; |
| 191 | 191 | |
| 192 | + @Schema(description = "是否作为消息通道") | |
| 193 | + private boolean asMessageChannel; | |
| 194 | + | |
| 192 | 195 | public Integer getId() { |
| 193 | 196 | return id; |
| 194 | 197 | } |
| ... | ... | @@ -428,4 +431,12 @@ public class ParentPlatform { |
| 428 | 431 | public void setTreeType(String treeType) { |
| 429 | 432 | this.treeType = treeType; |
| 430 | 433 | } |
| 434 | + | |
| 435 | + public boolean isAsMessageChannel() { | |
| 436 | + return asMessageChannel; | |
| 437 | + } | |
| 438 | + | |
| 439 | + public void setAsMessageChannel(boolean asMessageChannel) { | |
| 440 | + this.asMessageChannel = asMessageChannel; | |
| 441 | + } | |
| 431 | 442 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/bean/RecordInfo.java
| 1 | 1 | package com.genersoft.iot.vmp.gb28181.bean; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | + | |
| 4 | 6 | import java.time.Instant; |
| 5 | 7 | import java.util.List; |
| 6 | 8 | |
| ... | ... | @@ -9,22 +11,29 @@ import java.util.List; |
| 9 | 11 | * @author: swwheihei |
| 10 | 12 | * @date: 2020年5月8日 下午2:05:56 |
| 11 | 13 | */ |
| 14 | +@Schema(description = "设备录像查询结果信息") | |
| 12 | 15 | public class RecordInfo { |
| 13 | 16 | |
| 17 | + @Schema(description = "设备编号") | |
| 14 | 18 | private String deviceId; |
| 15 | 19 | |
| 20 | + @Schema(description = "通道编号") | |
| 16 | 21 | private String channelId; |
| 17 | 22 | |
| 23 | + @Schema(description = "命令序列号") | |
| 18 | 24 | private String sn; |
| 19 | 25 | |
| 26 | + @Schema(description = "设备名称") | |
| 20 | 27 | private String name; |
| 21 | - | |
| 28 | + | |
| 29 | + @Schema(description = "列表总数") | |
| 22 | 30 | private int sumNum; |
| 23 | 31 | |
| 24 | 32 | private int count; |
| 25 | 33 | |
| 26 | 34 | private Instant lastTime; |
| 27 | - | |
| 35 | + | |
| 36 | + @Schema(description = "") | |
| 28 | 37 | private List<RecordItem> recordList; |
| 29 | 38 | |
| 30 | 39 | public String getDeviceId() { | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/bean/RecordItem.java
| ... | ... | @@ -2,9 +2,9 @@ package com.genersoft.iot.vmp.gb28181.bean; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | import com.genersoft.iot.vmp.utils.DateUtil; |
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | 6 | import org.jetbrains.annotations.NotNull; |
| 6 | 7 | |
| 7 | -import java.text.ParseException; | |
| 8 | 8 | import java.time.Instant; |
| 9 | 9 | import java.time.temporal.TemporalAccessor; |
| 10 | 10 | |
| ... | ... | @@ -13,26 +13,37 @@ import java.time.temporal.TemporalAccessor; |
| 13 | 13 | * @author: swwheihei |
| 14 | 14 | * @date: 2020年5月8日 下午2:06:54 |
| 15 | 15 | */ |
| 16 | +@Schema(description = "设备录像详情") | |
| 16 | 17 | public class RecordItem implements Comparable<RecordItem>{ |
| 17 | 18 | |
| 19 | + @Schema(description = "设备编号") | |
| 18 | 20 | private String deviceId; |
| 19 | - | |
| 21 | + | |
| 22 | + @Schema(description = "名称") | |
| 20 | 23 | private String name; |
| 21 | - | |
| 24 | + | |
| 25 | + @Schema(description = "文件路径名 (可选)") | |
| 22 | 26 | private String filePath; |
| 23 | 27 | |
| 28 | + @Schema(description = "录像文件大小,单位:Byte(可选)") | |
| 24 | 29 | private String fileSize; |
| 25 | 30 | |
| 31 | + @Schema(description = "录像地址(可选)") | |
| 26 | 32 | private String address; |
| 27 | - | |
| 33 | + | |
| 34 | + @Schema(description = "录像开始时间(可选)") | |
| 28 | 35 | private String startTime; |
| 29 | - | |
| 36 | + | |
| 37 | + @Schema(description = "录像结束时间(可选)") | |
| 30 | 38 | private String endTime; |
| 31 | - | |
| 39 | + | |
| 40 | + @Schema(description = "保密属性(必选)缺省为0;0:不涉密,1:涉密") | |
| 32 | 41 | private int secrecy; |
| 33 | - | |
| 42 | + | |
| 43 | + @Schema(description = "录像产生类型(可选)time或alarm 或 manua") | |
| 34 | 44 | private String type; |
| 35 | - | |
| 45 | + | |
| 46 | + @Schema(description = "录像触发者ID(可选)") | |
| 36 | 47 | private String recorderId; |
| 37 | 48 | |
| 38 | 49 | public String getDeviceId() { | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
| ... | ... | @@ -1376,7 +1376,7 @@ public class SIPCommander implements ISIPCommander { |
| 1376 | 1376 | if (device == null) { |
| 1377 | 1377 | return; |
| 1378 | 1378 | } |
| 1379 | - logger.info("[发送 报警通知] {}/{}->{},{}", device.getDeviceId(), deviceAlarm.getChannelId(), | |
| 1379 | + logger.info("[发送报警通知]设备: {}/{}->{},{}", device.getDeviceId(), deviceAlarm.getChannelId(), | |
| 1380 | 1380 | deviceAlarm.getLongitude(), deviceAlarm.getLatitude()); |
| 1381 | 1381 | |
| 1382 | 1382 | String characterSet = device.getCharset(); | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
| ... | ... | @@ -402,7 +402,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 402 | 402 | if (parentPlatform == null) { |
| 403 | 403 | return; |
| 404 | 404 | } |
| 405 | - logger.info("[发送报警通知] {}/{}->{},{}: {}", parentPlatform.getServerGBId(), deviceAlarm.getChannelId(), | |
| 405 | + logger.info("[发送报警通知]平台: {}/{}->{},{}: {}", parentPlatform.getServerGBId(), deviceAlarm.getChannelId(), | |
| 406 | 406 | deviceAlarm.getLongitude(), deviceAlarm.getLatitude(), JSON.toJSONString(deviceAlarm)); |
| 407 | 407 | String characterSet = parentPlatform.getCharacterSet(); |
| 408 | 408 | StringBuffer deviceStatusXml = new StringBuffer(600); | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisAlarmMsgListener.java
| 1 | 1 | package com.genersoft.iot.vmp.service.redisMsg; |
| 2 | 2 | |
| 3 | 3 | import com.alibaba.fastjson2.JSON; |
| 4 | +import com.genersoft.iot.vmp.conf.UserSetting; | |
| 4 | 5 | import com.genersoft.iot.vmp.gb28181.bean.*; |
| 5 | 6 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; |
| 6 | 7 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; |
| ... | ... | @@ -44,8 +45,12 @@ public class RedisAlarmMsgListener implements MessageListener { |
| 44 | 45 | @Autowired |
| 45 | 46 | private ThreadPoolTaskExecutor taskExecutor; |
| 46 | 47 | |
| 48 | + @Autowired | |
| 49 | + private UserSetting userSetting; | |
| 50 | + | |
| 47 | 51 | @Override |
| 48 | 52 | public void onMessage(@NotNull Message message, byte[] bytes) { |
| 53 | + // 消息示例: PUBLISH alarm_receive '{ "gbId": "", "alarmSn": 1, "alarmType": "111", "alarmDescription": "222", }' | |
| 49 | 54 | logger.info("收到来自REDIS的ALARM通知: {}", new String(message.getBody())); |
| 50 | 55 | boolean isEmpty = taskQueue.isEmpty(); |
| 51 | 56 | taskQueue.offer(message); |
| ... | ... | @@ -74,17 +79,44 @@ public class RedisAlarmMsgListener implements MessageListener { |
| 74 | 79 | deviceAlarm.setLatitude(0); |
| 75 | 80 | |
| 76 | 81 | if (ObjectUtils.isEmpty(gbId)) { |
| 77 | - // 发送给所有的上级 | |
| 78 | - List<ParentPlatform> parentPlatforms = storage.queryEnableParentPlatformList(true); | |
| 79 | - if (parentPlatforms.size() > 0) { | |
| 80 | - for (ParentPlatform parentPlatform : parentPlatforms) { | |
| 82 | + if (userSetting.getSendToPlatformsWhenIdLost()) { | |
| 83 | + // 发送给所有的上级 | |
| 84 | + List<ParentPlatform> parentPlatforms = storage.queryEnableParentPlatformList(true); | |
| 85 | + if (parentPlatforms.size() > 0) { | |
| 86 | + for (ParentPlatform parentPlatform : parentPlatforms) { | |
| 87 | + try { | |
| 88 | + commanderForPlatform.sendAlarmMessage(parentPlatform, deviceAlarm); | |
| 89 | + } catch (SipException | InvalidArgumentException | ParseException e) { | |
| 90 | + logger.error("[命令发送失败] 国标级联 发送报警: {}", e.getMessage()); | |
| 91 | + } | |
| 92 | + } | |
| 93 | + } | |
| 94 | + }else { | |
| 95 | + // 获取开启了消息推送的设备和平台 | |
| 96 | + List<ParentPlatform> parentPlatforms = storage.queryEnablePlatformListWithAsMessageChannel(); | |
| 97 | + if (parentPlatforms.size() > 0) { | |
| 98 | + for (ParentPlatform parentPlatform : parentPlatforms) { | |
| 99 | + try { | |
| 100 | + commanderForPlatform.sendAlarmMessage(parentPlatform, deviceAlarm); | |
| 101 | + } catch (SipException | InvalidArgumentException | ParseException e) { | |
| 102 | + logger.error("[命令发送失败] 国标级联 发送报警: {}", e.getMessage()); | |
| 103 | + } | |
| 104 | + } | |
| 105 | + } | |
| 106 | + | |
| 107 | + } | |
| 108 | + // 获取开启了消息推送的设备和平台 | |
| 109 | + List<Device> devices = storage.queryDeviceWithAsMessageChannel(); | |
| 110 | + if (devices.size() > 0) { | |
| 111 | + for (Device device : devices) { | |
| 81 | 112 | try { |
| 82 | - commanderForPlatform.sendAlarmMessage(parentPlatform, deviceAlarm); | |
| 83 | - } catch (SipException | InvalidArgumentException | ParseException e) { | |
| 84 | - logger.error("[命令发送失败] 国标级联 发送报警: {}", e.getMessage()); | |
| 113 | + commander.sendAlarmMessage(device, deviceAlarm); | |
| 114 | + } catch (InvalidArgumentException | SipException | ParseException e) { | |
| 115 | + logger.error("[命令发送失败] 发送报警: {}", e.getMessage()); | |
| 85 | 116 | } |
| 86 | 117 | } |
| 87 | 118 | } |
| 119 | + | |
| 88 | 120 | }else { |
| 89 | 121 | Device device = storage.queryVideoDevice(gbId); |
| 90 | 122 | ParentPlatform platform = storage.queryParentPlatByServerGBId(gbId); | ... | ... |
src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorage.java
| ... | ... | @@ -378,4 +378,7 @@ public interface IVideoManagerStorage { |
| 378 | 378 | |
| 379 | 379 | List<DeviceChannelExtend> queryChannelsByDeviceId(String serial, List<String> channelIds, Boolean online); |
| 380 | 380 | |
| 381 | + List<ParentPlatform> queryEnablePlatformListWithAsMessageChannel(); | |
| 382 | + | |
| 383 | + List<Device> queryDeviceWithAsMessageChannel(); | |
| 381 | 384 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
| ... | ... | @@ -39,6 +39,7 @@ public interface DeviceMapper { |
| 39 | 39 | "mobilePositionSubmissionInterval," + |
| 40 | 40 | "subscribeCycleForAlarm," + |
| 41 | 41 | "ssrcCheck," + |
| 42 | + "asMessageChannel," + | |
| 42 | 43 | "geoCoordSys," + |
| 43 | 44 | "treeType," + |
| 44 | 45 | "online" + |
| ... | ... | @@ -70,6 +71,7 @@ public interface DeviceMapper { |
| 70 | 71 | "mobilePositionSubmissionInterval," + |
| 71 | 72 | "subscribeCycleForAlarm," + |
| 72 | 73 | "ssrcCheck," + |
| 74 | + "asMessageChannel," + | |
| 73 | 75 | "geoCoordSys," + |
| 74 | 76 | "treeType," + |
| 75 | 77 | "online" + |
| ... | ... | @@ -98,6 +100,7 @@ public interface DeviceMapper { |
| 98 | 100 | "#{mobilePositionSubmissionInterval}," + |
| 99 | 101 | "#{subscribeCycleForAlarm}," + |
| 100 | 102 | "#{ssrcCheck}," + |
| 103 | + "#{asMessageChannel}," + | |
| 101 | 104 | "#{geoCoordSys}," + |
| 102 | 105 | "#{treeType}," + |
| 103 | 106 | "#{online}" + |
| ... | ... | @@ -152,6 +155,7 @@ public interface DeviceMapper { |
| 152 | 155 | "mobilePositionSubmissionInterval," + |
| 153 | 156 | "subscribeCycleForAlarm," + |
| 154 | 157 | "ssrcCheck," + |
| 158 | + "asMessageChannel," + | |
| 155 | 159 | "geoCoordSys," + |
| 156 | 160 | "treeType," + |
| 157 | 161 | "online," + |
| ... | ... | @@ -192,6 +196,7 @@ public interface DeviceMapper { |
| 192 | 196 | "mobilePositionSubmissionInterval," + |
| 193 | 197 | "subscribeCycleForAlarm," + |
| 194 | 198 | "ssrcCheck," + |
| 199 | + "asMessageChannel," + | |
| 195 | 200 | "geoCoordSys," + |
| 196 | 201 | "treeType," + |
| 197 | 202 | "online " + |
| ... | ... | @@ -222,6 +227,7 @@ public interface DeviceMapper { |
| 222 | 227 | "mobilePositionSubmissionInterval," + |
| 223 | 228 | "subscribeCycleForAlarm," + |
| 224 | 229 | "ssrcCheck," + |
| 230 | + "asMessageChannel," + | |
| 225 | 231 | "geoCoordSys," + |
| 226 | 232 | "treeType," + |
| 227 | 233 | "online" + |
| ... | ... | @@ -243,6 +249,7 @@ public interface DeviceMapper { |
| 243 | 249 | "<if test=\"mobilePositionSubmissionInterval != null\">, mobilePositionSubmissionInterval=#{mobilePositionSubmissionInterval}</if>" + |
| 244 | 250 | "<if test=\"subscribeCycleForAlarm != null\">, subscribeCycleForAlarm=#{subscribeCycleForAlarm}</if>" + |
| 245 | 251 | "<if test=\"ssrcCheck != null\">, ssrcCheck=#{ssrcCheck}</if>" + |
| 252 | + "<if test=\"asMessageChannel != null\">, asMessageChannel=#{asMessageChannel}</if>" + | |
| 246 | 253 | "<if test=\"geoCoordSys != null\">, geoCoordSys=#{geoCoordSys}</if>" + |
| 247 | 254 | "<if test=\"treeType != null\">, treeType=#{treeType}</if>" + |
| 248 | 255 | "<if test=\"mediaServerId != null\">, mediaServerId=#{mediaServerId}</if>" + |
| ... | ... | @@ -259,6 +266,7 @@ public interface DeviceMapper { |
| 259 | 266 | "updateTime," + |
| 260 | 267 | "charset," + |
| 261 | 268 | "ssrcCheck," + |
| 269 | + "asMessageChannel," + | |
| 262 | 270 | "geoCoordSys," + |
| 263 | 271 | "treeType," + |
| 264 | 272 | "online" + |
| ... | ... | @@ -271,6 +279,7 @@ public interface DeviceMapper { |
| 271 | 279 | "#{updateTime}," + |
| 272 | 280 | "#{charset}," + |
| 273 | 281 | "#{ssrcCheck}," + |
| 282 | + "#{asMessageChannel}," + | |
| 274 | 283 | "#{geoCoordSys}," + |
| 275 | 284 | "#{treeType}," + |
| 276 | 285 | "#{online}" + |
| ... | ... | @@ -282,4 +291,7 @@ public interface DeviceMapper { |
| 282 | 291 | |
| 283 | 292 | @Select("select * from device") |
| 284 | 293 | List<Device> getAll(); |
| 294 | + | |
| 295 | + @Select("select * from device where asMessageChannel = 1") | |
| 296 | + List<Device> queryDeviceWithAsMessageChannel(); | |
| 285 | 297 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java
| ... | ... | @@ -15,10 +15,10 @@ import java.util.List; |
| 15 | 15 | public interface ParentPlatformMapper { |
| 16 | 16 | |
| 17 | 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, asMessageChannel, " + | |
| 19 | 19 | " status, startOfflinePush, catalogId, administrativeDivision, catalogGroup, createTime, updateTime, treeType) " + |
| 20 | 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}, #{asMessageChannel}, " + | |
| 22 | 22 | " #{status}, #{startOfflinePush}, #{catalogId}, #{administrativeDivision}, #{catalogGroup}, #{createTime}, #{updateTime}, #{treeType})") |
| 23 | 23 | int addParentPlatform(ParentPlatform parentPlatform); |
| 24 | 24 | |
| ... | ... | @@ -40,6 +40,7 @@ public interface ParentPlatformMapper { |
| 40 | 40 | "characterSet=#{characterSet}, " + |
| 41 | 41 | "ptz=#{ptz}, " + |
| 42 | 42 | "rtcp=#{rtcp}, " + |
| 43 | + "asMessageChannel=#{asMessageChannel}, " + | |
| 43 | 44 | "status=#{status}, " + |
| 44 | 45 | "startOfflinePush=#{startOfflinePush}, " + |
| 45 | 46 | "catalogGroup=#{catalogGroup}, " + |
| ... | ... | @@ -68,9 +69,12 @@ public interface ParentPlatformMapper { |
| 68 | 69 | "FROM parent_platform pp ") |
| 69 | 70 | List<ParentPlatform> getParentPlatformList(); |
| 70 | 71 | |
| 71 | - @Select("SELECT * FROM parent_platform WHERE enable=#{enable}") | |
| 72 | + @Select("SELECT * FROM parent_platform WHERE enable=#{enable} ") | |
| 72 | 73 | List<ParentPlatform> getEnableParentPlatformList(boolean enable); |
| 73 | 74 | |
| 75 | + @Select("SELECT * FROM parent_platform WHERE enable=1 and asMessageChannel = 1") | |
| 76 | + List<ParentPlatform> queryEnablePlatformListWithAsMessageChannel(); | |
| 77 | + | |
| 74 | 78 | @Select("SELECT * FROM parent_platform WHERE serverGBId=#{platformGbId}") |
| 75 | 79 | ParentPlatform getParentPlatByServerGBId(String platformGbId); |
| 76 | 80 | ... | ... |
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
| ... | ... | @@ -525,6 +525,16 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { |
| 525 | 525 | } |
| 526 | 526 | |
| 527 | 527 | @Override |
| 528 | + public List<ParentPlatform> queryEnablePlatformListWithAsMessageChannel() { | |
| 529 | + return platformMapper.queryEnablePlatformListWithAsMessageChannel(); | |
| 530 | + } | |
| 531 | + | |
| 532 | + @Override | |
| 533 | + public List<Device> queryDeviceWithAsMessageChannel() { | |
| 534 | + return deviceMapper.queryDeviceWithAsMessageChannel(); | |
| 535 | + } | |
| 536 | + | |
| 537 | + @Override | |
| 528 | 538 | public void outlineForAllParentPlatform() { |
| 529 | 539 | platformMapper.outlineForAllParentPlatform(); |
| 530 | 540 | } | ... | ... |
src/main/resources/all-application.yml
| ... | ... | @@ -199,8 +199,8 @@ user-settings: |
| 199 | 199 | sip-use-source-ip-as-remote-address: false |
| 200 | 200 | # 是否开启sip日志 |
| 201 | 201 | sip-log: true |
| 202 | - # 自动数据库升级,保证表结构完整 | |
| 203 | - sync-db: true | |
| 202 | + # 消息通道功能-缺少国标ID是否给所有上级发送消息 | |
| 203 | + send-to-platforms-when-id-lost: true | |
| 204 | 204 | |
| 205 | 205 | # 关闭在线文档(生产环境建议关闭) |
| 206 | 206 | springdoc: | ... | ... |
web_src/index.html
web_src/src/components/dialog/deviceEdit.vue
| ... | ... | @@ -66,6 +66,7 @@ |
| 66 | 66 | </el-form-item> |
| 67 | 67 | <el-form-item label="其他选项"> |
| 68 | 68 | <el-checkbox label="SSRC校验" v-model="form.ssrcCheck" style="float: left"></el-checkbox> |
| 69 | + <el-checkbox label="作为消息通道" v-model="form.asMessageChannel" style="float: left"></el-checkbox> | |
| 69 | 70 | </el-form-item> |
| 70 | 71 | <el-form-item> |
| 71 | 72 | <div style="float: right;"> | ... | ... |
web_src/src/components/dialog/platformEdit.vue
| ... | ... | @@ -96,9 +96,10 @@ |
| 96 | 96 | </el-form-item> |
| 97 | 97 | <el-form-item label="其他选项"> |
| 98 | 98 | <el-checkbox label="启用" v-model="platform.enable" @change="checkExpires"></el-checkbox> |
| 99 | - <el-checkbox label="云台控制" v-model="platform.ptz"></el-checkbox> | |
| 99 | +<!-- <el-checkbox label="云台控制" v-model="platform.ptz"></el-checkbox>--> | |
| 100 | 100 | <el-checkbox label="拉起离线推流" v-model="platform.startOfflinePush"></el-checkbox> |
| 101 | 101 | <el-checkbox label="RTCP保活" v-model="platform.rtcp" @change="rtcpCheckBoxChange"></el-checkbox> |
| 102 | + <el-checkbox label="作为消息通道" v-model="platform.asMessageChannel" ></el-checkbox> | |
| 102 | 103 | </el-form-item> |
| 103 | 104 | <el-form-item> |
| 104 | 105 | <el-button type="primary" @click="onSubmit">{{ |
| ... | ... | @@ -145,6 +146,7 @@ export default { |
| 145 | 146 | enable: true, |
| 146 | 147 | ptz: true, |
| 147 | 148 | rtcp: false, |
| 149 | + asMessageChannel: false, | |
| 148 | 150 | name: null, |
| 149 | 151 | serverGBId: null, |
| 150 | 152 | serverGBDomain: null, |
| ... | ... | @@ -213,6 +215,7 @@ export default { |
| 213 | 215 | this.platform.enable = platform.enable; |
| 214 | 216 | this.platform.ptz = platform.ptz; |
| 215 | 217 | this.platform.rtcp = platform.rtcp; |
| 218 | + this.platform.rtcpasMessageChannel = platform.asMessageChannel; | |
| 216 | 219 | this.platform.name = platform.name; |
| 217 | 220 | this.platform.serverGBId = platform.serverGBId; |
| 218 | 221 | this.platform.serverGBDomain = platform.serverGBDomain; |
| ... | ... | @@ -290,6 +293,7 @@ export default { |
| 290 | 293 | enable: true, |
| 291 | 294 | ptz: true, |
| 292 | 295 | rtcp: false, |
| 296 | + asMessageChannel: false, | |
| 293 | 297 | name: null, |
| 294 | 298 | serverGBId: null, |
| 295 | 299 | administrativeDivision: null, | ... | ... |