Commit a2cac5ca12f100d052cb31122a84de4bba829bca
Merge branch '2.6.9' into wvp-28181-2.0
# Conflicts: # pom.xml
Showing
13 changed files
with
41 additions
and
28 deletions
libs/jdbc-x86/bcprov-jdk15on-1.70.jar
0 → 100644
No preview for this file type
libs/jdbc-x86/kingbase8-8.6.0.jar
0 → 100644
No preview for this file type
libs/jdbc-x86/kingbase8-8.6.0.jre6.jar
0 → 100644
No preview for this file type
libs/jdbc-x86/kingbase8-8.6.0.jre7.jar
0 → 100644
No preview for this file type
libs/jdbc-x86/postgresql-42.2.9.jar
0 → 100644
No preview for this file type
libs/jdbc-x86/postgresql-42.2.9.jre6.jar
0 → 100644
No preview for this file type
libs/jdbc-x86/postgresql-42.2.9.jre7.jar
0 → 100644
No preview for this file type
pom.xml
| @@ -143,17 +143,24 @@ | @@ -143,17 +143,24 @@ | ||
| 143 | <version>42.5.1</version> | 143 | <version>42.5.1</version> |
| 144 | </dependency> | 144 | </dependency> |
| 145 | 145 | ||
| 146 | - <!-- kingbase人大金仓 --> | ||
| 147 | - <!-- 手动下载驱动后安装 --> | ||
| 148 | - <!-- mvn install:install-file -Dfile=/home/lin/soft/kingbase/jdbc-aarch/kingbase8-8.6.0.jar -DgroupId=com.kingbase -DartifactId=kingbase8 | ||
| 149 | - -Dversion=8.6.0 -Dpackaging=jar --> | ||
| 150 | - <dependency> | ||
| 151 | - <groupId>com.kingbase</groupId> | ||
| 152 | - <artifactId>kingbase8</artifactId> | ||
| 153 | - <version>8.6.0</version> | ||
| 154 | - <scope>system</scope> | ||
| 155 | - <systemPath>${basedir}/libs/jdbc-aarch/kingbase8-8.6.0.jar</systemPath> | ||
| 156 | - </dependency> | 146 | + <!-- kingbase人大金仓 --> |
| 147 | + <!-- 手动下载驱动后安装 --> | ||
| 148 | + <!-- mvn install:install-file -Dfile=/home/lin/soft/kingbase/jdbc-aarch/kingbase8-8.6.0.jar -DgroupId=com.kingbase -DartifactId=kingbase8 -Dversion=8.6.0 -Dpackaging=jar | ||
| 149 | + --> | ||
| 150 | + <dependency> | ||
| 151 | + <groupId>com.kingbase</groupId> | ||
| 152 | + <artifactId>kingbase8</artifactId> | ||
| 153 | + <version>8.6.0</version> | ||
| 154 | + <scope>system</scope> | ||
| 155 | + <systemPath>${basedir}/libs/jdbc-aarch/kingbase8-8.6.0.jar</systemPath> | ||
| 156 | + </dependency> | ||
| 157 | + <dependency> | ||
| 158 | + <groupId>com.kingbase</groupId> | ||
| 159 | + <artifactId>kingbase8</artifactId> | ||
| 160 | + <version>8.6.0</version> | ||
| 161 | + <scope>system</scope> | ||
| 162 | + <systemPath>${basedir}/libs/jdbc-x86/kingbase8-8.6.0.jar</systemPath> | ||
| 163 | + </dependency> | ||
| 157 | 164 | ||
| 158 | <!--Mybatis分页插件 --> | 165 | <!--Mybatis分页插件 --> |
| 159 | <dependency> | 166 | <dependency> |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
| @@ -598,7 +598,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -598,7 +598,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 598 | 598 | ||
| 599 | SIPRequest notifyRequest = headerProviderPlatformProvider.createNotifyRequest(parentPlatform, catalogXmlContent, subscribeInfo); | 599 | SIPRequest notifyRequest = headerProviderPlatformProvider.createNotifyRequest(parentPlatform, catalogXmlContent, subscribeInfo); |
| 600 | 600 | ||
| 601 | - sipSender.transmitRequest(parentPlatform.getDeviceIp(), notifyRequest); | 601 | + sipSender.transmitRequest(parentPlatform.getDeviceIp(), notifyRequest, errorEvent, okEvent); |
| 602 | } | 602 | } |
| 603 | 603 | ||
| 604 | private String getCatalogXmlContentForCatalogAddOrUpdate(ParentPlatform parentPlatform, List<DeviceChannel> channels, int sumNum, String type, SubscribeInfo subscribeInfo) { | 604 | private String getCatalogXmlContentForCatalogAddOrUpdate(ParentPlatform parentPlatform, List<DeviceChannel> channels, int sumNum, String type, SubscribeInfo subscribeInfo) { |
| @@ -610,7 +610,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -610,7 +610,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 610 | .append("<CmdType>Catalog</CmdType>\r\n") | 610 | .append("<CmdType>Catalog</CmdType>\r\n") |
| 611 | .append("<SN>" + (int) ((Math.random() * 9 + 1) * 100000) + "</SN>\r\n") | 611 | .append("<SN>" + (int) ((Math.random() * 9 + 1) * 100000) + "</SN>\r\n") |
| 612 | .append("<DeviceID>" + parentPlatform.getDeviceGBId() + "</DeviceID>\r\n") | 612 | .append("<DeviceID>" + parentPlatform.getDeviceGBId() + "</DeviceID>\r\n") |
| 613 | - .append("<SumNum>1</SumNum>\r\n") | 613 | + .append("<SumNum>"+ channels.size() +"</SumNum>\r\n") |
| 614 | .append("<DeviceList Num=\"" + channels.size() + "\">\r\n"); | 614 | .append("<DeviceList Num=\"" + channels.size() + "\">\r\n"); |
| 615 | if (channels.size() > 0) { | 615 | if (channels.size() > 0) { |
| 616 | for (DeviceChannel channel : channels) { | 616 | for (DeviceChannel channel : channels) { |
src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java
| @@ -250,9 +250,6 @@ public class GbStreamServiceImpl implements IGbStreamService { | @@ -250,9 +250,6 @@ public class GbStreamServiceImpl implements IGbStreamService { | ||
| 250 | if (platform == null) { | 250 | if (platform == null) { |
| 251 | return ; | 251 | return ; |
| 252 | } | 252 | } |
| 253 | - if (ObjectUtils.isEmpty(catalogId)) { | ||
| 254 | - catalogId = platform.getDeviceGBId(); | ||
| 255 | - } | ||
| 256 | if (platformGbStreamMapper.delByPlatformAndCatalogId(platformId, catalogId) > 0) { | 253 | if (platformGbStreamMapper.delByPlatformAndCatalogId(platformId, catalogId) > 0) { |
| 257 | List<GbStream> gbStreams = platformGbStreamMapper.queryChannelInParentPlatformAndCatalog(platformId, catalogId); | 254 | List<GbStream> gbStreams = platformGbStreamMapper.queryChannelInParentPlatformAndCatalog(platformId, catalogId); |
| 258 | List<DeviceChannel> deviceChannelList = new ArrayList<>(); | 255 | List<DeviceChannel> deviceChannelList = new ArrayList<>(); |
src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java
| @@ -103,6 +103,9 @@ public interface PlatformGbStreamMapper { | @@ -103,6 +103,9 @@ public interface PlatformGbStreamMapper { | ||
| 103 | "</script>") | 103 | "</script>") |
| 104 | void delByAppAndStreamsByPlatformId(@Param("gbStreams") List<GbStream> gbStreams, @Param("platformId") String platformId); | 104 | void delByAppAndStreamsByPlatformId(@Param("gbStreams") List<GbStream> gbStreams, @Param("platformId") String platformId); |
| 105 | 105 | ||
| 106 | - @Delete("DELETE from wvp_platform_gb_stream WHERE platform_id=#{platformId} and catalog_id=#{catalogId}") | 106 | + @Delete("<script> "+ |
| 107 | + "DELETE from wvp_platform_gb_stream WHERE platform_id=#{platformId}" + | ||
| 108 | + " <if test='catalogId != null' > and catalog_id=#{catalogId}</if>" + | ||
| 109 | + "</script>") | ||
| 107 | int delByPlatformAndCatalogId(@Param("platformId") String platformId, @Param("catalogId") String catalogId); | 110 | int delByPlatformAndCatalogId(@Param("platformId") String platformId, @Param("catalogId") String catalogId); |
| 108 | } | 111 | } |
src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java
| @@ -68,6 +68,7 @@ public class ApiDeviceController { | @@ -68,6 +68,7 @@ public class ApiDeviceController { | ||
| 68 | // if (logger.isDebugEnabled()) { | 68 | // if (logger.isDebugEnabled()) { |
| 69 | // logger.debug("查询所有视频设备API调用"); | 69 | // logger.debug("查询所有视频设备API调用"); |
| 70 | // } | 70 | // } |
| 71 | + | ||
| 71 | JSONObject result = new JSONObject(); | 72 | JSONObject result = new JSONObject(); |
| 72 | List<Device> devices; | 73 | List<Device> devices; |
| 73 | if (start == null || limit ==null) { | 74 | if (start == null || limit ==null) { |
| @@ -80,7 +81,7 @@ public class ApiDeviceController { | @@ -80,7 +81,7 @@ public class ApiDeviceController { | ||
| 80 | } | 81 | } |
| 81 | 82 | ||
| 82 | JSONArray deviceJSONList = new JSONArray(); | 83 | JSONArray deviceJSONList = new JSONArray(); |
| 83 | - for (Device device : devices) { | 84 | + devices.stream().forEach(device -> { |
| 84 | JSONObject deviceJsonObject = new JSONObject(); | 85 | JSONObject deviceJsonObject = new JSONObject(); |
| 85 | deviceJsonObject.put("ID", device.getDeviceId()); | 86 | deviceJsonObject.put("ID", device.getDeviceId()); |
| 86 | deviceJsonObject.put("Name", device.getName()); | 87 | deviceJsonObject.put("Name", device.getName()); |
| @@ -99,7 +100,7 @@ public class ApiDeviceController { | @@ -99,7 +100,7 @@ public class ApiDeviceController { | ||
| 99 | deviceJsonObject.put("UpdatedAt", ""); | 100 | deviceJsonObject.put("UpdatedAt", ""); |
| 100 | deviceJsonObject.put("CreatedAt", ""); | 101 | deviceJsonObject.put("CreatedAt", ""); |
| 101 | deviceJSONList.add(deviceJsonObject); | 102 | deviceJSONList.add(deviceJsonObject); |
| 102 | - } | 103 | + }); |
| 103 | result.put("DeviceList",deviceJSONList); | 104 | result.put("DeviceList",deviceJSONList); |
| 104 | return result; | 105 | return result; |
| 105 | } | 106 | } |
| @@ -114,7 +115,6 @@ public class ApiDeviceController { | @@ -114,7 +115,6 @@ public class ApiDeviceController { | ||
| 114 | @RequestParam(required = false)String q, | 115 | @RequestParam(required = false)String q, |
| 115 | @RequestParam(required = false)Boolean online ){ | 116 | @RequestParam(required = false)Boolean online ){ |
| 116 | 117 | ||
| 117 | - | ||
| 118 | JSONObject result = new JSONObject(); | 118 | JSONObject result = new JSONObject(); |
| 119 | List<DeviceChannelExtend> deviceChannels; | 119 | List<DeviceChannelExtend> deviceChannels; |
| 120 | List<String> channelIds = null; | 120 | List<String> channelIds = null; |
| @@ -127,13 +127,19 @@ public class ApiDeviceController { | @@ -127,13 +127,19 @@ public class ApiDeviceController { | ||
| 127 | deviceChannels = allDeviceChannelList; | 127 | deviceChannels = allDeviceChannelList; |
| 128 | result.put("ChannelCount", deviceChannels.size()); | 128 | result.put("ChannelCount", deviceChannels.size()); |
| 129 | }else { | 129 | }else { |
| 130 | - deviceChannels = storager.queryChannelsByDeviceIdWithStartAndLimit(serial,channelIds, null, null, online,start, limit); | ||
| 131 | - int total = allDeviceChannelList.size(); | ||
| 132 | - result.put("ChannelCount", total); | 130 | + if (start > allDeviceChannelList.size()) { |
| 131 | + deviceChannels = new ArrayList<>(); | ||
| 132 | + }else { | ||
| 133 | + if (start + limit < allDeviceChannelList.size()) { | ||
| 134 | + deviceChannels = allDeviceChannelList.subList(start, start + limit); | ||
| 135 | + }else { | ||
| 136 | + deviceChannels = allDeviceChannelList.subList(start, allDeviceChannelList.size()); | ||
| 137 | + } | ||
| 138 | + } | ||
| 139 | + result.put("ChannelCount", allDeviceChannelList.size()); | ||
| 133 | } | 140 | } |
| 134 | - | ||
| 135 | JSONArray channleJSONList = new JSONArray(); | 141 | JSONArray channleJSONList = new JSONArray(); |
| 136 | - for (DeviceChannelExtend deviceChannelExtend : deviceChannels) { | 142 | + deviceChannels.stream().forEach(deviceChannelExtend -> { |
| 137 | JSONObject deviceJOSNChannel = new JSONObject(); | 143 | JSONObject deviceJOSNChannel = new JSONObject(); |
| 138 | deviceJOSNChannel.put("ID", deviceChannelExtend.getChannelId()); | 144 | deviceJOSNChannel.put("ID", deviceChannelExtend.getChannelId()); |
| 139 | deviceJOSNChannel.put("DeviceID", deviceChannelExtend.getDeviceId()); | 145 | deviceJOSNChannel.put("DeviceID", deviceChannelExtend.getDeviceId()); |
| @@ -166,7 +172,7 @@ public class ApiDeviceController { | @@ -166,7 +172,7 @@ public class ApiDeviceController { | ||
| 166 | deviceJOSNChannel.put("StreamID", deviceChannelExtend.getStreamId()); // StreamID 直播流ID, 有值表示正在直播 | 172 | deviceJOSNChannel.put("StreamID", deviceChannelExtend.getStreamId()); // StreamID 直播流ID, 有值表示正在直播 |
| 167 | deviceJOSNChannel.put("NumOutputs ", -1); // 直播在线人数 | 173 | deviceJOSNChannel.put("NumOutputs ", -1); // 直播在线人数 |
| 168 | channleJSONList.add(deviceJOSNChannel); | 174 | channleJSONList.add(deviceJOSNChannel); |
| 169 | - } | 175 | + }); |
| 170 | result.put("ChannelList", channleJSONList); | 176 | result.put("ChannelList", channleJSONList); |
| 171 | return result; | 177 | return result; |
| 172 | } | 178 | } |
src/main/resources/all-application.yml
| @@ -54,9 +54,9 @@ spring: | @@ -54,9 +54,9 @@ spring: | ||
| 54 | password: root123 | 54 | password: root123 |
| 55 | hikari: | 55 | hikari: |
| 56 | connection-timeout: 20000 # 是客户端等待连接池连接的最大毫秒数 | 56 | connection-timeout: 20000 # 是客户端等待连接池连接的最大毫秒数 |
| 57 | - initialSize: 10 # 连接池初始化连接数 | 57 | + initialSize: 50 # 连接池初始化连接数 |
| 58 | maximum-pool-size: 200 # 连接池最大连接数 | 58 | maximum-pool-size: 200 # 连接池最大连接数 |
| 59 | - minimum-idle: 5 # 连接池最小空闲连接数 | 59 | + minimum-idle: 10 # 连接池最小空闲连接数 |
| 60 | idle-timeout: 300000 # 允许连接在连接池中空闲的最长时间(以毫秒为单位) | 60 | idle-timeout: 300000 # 允许连接在连接池中空闲的最长时间(以毫秒为单位) |
| 61 | max-lifetime: 1200000 # 是池中连接关闭后的最长生命周期(以毫秒为单位) | 61 | max-lifetime: 1200000 # 是池中连接关闭后的最长生命周期(以毫秒为单位) |
| 62 | 62 |