Commit a0537d74df5b9c8ee65dba7c4e5bc6da7fc3d031
Committed by
GitHub
Merge branch '648540858:wvp-28181-2.0' into wvp-28181-2.0
Showing
19 changed files
with
189 additions
and
80 deletions
DOCKERFILE
| @@ -84,7 +84,7 @@ RUN echo '#!/bin/bash' > run.sh && \ | @@ -84,7 +84,7 @@ RUN echo '#!/bin/bash' > run.sh && \ | ||
| 84 | echo 'nohup java -jar *.jar --userSettings.record=/opt/media/www/record/ &' >> run.sh && \ | 84 | echo 'nohup java -jar *.jar --userSettings.record=/opt/media/www/record/ &' >> run.sh && \ |
| 85 | echo 'nohup /opt/media/MediaServer -d -m 3 &' >> run.sh && \ | 85 | echo 'nohup /opt/media/MediaServer -d -m 3 &' >> run.sh && \ |
| 86 | echo 'cd /opt/wvp' >> run.sh && \ | 86 | echo 'cd /opt/wvp' >> run.sh && \ |
| 87 | - echo 'if [${WVP_CONFIG}]; then' >> run.sh && \ | 87 | + echo 'if [-n "${WVP_CONFIG}"]; then' >> run.sh && \ |
| 88 | echo ' java -jar *.jar --spring.config.location=/opt/wvp/config/application.yml --media.record-assist-port=18081 ${WVP_CONFIG}' >> run.sh && \ | 88 | echo ' java -jar *.jar --spring.config.location=/opt/wvp/config/application.yml --media.record-assist-port=18081 ${WVP_CONFIG}' >> run.sh && \ |
| 89 | echo 'else' >> run.sh && \ | 89 | echo 'else' >> run.sh && \ |
| 90 | echo ' java -jar *.jar --spring.config.location=/opt/wvp/config/application.yml --media.record-assist-port=18081 --media.ip=127.0.0.1 --media.sdp-ip=${WVP_IP} --sip.ip=${WVP_IP} --media.stream-ip=${WVP_IP}' >> run.sh && \ | 90 | echo ' java -jar *.jar --spring.config.location=/opt/wvp/config/application.yml --media.record-assist-port=18081 --media.ip=127.0.0.1 --media.sdp-ip=${WVP_IP} --sip.ip=${WVP_IP} --media.stream-ip=${WVP_IP}' >> run.sh && \ |
src/main/java/com/genersoft/iot/vmp/gb28181/event/subscribe/catalog/CatalogEventLister.java
| @@ -99,7 +99,7 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> { | @@ -99,7 +99,7 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> { | ||
| 99 | } | 99 | } |
| 100 | if (event.getGbStreams() != null && event.getGbStreams().size() > 0){ | 100 | if (event.getGbStreams() != null && event.getGbStreams().size() > 0){ |
| 101 | for (GbStream gbStream : event.getGbStreams()) { | 101 | for (GbStream gbStream : event.getGbStreams()) { |
| 102 | - DeviceChannel deviceChannelByStream = gbStreamService.getDeviceChannelListByStream(gbStream, gbStream.getCatalogId(), parentPlatform.getDeviceGBId()); | 102 | + DeviceChannel deviceChannelByStream = gbStreamService.getDeviceChannelListByStream(gbStream, gbStream.getCatalogId(), parentPlatform); |
| 103 | deviceChannelList.add(deviceChannelByStream); | 103 | deviceChannelList.add(deviceChannelByStream); |
| 104 | } | 104 | } |
| 105 | } | 105 | } |
| @@ -138,7 +138,10 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> { | @@ -138,7 +138,10 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> { | ||
| 138 | } | 138 | } |
| 139 | if (event.getGbStreams() != null && event.getGbStreams().size() > 0){ | 139 | if (event.getGbStreams() != null && event.getGbStreams().size() > 0){ |
| 140 | for (GbStream gbStream : event.getGbStreams()) { | 140 | for (GbStream gbStream : event.getGbStreams()) { |
| 141 | - DeviceChannel deviceChannelByStream = gbStreamService.getDeviceChannelListByStream(gbStream, gbStream.getCatalogId(), parentPlatform.getDeviceGBId()); | 141 | + DeviceChannel deviceChannelByStream = gbStreamService.getDeviceChannelListByStream(gbStream, gbStream.getCatalogId(), parentPlatform); |
| 142 | + if (deviceChannelByStream.getParentId().length() <= 10) { // 父节点是行政区划,则设置CivilCode使用此行政区划 | ||
| 143 | + deviceChannelByStream.setCivilCode(deviceChannelByStream.getParentId()); | ||
| 144 | + } | ||
| 142 | deviceChannelList.add(deviceChannelByStream); | 145 | deviceChannelList.add(deviceChannelByStream); |
| 143 | } | 146 | } |
| 144 | } | 147 | } |
| @@ -159,7 +162,7 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> { | @@ -159,7 +162,7 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> { | ||
| 159 | deviceChannelList.add(deviceChannel); | 162 | deviceChannelList.add(deviceChannel); |
| 160 | GbStream gbStream = storager.queryStreamInParentPlatform(platform.getServerGBId(), gbId); | 163 | GbStream gbStream = storager.queryStreamInParentPlatform(platform.getServerGBId(), gbId); |
| 161 | if(gbStream != null){ | 164 | if(gbStream != null){ |
| 162 | - DeviceChannel deviceChannelByStream = gbStreamService.getDeviceChannelListByStream(gbStream, gbStream.getCatalogId(), platform.getDeviceGBId()); | 165 | + DeviceChannel deviceChannelByStream = gbStreamService.getDeviceChannelListByStream(gbStream, gbStream.getCatalogId(), platform); |
| 163 | deviceChannelList.add(deviceChannelByStream); | 166 | deviceChannelList.add(deviceChannelByStream); |
| 164 | } | 167 | } |
| 165 | sipCommanderFroPlatform.sendNotifyForCatalogAddOrUpdate(event.getType(), platform, deviceChannelList, subscribeInfo, null); | 168 | sipCommanderFroPlatform.sendNotifyForCatalogAddOrUpdate(event.getType(), platform, deviceChannelList, subscribeInfo, null); |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
| @@ -259,28 +259,34 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -259,28 +259,34 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 259 | catalogXml.append("<Item>\r\n"); | 259 | catalogXml.append("<Item>\r\n"); |
| 260 | catalogXml.append("<DeviceID>" + channel.getChannelId() + "</DeviceID>\r\n"); | 260 | catalogXml.append("<DeviceID>" + channel.getChannelId() + "</DeviceID>\r\n"); |
| 261 | catalogXml.append("<Name>" + channel.getName() + "</Name>\r\n"); | 261 | catalogXml.append("<Name>" + channel.getName() + "</Name>\r\n"); |
| 262 | - catalogXml.append("<Manufacturer>" + channel.getManufacture() + "</Manufacturer>\r\n"); | ||
| 263 | catalogXml.append("<Parental>" + channel.getParental() + "</Parental>\r\n"); | 262 | catalogXml.append("<Parental>" + channel.getParental() + "</Parental>\r\n"); |
| 264 | if (channel.getParentId() != null) { | 263 | if (channel.getParentId() != null) { |
| 265 | catalogXml.append("<ParentID>" + channel.getParentId() + "</ParentID>\r\n"); | 264 | catalogXml.append("<ParentID>" + channel.getParentId() + "</ParentID>\r\n"); |
| 266 | } | 265 | } |
| 267 | - catalogXml.append("<RegisterWay>" + channel.getRegisterWay() + "</RegisterWay>\r\n"); | ||
| 268 | - catalogXml.append("<Status>" + (channel.getStatus() == 0?"OFF":"ON") + "</Status>\r\n"); | ||
| 269 | - catalogXml.append("<Secrecy>" + channel.getSecrecy() + "</Secrecy>\r\n"); | ||
| 270 | - if (channel.getChannelType() != 2) { // 业务分组/虚拟组织/行政区划 不设置以下字段 | ||
| 271 | - catalogXml.append("<Model>" + channel.getModel() + "</Model>\r\n"); | ||
| 272 | - catalogXml.append("<Owner>" + channel.getOwner() + "</Owner>\r\n"); | ||
| 273 | - catalogXml.append("<CivilCode>" + channel.getCivilCode() + "</CivilCode>\r\n"); | ||
| 274 | - catalogXml.append("<Address>" + channel.getAddress() + "</Address>\r\n"); | ||
| 275 | - catalogXml.append("<Longitude>" + channel.getLongitude() + "</Longitude>\r\n"); | ||
| 276 | - catalogXml.append("<Latitude>" + channel.getLatitude() + "</Latitude>\r\n"); | ||
| 277 | - catalogXml.append("<IPAddress>" + channel.getIpAddress() + "</IPAddress>\r\n"); | ||
| 278 | - catalogXml.append("<Port>" + channel.getPort() + "</Port>\r\n"); | ||
| 279 | - catalogXml.append("<Info>\r\n"); | ||
| 280 | - catalogXml.append("<PTZType>" + channel.getPTZType() + "</PTZType>\r\n"); | ||
| 281 | - catalogXml.append("</Info>\r\n"); | 266 | + if (channel.getChannelId().length() == 20) { |
| 267 | + if (Integer.parseInt(channel.getChannelId().substring(10, 13)) == 216) { // 虚拟组织增加BusinessGroupID字段 | ||
| 268 | + catalogXml.append("<BusinessGroupID>" + channel.getParentId() + "</BusinessGroupID>\r\n"); | ||
| 269 | + } | ||
| 270 | + catalogXml.append("<Manufacturer>" + channel.getManufacture() + "</Manufacturer>\r\n"); | ||
| 271 | + catalogXml.append("<RegisterWay>" + channel.getRegisterWay() + "</RegisterWay>\r\n"); | ||
| 272 | + catalogXml.append("<Status>" + (channel.getStatus() == 0?"OFF":"ON") + "</Status>\r\n"); | ||
| 273 | + if (channel.getChannelType() != 2) { // 业务分组/虚拟组织/行政区划 不设置以下字段 | ||
| 274 | + catalogXml.append("<Secrecy>" + channel.getSecrecy() + "</Secrecy>\r\n"); | ||
| 275 | + catalogXml.append("<Model>" + channel.getModel() + "</Model>\r\n"); | ||
| 276 | + catalogXml.append("<Owner>" + channel.getOwner() + "</Owner>\r\n"); | ||
| 277 | + catalogXml.append("<CivilCode>" + channel.getCivilCode() + "</CivilCode>\r\n"); | ||
| 278 | + catalogXml.append("<Address>" + channel.getAddress() + "</Address>\r\n"); | ||
| 279 | + catalogXml.append("<Longitude>" + channel.getLongitude() + "</Longitude>\r\n"); | ||
| 280 | + catalogXml.append("<Latitude>" + channel.getLatitude() + "</Latitude>\r\n"); | ||
| 281 | + catalogXml.append("<IPAddress>" + channel.getIpAddress() + "</IPAddress>\r\n"); | ||
| 282 | + catalogXml.append("<Port>" + channel.getPort() + "</Port>\r\n"); | ||
| 283 | + catalogXml.append("<Info>\r\n"); | ||
| 284 | + catalogXml.append("<PTZType>" + channel.getPTZType() + "</PTZType>\r\n"); | ||
| 285 | + catalogXml.append("</Info>\r\n"); | ||
| 286 | + } | ||
| 282 | } | 287 | } |
| 283 | 288 | ||
| 289 | + | ||
| 284 | catalogXml.append("</Item>\r\n"); | 290 | catalogXml.append("</Item>\r\n"); |
| 285 | } | 291 | } |
| 286 | } | 292 | } |
| @@ -596,6 +602,9 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -596,6 +602,9 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 596 | catalogXml.append("<Secrecy>" + channel.getSecrecy() + "</Secrecy>\r\n"); | 602 | catalogXml.append("<Secrecy>" + channel.getSecrecy() + "</Secrecy>\r\n"); |
| 597 | catalogXml.append("<RegisterWay>" + channel.getRegisterWay() + "</RegisterWay>\r\n"); | 603 | catalogXml.append("<RegisterWay>" + channel.getRegisterWay() + "</RegisterWay>\r\n"); |
| 598 | catalogXml.append("<Status>" + (channel.getStatus() == 0 ? "OFF" : "ON") + "</Status>\r\n"); | 604 | catalogXml.append("<Status>" + (channel.getStatus() == 0 ? "OFF" : "ON") + "</Status>\r\n"); |
| 605 | + if (channel.getChannelId().length() == 20 && Integer.parseInt(channel.getChannelId().substring(10, 13)) == 216) { // 虚拟组织增加BusinessGroupID字段 | ||
| 606 | + catalogXml.append("<BusinessGroupID>" + channel.getParentId() + "</BusinessGroupID>\r\n"); | ||
| 607 | + } | ||
| 599 | if (channel.getChannelType() == 2) { // 业务分组/虚拟组织/行政区划 不设置以下属性 | 608 | if (channel.getChannelType() == 2) { // 业务分组/虚拟组织/行政区划 不设置以下属性 |
| 600 | catalogXml.append("<Model>" + channel.getModel() + "</Model>\r\n"); | 609 | catalogXml.append("<Model>" + channel.getModel() + "</Model>\r\n"); |
| 601 | catalogXml.append("<Owner>0</Owner>\r\n"); | 610 | catalogXml.append("<Owner>0</Owner>\r\n"); |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java
| @@ -190,6 +190,10 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen | @@ -190,6 +190,10 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen | ||
| 190 | 190 | ||
| 191 | private void sendResponse(RequestEvent evt, Response response) throws InvalidArgumentException, SipException { | 191 | private void sendResponse(RequestEvent evt, Response response) throws InvalidArgumentException, SipException { |
| 192 | ServerTransaction serverTransaction = getServerTransaction(evt); | 192 | ServerTransaction serverTransaction = getServerTransaction(evt); |
| 193 | + if (serverTransaction == null) { | ||
| 194 | + logger.warn("回复失败:{}", response); | ||
| 195 | + return; | ||
| 196 | + } | ||
| 193 | serverTransaction.sendResponse(response); | 197 | serverTransaction.sendResponse(response); |
| 194 | if (serverTransaction.getDialog() != null) serverTransaction.getDialog().delete(); | 198 | if (serverTransaction.getDialog() != null) serverTransaction.getDialog().delete(); |
| 195 | } | 199 | } |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/CatalogNotifyMessageHandler.java
| @@ -79,6 +79,11 @@ public class CatalogNotifyMessageHandler extends SIPRequestProcessorParent imple | @@ -79,6 +79,11 @@ public class CatalogNotifyMessageHandler extends SIPRequestProcessorParent imple | ||
| 79 | deviceChannel.setParental(1); | 79 | deviceChannel.setParental(1); |
| 80 | deviceChannel.setParentId(catalog.getParentId()); | 80 | deviceChannel.setParentId(catalog.getParentId()); |
| 81 | deviceChannel.setRegisterWay(1); | 81 | deviceChannel.setRegisterWay(1); |
| 82 | + if (catalog.getParentId() != null && catalog.getParentId().length() <= 10) { | ||
| 83 | + deviceChannel.setCivilCode(catalog.getParentId()); | ||
| 84 | + }else { | ||
| 85 | + deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision()); | ||
| 86 | + } | ||
| 82 | deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision()); | 87 | deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision()); |
| 83 | deviceChannel.setModel("live"); | 88 | deviceChannel.setModel("live"); |
| 84 | deviceChannel.setOwner("wvp-pro"); | 89 | deviceChannel.setOwner("wvp-pro"); |
| @@ -95,7 +100,12 @@ public class CatalogNotifyMessageHandler extends SIPRequestProcessorParent imple | @@ -95,7 +100,12 @@ public class CatalogNotifyMessageHandler extends SIPRequestProcessorParent imple | ||
| 95 | DeviceChannel deviceChannel = storage.queryChannel(channel.getDeviceId(), channel.getChannelId()); | 100 | DeviceChannel deviceChannel = storage.queryChannel(channel.getDeviceId(), channel.getChannelId()); |
| 96 | deviceChannel.setParental(0); | 101 | deviceChannel.setParental(0); |
| 97 | deviceChannel.setParentId(channel.getCatalogId()); | 102 | deviceChannel.setParentId(channel.getCatalogId()); |
| 98 | - deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0, 6)); | 103 | + if (channel.getCatalogId() != null && channel.getCatalogId().length() <= 10) { |
| 104 | + channel.setCivilCode(channel.getCatalogId()); | ||
| 105 | + }else { | ||
| 106 | + deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision()); | ||
| 107 | + } | ||
| 108 | + | ||
| 99 | allChannels.add(deviceChannel); | 109 | allChannels.add(deviceChannel); |
| 100 | } | 110 | } |
| 101 | } | 111 | } |
| @@ -116,7 +126,11 @@ public class CatalogNotifyMessageHandler extends SIPRequestProcessorParent imple | @@ -116,7 +126,11 @@ public class CatalogNotifyMessageHandler extends SIPRequestProcessorParent imple | ||
| 116 | deviceChannel.setStatus(1); | 126 | deviceChannel.setStatus(1); |
| 117 | deviceChannel.setParentId(gbStream.getCatalogId()); | 127 | deviceChannel.setParentId(gbStream.getCatalogId()); |
| 118 | deviceChannel.setRegisterWay(1); | 128 | deviceChannel.setRegisterWay(1); |
| 119 | - deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision()); | 129 | + if (gbStream.getCatalogId() != null && gbStream.getCatalogId().length() <= 10) { |
| 130 | + deviceChannel.setCivilCode(gbStream.getCatalogId()); | ||
| 131 | + }else { | ||
| 132 | + deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision()); | ||
| 133 | + } | ||
| 120 | deviceChannel.setModel("live"); | 134 | deviceChannel.setModel("live"); |
| 121 | deviceChannel.setOwner("wvp-pro"); | 135 | deviceChannel.setOwner("wvp-pro"); |
| 122 | deviceChannel.setParental(0); | 136 | deviceChannel.setParental(0); |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java
| @@ -93,7 +93,11 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem | @@ -93,7 +93,11 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem | ||
| 93 | deviceChannel.setParental(1); | 93 | deviceChannel.setParental(1); |
| 94 | deviceChannel.setParentId(catalog.getParentId()); | 94 | deviceChannel.setParentId(catalog.getParentId()); |
| 95 | deviceChannel.setRegisterWay(1); | 95 | deviceChannel.setRegisterWay(1); |
| 96 | - deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision()); | 96 | + if (catalog.getParentId() != null && catalog.getParentId().length() < 10) { |
| 97 | + deviceChannel.setCivilCode(catalog.getParentId()); | ||
| 98 | + }else { | ||
| 99 | + deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision()); | ||
| 100 | + } | ||
| 97 | allChannels.add(deviceChannel); | 101 | allChannels.add(deviceChannel); |
| 98 | } | 102 | } |
| 99 | } | 103 | } |
| @@ -108,7 +112,11 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem | @@ -108,7 +112,11 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem | ||
| 108 | deviceChannel.setChannelType(0); | 112 | deviceChannel.setChannelType(0); |
| 109 | deviceChannel.setParental(0); | 113 | deviceChannel.setParental(0); |
| 110 | deviceChannel.setParentId(channel.getCatalogId()); | 114 | deviceChannel.setParentId(channel.getCatalogId()); |
| 111 | - deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0, 6)); | 115 | + if (channel.getCatalogId() != null && channel.getCatalogId().length() < 10) { |
| 116 | + deviceChannel.setCivilCode(channel.getCatalogId()); | ||
| 117 | + }else { | ||
| 118 | + deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision()); | ||
| 119 | + } | ||
| 112 | allChannels.add(deviceChannel); | 120 | allChannels.add(deviceChannel); |
| 113 | } | 121 | } |
| 114 | } | 122 | } |
| @@ -131,7 +139,11 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem | @@ -131,7 +139,11 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem | ||
| 131 | deviceChannel.setStatus(1); | 139 | deviceChannel.setStatus(1); |
| 132 | deviceChannel.setParentId(gbStream.getCatalogId()); | 140 | deviceChannel.setParentId(gbStream.getCatalogId()); |
| 133 | deviceChannel.setRegisterWay(1); | 141 | deviceChannel.setRegisterWay(1); |
| 134 | - deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision()); | 142 | + if (gbStream.getCatalogId() != null && gbStream.getCatalogId().length() < 10) { |
| 143 | + deviceChannel.setCivilCode(gbStream.getCatalogId()); | ||
| 144 | + }else { | ||
| 145 | + deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision()); | ||
| 146 | + } | ||
| 135 | deviceChannel.setModel("live"); | 147 | deviceChannel.setModel("live"); |
| 136 | deviceChannel.setOwner("wvp-pro"); | 148 | deviceChannel.setOwner("wvp-pro"); |
| 137 | deviceChannel.setParental(0); | 149 | deviceChannel.setParental(0); |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/response/impl/RegisterResponseProcessor.java
| @@ -90,10 +90,12 @@ public class RegisterResponseProcessor extends SIPResponseProcessorAbstract { | @@ -90,10 +90,12 @@ public class RegisterResponseProcessor extends SIPResponseProcessorAbstract { | ||
| 90 | redisCatchStorage.delPlatformCatchInfo(platformGBId); | 90 | redisCatchStorage.delPlatformCatchInfo(platformGBId); |
| 91 | // 取回Expires设置,避免注销过程中被置为0 | 91 | // 取回Expires设置,避免注销过程中被置为0 |
| 92 | ParentPlatform parentPlatformTmp = storager.queryParentPlatByServerGBId(platformGBId); | 92 | ParentPlatform parentPlatformTmp = storager.queryParentPlatByServerGBId(platformGBId); |
| 93 | - parentPlatformTmp.setStatus("注册".equals(action)); | ||
| 94 | - redisCatchStorage.updatePlatformRegister(parentPlatformTmp); | ||
| 95 | - redisCatchStorage.updatePlatformKeepalive(parentPlatformTmp); | ||
| 96 | - parentPlatformCatch.setParentPlatform(parentPlatformTmp); | 93 | + if (parentPlatformTmp != null) { |
| 94 | + parentPlatformTmp.setStatus("注册".equals(action)); | ||
| 95 | + redisCatchStorage.updatePlatformRegister(parentPlatformTmp); | ||
| 96 | + redisCatchStorage.updatePlatformKeepalive(parentPlatformTmp); | ||
| 97 | + parentPlatformCatch.setParentPlatform(parentPlatformTmp); | ||
| 98 | + } | ||
| 97 | redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch); | 99 | redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch); |
| 98 | storager.updateParentPlatformStatus(platformGBId, "注册".equals(action)); | 100 | storager.updateParentPlatformStatus(platformGBId, "注册".equals(action)); |
| 99 | if ("注销".equals(action)) { | 101 | if ("注销".equals(action)) { |
src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
| @@ -204,19 +204,47 @@ public class XmlUtil { | @@ -204,19 +204,47 @@ public class XmlUtil { | ||
| 204 | deviceChannel.setCivilCode(XmlUtil.getText(itemDevice, "CivilCode")); | 204 | deviceChannel.setCivilCode(XmlUtil.getText(itemDevice, "CivilCode")); |
| 205 | deviceChannel.setBlock(XmlUtil.getText(itemDevice, "Block")); | 205 | deviceChannel.setBlock(XmlUtil.getText(itemDevice, "Block")); |
| 206 | deviceChannel.setAddress(XmlUtil.getText(itemDevice, "Address")); | 206 | deviceChannel.setAddress(XmlUtil.getText(itemDevice, "Address")); |
| 207 | + String businessGroupID = XmlUtil.getText(itemDevice, "BusinessGroupID"); | ||
| 207 | if (XmlUtil.getText(itemDevice, "Parental") == null | 208 | if (XmlUtil.getText(itemDevice, "Parental") == null |
| 208 | - || XmlUtil.getText(itemDevice, "Parental") == "") { | ||
| 209 | - deviceChannel.setParental(0); | 209 | + || XmlUtil.getText(itemDevice, "Parental").equals("")) { |
| 210 | + if (deviceChannel.getChannelId().length() <= 10 | ||
| 211 | + || (deviceChannel.getChannelId().length() == 20 && ( | ||
| 212 | + Integer.parseInt(deviceChannel.getChannelId().substring(10, 13)) == 215 | ||
| 213 | + || Integer.parseInt(deviceChannel.getChannelId().substring(10, 13)) == 216 | ||
| 214 | + ) | ||
| 215 | + ) | ||
| 216 | + ) { | ||
| 217 | + deviceChannel.setParental(1); | ||
| 218 | + }else { | ||
| 219 | + deviceChannel.setParental(0); | ||
| 220 | + } | ||
| 210 | } else { | 221 | } else { |
| 211 | - deviceChannel.setParental(Integer.parseInt(XmlUtil.getText(itemDevice, "Parental"))); | 222 | + // 由于海康会错误的发送65535作为这里的取值,所以这里除非是0否则认为是1 |
| 223 | + deviceChannel.setParental(Integer.parseInt(XmlUtil.getText(itemDevice, "Parental")) == 1?1:0); | ||
| 212 | } | 224 | } |
| 213 | deviceChannel.setParentId(XmlUtil.getText(itemDevice, "ParentID")); | 225 | deviceChannel.setParentId(XmlUtil.getText(itemDevice, "ParentID")); |
| 214 | String parentId = XmlUtil.getText(itemDevice, "ParentID"); | 226 | String parentId = XmlUtil.getText(itemDevice, "ParentID"); |
| 215 | - if (parentId != null && parentId.contains("/")) { | ||
| 216 | - String lastParentId = parentId.substring(parentId.lastIndexOf("/") + 1); | ||
| 217 | - deviceChannel.setParentId(lastParentId); | 227 | + if (parentId != null) { |
| 228 | + if (parentId.contains("/")) { | ||
| 229 | + String lastParentId = parentId.substring(parentId.lastIndexOf("/") + 1); | ||
| 230 | + deviceChannel.setParentId(lastParentId); | ||
| 231 | + }else { | ||
| 232 | + deviceChannel.setParentId(parentId); | ||
| 233 | + } | ||
| 218 | }else { | 234 | }else { |
| 219 | - deviceChannel.setParentId(parentId); | 235 | + if (deviceChannel.getChannelId().length() <= 10) { // 此时为行政区划, 上下级行政区划使用DeviceId关联 |
| 236 | + deviceChannel.setParentId(deviceChannel.getChannelId().substring(0, deviceChannel.getChannelId().length() - 2)); | ||
| 237 | + }else if (deviceChannel.getChannelId().length() == 20) { | ||
| 238 | + if (Integer.parseInt(deviceChannel.getChannelId().substring(10, 13)) == 216) { // 虚拟组织 | ||
| 239 | + deviceChannel.setParentId(businessGroupID); | ||
| 240 | + }else if (deviceChannel.getCivilCode() != null) { | ||
| 241 | + // 设备, 无parentId的20位是使用CivilCode表示上级的设备, | ||
| 242 | + // 注:215 业务分组是需要有parentId的 | ||
| 243 | + deviceChannel.setParentId(deviceChannel.getCivilCode()); | ||
| 244 | + } | ||
| 245 | + }else { | ||
| 246 | + deviceChannel.setParentId(deviceChannel.getDeviceId()); | ||
| 247 | + } | ||
| 220 | } | 248 | } |
| 221 | 249 | ||
| 222 | if (XmlUtil.getText(itemDevice, "SafetyWay") == null | 250 | if (XmlUtil.getText(itemDevice, "SafetyWay") == null |
| @@ -277,4 +305,4 @@ public class XmlUtil { | @@ -277,4 +305,4 @@ public class XmlUtil { | ||
| 277 | deviceChannel.setHasAudio(true); // 默认含有音频,播放时再检查是否有音频及是否AAC | 305 | deviceChannel.setHasAudio(true); // 默认含有音频,播放时再检查是否有音频及是否AAC |
| 278 | return deviceChannel; | 306 | return deviceChannel; |
| 279 | } | 307 | } |
| 280 | -} | 308 | +} |
| 281 | \ No newline at end of file | 309 | \ No newline at end of file |
src/main/java/com/genersoft/iot/vmp/service/IGbStreamService.java
| @@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.service; | @@ -2,6 +2,7 @@ package com.genersoft.iot.vmp.service; | ||
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; | 3 | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; |
| 4 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; | 4 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; |
| 5 | +import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | ||
| 5 | import com.github.pagehelper.PageInfo; | 6 | import com.github.pagehelper.PageInfo; |
| 6 | 7 | ||
| 7 | import java.util.List; | 8 | import java.util.List; |
| @@ -40,7 +41,7 @@ public interface IGbStreamService { | @@ -40,7 +41,7 @@ public interface IGbStreamService { | ||
| 40 | */ | 41 | */ |
| 41 | boolean delPlatformInfo(String platformId, List<GbStream> gbStreams); | 42 | boolean delPlatformInfo(String platformId, List<GbStream> gbStreams); |
| 42 | 43 | ||
| 43 | - DeviceChannel getDeviceChannelListByStream(GbStream gbStream, String catalogId, String deviceGBId); | 44 | + DeviceChannel getDeviceChannelListByStream(GbStream gbStream, String catalogId, ParentPlatform platform); |
| 44 | 45 | ||
| 45 | void sendCatalogMsg(GbStream gbStream, String type); | 46 | void sendCatalogMsg(GbStream gbStream, String type); |
| 46 | void sendCatalogMsgs(List<GbStream> gbStreams, String type); | 47 | void sendCatalogMsgs(List<GbStream> gbStreams, String type); |
src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java
| @@ -78,7 +78,7 @@ public class GbStreamServiceImpl implements IGbStreamService { | @@ -78,7 +78,7 @@ public class GbStreamServiceImpl implements IGbStreamService { | ||
| 78 | gbStream.setPlatformId(platformId); | 78 | gbStream.setPlatformId(platformId); |
| 79 | // TODO 修改为批量提交 | 79 | // TODO 修改为批量提交 |
| 80 | platformGbStreamMapper.add(gbStream); | 80 | platformGbStreamMapper.add(gbStream); |
| 81 | - DeviceChannel deviceChannelListByStream = getDeviceChannelListByStream(gbStream, catalogId, parentPlatform.getDeviceGBId()); | 81 | + DeviceChannel deviceChannelListByStream = getDeviceChannelListByStream(gbStream, catalogId, parentPlatform); |
| 82 | deviceChannelList.add(deviceChannelListByStream); | 82 | deviceChannelList.add(deviceChannelListByStream); |
| 83 | } | 83 | } |
| 84 | dataSourceTransactionManager.commit(transactionStatus); //手动提交 | 84 | dataSourceTransactionManager.commit(transactionStatus); //手动提交 |
| @@ -92,19 +92,23 @@ public class GbStreamServiceImpl implements IGbStreamService { | @@ -92,19 +92,23 @@ public class GbStreamServiceImpl implements IGbStreamService { | ||
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | @Override | 94 | @Override |
| 95 | - public DeviceChannel getDeviceChannelListByStream(GbStream gbStream, String catalogId, String deviceGBId) { | 95 | + public DeviceChannel getDeviceChannelListByStream(GbStream gbStream, String catalogId, ParentPlatform platform) { |
| 96 | DeviceChannel deviceChannel = new DeviceChannel(); | 96 | DeviceChannel deviceChannel = new DeviceChannel(); |
| 97 | deviceChannel.setChannelId(gbStream.getGbId()); | 97 | deviceChannel.setChannelId(gbStream.getGbId()); |
| 98 | deviceChannel.setName(gbStream.getName()); | 98 | deviceChannel.setName(gbStream.getName()); |
| 99 | deviceChannel.setLongitude(gbStream.getLongitude()); | 99 | deviceChannel.setLongitude(gbStream.getLongitude()); |
| 100 | deviceChannel.setLatitude(gbStream.getLatitude()); | 100 | deviceChannel.setLatitude(gbStream.getLatitude()); |
| 101 | - deviceChannel.setDeviceId(deviceGBId); | 101 | + deviceChannel.setDeviceId(platform.getDeviceGBId()); |
| 102 | deviceChannel.setManufacture("wvp-pro"); | 102 | deviceChannel.setManufacture("wvp-pro"); |
| 103 | // deviceChannel.setStatus(gbStream.isStatus()?1:0); | 103 | // deviceChannel.setStatus(gbStream.isStatus()?1:0); |
| 104 | deviceChannel.setStatus(1); | 104 | deviceChannel.setStatus(1); |
| 105 | deviceChannel.setParentId(catalogId ==null?gbStream.getCatalogId():catalogId); | 105 | deviceChannel.setParentId(catalogId ==null?gbStream.getCatalogId():catalogId); |
| 106 | deviceChannel.setRegisterWay(1); | 106 | deviceChannel.setRegisterWay(1); |
| 107 | - deviceChannel.setCivilCode(deviceGBId.substring(0, 6)); | 107 | + if (catalogId.length() <= 10) { // 父节点是行政区划,则设置CivilCode使用此行政区划 |
| 108 | + deviceChannel.setCivilCode(catalogId); | ||
| 109 | + }else { | ||
| 110 | + deviceChannel.setCivilCode(platform.getAdministrativeDivision()); | ||
| 111 | + } | ||
| 108 | deviceChannel.setModel("live"); | 112 | deviceChannel.setModel("live"); |
| 109 | deviceChannel.setOwner("wvp-pro"); | 113 | deviceChannel.setOwner("wvp-pro"); |
| 110 | deviceChannel.setParental(0); | 114 | deviceChannel.setParental(0); |
src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorage.java
| @@ -89,7 +89,7 @@ public interface IVideoManagerStorage { | @@ -89,7 +89,7 @@ public interface IVideoManagerStorage { | ||
| 89 | * @param count 每页数量 | 89 | * @param count 每页数量 |
| 90 | * @return | 90 | * @return |
| 91 | */ | 91 | */ |
| 92 | - public PageInfo queryChannelsByDeviceId(String deviceId, String query, Boolean hasSubChannel, Boolean online, int page, int count); | 92 | + public PageInfo queryChannelsByDeviceId(String deviceId, String query, Boolean hasSubChannel, Boolean online, Boolean catalogUnderDevice, int page, int count); |
| 93 | 93 | ||
| 94 | public List<DeviceChannel> queryChannelsByDeviceIdWithStartAndLimit(String deviceId, String query, Boolean hasSubChannel, Boolean online, int start, int limit); | 94 | public List<DeviceChannel> queryChannelsByDeviceIdWithStartAndLimit(String deviceId, String query, Boolean hasSubChannel, Boolean online, int start, int limit); |
| 95 | 95 |
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
| @@ -340,10 +340,15 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { | @@ -340,10 +340,15 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { | ||
| 340 | } | 340 | } |
| 341 | 341 | ||
| 342 | @Override | 342 | @Override |
| 343 | - public PageInfo queryChannelsByDeviceId(String deviceId, String query, Boolean hasSubChannel, Boolean online, int page, int count) { | 343 | + public PageInfo queryChannelsByDeviceId(String deviceId, String query, Boolean hasSubChannel, Boolean online, Boolean catalogUnderDevice, int page, int count) { |
| 344 | // 获取到所有正在播放的流 | 344 | // 获取到所有正在播放的流 |
| 345 | PageHelper.startPage(page, count); | 345 | PageHelper.startPage(page, count); |
| 346 | - List<DeviceChannel> all = deviceChannelMapper.queryChannels(deviceId, null, query, hasSubChannel, online); | 346 | + List<DeviceChannel> all; |
| 347 | + if (catalogUnderDevice != null && catalogUnderDevice) { | ||
| 348 | + all = deviceChannelMapper.queryChannels(deviceId, deviceId, query, hasSubChannel, online); | ||
| 349 | + }else { | ||
| 350 | + all = deviceChannelMapper.queryChannels(deviceId, null, query, hasSubChannel, online); | ||
| 351 | + } | ||
| 347 | return new PageInfo<>(all); | 352 | return new PageInfo<>(all); |
| 348 | } | 353 | } |
| 349 | 354 |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java
| @@ -128,12 +128,14 @@ public class DeviceQuery { | @@ -128,12 +128,14 @@ public class DeviceQuery { | ||
| 128 | @ApiImplicitParam(name="query", value = "查询内容" ,dataTypeClass = String.class), | 128 | @ApiImplicitParam(name="query", value = "查询内容" ,dataTypeClass = String.class), |
| 129 | @ApiImplicitParam(name="online", value = "是否在线" ,dataTypeClass = Boolean.class), | 129 | @ApiImplicitParam(name="online", value = "是否在线" ,dataTypeClass = Boolean.class), |
| 130 | @ApiImplicitParam(name="channelType", value = "设备/子目录-> false/true" ,dataTypeClass = Boolean.class), | 130 | @ApiImplicitParam(name="channelType", value = "设备/子目录-> false/true" ,dataTypeClass = Boolean.class), |
| 131 | + @ApiImplicitParam(name="catalogUnderDevice", value = "是否直属与设备的目录" ,dataTypeClass = Boolean.class), | ||
| 131 | }) | 132 | }) |
| 132 | public ResponseEntity<PageInfo> channels(@PathVariable String deviceId, | 133 | public ResponseEntity<PageInfo> channels(@PathVariable String deviceId, |
| 133 | int page, int count, | 134 | int page, int count, |
| 134 | @RequestParam(required = false) String query, | 135 | @RequestParam(required = false) String query, |
| 135 | @RequestParam(required = false) Boolean online, | 136 | @RequestParam(required = false) Boolean online, |
| 136 | - @RequestParam(required = false) Boolean channelType) { | 137 | + @RequestParam(required = false) Boolean channelType, |
| 138 | + @RequestParam(required = false) Boolean catalogUnderDevice) { | ||
| 137 | // if (logger.isDebugEnabled()) { | 139 | // if (logger.isDebugEnabled()) { |
| 138 | // logger.debug("查询视频设备通道API调用"); | 140 | // logger.debug("查询视频设备通道API调用"); |
| 139 | // } | 141 | // } |
| @@ -141,7 +143,7 @@ public class DeviceQuery { | @@ -141,7 +143,7 @@ public class DeviceQuery { | ||
| 141 | query = null; | 143 | query = null; |
| 142 | } | 144 | } |
| 143 | 145 | ||
| 144 | - PageInfo pageResult = storager.queryChannelsByDeviceId(deviceId, query, channelType, online, page, count); | 146 | + PageInfo pageResult = storager.queryChannelsByDeviceId(deviceId, query, channelType, online, catalogUnderDevice, page, count); |
| 145 | return new ResponseEntity<>(pageResult,HttpStatus.OK); | 147 | return new ResponseEntity<>(pageResult,HttpStatus.OK); |
| 146 | } | 148 | } |
| 147 | 149 |
web_src/src/components/channelList.vue
| @@ -40,6 +40,7 @@ | @@ -40,6 +40,7 @@ | ||
| 40 | <el-table-column label="快照" width="80" align="center"> | 40 | <el-table-column label="快照" width="80" align="center"> |
| 41 | <template slot-scope="scope"> | 41 | <template slot-scope="scope"> |
| 42 | <img style="max-height: 3rem;max-width: 4rem;" | 42 | <img style="max-height: 3rem;max-width: 4rem;" |
| 43 | + v-if="scope.row.subCount === 0 && scope.row.parental === 0" | ||
| 43 | :id="scope.row.deviceId + '_' + scope.row.channelId" | 44 | :id="scope.row.deviceId + '_' + scope.row.channelId" |
| 44 | :src="getSnap(scope.row)" | 45 | :src="getSnap(scope.row)" |
| 45 | @error="getSnapErrorEvent($event.target.id)" | 46 | @error="getSnapErrorEvent($event.target.id)" |
| @@ -89,7 +90,7 @@ | @@ -89,7 +90,7 @@ | ||
| 89 | <el-button size="mini" icon="el-icon-switch-button" type="danger" v-if="!!scope.row.streamId" | 90 | <el-button size="mini" icon="el-icon-switch-button" type="danger" v-if="!!scope.row.streamId" |
| 90 | @click="stopDevicePush(scope.row)">停止 | 91 | @click="stopDevicePush(scope.row)">停止 |
| 91 | </el-button> | 92 | </el-button> |
| 92 | - <el-button size="mini" icon="el-icon-s-open" type="primary" v-if="scope.row.subCount > 0" | 93 | + <el-button size="mini" icon="el-icon-s-open" type="primary" v-if="scope.row.subCount > 0 || scope.row.parental === 1" |
| 93 | @click="changeSubchannel(scope.row)">查看 | 94 | @click="changeSubchannel(scope.row)">查看 |
| 94 | </el-button> | 95 | </el-button> |
| 95 | <el-button size="mini" icon="el-icon-video-camera" type="primary" @click="queryRecords(scope.row)">设备录象 | 96 | <el-button size="mini" icon="el-icon-video-camera" type="primary" @click="queryRecords(scope.row)">设备录象 |
web_src/src/components/common/DeviceTree.vue
| @@ -89,8 +89,8 @@ export default { | @@ -89,8 +89,8 @@ export default { | ||
| 89 | }) | 89 | }) |
| 90 | } | 90 | } |
| 91 | if (node.level === 1) { | 91 | if (node.level === 1) { |
| 92 | - this.deviceService.getAllChannel(true, node.data.id, (catalogData) => { | ||
| 93 | - this.deviceService.getAllChannel(false, node.data.id, (channelData) => { | 92 | + this.deviceService.getAllChannel(true, true, node.data.id, (catalogData) => { |
| 93 | + this.deviceService.getAllChannel(false, true, node.data.id, (channelData) => { | ||
| 94 | let data = catalogData.concat(channelData) | 94 | let data = catalogData.concat(channelData) |
| 95 | this.channelDataHandler(data, resolve) | 95 | this.channelDataHandler(data, resolve) |
| 96 | }) | 96 | }) |
| @@ -109,7 +109,7 @@ export default { | @@ -109,7 +109,7 @@ export default { | ||
| 109 | let nodeList = [] | 109 | let nodeList = [] |
| 110 | for (let i = 0; i < data.length; i++) { | 110 | for (let i = 0; i < data.length; i++) { |
| 111 | let type = 3; | 111 | let type = 3; |
| 112 | - if (data[i].subCount > 0) { | 112 | + if (data[i].subCount > 0 || data[i].parental === 1) { |
| 113 | type = 2; | 113 | type = 2; |
| 114 | }else if (data[i].ptztype === 1 ) { // 1-球机;2-半球;3-固定枪机;4-遥控枪机 | 114 | }else if (data[i].ptztype === 1 ) { // 1-球机;2-半球;3-固定枪机;4-遥控枪机 |
| 115 | type = 4; | 115 | type = 4; |
web_src/src/components/common/jessibuca.vue
| 1 | <template> | 1 | <template> |
| 2 | - <div id="container" ref="containerId" @dblclick="fullscreenSwich" style="width: 100%"> | 2 | + <div ref="container" @dblclick="fullscreenSwich" style="width:100%;height:100%;background-color: #eee;margin:0 auto;"> |
| 3 | <div class="buttons-box" id="buttonsBox"> | 3 | <div class="buttons-box" id="buttonsBox"> |
| 4 | <div class="buttons-box-left"> | 4 | <div class="buttons-box-left"> |
| 5 | <i v-if="!playing" class="iconfont icon-play jessibuca-btn" @click="playBtnClick"></i> | 5 | <i v-if="!playing" class="iconfont icon-play jessibuca-btn" @click="playBtnClick"></i> |
| @@ -71,19 +71,26 @@ export default { | @@ -71,19 +71,26 @@ export default { | ||
| 71 | }, | 71 | }, |
| 72 | methods: { | 72 | methods: { |
| 73 | updatePlayerDomSize() { | 73 | updatePlayerDomSize() { |
| 74 | - let dom = document.getElementById('container'); | ||
| 75 | - const width = dom.parentNode.clientWidth | 74 | + let dom = this.$refs.container; |
| 75 | + let width = dom.parentNode.clientWidth | ||
| 76 | + let height = (9 / 16) * width | ||
| 77 | + | ||
| 78 | + const clientHeight = Math.min(document.body.clientHeight, document.documentElement.clientHeight) | ||
| 79 | + if (height > clientHeight) { | ||
| 80 | + height = clientHeight | ||
| 81 | + width = (16 / 9) * height | ||
| 82 | + } | ||
| 83 | + | ||
| 76 | dom.style.width = width + 'px'; | 84 | dom.style.width = width + 'px'; |
| 77 | - dom.style.height = (9 / 16) * width + "px"; | 85 | + dom.style.height = height + "px"; |
| 78 | }, | 86 | }, |
| 79 | create() { | 87 | create() { |
| 80 | let options = {}; | 88 | let options = {}; |
| 81 | - console.log(this.$refs.containerId) | ||
| 82 | console.log("hasAudio " + this.hasAudio) | 89 | console.log("hasAudio " + this.hasAudio) |
| 83 | 90 | ||
| 84 | this.jessibuca = new window.Jessibuca(Object.assign( | 91 | this.jessibuca = new window.Jessibuca(Object.assign( |
| 85 | { | 92 | { |
| 86 | - container: this.$refs.containerId, | 93 | + container: this.$refs.container, |
| 87 | videoBuffer: 0.2, // 最大缓冲时长,单位秒 | 94 | videoBuffer: 0.2, // 最大缓冲时长,单位秒 |
| 88 | isResize: true, | 95 | isResize: true, |
| 89 | decoder: "static/js/jessibuca/decoder.js", | 96 | decoder: "static/js/jessibuca/decoder.js", |
| @@ -240,7 +247,7 @@ export default { | @@ -240,7 +247,7 @@ export default { | ||
| 240 | this.jessibuca.destroy(); | 247 | this.jessibuca.destroy(); |
| 241 | } | 248 | } |
| 242 | if (document.getElementById("buttonsBox") == null) { | 249 | if (document.getElementById("buttonsBox") == null) { |
| 243 | - document.getElementById("container").appendChild(this.btnDom) | 250 | + this.$refs.container.appendChild(this.btnDom) |
| 244 | } | 251 | } |
| 245 | this.jessibuca = null; | 252 | this.jessibuca = null; |
| 246 | this.playing = false; | 253 | this.playing = false; |
web_src/src/components/devicePosition.vue
| @@ -14,13 +14,14 @@ | @@ -14,13 +14,14 @@ | ||
| 14 | <div ref="infobox" v-if="channel != null " > | 14 | <div ref="infobox" v-if="channel != null " > |
| 15 | <div v-if="channel != null" class="infobox-content"> | 15 | <div v-if="channel != null" class="infobox-content"> |
| 16 | <el-descriptions class="margin-top" :title="channel.name" :column="1" :colon="true" size="mini" :labelStyle="labelStyle" > | 16 | <el-descriptions class="margin-top" :title="channel.name" :column="1" :colon="true" size="mini" :labelStyle="labelStyle" > |
| 17 | - <el-descriptions-item label="生产厂商">{{channel.manufacture}}</el-descriptions-item> | 17 | + <el-descriptions-item label="编号" >{{channel.channelId}}</el-descriptions-item> |
| 18 | <el-descriptions-item label="型号">{{channel.model}}</el-descriptions-item> | 18 | <el-descriptions-item label="型号">{{channel.model}}</el-descriptions-item> |
| 19 | - <el-descriptions-item label="设备归属" >{{channel.owner}}</el-descriptions-item> | 19 | + <el-descriptions-item label="经纬度" >{{channel.longitude}},{{channel.latitude}}</el-descriptions-item> |
| 20 | + <el-descriptions-item label="生产厂商">{{channel.manufacture}}</el-descriptions-item> | ||
| 20 | <el-descriptions-item label="行政区域" >{{channel.civilCode}}</el-descriptions-item> | 21 | <el-descriptions-item label="行政区域" >{{channel.civilCode}}</el-descriptions-item> |
| 22 | + <el-descriptions-item label="设备归属" >{{channel.owner}}</el-descriptions-item> | ||
| 21 | <el-descriptions-item label="安装地址" >{{channel.address == null?'未知': channel.address}}</el-descriptions-item> | 23 | <el-descriptions-item label="安装地址" >{{channel.address == null?'未知': channel.address}}</el-descriptions-item> |
| 22 | <el-descriptions-item label="云台类型" >{{channel.ptztypeText}}</el-descriptions-item> | 24 | <el-descriptions-item label="云台类型" >{{channel.ptztypeText}}</el-descriptions-item> |
| 23 | - <el-descriptions-item label="经纬度" >{{channel.longitude}},{{channel.latitude}}</el-descriptions-item> | ||
| 24 | <el-descriptions-item label="状态"> | 25 | <el-descriptions-item label="状态"> |
| 25 | <el-tag size="small" v-if="channel.status === 1">在线</el-tag> | 26 | <el-tag size="small" v-if="channel.status === 1">在线</el-tag> |
| 26 | <el-tag size="small" type="info" v-if="channel.status === 0">离线</el-tag> | 27 | <el-tag size="small" type="info" v-if="channel.status === 0">离线</el-tag> |
| @@ -75,7 +76,7 @@ export default { | @@ -75,7 +76,7 @@ export default { | ||
| 75 | console.log(this.$route.query.deviceId) | 76 | console.log(this.$route.query.deviceId) |
| 76 | // this.$refs.deviceTree.openByDeivceId(this.$route.query.deivceId) | 77 | // this.$refs.deviceTree.openByDeivceId(this.$route.query.deivceId) |
| 77 | setTimeout(()=>{ // 延迟以等待地图加载完成 TODO 后续修改为通过是实际这;状态加回调完成 | 78 | setTimeout(()=>{ // 延迟以等待地图加载完成 TODO 后续修改为通过是实际这;状态加回调完成 |
| 78 | - this.deviceService.getAllChannel(false, this.$route.query.deviceId, this.channelsHandler) | 79 | + this.deviceService.getAllChannel(false, false, this.$route.query.deviceId, this.channelsHandler) |
| 79 | }, 1000) | 80 | }, 1000) |
| 80 | 81 | ||
| 81 | } | 82 | } |
| @@ -141,7 +142,13 @@ export default { | @@ -141,7 +142,13 @@ export default { | ||
| 141 | zIndex: 3000, // 菜单样式 z-index | 142 | zIndex: 3000, // 菜单样式 z-index |
| 142 | }); | 143 | }); |
| 143 | } else { | 144 | } else { |
| 144 | - this.deviceOrSubChannelMenu(event, data) | 145 | + if (typeof data.channelId === "undefined") { |
| 146 | + this.deviceOrSubChannelMenu(event, data) | ||
| 147 | + }else { | ||
| 148 | + // TODO 子目录暂时不支持查询他下面所有设备, 支持支持查询直属于这个目录的设备 | ||
| 149 | + this.deviceOrSubChannelMenu(event, data) | ||
| 150 | + } | ||
| 151 | + | ||
| 145 | } | 152 | } |
| 146 | 153 | ||
| 147 | }, | 154 | }, |
| @@ -155,7 +162,7 @@ export default { | @@ -155,7 +162,7 @@ export default { | ||
| 155 | disabled: false, | 162 | disabled: false, |
| 156 | onClick: () => { | 163 | onClick: () => { |
| 157 | if (!data.channelId) { | 164 | if (!data.channelId) { |
| 158 | - this.deviceService.getAllChannel(false, data.deviceId, this.channelsHandler) | 165 | + this.deviceService.getAllChannel(false, false, data.deviceId, this.channelsHandler) |
| 159 | } | 166 | } |
| 160 | if (data.channelId && data.subCount > 0) { | 167 | if (data.channelId && data.subCount > 0) { |
| 161 | // 点击子目录 | 168 | // 点击子目录 |
web_src/src/components/live.vue
| @@ -15,10 +15,10 @@ | @@ -15,10 +15,10 @@ | ||
| 15 | <div style="width: 99%;height: 85vh;display: flex;flex-wrap: wrap;background-color: #000;"> | 15 | <div style="width: 99%;height: 85vh;display: flex;flex-wrap: wrap;background-color: #000;"> |
| 16 | <div v-for="i in spilt" :key="i" class="play-box" | 16 | <div v-for="i in spilt" :key="i" class="play-box" |
| 17 | :style="liveStyle" :class="{redborder:playerIdx == (i-1)}" | 17 | :style="liveStyle" :class="{redborder:playerIdx == (i-1)}" |
| 18 | - @click="playerIdx = (i-1)" | ||
| 19 | - > | 18 | + @click="playerIdx = (i-1)"> |
| 20 | <div v-if="!videoUrl[i-1]" style="color: #ffffff;font-size: 30px;font-weight: bold;">{{ i }}</div> | 19 | <div v-if="!videoUrl[i-1]" style="color: #ffffff;font-size: 30px;font-weight: bold;">{{ i }}</div> |
| 21 | - <player v-else :videoUrl="videoUrl[i-1]" fluent autoplay @screenshot="shot" @destroy="destroy"/> | 20 | + <player ref="player" v-else :videoUrl="videoUrl[i-1]" fluent autoplay @screenshot="shot" |
| 21 | + @destroy="destroy"/> | ||
| 22 | </div> | 22 | </div> |
| 23 | </div> | 23 | </div> |
| 24 | </el-main> | 24 | </el-main> |
| @@ -60,13 +60,22 @@ export default { | @@ -60,13 +60,22 @@ export default { | ||
| 60 | 60 | ||
| 61 | computed: { | 61 | computed: { |
| 62 | liveStyle() { | 62 | liveStyle() { |
| 63 | - if (this.spilt == 1) { | ||
| 64 | - return {width: '100%', height: '100%'} | ||
| 65 | - } else if (this.spilt == 4) { | ||
| 66 | - return {width: '49%', height: '49%'} | ||
| 67 | - } else if (this.spilt == 9) { | ||
| 68 | - return {width: '32%', height: '32%'} | 63 | + let style = {width: '100%', height: '100%'} |
| 64 | + switch (this.spilt) { | ||
| 65 | + case 4: | ||
| 66 | + style = {width: '49%', height: '49%'} | ||
| 67 | + break | ||
| 68 | + case 9: | ||
| 69 | + style = {width: '32%', height: '32%'} | ||
| 70 | + break | ||
| 69 | } | 71 | } |
| 72 | + this.$nextTick(() => { | ||
| 73 | + for (let i = 0; i < this.spilt; i++) { | ||
| 74 | + const player = this.$refs.player | ||
| 75 | + player && player[i] && player[i].updatePlayerDomSize() | ||
| 76 | + } | ||
| 77 | + }) | ||
| 78 | + return style | ||
| 70 | } | 79 | } |
| 71 | }, | 80 | }, |
| 72 | watch: { | 81 | watch: { |
web_src/src/components/service/DeviceService.js
| @@ -45,20 +45,20 @@ class DeviceService{ | @@ -45,20 +45,20 @@ class DeviceService{ | ||
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | 47 | ||
| 48 | - getAllChannel(isCatalog, deviceId, callback, errorCallback) { | 48 | + getAllChannel(isCatalog, catalogUnderDevice, deviceId, callback, errorCallback) { |
| 49 | let currentPage = 1; | 49 | let currentPage = 1; |
| 50 | let count = 100; | 50 | let count = 100; |
| 51 | let catalogList = [] | 51 | let catalogList = [] |
| 52 | - this.getAllChannelIteration(isCatalog, deviceId, catalogList, currentPage, count, callback, errorCallback) | 52 | + this.getAllChannelIteration(isCatalog, catalogUnderDevice, deviceId, catalogList, currentPage, count, callback, errorCallback) |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | - getAllChannelIteration(isCatalog, deviceId, catalogList, currentPage, count, callback, errorCallback) { | ||
| 56 | - this.getChanel(isCatalog, deviceId, currentPage, count, (data) => { | 55 | + getAllChannelIteration(isCatalog, catalogUnderDevice, deviceId, catalogList, currentPage, count, callback, errorCallback) { |
| 56 | + this.getChanel(isCatalog, catalogUnderDevice, deviceId, currentPage, count, (data) => { | ||
| 57 | if (data.list) { | 57 | if (data.list) { |
| 58 | catalogList = catalogList.concat(data.list); | 58 | catalogList = catalogList.concat(data.list); |
| 59 | if (catalogList.length < data.total) { | 59 | if (catalogList.length < data.total) { |
| 60 | currentPage ++ | 60 | currentPage ++ |
| 61 | - this.getAllChannelIteration(isCatalog, deviceId, catalogList, currentPage, count, callback, errorCallback) | 61 | + this.getAllChannelIteration(isCatalog,catalogUnderDevice, deviceId, catalogList, currentPage, count, callback, errorCallback) |
| 62 | }else { | 62 | }else { |
| 63 | console.log(1) | 63 | console.log(1) |
| 64 | if (typeof (callback) == "function") callback(catalogList) | 64 | if (typeof (callback) == "function") callback(catalogList) |
| @@ -66,7 +66,7 @@ class DeviceService{ | @@ -66,7 +66,7 @@ class DeviceService{ | ||
| 66 | } | 66 | } |
| 67 | }, errorCallback) | 67 | }, errorCallback) |
| 68 | } | 68 | } |
| 69 | - getChanel(isCatalog, deviceId, currentPage, count, callback, errorCallback) { | 69 | + getChanel(isCatalog, catalogUnderDevice, deviceId, currentPage, count, callback, errorCallback) { |
| 70 | this.$axios({ | 70 | this.$axios({ |
| 71 | method: 'get', | 71 | method: 'get', |
| 72 | url: `/api/device/query/devices/${deviceId}/channels`, | 72 | url: `/api/device/query/devices/${deviceId}/channels`, |
| @@ -75,7 +75,8 @@ class DeviceService{ | @@ -75,7 +75,8 @@ class DeviceService{ | ||
| 75 | count: count, | 75 | count: count, |
| 76 | query: "", | 76 | query: "", |
| 77 | online: "", | 77 | online: "", |
| 78 | - channelType: isCatalog | 78 | + channelType: isCatalog, |
| 79 | + catalogUnderDevice: catalogUnderDevice | ||
| 79 | } | 80 | } |
| 80 | }).then((res) =>{ | 81 | }).then((res) =>{ |
| 81 | if (typeof (callback) == "function") callback(res.data) | 82 | if (typeof (callback) == "function") callback(res.data) |