Commit c5b16e058dd1d517abea9a475897d9333c6e2e2e

Authored by 648540858
2 parents 5327a857 7bfa8542

Merge remote-tracking branch 'origin/wvp-28181-2.0' into wvp-28181-2.0

# Conflicts:
#	sql/mysql.sql
README.md
@@ -156,7 +156,6 @@ QQ蝘縑銝銝, 蝎曉.甈Z之摰嗅蝢日悄霈.閫★撖嫣 @@ -156,7 +156,6 @@ QQ蝘縑銝銝, 蝎曉.甈Z之摰嗅蝢日悄霈.閫★撖嫣
156 156
157 # 悅 157 # 悅
158 憿寧誨蝙摰賣IT悅嚗靽縑銝隞亥摨鈭★ 雿憿寧銋蝣蝙鈭鈭隞皞誨銝窈銵隞嚗 鈭蝙憿寧漣熒噩蛹銝璁憿寧嚗窈銵 雿輻憿寧隞嚗砲悅銝剖銵冽憿寧靘洵銝摨悅 158 憿寧誨蝙摰賣IT悅嚗靽縑銝隞亥摨鈭★ 雿憿寧銋蝣蝙鈭鈭隞皞誨銝窈銵隞嚗 鈭蝙憿寧漣熒噩蛹銝璁憿寧嚗窈銵 雿輻憿寧隞嚗砲悅銝剖銵冽憿寧靘洵銝摨悅
159 -  
160 # 靚 159 # 靚
161 陝雿憭(https://github.com/xia-chu) 皞獢,撟嗅撘葉蝏葬 160 陝雿憭(https://github.com/xia-chu) 皞獢,撟嗅撘葉蝏葬
162 陝雿dexter langhuihui](https://github.com/langhuihui) 撘皞末EB 161 陝雿dexter langhuihui](https://github.com/langhuihui) 撘皞末EB
@@ -166,7 +165,7 @@ QQ蝘縑銝銝, 蝎曉.甈Z之摰嗅蝢日悄霈.閫★撖嫣 @@ -166,7 +165,7 @@ QQ蝘縑銝銝, 蝎曉.甈Z之摰嗅蝢日悄霈.閫★撖嫣
166 [hotcoffie](https://github.com/hotcoffie) [xiaomu](https://github.com/nikmu) [TristingChen](https://github.com/TristingChen) 165 [hotcoffie](https://github.com/hotcoffie) [xiaomu](https://github.com/nikmu) [TristingChen](https://github.com/TristingChen)
167 [chenparty](https://github.com/chenparty) [Hotleave](https://github.com/hotleave) [ydwxb](https://github.com/ydwxb) 166 [chenparty](https://github.com/chenparty) [Hotleave](https://github.com/hotleave) [ydwxb](https://github.com/ydwxb)
168 [ydpd](https://github.com/ydpd) [szy833](https://github.com/szy833) [ydwxb](https://github.com/ydwxb) [Albertzhu666](https://github.com/Albertzhu666) 167 [ydpd](https://github.com/ydpd) [szy833](https://github.com/szy833) [ydwxb](https://github.com/ydwxb) [Albertzhu666](https://github.com/Albertzhu666)
169 -[mk1990](https://github.com/mk1990) 168 +[mk1990](https://github.com/mk1990) [SaltFish001](https://github.com/SaltFish001)
170 169
171 ps: 葵摰鈭之雿穿洽餈之雿祈頂溶 170 ps: 葵摰鈭之雿穿洽餈之雿祈頂溶
172 171
sql/mysql.sql
@@ -48,6 +48,7 @@ CREATE TABLE `device` ( @@ -48,6 +48,7 @@ CREATE TABLE `device` (
48 `ssrcCheck` int DEFAULT '0', 48 `ssrcCheck` int DEFAULT '0',
49 `geoCoordSys` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, 49 `geoCoordSys` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
50 `treeType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, 50 `treeType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  51 + `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'auto',
51 `custom_name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, 52 `custom_name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
52 `password` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, 53 `password` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
53 PRIMARY KEY (`id`), 54 PRIMARY KEY (`id`),
src/main/java/com/genersoft/iot/vmp/gb28181/conf/SipLoggerPass.java
@@ -6,6 +6,7 @@ import java.util.Properties; @@ -6,6 +6,7 @@ import java.util.Properties;
6 6
7 /** 7 /**
8 * sip日志格式化 8 * sip日志格式化
  9 + * 暂不使用
9 */ 10 */
10 public class SipLoggerPass implements StackLogger { 11 public class SipLoggerPass implements StackLogger {
11 12
src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java
@@ -118,6 +118,7 @@ public class DeviceServiceImpl implements IDeviceService { @@ -118,6 +118,7 @@ public class DeviceServiceImpl implements IDeviceService {
118 } 118 }
119 sync(device); 119 sync(device);
120 }else { 120 }else {
  121 +
121 if(device.getOnline() == 0){ 122 if(device.getOnline() == 0){
122 device.setOnline(1); 123 device.setOnline(1);
123 device.setCreateTime(now); 124 device.setCreateTime(now);
@@ -132,6 +133,11 @@ public class DeviceServiceImpl implements IDeviceService { @@ -132,6 +133,11 @@ public class DeviceServiceImpl implements IDeviceService {
132 sync(device); 133 sync(device);
133 // TODO 如果设备下的通道级联到了其他平台,那么需要发送事件或者notify给上级平台 134 // TODO 如果设备下的通道级联到了其他平台,那么需要发送事件或者notify给上级平台
134 }else { 135 }else {
  136 + if (deviceChannelMapper.queryAllChannels(device.getDeviceId()).size() == 0) {
  137 + logger.info("[设备上线]: {},通道数为0,查询通道信息", device.getDeviceId());
  138 + sync(device);
  139 + }
  140 +
135 deviceMapper.update(device); 141 deviceMapper.update(device);
136 redisCatchStorage.updateDevice(device); 142 redisCatchStorage.updateDevice(device);
137 } 143 }
@@ -362,10 +368,10 @@ public class DeviceServiceImpl implements IDeviceService { @@ -362,10 +368,10 @@ public class DeviceServiceImpl implements IDeviceService {
362 return null; 368 return null;
363 } 369 }
364 // 使用行政区划展示树 370 // 使用行政区划展示树
365 - if (parentId.length() > 10) {  
366 - // TODO 可能是行政区划与业务分组混杂的情形  
367 - return null;  
368 - } 371 +// if (parentId.length() > 10) {
  372 +// // TODO 可能是行政区划与业务分组混杂的情形
  373 +// return null;
  374 +// }
369 375
370 if (parentId.length() == 10 ) { 376 if (parentId.length() == 10 ) {
371 if (onlyCatalog) { 377 if (onlyCatalog) {
@@ -380,7 +386,18 @@ public class DeviceServiceImpl implements IDeviceService { @@ -380,7 +386,18 @@ public class DeviceServiceImpl implements IDeviceService {
380 List<DeviceChannel> channelsForCivilCode = deviceChannelMapper.getChannelsWithCivilCodeAndLength(deviceId, parentId, parentId.length() + 2); 386 List<DeviceChannel> channelsForCivilCode = deviceChannelMapper.getChannelsWithCivilCodeAndLength(deviceId, parentId, parentId.length() + 2);
381 if (!onlyCatalog) { 387 if (!onlyCatalog) {
382 List<DeviceChannel> channels = deviceChannelMapper.getChannelsByCivilCode(deviceId, parentId); 388 List<DeviceChannel> channels = deviceChannelMapper.getChannelsByCivilCode(deviceId, parentId);
383 - channelsForCivilCode.addAll(channels); 389 +
  390 + for(DeviceChannel channel : channels) {
  391 + boolean flag = false;
  392 + for(DeviceChannel deviceChannel : channelsForCivilCode) {
  393 + if(channel.getChannelId().equals(deviceChannel.getChannelId())) {
  394 + flag = true;
  395 + }
  396 + }
  397 + if(!flag) {
  398 + channelsForCivilCode.add(channel);
  399 + }
  400 + }
384 } 401 }
385 List<BaseTree<DeviceChannel>> trees = transportChannelsToTree(channelsForCivilCode, parentId); 402 List<BaseTree<DeviceChannel>> trees = transportChannelsToTree(channelsForCivilCode, parentId);
386 return trees; 403 return trees;
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
@@ -71,7 +71,7 @@ public interface DeviceChannelMapper { @@ -71,7 +71,7 @@ public interface DeviceChannelMapper {
71 "WHERE " + 71 "WHERE " +
72 "dc.deviceId = #{deviceId} " + 72 "dc.deviceId = #{deviceId} " +
73 " <if test='query != null'> AND (dc.channelId LIKE '%${query}%' OR dc.name LIKE '%${query}%' OR dc.name LIKE '%${query}%')</if> " + 73 " <if test='query != null'> AND (dc.channelId LIKE '%${query}%' OR dc.name LIKE '%${query}%' OR dc.name LIKE '%${query}%')</if> " +
74 - " <if test='parentChannelId != null'> AND dc.parentId=#{parentChannelId} </if> " + 74 + " <if test='parentChannelId != null'> AND (dc.parentId=#{parentChannelId} OR dc.civilCode = #{parentChannelId}) </if> " +
75 " <if test='online == true' > AND dc.status=1</if>" + 75 " <if test='online == true' > AND dc.status=1</if>" +
76 " <if test='online == false' > AND dc.status=0</if>" + 76 " <if test='online == false' > AND dc.status=0</if>" +
77 " <if test='hasSubChannel == true' > AND dc.subCount > 0 </if>" + 77 " <if test='hasSubChannel == true' > AND dc.subCount > 0 </if>" +
@@ -309,8 +309,10 @@ public interface DeviceChannelMapper { @@ -309,8 +309,10 @@ public interface DeviceChannelMapper {
309 "select * " + 309 "select * " +
310 "from device_channel " + 310 "from device_channel " +
311 "where deviceId=#{deviceId}" + 311 "where deviceId=#{deviceId}" +
312 - " <if test='parentId != null' > and left(channelId, ${parentId.length()}) = #{parentId}</if>" +  
313 - " <if test='length != null' > and length(channelId)=${length}</if>" + 312 + " <if test='parentId != null and length != null' > and parentId = #{parentId} or left(channelId, ${parentId.length()}) = #{parentId} and length(channelId)=${length} </if>" +
  313 + " <if test='parentId == null and length != null' > and parentId = #{parentId} or length(channelId)=${length} </if>" +
  314 + " <if test='parentId == null and length == null' > and parentId = #{parentId} </if>" +
  315 + " <if test='parentId != null and length == null' > and parentId = #{parentId} or left(channelId, ${parentId.length()}) = #{parentId} </if>" +
314 " </script>"}) 316 " </script>"})
315 List<DeviceChannel> getChannelsWithCivilCodeAndLength(String deviceId, String parentId, Integer length); 317 List<DeviceChannel> getChannelsWithCivilCodeAndLength(String deviceId, String parentId, Integer length);
316 318
web_src/src/components/CloudRecord.vue
@@ -109,15 +109,26 @@ @@ -109,15 +109,26 @@
109 that.mediaServerList = data.data; 109 that.mediaServerList = data.data;
110 if (that.mediaServerList.length > 0) { 110 if (that.mediaServerList.length > 0) {
111 that.mediaServerId = that.mediaServerList[0].id 111 that.mediaServerId = that.mediaServerList[0].id
112 - let port = that.mediaServerList[0].httpPort;  
113 - if (location.protocol === "https:" && that.mediaServerList[0].httpSSlPort) {  
114 - port = that.mediaServerList[0].httpSSlPort  
115 - }  
116 - that.mediaServerPath = location.protocol + "//" + that.mediaServerList[0].streamIp + ":" + port 112 + that.setMediaServerPath(that.mediaServerId);
117 that.getRecordList(); 113 that.getRecordList();
118 } 114 }
119 }) 115 })
120 }, 116 },
  117 + setMediaServerPath: function (serverId) {
  118 + let that = this;
  119 + let i;
  120 + for (i = 0; i < that.mediaServerList.length; i++) {
  121 + if (serverId === that.mediaServerList[i].id) {
  122 + break;
  123 + }
  124 + }
  125 + let port = that.mediaServerList[i].httpPort;
  126 + if (location.protocol === "https:" && that.mediaServerList[i].httpSSlPort) {
  127 + port = that.mediaServerList[i].httpSSlPort
  128 + }
  129 + that.mediaServerPath = location.protocol + "//" + that.mediaServerList[i].streamIp + ":" + port
  130 + console.log(that.mediaServerPath)
  131 + },
121 getRecordList: function (){ 132 getRecordList: function (){
122 let that = this; 133 let that = this;
123 this.$axios({ 134 this.$axios({
@@ -146,6 +157,7 @@ @@ -146,6 +157,7 @@
146 console.log(val) 157 console.log(val)
147 this.total = 0; 158 this.total = 0;
148 this.recordList = []; 159 this.recordList = [];
  160 + this.setMediaServerPath(val);
149 this.getRecordList(); 161 this.getRecordList();
150 }, 162 },
151 showRecordDetail(row){ 163 showRecordDetail(row){