Browse Source

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

修改不能创建多个上级平台的问题等
pull/46/head
648540858 4 years ago
committed by GitHub
parent
commit
c8b6ed5823
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java
  2. 2
      src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
  3. 2
      src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java
  4. 2
      src/main/java/com/genersoft/iot/vmp/storager/dao/PatformChannelMapper.java
  5. 6
      src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
  6. 3
      src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java
  7. BIN
      src/main/resources/wvp.sqlite
  8. 2
      web_src/src/components/gb28181/chooseChannelForGb.vue
  9. 1
      web_src/src/components/platformEdit.vue

4
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java

@ -162,10 +162,12 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
private void processMessageCatalogList(RequestEvent evt) {
try {
Element rootElement = getRootElement(evt);
String name = rootElement.getName();
Element deviceIdElement = rootElement.element("DeviceID");
String deviceId = deviceIdElement.getText();
Element deviceListElement = rootElement.element("DeviceList");
if (deviceListElement == null) { // 存在DeviceList则为响应 catalog, 不存在DeviceList则为查询请求
// if (deviceListElement == null) { // 存在DeviceList则为响应 catalog, 不存在DeviceList则为查询请求
if (name == "Query") { // 区分是Response——查询响应,还是Query——查询请求
// TODO 后续将代码拆分
ParentPlatform parentPlatform = storager.queryParentPlatById(deviceId);
if (parentPlatform == null) {

2
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java

@ -63,6 +63,7 @@ public interface DeviceChannelMapper {
" WHERE 1=1 " +
" <if test=\"hasSubChannel == true\" > AND subCount >0</if>" +
" <if test=\"hasSubChannel == false\" > AND subCount=0</if>" +
" ORDER BY channelId ASC" +
" </script>"})
List<DeviceChannel> queryChannelsByDeviceId(String deviceId, String parentChannelId, String query, Boolean hasSubChannel, Boolean online);
@ -96,6 +97,7 @@ public interface DeviceChannelMapper {
" <if test=\"hasSubChannel!= null and hasSubChannel == false\" > AND subCount=0</if> " +
" <if test=\"platformId != null and inPlatform == true \" > AND platformId='${platformId}'</if> " +
" <if test=\"platformId != null and inPlatform == false \" > AND (platformId != '${platformId}' OR platformId is NULL ) </if> " +
" ORDER BY deviceId, channelId ASC" +
" </script>"})
List<ChannelReduce> queryChannelListInAll(String query, Boolean online, Boolean hasSubChannel, String platformId, Boolean inPlatform);

2
src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java

@ -51,7 +51,7 @@ public interface ParentPlatformMapper {
@Select("SELECT * FROM parent_platform WHERE enable=#{enable}")
List<ParentPlatform> getEnableParentPlatformList(boolean enable);
@Select("SELECT * FROM parent_platform WHERE deviceGBId=#{platformGbId}")
@Select("SELECT * FROM parent_platform WHERE serverGBId=#{platformGbId}")
ParentPlatform getParentPlatById(String platformGbId);
@Update("UPDATE parent_platform SET status=false" )

2
src/main/java/com/genersoft/iot/vmp/storager/dao/PatformChannelMapper.java

@ -18,7 +18,7 @@ public interface PatformChannelMapper {
*/
@Select("<script> "+
"SELECT deviceAndChannelId FROM platform_gb_channel WHERE platformId='${platformId}' AND deviceAndChannelId in" +
"<foreach collection='deviceAndChannelIds' open='(' item='id_' separator=',' close=')'> '${id_}'</foreach>" +
"<foreach collection='deviceAndChannelIds' open='(' item='id_' separator=',' close=')'> '${id_}'</foreach> ORDER BY deviceAndChannelId ASC" +
"</script>")
List<String> findChannelRelatedPlatform(String platformId, List<String> deviceAndChannelIds);

6
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java

@ -231,14 +231,14 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
@Override
public boolean updateParentPlatform(ParentPlatform parentPlatform) {
int result = 0;
ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getDeviceGBId());
if ( platformMapper.getParentPlatById(parentPlatform.getDeviceGBId()) == null) {
ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId());
if ( platformMapper.getParentPlatById(parentPlatform.getServerGBId()) == null) {
result = platformMapper.addParentPlatform(parentPlatform);
if (parentPlatformCatch == null) {
parentPlatformCatch = new ParentPlatformCatch();
parentPlatformCatch.setParentPlatform(parentPlatform);
parentPlatformCatch.setId(parentPlatform.getDeviceGBId());
parentPlatformCatch.setId(parentPlatform.getServerGBId());
}
}else {
result = platformMapper.updateParentPlatform(parentPlatform);

3
src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java

@ -82,7 +82,8 @@ public class PlatformController {
}
// TODO 检查是否已经存在,且注册成功, 如果注册成功,需要先注销之前再,修改并注册
ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getDeviceGBId());
// ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getDeviceGBId());
ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getServerGBId());
boolean updateResult = storager.updateParentPlatform(parentPlatform);

BIN
src/main/resources/wvp.sqlite

Binary file not shown.

2
web_src/src/components/gb28181/chooseChannelForGb.vue

@ -72,7 +72,7 @@ export default {
online: "",
choosed: "",
currentPage: 0,
count: 15,
count: 10,
total: 0,
eventEnanle: false

1
web_src/src/components/platformEdit.vue

@ -200,6 +200,7 @@ export default {
this.platform = platform;
this.onSubmit_text = "保存";
} else {
this.onSubmit_text = "立即创建";
}
},
onSubmit: function () {

Loading…
Cancel
Save