Commit c8b6ed5823fbe8e7eeef2e733859b4406b2ba4c5

Authored by 648540858
Committed by GitHub
2 parents 6c4da7be 1b200bcc

Merge pull request #38 from lawrencehj/wvp-28181-2.0

修改不能创建多个上级平台的问题等
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java
@@ -162,11 +162,13 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor { @@ -162,11 +162,13 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
162 private void processMessageCatalogList(RequestEvent evt) { 162 private void processMessageCatalogList(RequestEvent evt) {
163 try { 163 try {
164 Element rootElement = getRootElement(evt); 164 Element rootElement = getRootElement(evt);
  165 + String name = rootElement.getName();
165 Element deviceIdElement = rootElement.element("DeviceID"); 166 Element deviceIdElement = rootElement.element("DeviceID");
166 String deviceId = deviceIdElement.getText(); 167 String deviceId = deviceIdElement.getText();
167 Element deviceListElement = rootElement.element("DeviceList"); 168 Element deviceListElement = rootElement.element("DeviceList");
168 - if (deviceListElement == null) { // 存在DeviceList则为响应 catalog, 不存在DeviceList则为查询请求  
169 - // TODO 后续将代码拆分 169 + // if (deviceListElement == null) { // 存在DeviceList则为响应 catalog, 不存在DeviceList则为查询请求
  170 + if (name == "Query") { // 区分是Response——查询响应,还是Query——查询请求
  171 + // TODO 后续将代码拆分
170 ParentPlatform parentPlatform = storager.queryParentPlatById(deviceId); 172 ParentPlatform parentPlatform = storager.queryParentPlatById(deviceId);
171 if (parentPlatform == null) { 173 if (parentPlatform == null) {
172 response404Ack(evt); 174 response404Ack(evt);
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
@@ -63,6 +63,7 @@ public interface DeviceChannelMapper { @@ -63,6 +63,7 @@ public interface DeviceChannelMapper {
63 " WHERE 1=1 " + 63 " WHERE 1=1 " +
64 " <if test=\"hasSubChannel == true\" > AND subCount >0</if>" + 64 " <if test=\"hasSubChannel == true\" > AND subCount >0</if>" +
65 " <if test=\"hasSubChannel == false\" > AND subCount=0</if>" + 65 " <if test=\"hasSubChannel == false\" > AND subCount=0</if>" +
  66 + " ORDER BY channelId ASC" +
66 " </script>"}) 67 " </script>"})
67 List<DeviceChannel> queryChannelsByDeviceId(String deviceId, String parentChannelId, String query, Boolean hasSubChannel, Boolean online); 68 List<DeviceChannel> queryChannelsByDeviceId(String deviceId, String parentChannelId, String query, Boolean hasSubChannel, Boolean online);
68 69
@@ -96,6 +97,7 @@ public interface DeviceChannelMapper { @@ -96,6 +97,7 @@ public interface DeviceChannelMapper {
96 " <if test=\"hasSubChannel!= null and hasSubChannel == false\" > AND subCount=0</if> " + 97 " <if test=\"hasSubChannel!= null and hasSubChannel == false\" > AND subCount=0</if> " +
97 " <if test=\"platformId != null and inPlatform == true \" > AND platformId='${platformId}'</if> " + 98 " <if test=\"platformId != null and inPlatform == true \" > AND platformId='${platformId}'</if> " +
98 " <if test=\"platformId != null and inPlatform == false \" > AND (platformId != '${platformId}' OR platformId is NULL ) </if> " + 99 " <if test=\"platformId != null and inPlatform == false \" > AND (platformId != '${platformId}' OR platformId is NULL ) </if> " +
  100 + " ORDER BY deviceId, channelId ASC" +
99 " </script>"}) 101 " </script>"})
100 102
101 List<ChannelReduce> queryChannelListInAll(String query, Boolean online, Boolean hasSubChannel, String platformId, Boolean inPlatform); 103 List<ChannelReduce> queryChannelListInAll(String query, Boolean online, Boolean hasSubChannel, String platformId, Boolean inPlatform);
src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java
@@ -51,7 +51,7 @@ public interface ParentPlatformMapper { @@ -51,7 +51,7 @@ public interface ParentPlatformMapper {
51 @Select("SELECT * FROM parent_platform WHERE enable=#{enable}") 51 @Select("SELECT * FROM parent_platform WHERE enable=#{enable}")
52 List<ParentPlatform> getEnableParentPlatformList(boolean enable); 52 List<ParentPlatform> getEnableParentPlatformList(boolean enable);
53 53
54 - @Select("SELECT * FROM parent_platform WHERE deviceGBId=#{platformGbId}") 54 + @Select("SELECT * FROM parent_platform WHERE serverGBId=#{platformGbId}")
55 ParentPlatform getParentPlatById(String platformGbId); 55 ParentPlatform getParentPlatById(String platformGbId);
56 56
57 @Update("UPDATE parent_platform SET status=false" ) 57 @Update("UPDATE parent_platform SET status=false" )
src/main/java/com/genersoft/iot/vmp/storager/dao/PatformChannelMapper.java
@@ -18,7 +18,7 @@ public interface PatformChannelMapper { @@ -18,7 +18,7 @@ public interface PatformChannelMapper {
18 */ 18 */
19 @Select("<script> "+ 19 @Select("<script> "+
20 "SELECT deviceAndChannelId FROM platform_gb_channel WHERE platformId='${platformId}' AND deviceAndChannelId in" + 20 "SELECT deviceAndChannelId FROM platform_gb_channel WHERE platformId='${platformId}' AND deviceAndChannelId in" +
21 - "<foreach collection='deviceAndChannelIds' open='(' item='id_' separator=',' close=')'> '${id_}'</foreach>" + 21 + "<foreach collection='deviceAndChannelIds' open='(' item='id_' separator=',' close=')'> '${id_}'</foreach> ORDER BY deviceAndChannelId ASC" +
22 "</script>") 22 "</script>")
23 List<String> findChannelRelatedPlatform(String platformId, List<String> deviceAndChannelIds); 23 List<String> findChannelRelatedPlatform(String platformId, List<String> deviceAndChannelIds);
24 24
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
@@ -231,14 +231,14 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager { @@ -231,14 +231,14 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
231 @Override 231 @Override
232 public boolean updateParentPlatform(ParentPlatform parentPlatform) { 232 public boolean updateParentPlatform(ParentPlatform parentPlatform) {
233 int result = 0; 233 int result = 0;
234 - ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getDeviceGBId());  
235 - if ( platformMapper.getParentPlatById(parentPlatform.getDeviceGBId()) == null) { 234 + ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId());
  235 + if ( platformMapper.getParentPlatById(parentPlatform.getServerGBId()) == null) {
236 result = platformMapper.addParentPlatform(parentPlatform); 236 result = platformMapper.addParentPlatform(parentPlatform);
237 237
238 if (parentPlatformCatch == null) { 238 if (parentPlatformCatch == null) {
239 parentPlatformCatch = new ParentPlatformCatch(); 239 parentPlatformCatch = new ParentPlatformCatch();
240 parentPlatformCatch.setParentPlatform(parentPlatform); 240 parentPlatformCatch.setParentPlatform(parentPlatform);
241 - parentPlatformCatch.setId(parentPlatform.getDeviceGBId()); 241 + parentPlatformCatch.setId(parentPlatform.getServerGBId());
242 } 242 }
243 }else { 243 }else {
244 result = platformMapper.updateParentPlatform(parentPlatform); 244 result = platformMapper.updateParentPlatform(parentPlatform);
src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java
@@ -82,7 +82,8 @@ public class PlatformController { @@ -82,7 +82,8 @@ public class PlatformController {
82 } 82 }
83 // TODO 检查是否已经存在,且注册成功, 如果注册成功,需要先注销之前再,修改并注册 83 // TODO 检查是否已经存在,且注册成功, 如果注册成功,需要先注销之前再,修改并注册
84 84
85 - ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getDeviceGBId()); 85 + // ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getDeviceGBId());
  86 + ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getServerGBId());
86 87
87 boolean updateResult = storager.updateParentPlatform(parentPlatform); 88 boolean updateResult = storager.updateParentPlatform(parentPlatform);
88 89
src/main/resources/wvp.sqlite
No preview for this file type
web_src/src/components/gb28181/chooseChannelForGb.vue
@@ -72,7 +72,7 @@ export default { @@ -72,7 +72,7 @@ export default {
72 online: "", 72 online: "",
73 choosed: "", 73 choosed: "",
74 currentPage: 0, 74 currentPage: 0,
75 - count: 15, 75 + count: 10,
76 total: 0, 76 total: 0,
77 eventEnanle: false 77 eventEnanle: false
78 78
web_src/src/components/platformEdit.vue
@@ -200,6 +200,7 @@ export default { @@ -200,6 +200,7 @@ export default {
200 this.platform = platform; 200 this.platform = platform;
201 this.onSubmit_text = "保存"; 201 this.onSubmit_text = "保存";
202 } else { 202 } else {
  203 + this.onSubmit_text = "立即创建";
203 } 204 }
204 }, 205 },
205 onSubmit: function () { 206 onSubmit: function () {