648540858
2022-01-25 2e60339e0a9db9548d4523399c87ec02cd1fb625
修复候选通道查询bug
12个文件已修改
80 ■■■■■ 已修改文件
src/main/java/com/genersoft/iot/vmp/gb28181/bean/GbStream.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaListManager.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/media/zlm/dto/StreamPushItem.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushUploadFileHandler.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/wvp.sqlite 补丁 | 查看 | 原始文档 | blame | 历史
web_src/src/components/dialog/chooseChannelForCatalog.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/gb28181/bean/GbStream.java
@@ -14,6 +14,10 @@
    private double latitude;
    private String streamType;
    private boolean status;
    /**
     * GMT unix系统时间戳,单位秒
     */
    public Long createStamp;
    public String getApp() {
        return app;
@@ -86,4 +90,13 @@
    public void setMediaServerId(String mediaServerId) {
        this.mediaServerId = mediaServerId;
    }
    public Long getCreateStamp() {
        return createStamp;
    }
    public void setCreateStamp(Long createStamp) {
        this.createStamp = createStamp;
    }
}
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaListManager.java
@@ -138,6 +138,7 @@
            if (gbStreamMapper.selectOne(transform.getApp(), transform.getStream()) != null) {
                gbStreamMapper.update(transform);
            }else {
                transform.setCreateStamp(System.currentTimeMillis());
                gbStreamMapper.add(transform);
            }
        }
src/main/java/com/genersoft/iot/vmp/media/zlm/dto/StreamPushItem.java
@@ -57,11 +57,6 @@
    private String originUrl;
    /**
     * GMT unix系统时间戳,单位秒
     */
    private Long createStamp;
    /**
     * 存活时间,单位秒
     */
    private Long aliveSecond;
@@ -92,7 +87,7 @@
    @Override
    public int compareTo(@NotNull StreamPushItem streamPushItem) {
        return Long.valueOf(this.createStamp - streamPushItem.getCreateStamp().intValue()).intValue();
        return Long.valueOf(super.createStamp - streamPushItem.getCreateStamp().intValue()).intValue();
    }
    public static class MediaSchema {
@@ -180,14 +175,6 @@
    public void setOriginUrl(String originUrl) {
        this.originUrl = originUrl;
    }
    public Long getCreateStamp() {
        return createStamp;
    }
    public void setCreateStamp(Long createStamp) {
        this.createStamp = createStamp;
    }
    public Long getAliveSecond() {
src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java
@@ -117,7 +117,7 @@
        try {
            List<DeviceChannel> deviceChannelList = new ArrayList<>();
            for (GbStream gbStream : gbStreams) {
                platformGbStreamMapper.delByAppAndStream(gbStream.getApp(), gbStream.getStream());
                platformGbStreamMapper.delByAppAndStreamAndPlatform(gbStream.getApp(), gbStream.getStream(), platformId);
                DeviceChannel deviceChannel = new DeviceChannel();
                deviceChannel.setChannelId(gbStream.getGbId());
                deviceChannelList.add(deviceChannel);
src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java
@@ -125,6 +125,7 @@
    public boolean saveToGB(GbStream stream) {
        stream.setStreamType("push");
        stream.setStatus(true);
        stream.setCreateStamp(System.currentTimeMillis());
        int add = gbStreamMapper.add(stream);
        // 查找开启了全部直播流共享的上级平台
@@ -305,6 +306,7 @@
            streamPushItem.setStreamType("push");
            streamPushItem.setStatus(true);
            streamPushItem.setGbId("34020000004111" + gbId);
            streamPushItem.setCreateStamp(System.currentTimeMillis());
            gbId ++;
        }
        int  limitCount = 30;
src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushUploadFileHandler.java
@@ -56,7 +56,7 @@
        streamPushItem.setGbId(streamPushExcelDto.getGbId());
        streamPushItem.setStatus(false);
        streamPushItem.setStreamType("push");
        streamPushItem.setCreateStamp(System.currentTimeMillis()/1000);
        streamPushItem.setCreateStamp(System.currentTimeMillis());
        streamPushItem.setMediaServerId(defaultMediaServerId);
        streamPushItem.setName(streamPushExcelDto.getName());
        streamPushItem.setOriginType(2);
src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java
@@ -15,10 +15,10 @@
public interface GbStreamMapper {
    @Insert("REPLACE INTO gb_stream (app, stream, gbId, name, " +
            "longitude, latitude, streamType, mediaServerId, status) VALUES" +
            "longitude, latitude, streamType, mediaServerId, status, createStamp) VALUES" +
            "('${app}', '${stream}', '${gbId}', '${name}', " +
            "'${longitude}', '${latitude}', '${streamType}', " +
            "'${mediaServerId}', ${status})")
            "'${mediaServerId}', ${status}, ${createStamp})")
    int add(GbStream gbStream);
    @Update("UPDATE gb_stream " +
@@ -38,8 +38,8 @@
    int del(String app, String stream);
    @Select("SELECT gs.*, pgs.platformId AS platformId, pgs.catalogId AS catalogId FROM gb_stream gs " +
            "LEFT JOIN  platform_gb_stream pgs ON gs.app = pgs.app AND gs.stream = pgs.stream " +
            "WHERE pgs.platformId is null OR pgs.platformId = #{platformId}")
            "LEFT JOIN  platform_gb_stream pgs ON gs.app = pgs.app AND gs.stream = pgs.stream AND (pgs.platformId = #{platformId} OR pgs.platformId is null)" +
            "order by gs.id asc ")
    List<GbStream> selectAll(String platformId);
    @Select("SELECT * FROM gb_stream WHERE app=#{app} AND stream=#{stream}")
@@ -87,12 +87,12 @@
    @Insert("<script> " +
            "REPLACE into gb_stream " +
            "(app, stream, gbId, name, " +
            "longitude, latitude, streamType, mediaServerId, status)" +
            "longitude, latitude, streamType, mediaServerId, status, createStamp)" +
            "values " +
            "<foreach collection='subList' index='index' item='item' separator=','> " +
            "('${item.app}', '${item.stream}', '${item.gbId}', '${item.name}', " +
            "'${item.longitude}', '${item.latitude}', '${item.streamType}', " +
            "'${item.mediaServerId}', ${item.status}) "+
            "'${item.mediaServerId}', ${item.status}, ${item.createStamp}) "+
            "</foreach> " +
            "</script>")
    void batchAdd(List<StreamPushItem> subList);
src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java
@@ -73,6 +73,6 @@
            "</script> ")
    List<ParentPlatform> queryPlatFormListForGBWithGBId(String app, String stream, List<String> platforms);
    @Select("SELECT * FROM platform_gb_stream WHERE app=#{app} AND stream=#{stream} AND platformId=#{platformId}")
    int delByAppAndStreamAndPlatform(String app, String streamId, String platformId);
    @Delete("DELETE FROM platform_gb_stream WHERE app=#{app} AND stream=#{stream} AND platformId=#{platformId}")
    int delByAppAndStreamAndPlatform(String app, String stream, String platformId);
}
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
@@ -679,6 +679,7 @@
        streamProxyItem.setStatus(true);
        String now = this.format.format(System.currentTimeMillis());
        streamProxyItem.setCreateTime(now);
        streamProxyItem.setCreateStamp(System.currentTimeMillis());
        try {
            if (gbStreamMapper.add(streamProxyItem)<0 || streamProxyMapper.add(streamProxyItem) < 0) {
                //事务回滚
src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java
@@ -118,7 +118,6 @@
    @ResponseBody
    public DeferredResult<ResponseEntity<WVPResult<Object>>> uploadChannelFile(@RequestParam(value = "file") MultipartFile file){
        // 最多处理文件一个小时
        DeferredResult<ResponseEntity<WVPResult<Object>>> result = new DeferredResult<>(60*60*1000L);
        // 录像查询以channelId作为deviceId查询
@@ -133,6 +132,23 @@
            result.setResult(ResponseEntity.status(HttpStatus.BAD_REQUEST).body(wvpResult));
            return result;
        }
        if (file.getContentType() == null) {
            WVPResult<Object> wvpResult = new WVPResult<>();
            wvpResult.setCode(-1);
            wvpResult.setMsg("无法识别文件类型");
            result.setResult(ResponseEntity.status(HttpStatus.BAD_REQUEST).body(wvpResult));
            return result;
        }
        if (!file.getContentType().endsWith(".xls")
            && !file.getContentType().endsWith(".csv")
            && !file.getContentType().endsWith(".xlsx") ) {
            logger.warn("通道导入文件类型错误");
            WVPResult<Object> wvpResult = new WVPResult<>();
            wvpResult.setCode(-1);
            wvpResult.setMsg("文件类型错误,请使用");
            result.setResult(ResponseEntity.status(HttpStatus.BAD_REQUEST).body(wvpResult));
            return result;
        }
        // 同时只处理一个文件
        if (resultHolder.exist(key, null)) {
            logger.warn("已有导入任务正在执行");
src/main/resources/wvp.sqlite
Binary files differ
web_src/src/components/dialog/chooseChannelForCatalog.vue
@@ -239,7 +239,15 @@
                  disabled: node.level === 1,
                  divided: true,
                  onClick: () => {
                    this.removeCatalog(data.id, node)
                    this.$confirm('确定删除?', '提示', {
                      confirmButtonText: '确定',
                      cancelButtonText: '取消',
                      type: 'warning'
                    }).then(() => {
                      this.removeCatalog(data.id, node)
                    }).catch(() => {
                    });
                  }
                },
                {