From 2e60339e0a9db9548d4523399c87ec02cd1fb625 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Tue, 25 Jan 2022 12:20:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=80=99=E9=80=89=E9=80=9A?= =?UTF-8?q?=E9=81=93=E6=9F=A5=E8=AF=A2bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/gb28181/bean/GbStream.java | 13 +++++++++++++ .../vmp/media/zlm/ZLMMediaListManager.java | 1 + .../iot/vmp/media/zlm/dto/StreamPushItem.java | 15 +-------------- .../vmp/service/impl/GbStreamServiceImpl.java | 2 +- .../service/impl/StreamPushServiceImpl.java | 2 ++ .../impl/StreamPushUploadFileHandler.java | 2 +- .../iot/vmp/storager/dao/GbStreamMapper.java | 12 ++++++------ .../storager/dao/PlatformGbStreamMapper.java | 4 ++-- .../impl/VideoManagerStoragerImpl.java | 1 + .../streamPush/StreamPushController.java | 18 +++++++++++++++++- src/main/resources/wvp.sqlite | Bin 155648 -> 155648 bytes .../dialog/chooseChannelForCatalog.vue | 10 +++++++++- 12 files changed, 54 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/GbStream.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/GbStream.java index a1ce8ca9..37e636ba 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/GbStream.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/GbStream.java @@ -14,6 +14,10 @@ public class GbStream extends PlatformGbStream{ private double latitude; private String streamType; private boolean status; + /** + * GMT unix系统时间戳,单位秒 + */ + public Long createStamp; public String getApp() { return app; @@ -86,4 +90,13 @@ public class GbStream extends PlatformGbStream{ public void setMediaServerId(String mediaServerId) { this.mediaServerId = mediaServerId; } + + + public Long getCreateStamp() { + return createStamp; + } + + public void setCreateStamp(Long createStamp) { + this.createStamp = createStamp; + } } diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaListManager.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaListManager.java index a6c30cf9..a15e01a4 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaListManager.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaListManager.java @@ -138,6 +138,7 @@ public class ZLMMediaListManager { if (gbStreamMapper.selectOne(transform.getApp(), transform.getStream()) != null) { gbStreamMapper.update(transform); }else { + transform.setCreateStamp(System.currentTimeMillis()); gbStreamMapper.add(transform); } } diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/dto/StreamPushItem.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/dto/StreamPushItem.java index 73e162af..d3c9b1bd 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/dto/StreamPushItem.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/dto/StreamPushItem.java @@ -56,11 +56,6 @@ public class StreamPushItem extends GbStream implements Comparable 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); diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java index ebfa124b..d3d32499 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java @@ -125,6 +125,7 @@ public class StreamPushServiceImpl implements IStreamPushService { public boolean saveToGB(GbStream stream) { stream.setStreamType("push"); stream.setStatus(true); + stream.setCreateStamp(System.currentTimeMillis()); int add = gbStreamMapper.add(stream); // 查找开启了全部直播流共享的上级平台 @@ -305,6 +306,7 @@ public class StreamPushServiceImpl implements IStreamPushService { streamPushItem.setStreamType("push"); streamPushItem.setStatus(true); streamPushItem.setGbId("34020000004111" + gbId); + streamPushItem.setCreateStamp(System.currentTimeMillis()); gbId ++; } int limitCount = 30; diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushUploadFileHandler.java b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushUploadFileHandler.java index 16924df3..586b5b49 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushUploadFileHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushUploadFileHandler.java @@ -56,7 +56,7 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener selectAll(String platformId); @Select("SELECT * FROM gb_stream WHERE app=#{app} AND stream=#{stream}") @@ -87,12 +87,12 @@ public interface GbStreamMapper { @Insert("") void batchAdd(List subList); diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java index a07e68ee..a9f85104 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java @@ -73,6 +73,6 @@ public interface PlatformGbStreamMapper { " ") List queryPlatFormListForGBWithGBId(String app, String stream, List 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); } diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java index dc4d497c..98f3594e 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java @@ -679,6 +679,7 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager { 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) { //事务回滚 diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java index c0fafd3f..91118442 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java @@ -118,7 +118,6 @@ public class StreamPushController { @ResponseBody public DeferredResult>> uploadChannelFile(@RequestParam(value = "file") MultipartFile file){ - // 最多处理文件一个小时 DeferredResult>> result = new DeferredResult<>(60*60*1000L); // 录像查询以channelId作为deviceId查询 @@ -133,6 +132,23 @@ public class StreamPushController { result.setResult(ResponseEntity.status(HttpStatus.BAD_REQUEST).body(wvpResult)); return result; } + if (file.getContentType() == null) { + WVPResult 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 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("已有导入任务正在执行"); diff --git a/src/main/resources/wvp.sqlite b/src/main/resources/wvp.sqlite index 37eefca6296fde6def7f6ff51df23d08db590f00..b317a623274c6972febb10380337293be1a03e68 100644 GIT binary patch delta 710 zcmZoTz}awsbAq&>1Oo$u8W76>F%ts=bKOK8V@8RM2}|^OSon{#@_*;Q%Kw=E_+|lv z4g8`&HKH8pNj!Ya@<1xSxTGjGF?aJ-d+i023b+~hHVa<(!oO&Oz!pYE2Wbv322NHZ z2L8)@O*~I{rgMGd+QGSnvzFC})o8nn1LF^7E{g z81+FchV6|WjP>ag1K3#^flig)EU2)bfBWhEjOGn;91J`x%b59(^9S;XbKK!$=H17# zjQa+M0QYpx$(#wB1qF&(woi6pDrM&2RA%4+>Sow3;K3x!$i^MUU>mGEiA8eyU0)`S z>HEBy#Fz}TC$Hf!Q08xT$YKZipv}J|F)1e%9wcxE-}Lz&j1pX28e9rMkXTSKUD1_E zECd{GAQ2DN2HynT4gP3L3zm&{2RmPm@cNH;KV9 kSaFaraF8W8gXF%ts=bJav0V@BbP2}|^OnE9`=@_*;Q%Kw;u*Jc5O z4gAw5_%exZzG|<%U}69}DOe}_0Y~s`X zJQ(#^8fz`tw>Nq))~8P@;9%i@&VORFpu&Fs?WgxMnm5R?GH|ghW8go|AIKxlafgqY zcOT0#?i(Be+|#)mxf?eN3KX+!pX|a^%FMwnuB*$~dNqj+0Vo6$lQLd7L1{bGNYF=VePO1{8r(cMxyK9gRP$(}k7bp4&0Oa{AnV>pnowq|T{EdjX-=F<4&#FE6E{Pg&g^!Sq80vy8A q?LC<0%J^ooi6>e!GGykZq*fFc=46(n#wV8A14R)5w;dR8P9gyJ@2a5y diff --git a/web_src/src/components/dialog/chooseChannelForCatalog.vue b/web_src/src/components/dialog/chooseChannelForCatalog.vue index 08e180a4..5133caa5 100644 --- a/web_src/src/components/dialog/chooseChannelForCatalog.vue +++ b/web_src/src/components/dialog/chooseChannelForCatalog.vue @@ -239,7 +239,15 @@ export default { 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(() => { + + }); } }, {