648540858
2021-01-15 c8b6ed5823fbe8e7eeef2e733859b4406b2ba4c5
Merge pull request #38 from lawrencehj/wvp-28181-2.0

修改不能创建多个上级平台的问题等
9个文件已修改
24 ■■■■■ 已修改文件
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/storager/dao/PatformChannelMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/wvp.sqlite 补丁 | 查看 | 原始文档 | blame | 历史
web_src/src/components/gb28181/chooseChannelForGb.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_src/src/components/platformEdit.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java
@@ -162,11 +162,13 @@
    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则为查询请求
                // TODO 后续将代码拆分
            // if (deviceListElement == null) { // 存在DeviceList则为响应 catalog, 不存在DeviceList则为查询请求
            if (name == "Query") { // 区分是Response——查询响应,还是Query——查询请求
                    // TODO 后续将代码拆分
                ParentPlatform parentPlatform = storager.queryParentPlatById(deviceId);
                if (parentPlatform == null) {
                    response404Ack(evt);
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
@@ -63,6 +63,7 @@
            " 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 @@
            " <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);
src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java
@@ -51,7 +51,7 @@
    @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" )
src/main/java/com/genersoft/iot/vmp/storager/dao/PatformChannelMapper.java
@@ -18,7 +18,7 @@
     */
    @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);
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
@@ -231,14 +231,14 @@
    @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);
src/main/java/com/genersoft/iot/vmp/vmanager/platform/PlatformController.java
@@ -82,7 +82,8 @@
        }
        // TODO 检查是否已经存在,且注册成功, 如果注册成功,需要先注销之前再,修改并注册
        ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getDeviceGBId());
        // ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getDeviceGBId());
        ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getServerGBId());
        boolean updateResult = storager.updateParentPlatform(parentPlatform);
src/main/resources/wvp.sqlite
Binary files differ
web_src/src/components/gb28181/chooseChannelForGb.vue
@@ -72,7 +72,7 @@
            online: "",
            choosed: "",
            currentPage: 0,
            count: 15,
            count: 10,
            total: 0,
            eventEnanle: false
web_src/src/components/platformEdit.vue
@@ -200,6 +200,7 @@
        this.platform = platform;
        this.onSubmit_text = "保存";
      } else {
        this.onSubmit_text = "立即创建";
      }
    },
    onSubmit: function () {