wenhongquan 2 months ago
parent
commit
dc3bc2425a

+ 4 - 0
plus-ui-ts/src/views/index.vue

@@ -743,6 +743,10 @@ const showDetails = (row) => {
           .filter((item) => !item.includes('mp4'))
           .map((item) => `${import.meta.env.VITE_APP_BASE_HOST}/api/oss/local/upload/${item}`);
       }
+      if(data.ext2.EventVideoPath){
+        videoList = [data.ext2.EventVideoPath];
+      }
+
       form.value = data;
       Object.assign(form.value, { imgList, videoList });
       dialog.visible = true;

+ 9 - 18
ruoyi-admin/src/main/java/org/dromara/web/task/KafkaMessageConsumer.java

@@ -3,6 +3,7 @@ package org.dromara.web.task;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.lang.UUID;
+import cn.hutool.core.thread.ThreadUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpUtil;
 import cn.hutool.json.JSONArray;
@@ -46,17 +47,6 @@ public class KafkaMessageConsumer {
     private String ffmpegFilePath = "/usr/local/bin/ffmpeg";
     @Scheduled(cron = "*/1 * * * * *")
     public void doChange() {
-        String eventTime = SpringUtils.getBean(ISysConfigService.class).selectConfigByKey("event_time");
-        if(StrUtil.isEmptyIfStr(eventTime)){
-            eventTime = "200";
-        }
-        finalEventTime = eventTime;
-        String eventChangeTime = SpringUtils.getBean(ISysConfigService.class).selectConfigByKey("event_change_time");
-        if(StrUtil.isEmptyIfStr(eventChangeTime)){
-            eventChangeTime = "400";
-        }
-        finalEventChangeTime = eventChangeTime;
-//        System.out.println("事件判断");
 
             AtomicBoolean succes = new AtomicBoolean(false);
             eventMap.forEach((key, value) -> {
@@ -204,16 +194,17 @@ public class KafkaMessageConsumer {
         }
         File file = HttpUtil.downloadFileFromUrl(path, FileUtil.file("./temp/"));
         if(path.endsWith(".mp4")){
-            try{
-                String pathfile = "./"+ UUID.fastUUID()+".mp4";
-                Utils.exchangeToMp4(ffmpegFilePath,file.toPath().toString(),pathfile);
-                FileUtil.del(file);
-                file =  new File(pathfile);;
-            }catch (Exception e){
-            }
+//            try{
+//                String pathfile = "./"+ UUID.fastUUID()+".mp4";
+//                Utils.exchangeToMp4(ffmpegFilePath,file.toPath().toString(),pathfile);
+//                FileUtil.del(file);
+//                file =  new File(pathfile);;
+//            }catch (Exception e){
+//            }
         }
 
         SysOssVo oss = SpringUtils.getBean(ISysOssService.class).upload(file);
+
         FileUtil.del(file);
         return oss.getFileName();
     }