Kaynağa Gözat

定时删除机车行驶日志

gao.qiang 1 hafta önce
ebeveyn
işleme
972e56c59d
32 değiştirilmiş dosya ile 235 ekleme ve 2349 silme
  1. 2 0
      .idea/encodings.xml
  2. 5 0
      .idea/jarRepositories.xml
  3. 3 3
      business-service/pom.xml
  4. 0 13
      business-service/src/main/java/com/ozs/utils/CameraUtil.java
  5. 64 61
      business-service/src/main/java/com/ozs/utils/CmdCameraUtil.java
  6. 0 66
      business-service/src/main/java/com/ozs/utils/CodeGet.java
  7. 0 90
      business-service/src/main/java/com/ozs/utils/RtspToMP4.java
  8. BIN
      libs/kingbase8-8.6.0.jar
  9. 4 4
      pom.xml
  10. 115 114
      vehicle-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseCameraManagementController.java
  11. 1 1
      vehicle-admin/src/main/java/com/ozs/web/controller/home/HomeController.java
  12. 1 2
      vehicle-admin/src/main/java/com/ozs/web/controller/system/MonitorSystemController.java
  13. 0 9
      vehicle-admin/src/main/java/com/ozs/web/controller/accountmanagment/MsgAlarmTemporaryController.java
  14. 0 89
      vehicle-admin/src/main/java/com/ozs/web/controller/monitor/SysUserOnlineController.java
  15. 0 29
      vehicle-admin/src/main/java/com/ozs/web/controller/system/SysIndexController.java
  16. 0 85
      vehicle-admin/src/main/java/com/ozs/web/controller/system/SysNoticeController.java
  17. 0 124
      vehicle-admin/src/main/java/com/ozs/web/controller/system/SysPostController.java
  18. 0 38
      vehicle-admin/src/main/java/com/ozs/web/controller/system/SysRegisterController.java
  19. 0 53
      vehicle-admin/src/main/java/com/ozs/web/core/config/CaneraConfig.java
  20. 0 157
      vehicle-admin/src/main/java/com/ozs/web/core/config/GetCameraPreviewURL.java
  21. 0 978
      vehicle-admin/src/main/java/com/ozs/web/core/util/CameraUtil.java
  22. 0 81
      vehicle-admin/src/main/java/com/ozs/web/core/util/CmdCameraUtil.java
  23. 0 1
      vehicle-admin/src/main/resources/META-INF/spring-devtools.properties
  24. 0 57
      vehicle-admin/src/main/resources/application-kdruid.yml
  25. 0 37
      vehicle-admin/src/main/resources/i18n/messages.properties
  26. 0 5
      vehicle-sdk/src/main/java/com/ozs/config/Constant.java
  27. 0 42
      vehicle-sdk/src/main/java/com/ozs/config/ShotExecutors.java
  28. 40 76
      vehicle-sdk/src/main/java/com/ozs/controller/upload/GeoHazardMonitorTokenController.java
  29. 0 39
      vehicle-sdk/src/main/java/com/ozs/controller/upload/PressureController.java
  30. 0 1
      vehicle-sdk/src/main/resources/META-INF/spring-devtools.properties
  31. 0 57
      vehicle-sdk/src/main/resources/application-kdruid.yml
  32. 0 37
      vehicle-sdk/src/main/resources/i18n/messages.properties

+ 2 - 0
.idea/encodings.xml

@@ -3,6 +3,8 @@
   <component name="Encoding">
     <file url="file://$PROJECT_DIR$/business-service/src/main/java" charset="UTF-8" />
     <file url="file://$PROJECT_DIR$/business-service/src/main/resources" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
     <file url="file://$PROJECT_DIR$/vehicle-admin/src/main/java" charset="UTF-8" />
     <file url="file://$PROJECT_DIR$/vehicle-admin/src/main/resources" charset="UTF-8" />
     <file url="file://$PROJECT_DIR$/vehicle-sdk/src/main/java" charset="UTF-8" />

+ 5 - 0
.idea/jarRepositories.xml

@@ -21,6 +21,11 @@
       <option name="name" value="Nexus Repository" />
       <option name="url" value="http://10.21.171.91:8084/nexus/content/groups/public/" />
     </remote-repository>
+    <remote-repository>
+      <option name="id" value="custom_group" />
+      <option name="name" value="Nexus Repository" />
+      <option name="url" value="http://47.94.132.61:18881/repository/custom_group/" />
+    </remote-repository>
     <remote-repository>
       <option name="id" value="central" />
       <option name="name" value="Central Repository" />

+ 3 - 3
business-service/pom.xml

@@ -37,9 +37,9 @@
         </dependency>
 
         <dependency>
-            <groupId>com.dm</groupId>
-            <artifactId>DmJdbcDriver18</artifactId>
-            <version>1.8</version>
+            <groupId>com.dameng</groupId>
+            <artifactId>DmJdbcDriver8</artifactId>
+            <version>8.1.3.162</version>
         </dependency>
 
         <!-- 阿里云oss依赖 -->

+ 0 - 13
business-service/src/main/java/com/ozs/utils/CameraUtil.java

@@ -126,8 +126,6 @@ public class CameraUtil {
     @Autowired
     private ISysDictTypeService dictTypeService;
     @Autowired
-    private RtspToMP4 rtspToMP4;
-    @Autowired
     private BaseCameraManagementService baseCameraManagementService;
     @Autowired
     private BaseTerminalLogService baseTerminalLogService;
@@ -1449,17 +1447,6 @@ ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
         return "正常";
     }
 
-    public AjaxResult stop(String id) {
-        if (map.containsKey(id)) {
-            Process process = map.get(id);
-            log.info("-----stop------>>>" + process);
-            if (null != process) {
-                rtspToMP4.stopRecord(process);
-                return AjaxResult.success();
-            }
-        }
-        return AjaxResult.error();
-    }
 
     public static void main(String[] args) throws InterruptedException, ParseException, IOException {
 //        CameraUtil cameraUtil = new CameraUtil();

+ 64 - 61
business-service/src/main/java/com/ozs/utils/CmdCameraUtil.java

@@ -8,73 +8,76 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 
+/**
+ * 以废弃,原来报警回放视频使用ffmpeg进行合成工具类
+ */
 @Slf4j
 @Component
 public class CmdCameraUtil {
 
 
     public void cmd(String cmd) {
-        long l = System.currentTimeMillis();
-        Process exec = null;
-        try {
-            exec = Runtime.getRuntime().exec(new String[]{"sh", "-c", cmd});
-            long l1 = System.currentTimeMillis();
-            log.info("cmd-time:{}", l1 - l);
-        } catch (IOException e) {
-            log.error(e.getMessage());
-            e.printStackTrace();
-        }
-        try {
-            printProcessMsg(exec);
-        } catch (IOException e) {
-            log.error(e.getMessage());
-            e.printStackTrace();
-        }
-        try {
-            int i = exec.waitFor();
-            log.info("------"+i);
-        } catch (InterruptedException e) {
-            log.error(e.getMessage());
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * 处理process输出流和错误流,防止进程阻塞,在process.waitFor();前调用
-     *
-     * @param exec
-     * @throws IOException
-     */
-    private void printProcessMsg(Process exec) throws IOException {
-        //防止ffmpeg进程塞满缓存造成死锁
-        InputStream error = exec.getErrorStream();
-        InputStream is = exec.getInputStream();
-
-        StringBuffer result = new StringBuffer();
-        String line = null;
-        try {
-            BufferedReader br = new BufferedReader(new InputStreamReader(error, "GBK"));
-            BufferedReader br2 = new BufferedReader(new InputStreamReader(is, "GBK"));
-
-            while ((line = br.readLine()) != null) {
-                result.append(line + "\n");
-            }
-            log.info("FFMPEG视频合成进程错误信息:" + result.toString());
-
-            result = new StringBuffer();
-            line = null;
-
-            while ((line = br2.readLine()) != null) {
-                result.append(line + "\n");
-            }
-            log.info("FFMPEG视频合成进程输出内容为:" + result.toString());
-        } catch (IOException e2) {
-            e2.printStackTrace();
-        } finally {
-            error.close();
-            is.close();
-        }
-
+//        long l = System.currentTimeMillis();
+//        Process exec = null;
+//        try {
+//            exec = Runtime.getRuntime().exec(new String[]{"sh", "-c", cmd});
+//            long l1 = System.currentTimeMillis();
+//            log.info("cmd-time:{}", l1 - l);
+//        } catch (IOException e) {
+//            log.error(e.getMessage());
+//            e.printStackTrace();
+//        }
+//        try {
+//            printProcessMsg(exec);
+//        } catch (IOException e) {
+//            log.error(e.getMessage());
+//            e.printStackTrace();
+//        }
+//        try {
+//            int i = exec.waitFor();
+//            log.info("------"+i);
+//        } catch (InterruptedException e) {
+//            log.error(e.getMessage());
+//            e.printStackTrace();
+//        }
     }
+//
+//    /**
+//     * 处理process输出流和错误流,防止进程阻塞,在process.waitFor();前调用
+//     *
+//     * @param exec
+//     * @throws IOException
+//     */
+//    private void printProcessMsg(Process exec) throws IOException {
+//        //防止ffmpeg进程塞满缓存造成死锁
+//        InputStream error = exec.getErrorStream();
+//        InputStream is = exec.getInputStream();
+//
+//        StringBuffer result = new StringBuffer();
+//        String line = null;
+//        try {
+//            BufferedReader br = new BufferedReader(new InputStreamReader(error, "GBK"));
+//            BufferedReader br2 = new BufferedReader(new InputStreamReader(is, "GBK"));
+//
+//            while ((line = br.readLine()) != null) {
+//                result.append(line + "\n");
+//            }
+//            log.info("FFMPEG视频合成进程错误信息:" + result.toString());
+//
+//            result = new StringBuffer();
+//            line = null;
+//
+//            while ((line = br2.readLine()) != null) {
+//                result.append(line + "\n");
+//            }
+//            log.info("FFMPEG视频合成进程输出内容为:" + result.toString());
+//        } catch (IOException e2) {
+//            e2.printStackTrace();
+//        } finally {
+//            error.close();
+//            is.close();
+//        }
+//
+//    }
 
 }

+ 0 - 66
business-service/src/main/java/com/ozs/utils/CodeGet.java

@@ -1,66 +0,0 @@
-package com.ozs.utils;
-
-
-import com.baomidou.mybatisplus.annotation.DbType;
-import com.baomidou.mybatisplus.generator.AutoGenerator;
-import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
-import com.baomidou.mybatisplus.generator.config.GlobalConfig;
-import com.baomidou.mybatisplus.generator.config.PackageConfig;
-import com.baomidou.mybatisplus.generator.config.StrategyConfig;
-import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
-
-public class CodeGet {
-
-    public static void main(String[] args) {
-
-        // 1、创建代码生成器
-        AutoGenerator mpg = new AutoGenerator();
-
-        // 2、全局配置
-        // 全局配置
-        GlobalConfig gc = new GlobalConfig();
-        gc.setOutputDir("D://机车/business-service/src/main/java");
-
-        // IUserService
-        gc.setServiceName("%sService");	//去掉Service接口的首字母I
-        gc.setAuthor("ozs");
-        gc.setOpen(false);
-        mpg.setGlobalConfig(gc);
-
-        // 3、数据源配置
-        DataSourceConfig dsc = new DataSourceConfig();
-        dsc.setUrl("jdbc:mysql://124.70.58.209:18806/vehicle?characterEncoding=utf-8&useSSL=false");
-        dsc.setDriverName("com.mysql.cj.jdbc.Driver");
-        dsc.setUsername("root");
-        dsc.setPassword("123.asd");
-        dsc.setDbType(DbType.MYSQL);
-        mpg.setDataSource(dsc);
-
-        // 4、包配置
-        PackageConfig pc = new PackageConfig();
-        pc.setParent("com.ozs");
-        pc.setModuleName(""); //模块名
-        pc.setController("controller");
-        pc.setService("service");
-        pc.setMapper("mapper");
-        mpg.setPackageInfo(pc);
-
-        // 5、策略配置
-        StrategyConfig strategy = new StrategyConfig();
-
-        strategy.setInclude("terminal_ignore_alarm");
-
-        strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略
-
-        strategy.setColumnNaming(NamingStrategy.underline_to_camel);//数据库表字段映射到实体的命名策略
-        strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作
-
-        strategy.setRestControllerStyle(true); //restful api风格控制器
-        strategy.setControllerMappingHyphenStyle(true); //url中驼峰转连字符
-
-        mpg.setStrategy(strategy);
-
-        // 6、执行
-        mpg.execute();
-    }
-}

+ 0 - 90
business-service/src/main/java/com/ozs/utils/RtspToMP4.java

@@ -1,90 +0,0 @@
-package com.ozs.utils;
-
-
-import org.springframework.stereotype.Component;
-
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-@Component
-public class RtspToMP4 {
-
-    public class In implements Runnable{
-        private InputStream inputStream;
-
-        public In(InputStream inputStream) {
-            this.inputStream = inputStream;
-        }
-        @Override
-        public void run() {
-            try {
-                //转成字符输入流
-                InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "gbk");
-                int len = -1;
-                char[] c = new char[1024];
-                //读取进程输入流中的内容
-                while ((len = inputStreamReader.read(c)) != -1) {
-                    String s = new String(c, 0, len);
-                    System.out.print(s);
-                }
-            }catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-    }
-
-    public Process StartRecord(String ffmpegPath,String streamUrl, String FilePath){
-        ProcessBuilder processBuilder = new ProcessBuilder();
-        //定义命令内容
-        List<String> command = new ArrayList<>();
-        command.add(ffmpegPath);
-        command.add("-rtsp_transport");
-        command.add("tcp");
-        command.add("-y");
-        command.add("-i");
-        command.add(streamUrl);
-        command.add("-c:a");
-        command.add("aac");
-        command.add("-strict");
-        command.add("experimental");
-        command.add("-f");
-        command.add("mp4");
-        command.add(FilePath);
-        processBuilder.command(command);
-        System.out.println("脚本:" + command.toString());
-        //将标准输入流和错误输入流合并,通过标准输入流读取信息
-        processBuilder.redirectErrorStream(true);
-        try {
-            //启动进程
-            Process process = processBuilder.start();
-            System.out.println("开始时间:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(System.currentTimeMillis())));
-            //获取输入流
-            InputStream inputStream = process.getInputStream();
-            Thread inThread = new Thread(new In(inputStream));
-            inThread.start();
-            return process;
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-    public boolean stopRecord(Process process) {
-        try {
-            OutputStream os = process.getOutputStream();
-            os.write("q".getBytes());
-            // 一定要刷新
-            os.flush();
-            os.close();
-        } catch (Exception err) {
-            err.printStackTrace();
-            return false;
-        }
-        return true;
-    }
-}

BIN
libs/kingbase8-8.6.0.jar


+ 4 - 4
pom.xml

@@ -127,7 +127,7 @@
         <repository>
             <id>custom_group</id>
             <name>Nexus Repository</name>
-            <url>http://124.71.171.71:18881/repository/custom_group/</url>
+            <url>http://47.94.132.61:18881/repository/custom_group/</url>
             <snapshots>
                 <enabled>true</enabled>
             </snapshots>
@@ -140,7 +140,7 @@
         <pluginRepository>
             <id>custom_group</id>
             <name>Nexus Plugin Repository</name>
-            <url>http://124.71.171.71:18881/repository/custom_group/</url>
+            <url>http://47.94.132.61:18881/repository/custom_group/</url>
             <snapshots>
                 <enabled>true</enabled>
             </snapshots>
@@ -154,12 +154,12 @@
         <repository><!--部署项目产生的构件到远程仓库需要的信息 -->
             <id>custom_releases</id><!-- 此处id和settings.xml的id保持一致 -->
             <name>Nexus Release Repository</name>
-            <url>http://124.71.171.71:18881/repository/custom_releases/</url>
+            <url>http://47.94.132.61:18881/repository/custom_releases/</url>
         </repository>
         <snapshotRepository><!--构件的快照部署到哪里?如果没有配置该元素,默认部署到repository元素配置的仓库,参见distributionManagement/repository元素 -->
             <id>custom_snapshots</id><!-- 此处id和settings.xml的id保持一致 -->
             <name>Nexus Snapshot Repository</name>
-            <url>http://124.71.171.71:18881/repository/custom_snapshots/</url>
+            <url>http://47.94.132.61:18881/repository/custom_snapshots/</url>
         </snapshotRepository>
     </distributionManagement>
 

+ 115 - 114
vehicle-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseCameraManagementController.java

@@ -1,14 +1,10 @@
 package com.ozs.web.controller.accountmanagment;
 
-import com.alibaba.fastjson2.JSONArray;
-import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ozs.common.annotation.Log;
 import com.ozs.common.core.controller.BaseController;
 import com.ozs.common.core.domain.AjaxResult;
-import com.ozs.common.core.domain.R;
 import com.ozs.common.core.domain.entity.SysDept;
 import com.ozs.common.core.domain.entity.SysDictData;
 import com.ozs.common.enums.BusinessType;
@@ -20,19 +16,14 @@ import com.ozs.common.utils.StringUtils;
 import com.ozs.common.utils.file.FileUtils;
 import com.ozs.common.utils.http.HttpUtils;
 import com.ozs.common.utils.poi.ExcelUtil;
-import com.ozs.common.utils.stateSecrets.SM4Utils;
 import com.ozs.entity.*;
 import com.ozs.entity.response.BaseCameraManagementResponse;
 import com.ozs.entity.vo.*;
-import com.ozs.framework.config.ServerConfig;
 import com.ozs.service.*;
 import com.ozs.system.service.DataScoreUtil;
 import com.ozs.system.service.ISysDeptService;
 import com.ozs.system.service.ISysDictTypeService;
 import com.ozs.utils.CameraUtil;
-import com.ozs.utils.CaneraConfig;
-import com.ozs.utils.RtspToMP4;
-import com.ozs.web.core.config.GetCameraPreviewURL;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -50,8 +41,6 @@ import java.io.InputStream;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.util.*;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 /**
@@ -298,19 +287,7 @@ public class BaseCameraManagementController extends BaseController {
     }
 
 
-    /**
-     * HTTP流转RTSP流
-     *
-     * @param
-     * @return
-     */
-    @GetMapping("/streamConversion")
-    @Transactional
-    @Log(title = "相机台账管理", businessType = BusinessType.INSERT)
-    public AjaxResult streamConversion(String code) {
-        cameraUtil.streamConversion(code);
-        return AjaxResult.success();
-    }
+
 
     /**
      * 新增相机台账管理信息
@@ -538,7 +515,6 @@ public class BaseCameraManagementController extends BaseController {
     }
 
     /**
-     * ***********************   弃用   ***********************
      *
      * @param cameraCode
      * @return
@@ -689,6 +665,11 @@ public class BaseCameraManagementController extends BaseController {
         return new AjaxResult(200, "ok", cameraUtil.getPlayFlv(cameraCode, "channel"));
     }
 
+    /**
+     * 已弃用
+     * @param cameraCode
+     * @return
+     */
     @GetMapping("/api/invite/{cameraCode}")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult invite(@PathVariable @NotNull(message = "相机编码不能为空") String cameraCode) {
@@ -701,7 +682,11 @@ public class BaseCameraManagementController extends BaseController {
         return new AjaxResult(200, "ok", CameraUtil.invite(cameraCode, one.getGraphicsCard()));
     }
 
-
+    /**
+     * 已弃用
+     * @param cameraCode
+     * @return
+     */
     @GetMapping("/api/records/{cameraCode}/{flay}")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult apiRecords(@PathVariable @NotNull(message = "相机编码不能为空") String cameraCode,
@@ -715,6 +700,7 @@ public class BaseCameraManagementController extends BaseController {
         return new AjaxResult(200, "ok", CameraUtil.getPlayFlv(cameraCode, one.getGraphicsCard(), flay));
     }
 
+
     @GetMapping("/api/getRecordByAlarmId")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult getRecordByAlarmId(@RequestParam("alarmId") String alarmId) {
@@ -767,6 +753,11 @@ public class BaseCameraManagementController extends BaseController {
         return new AjaxResult(200, "ok", CameraUtil.getRecordList(one.getCameraCode(), vo.getStartTime(), vo.getEntTime(), "record"));
     }
 
+    /**
+     * 已弃用
+     * @param cameraCodes
+     * @return
+     */
     @GetMapping("/api/recordsList")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult apiRecordsList(@RequestBody
@@ -792,7 +783,11 @@ public class BaseCameraManagementController extends BaseController {
         return new AjaxResult(200, "ok", list);
     }
 
-
+    /**
+     * 已弃用
+     * @param vo
+     * @return
+     */
     @PostMapping("/api/invite")
     public AjaxResult apiInvite(@Validated @RequestBody BaseCameraResVo vo) {
         LambdaQueryWrapper<BaseCameraManagement> lw = new LambdaQueryWrapper<BaseCameraManagement>();
@@ -822,6 +817,7 @@ public class BaseCameraManagementController extends BaseController {
 ////        return success(CameraUtil.historyPlayList(one.getChannel(), vo.getStartTime(), vo.getEntTime()));
 //    }
 
+
     @GetMapping("/totalNumberOfDevices")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult totalNumberOfDevices() {
@@ -891,6 +887,11 @@ public class BaseCameraManagementController extends BaseController {
         return success(cameraTree);
     }
 
+    /**
+     * 已弃用
+     * @param id
+     * @return
+     */
     @GetMapping("/endRecording/{id}")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult endRecording(@PathVariable Long id) {
@@ -917,6 +918,11 @@ public class BaseCameraManagementController extends BaseController {
         return error();
     }
 
+    /**
+     * 已弃用
+     * @param id
+     * @return
+     */
     @GetMapping("/startRecording/{id}")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult startRecording(@PathVariable Long id) {
@@ -1014,92 +1020,87 @@ public class BaseCameraManagementController extends BaseController {
         }
     }
 
-    @GetMapping(value = "/getCameraPreviewURL")
-    @Log(title = "相机台账管理", businessType = BusinessType.MESSAGE)
-    public AjaxResult getCameraPreviewURL() {
-        String cameraPreviewURL = GetCameraPreviewURL.getCameraPreviewURL();
-        return AjaxResult.success(cameraPreviewURL);
-    }
-
-    @GetMapping(value = "/testURL")
-    @Log(title = "相机台账管理", businessType = BusinessType.MESSAGE)
-    public AjaxResult testURL() {
-        return AjaxResult.success(cameraUtil.getPlayFlv("live", "42010001541320000025"));
-    }
-
-    @GetMapping(value = "/getAlarmRecord")
-    @Log(title = "相机台账管理", businessType = BusinessType.MESSAGE)
-    public AjaxResult getAlarmRecord(String id) {
-        MsgAlarm one = msgAlarmService.getById(id);
-        if (StringUtils.isEmpty(one.getReleasedUrl())) {
-            return AjaxResult.error("该报警还未生成报警回放视频");
-        } else {
-            return AjaxResult.success(one.getReleasedUrl());
-        }
-    }
-
-
-    @GetMapping(value = "/stop")
-    public AjaxResult stop(String id) {
-        return cameraUtil.stop(id);
-    }
-
-
-    @GetMapping(value = "/videoCompression")
-    public AjaxResult videoCompression(String code) {
-        cameraUtil.videoCompression(code);
-        return AjaxResult.success();
-    }
-
-    @GetMapping(value = "/terminalHeartbeatLog")
-    public AjaxResult terminalHeartbeatLog() {
-        TerminalHeartbeatLog terminalHeartbeatLog = new TerminalHeartbeatLog();
-        terminalHeartbeatLog.setId(terminalHeartbeatLogService.count() + 1);
-        terminalHeartbeatLog.setCameraCode("111");
-        terminalHeartbeatLog.setCreateTime(new Date());
-        boolean save = terminalHeartbeatLogService.save(terminalHeartbeatLog);
-        return AjaxResult.success(save);
-    }
-
-    /**
-     * 流媒体页面接口
-     *
-     * @param list
-     * @return
-     */
-    @RequestMapping("/getCameraManagementList")
-    public AjaxResult getCameraManagementList(@RequestBody List<String> list) {
-        List<BaseCameraManagementResponse> responseList = new ArrayList<>();
-        for (String name : list) {
-            // 寻找第一个斜杠的位置
-            int slashIndex = name.indexOf("/");
-            if (slashIndex != -1) {
-                BaseCameraManagementResponse response = new BaseCameraManagementResponse();
-                String result = name.substring(0, slashIndex);
-                BaseCameraManagement cameraManagement = baseCameraManagementService.getOne(new LambdaQueryWrapper<BaseCameraManagement>()
-                        .eq(BaseCameraManagement::getCameraCode, result));
-                response.setCameraCode(cameraManagement.getCameraCode());
-                response.setInstallMile(cameraManagement.getInstallMile());
-                response.setStreamPath(name);
-                responseList.add(response);
-            } else {
-                return AjaxResult.error("未找到斜杠符号");
-            }
-        }
-        return AjaxResult.success(responseList);
-    }
-
-
-    /**
-     * 流媒体页面接口
-     *
-     * @param
-     * @return
-     */
-    @GetMapping("/getCameraManagementList")
-    public AjaxResult getCameraManagementList() {
-        List<BaseCameraManagementResponse> baseCameraManagementResponses = cameraUtil.heartbeatGetPlayFlv();
-        return AjaxResult.success(baseCameraManagementResponses);
-    }
+//    @GetMapping(value = "/getCameraPreviewURL")
+//    @Log(title = "相机台账管理", businessType = BusinessType.MESSAGE)
+//    public AjaxResult getCameraPreviewURL() {
+//        String cameraPreviewURL = GetCameraPreviewURL.getCameraPreviewURL();
+//        return AjaxResult.success(cameraPreviewURL);
+//    }
+//
+//    @GetMapping(value = "/testURL")
+//    @Log(title = "相机台账管理", businessType = BusinessType.MESSAGE)
+//    public AjaxResult testURL() {
+//        return AjaxResult.success(cameraUtil.getPlayFlv("live", "42010001541320000025"));
+//    }
+//
+//    @GetMapping(value = "/getAlarmRecord")
+//    @Log(title = "相机台账管理", businessType = BusinessType.MESSAGE)
+//    public AjaxResult getAlarmRecord(String id) {
+//        MsgAlarm one = msgAlarmService.getById(id);
+//        if (StringUtils.isEmpty(one.getReleasedUrl())) {
+//            return AjaxResult.error("该报警还未生成报警回放视频");
+//        } else {
+//            return AjaxResult.success(one.getReleasedUrl());
+//        }
+//    }
+//
+//
+//
+//    @GetMapping(value = "/videoCompression")
+//    public AjaxResult videoCompression(String code) {
+//        cameraUtil.videoCompression(code);
+//        return AjaxResult.success();
+//    }
+//
+//    @GetMapping(value = "/terminalHeartbeatLog")
+//    public AjaxResult terminalHeartbeatLog() {
+//        TerminalHeartbeatLog terminalHeartbeatLog = new TerminalHeartbeatLog();
+//        terminalHeartbeatLog.setId(terminalHeartbeatLogService.count() + 1);
+//        terminalHeartbeatLog.setCameraCode("111");
+//        terminalHeartbeatLog.setCreateTime(new Date());
+//        boolean save = terminalHeartbeatLogService.save(terminalHeartbeatLog);
+//        return AjaxResult.success(save);
+//    }
+//
+//    /**
+//     * 流媒体页面接口
+//     *
+//     * @param list
+//     * @return
+//     */
+//    @RequestMapping("/getCameraManagementList")
+//    public AjaxResult getCameraManagementList(@RequestBody List<String> list) {
+//        List<BaseCameraManagementResponse> responseList = new ArrayList<>();
+//        for (String name : list) {
+//            // 寻找第一个斜杠的位置
+//            int slashIndex = name.indexOf("/");
+//            if (slashIndex != -1) {
+//                BaseCameraManagementResponse response = new BaseCameraManagementResponse();
+//                String result = name.substring(0, slashIndex);
+//                BaseCameraManagement cameraManagement = baseCameraManagementService.getOne(new LambdaQueryWrapper<BaseCameraManagement>()
+//                        .eq(BaseCameraManagement::getCameraCode, result));
+//                response.setCameraCode(cameraManagement.getCameraCode());
+//                response.setInstallMile(cameraManagement.getInstallMile());
+//                response.setStreamPath(name);
+//                responseList.add(response);
+//            } else {
+//                return AjaxResult.error("未找到斜杠符号");
+//            }
+//        }
+//        return AjaxResult.success(responseList);
+//    }
+//
+//
+//    /**
+//     * 流媒体页面接口
+//     *
+//     * @param
+//     * @return
+//     */
+//    @GetMapping("/getCameraManagementList")
+//    public AjaxResult getCameraManagementList() {
+//        List<BaseCameraManagementResponse> baseCameraManagementResponses = cameraUtil.heartbeatGetPlayFlv();
+//        return AjaxResult.success(baseCameraManagementResponses);
+//    }
 }
 

+ 1 - 1
vehicle-admin/src/main/java/com/ozs/web/controller/home/HomeController.java

@@ -1,4 +1,4 @@
-package com.ozs.web.controller.home;
+package com.ozs.web.controller.accountmanagment;
 
 import com.ozs.common.core.controller.BaseController;
 import com.ozs.common.core.domain.AjaxResult;

+ 1 - 2
vehicle-admin/src/main/java/com/ozs/web/controller/system/MonitorSystemController.java

@@ -1,4 +1,4 @@
-package com.ozs.web.controller.system;
+package com.ozs.web.controller.accountmanagment;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -8,7 +8,6 @@ import com.ozs.common.core.controller.BaseController;
 import com.ozs.common.core.domain.AjaxResult;
 import com.ozs.common.enums.BusinessType;
 import com.ozs.entity.MonitorSystem;
-import com.ozs.entity.VehiclePosition;
 import com.ozs.entity.vo.MonitorSystemVo;
 import com.ozs.service.MonitorSystemService;
 import lombok.extern.slf4j.Slf4j;

+ 0 - 9
vehicle-admin/src/main/java/com/ozs/web/controller/accountmanagment/MsgAlarmTemporaryController.java

@@ -1,7 +1,5 @@
 package com.ozs.web.controller.accountmanagment;
 
-import com.alibaba.fastjson2.JSON;
-import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -14,8 +12,6 @@ import com.ozs.common.enums.BusinessType;
 import com.ozs.common.utils.AppendUtils;
 import com.ozs.common.utils.IdempotenceUtils;
 import com.ozs.common.utils.StringUtils;
-import com.ozs.common.utils.http.HttpUtils;
-import com.ozs.common.utils.stateSecrets.SM4Utils;
 import com.ozs.entity.BaseCameraManagement;
 import com.ozs.entity.BaseRailwayManagement;
 import com.ozs.entity.BaseUser;
@@ -25,7 +21,6 @@ import com.ozs.entity.MsgAlarmFrequency;
 import com.ozs.entity.vo.Files;
 import com.ozs.entity.vo.MsgAlarmTemporary;
 import com.ozs.entity.vo.MsgAlarmVo;
-import com.ozs.entity.vo.ParameterVo;
 import com.ozs.entity.vo.ReleaseAlarmVo;
 import com.ozs.entity.vo.ReqMsgAlarmVo;
 import com.ozs.service.BaseCameraManagementService;
@@ -37,7 +32,6 @@ import com.ozs.service.MsgAlarmService;
 import com.ozs.service.MsgAlarmTemporaryService;
 import com.ozs.service.SvcAddressService;
 import com.ozs.system.service.ISysDictTypeService;
-import com.ozs.web.controller.monitor.SysUserOnlineController;
 import com.ozs.web.controller.websocket.WebSocketCommon;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -49,7 +43,6 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.servlet.http.HttpServletRequest;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -81,8 +74,6 @@ public class MsgAlarmTemporaryController extends BaseController {
     @Autowired
     BaseCameraManagementService baseCameraManagementService;
     @Autowired
-    SysUserOnlineController sysUserOnlineController;
-    @Autowired
     private BaseUserService baseUserService;
     @Autowired
     private MsgAlarmExtService msgAlarmExtService;

+ 0 - 89
vehicle-admin/src/main/java/com/ozs/web/controller/monitor/SysUserOnlineController.java

@@ -1,89 +0,0 @@
-package com.ozs.web.controller.monitor;
-
-import com.ozs.common.annotation.Log;
-import com.ozs.common.constant.CacheConstants;
-import com.ozs.common.core.controller.BaseController;
-import com.ozs.common.core.domain.AjaxResult;
-import com.ozs.common.core.domain.model.LoginUser;
-import com.ozs.common.core.page.TableDataInfo;
-import com.ozs.common.core.redis.RedisCache;
-import com.ozs.common.enums.BusinessType;
-import com.ozs.common.utils.StringUtils;
-import com.ozs.system.domain.SysUserOnline;
-import com.ozs.system.service.ISysUserOnlineService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * 在线用户监控
- *
- * @author ruoyi
- */
-@RestController
-@RequestMapping("/monitor/online")
-public class SysUserOnlineController extends BaseController
-{
-    @Autowired
-    private ISysUserOnlineService userOnlineService;
-
-    @Autowired
-    private RedisCache redisCache;
-
-    @PreAuthorize("@ss.hasPermi('monitor:online:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(String ipaddr, String userName)
-    {
-        Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*");
-        List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>();
-        for (String key : keys)
-        {
-            LoginUser user = redisCache.getCacheObject(key);
-            if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName))
-            {
-                if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername()))
-                {
-                    userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user));
-                }
-            }
-            else if (StringUtils.isNotEmpty(ipaddr))
-            {
-                if (StringUtils.equals(ipaddr, user.getIpaddr()))
-                {
-                    userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user));
-                }
-            }
-            else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser()))
-            {
-                if (StringUtils.equals(userName, user.getUsername()))
-                {
-                    userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user));
-                }
-            }
-            else
-            {
-                userOnlineList.add(userOnlineService.loginUserToUserOnline(user));
-            }
-        }
-        Collections.reverse(userOnlineList);
-        userOnlineList.removeAll(Collections.singleton(null));
-        return getDataTable(userOnlineList);
-    }
-
-    /**
-     * 强退用户
-     */
-    @PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')")
-    @Log(title = "在线用户", businessType = BusinessType.FORCE)
-    @RequestMapping("/{tokenId}")
-    public AjaxResult forceLogout(@PathVariable String tokenId)
-    {
-        redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId);
-        return success();
-    }
-}

+ 0 - 29
vehicle-admin/src/main/java/com/ozs/web/controller/system/SysIndexController.java

@@ -1,29 +0,0 @@
-package com.ozs.web.controller.system;
-
-import com.ozs.common.config.BaseConfig;
-import com.ozs.common.utils.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * 首页
- *
- * @author ruoyi
- */
-@RestController
-public class SysIndexController
-{
-    /** 系统基础配置 */
-    @Autowired
-    private BaseConfig ruoyiConfig;
-
-    /**
-     * 访问首页,提示语
-     */
-    @RequestMapping("/")
-    public String index()
-    {
-        return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", ruoyiConfig.getName(), ruoyiConfig.getVersion());
-    }
-}

+ 0 - 85
vehicle-admin/src/main/java/com/ozs/web/controller/system/SysNoticeController.java

@@ -1,85 +0,0 @@
-package com.ozs.web.controller.system;
-
-import com.ozs.common.annotation.Log;
-import com.ozs.common.core.controller.BaseController;
-import com.ozs.common.core.domain.AjaxResult;
-import com.ozs.common.core.page.TableDataInfo;
-import com.ozs.common.enums.BusinessType;
-import com.ozs.system.domain.SysNotice;
-import com.ozs.system.service.ISysNoticeService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- * 公告 信息操作处理
- *
- * @author ruoyi
- */
-@RestController
-@RequestMapping("/system/notice")
-public class SysNoticeController extends BaseController
-{
-    @Autowired
-    private ISysNoticeService noticeService;
-
-    /**
-     * 获取通知公告列表
-     */
-    @PreAuthorize("@ss.hasPermi('system:notice:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(SysNotice notice)
-    {
-        startPage();
-        List<SysNotice> list = noticeService.selectNoticeList(notice);
-        return getDataTable(list);
-    }
-
-    /**
-     * 根据通知公告编号获取详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('system:notice:query')")
-    @GetMapping(value = "/{noticeId}")
-    public AjaxResult getInfo(@PathVariable Long noticeId)
-    {
-        return success(noticeService.selectNoticeById(noticeId));
-    }
-
-    /**
-     * 新增通知公告
-     */
-    @PreAuthorize("@ss.hasPermi('system:notice:add')")
-    @Log(title = "通知公告", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@Validated @RequestBody SysNotice notice)
-    {
-        notice.setCreateBy(getUsername());
-        return toAjax(noticeService.insertNotice(notice));
-    }
-
-    /**
-     * 修改通知公告
-     */
-    @PreAuthorize("@ss.hasPermi('system:notice:edit')")
-    @Log(title = "通知公告", businessType = BusinessType.UPDATE)
-    @RequestMapping("/edit")
-    public AjaxResult edit(@Validated @RequestBody SysNotice notice)
-    {
-        notice.setUpdateBy(getUsername());
-        return toAjax(noticeService.updateNotice(notice));
-    }
-
-    /**
-     * 删除通知公告
-     */
-    @PreAuthorize("@ss.hasPermi('system:notice:remove')")
-    @Log(title = "通知公告", businessType = BusinessType.DELETE)
-    @RequestMapping("/{noticeIds}")
-    public AjaxResult remove(@PathVariable Long[] noticeIds)
-    {
-        return toAjax(noticeService.deleteNoticeByIds(noticeIds));
-    }
-}

+ 0 - 124
vehicle-admin/src/main/java/com/ozs/web/controller/system/SysPostController.java

@@ -1,124 +0,0 @@
-package com.ozs.web.controller.system;
-
-import com.ozs.common.annotation.Log;
-import com.ozs.common.constant.UserConstants;
-import com.ozs.common.core.controller.BaseController;
-import com.ozs.common.core.domain.AjaxResult;
-import com.ozs.common.core.page.TableDataInfo;
-import com.ozs.common.enums.BusinessType;
-import com.ozs.common.utils.poi.ExcelUtil;
-import com.ozs.system.domain.SysPost;
-import com.ozs.system.service.ISysPostService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletResponse;
-import java.util.List;
-
-/**
- * 岗位信息操作处理
- *
- * @author ruoyi
- */
-@RestController
-@RequestMapping("/system/post")
-public class SysPostController extends BaseController
-{
-    @Autowired
-    private ISysPostService postService;
-
-    /**
-     * 获取岗位列表
-     */
-    @PreAuthorize("@ss.hasPermi('system:post:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(SysPost post)
-    {
-        startPage();
-        List<SysPost> list = postService.selectPostList(post);
-        return getDataTable(list);
-    }
-
-    @Log(title = "岗位管理", businessType = BusinessType.EXPORT)
-    @PreAuthorize("@ss.hasPermi('system:post:export')")
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, SysPost post)
-    {
-        List<SysPost> list = postService.selectPostList(post);
-        ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class);
-        util.exportExcel(response, list, "岗位数据");
-    }
-
-    /**
-     * 根据岗位编号获取详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('system:post:query')")
-    @GetMapping(value = "/{postId}")
-    public AjaxResult getInfo(@PathVariable Long postId)
-    {
-        return success(postService.selectPostById(postId));
-    }
-
-    /**
-     * 新增岗位
-     */
-    @PreAuthorize("@ss.hasPermi('system:post:add')")
-    @Log(title = "岗位管理", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@Validated @RequestBody SysPost post)
-    {
-        if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
-        {
-            return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
-        }
-        else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post)))
-        {
-            return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
-        }
-        post.setCreateBy(getUsername());
-        return toAjax(postService.insertPost(post));
-    }
-
-    /**
-     * 修改岗位
-     */
-    @PreAuthorize("@ss.hasPermi('system:post:edit')")
-    @Log(title = "岗位管理", businessType = BusinessType.UPDATE)
-    @RequestMapping("/edit")
-    public AjaxResult edit(@Validated @RequestBody SysPost post)
-    {
-        if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
-        {
-            return error("修改岗位'" + post.getPostName() + "'失败,岗位名称已存在");
-        }
-        else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post)))
-        {
-            return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
-        }
-        post.setUpdateBy(getUsername());
-        return toAjax(postService.updatePost(post));
-    }
-
-    /**
-     * 删除岗位
-     */
-    @PreAuthorize("@ss.hasPermi('system:post:remove')")
-    @Log(title = "岗位管理", businessType = BusinessType.DELETE)
-    @RequestMapping("/remove/{postIds}")
-    public AjaxResult remove(@PathVariable Long[] postIds)
-    {
-        return toAjax(postService.deletePostByIds(postIds));
-    }
-
-    /**
-     * 获取岗位选择框列表
-     */
-    @GetMapping("/optionselect")
-    public AjaxResult optionselect()
-    {
-        List<SysPost> posts = postService.selectPostAll();
-        return success(posts);
-    }
-}

+ 0 - 38
vehicle-admin/src/main/java/com/ozs/web/controller/system/SysRegisterController.java

@@ -1,38 +0,0 @@
-package com.ozs.web.controller.system;
-
-import com.ozs.common.core.controller.BaseController;
-import com.ozs.common.core.domain.AjaxResult;
-import com.ozs.common.core.domain.model.RegisterBody;
-import com.ozs.common.utils.StringUtils;
-import com.ozs.framework.web.service.SysRegisterService;
-import com.ozs.system.service.ISysConfigService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * 注册验证
- *
- * @author ruoyi
- */
-@RestController
-public class SysRegisterController extends BaseController
-{
-    @Autowired
-    private SysRegisterService registerService;
-
-    @Autowired
-    private ISysConfigService configService;
-
-    @PostMapping("/register")
-    public AjaxResult register(@RequestBody RegisterBody user)
-    {
-        if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
-        {
-            return error("当前系统没有开启注册功能!");
-        }
-        String msg = registerService.register(user);
-        return StringUtils.isEmpty(msg) ? success() : error(msg);
-    }
-}

+ 0 - 53
vehicle-admin/src/main/java/com/ozs/web/core/config/CaneraConfig.java

@@ -1,53 +0,0 @@
-//package com.ozs.web.core.config;
-//
-//import lombok.Data;
-//import org.springframework.beans.factory.annotation.Value;
-//import org.springframework.context.annotation.Configuration;
-//
-//@Configuration
-//@Data
-//public class CaneraConfig {
-//
-//    /**
-//     * 视频服务器访问路径
-//     */
-//    @Value("${base.historyUrl:http://47.106.159.135/streams}")
-//    private String historyUrl;
-//
-//    /**
-//     * ffmpeg.exe路径
-//     * "D:\\Java\\operSources\\ffmpeg-4.3.1\\bin\\ffmpeg.exe"
-//     */
-//    @Value("${base.ffmpegPath:C:\\Users\\Administrator.DESKTOP-0NUUTMM\\Downloads\\ffmpeg-5.1.2-essentials_build\\ffmpeg-5.1.2-essentials_build\\bin\\ffmpeg.exe}")
-//    private String ffmpegPath;
-//
-//
-//    @Value("${base.filePath:/opt/streams/}")
-//    private String filePath;
-//
-//    /**
-//     * 录制视频存放路径
-//     */
-//    @Value("${base.transcribeFilePath:/opt/streams/record/flv}")
-//    private String transcribeFilePath;
-//
-//
-//    @Value("${base.webUrl:http://47.106.159.135/streams}")
-//    private String webUrl;
-//
-//    @Value("${base.bakUrl:http://124.70.58.209:18891}")
-//    private String bakUrl;
-//
-//    @Value("${base.bakUrlRtsp:rtsp://124.70.58.209:8554}")
-//    private String bakUrlRtsp;
-//
-//    @Value("${base.wsUrl:http://124.70.58.209:18891}")
-//    private String wsUrl;
-//
-//    @Value("${base.recordUrl:http://183.236.39.220:8083}")
-//    private String recordUrl;
-//
-//    @Value("${base.hkUrl:http://10.48.253.21:1443}")
-//    private String hkUrl;
-//    
-//}

+ 0 - 157
vehicle-admin/src/main/java/com/ozs/web/core/config/GetCameraPreviewURL.java

@@ -1,157 +0,0 @@
-package com.ozs.web.core.config;
-
-import com.alibaba.fastjson2.JSONObject;
-import com.hikvision.artemis.sdk.ArtemisHttpUtil;
-import com.hikvision.artemis.sdk.config.ArtemisConfig;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.context.annotation.Configuration;
-
-import java.util.HashMap;
-import java.util.Map;
-
-
-@Configuration
-@Slf4j
-public class GetCameraPreviewURL {
-    public static String getCameraPreviewURL() {
-
-        /**
-         * STEP1:设置平台参数,根据实际情况,设置host appkey appsecret 三个参数.
-         */
-        ArtemisConfig.host = "10.48.253.21:1443"; // 平台的ip端口
-        ArtemisConfig.appKey = "20110033";  // 密钥appkey
-        ArtemisConfig.appSecret = "QoGESFXOYrC68ixIS7wo";// 密钥appSecret
-
-        /**
-         * STEP2:设置OpenAPI接口的上下文
-         */
-        final String ARTEMIS_PATH = "/artemis";
-
-        /**
-         * STEP3:设置接口的URI地址
-         */
-        final String previewURLsApi = ARTEMIS_PATH+"/api/resource/v1/camera/advance/cameraList";
-        Map<String, String> path = new HashMap<String, String>(2) {
-            {
-                put("https://", previewURLsApi);//根据现场环境部署确认是http还是https
-            }
-        };
-
-        /**
-         * STEP4:设置参数提交方式
-         */
-        String contentType = "application/json";
-
-        /**
-         * STEP5:组装请求参数
-         */
-        JSONObject jsonBody = new JSONObject();
-        jsonBody.put("pageNo", 1);
-        jsonBody.put("pageSize", 999);
-        String body = jsonBody.toJSONString();
-        /**
-         * STEP6:调用接口
-         */
-        String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, contentType , null);// post请求application/json类型参数
-        log.info("GetCameraPreviewURL----->"+result);
-        return result;
-    }
-
-
-
-    public static String getPreviewURLs() {
-
-        /**
-         * STEP1:设置平台参数,根据实际情况,设置host appkey appsecret 三个参数.
-         */
-        ArtemisConfig.host = "10.48.253.21:1443"; // 平台的ip端口
-        ArtemisConfig.appKey = "20110033";  // 密钥appkey
-        ArtemisConfig.appSecret = "QoGESFXOYrC68ixIS7wo";// 密钥appSecret
-
-        /**
-         * STEP2:设置OpenAPI接口的上下文
-         */
-        final String ARTEMIS_PATH = "/artemis";
-
-        /**
-         * STEP3:设置接口的URI地址
-         */
-        final String previewURLsApi = ARTEMIS_PATH+"/api/video/v1/cameras/previewURLs";
-        Map<String, String> path = new HashMap<String, String>(2) {
-            {
-                put("https://", previewURLsApi);//根据现场环境部署确认是http还是https
-            }
-        };
-
-        /**
-         * STEP4:设置参数提交方式
-         */
-        String contentType = "application/json";
-
-        /**
-         * STEP5:组装请求参数
-         */
-        JSONObject jsonBody = new JSONObject();
-        jsonBody.put("cameraIndexCode", "01ea43e6676f4e47bd6c5cd9e02aa006");
-        jsonBody.put("streamType", 0);
-        jsonBody.put("protocol","rtsp");
-        jsonBody.put("transmode", 1);
-        jsonBody.put("expand","streamform=rtp");
-        String body = jsonBody.toJSONString();
-        /**
-         * STEP6:调用接口
-         */
-        String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, contentType , null);// post请求application/json类型参数
-        log.info("GetCameraPreviewURL----->"+result);
-        return result;
-    }
-
-
-    public static String playbackURLs() {
-
-        /**
-         * STEP1:设置平台参数,根据实际情况,设置host appkey appsecret 三个参数.
-         */
-        ArtemisConfig.host = "10.48.253.21:1443"; // 平台的ip端口
-        ArtemisConfig.appKey = "20110033";  // 密钥appkey
-        ArtemisConfig.appSecret = "QoGESFXOYrC68ixIS7wo";// 密钥appSecret
-
-        /**
-         * STEP2:设置OpenAPI接口的上下文
-         */
-        final String ARTEMIS_PATH = "/artemis";
-
-        /**
-         * STEP3:设置接口的URI地址
-         */
-        final String previewURLsApi = ARTEMIS_PATH+"/api/video/v1/cameras/playbackURLs";
-        Map<String, String> path = new HashMap<String, String>(2) {
-            {
-                put("https://", previewURLsApi);//根据现场环境部署确认是http还是https
-            }
-        };
-
-        /**
-         * STEP4:设置参数提交方式
-         */
-        String contentType = "application/json";
-
-        /**
-         * STEP5:组装请求参数
-         */
-        JSONObject jsonBody = new JSONObject();
-        jsonBody.put("cameraIndexCode", "01ea43e6676f4e47bd6c5cd9e02aa006");
-        jsonBody.put("beginTime", "2023-11-29T14:00:00.000+08:00");
-        jsonBody.put("endTime","2023-11-29T14:20:00.000+08:00");
-        jsonBody.put("protocol","rtsp");
-        jsonBody.put("expand","streamform=rtp");
-        String body = jsonBody.toJSONString();
-        /**
-         * STEP6:调用接口
-         */
-        String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, contentType , null);// post请求application/json类型参数
-        log.info("GetCameraPreviewURL----->"+result);
-        return result;
-    }
-    
-}

+ 0 - 978
vehicle-admin/src/main/java/com/ozs/web/core/util/CameraUtil.java

@@ -1,978 +0,0 @@
-//package com.ozs.web.core.util;
-//
-//import com.alibaba.fastjson2.JSON;
-//import com.alibaba.fastjson2.JSONObject;
-//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-//import com.ozs.common.config.BaseConfig;
-//import com.ozs.common.constant.Constants;
-//import com.ozs.common.core.domain.AjaxResult;
-//import com.ozs.common.core.domain.entity.SysDictData;
-//import com.ozs.common.core.redis.RedisCache;
-//import com.ozs.common.exception.base.BaseException;
-//import com.ozs.common.utils.DateUtils;
-//import com.ozs.common.utils.HttpClientUtil;
-//import com.ozs.common.utils.http.HttpUtils;
-//import com.ozs.entity.BaseTerminal;
-//import com.ozs.entity.MsgHeartbeatAlarmMessage;
-//import com.ozs.entity.vo.CamerasVo;
-//import com.ozs.entity.vo.PlaybackVo;
-//import com.ozs.framework.config.ServerConfig;
-//import com.ozs.service.BaseTerminalService;
-//import com.ozs.service.MsgHeartbeatAlarmMessageService;
-//import com.ozs.system.mapper.SysDictDataMapper;
-//import com.ozs.system.service.ISysDictTypeService;
-//import com.ozs.web.core.config.CaneraConfig;
-//import lombok.SneakyThrows;
-//import lombok.extern.slf4j.Slf4j;
-//import org.apache.commons.lang3.StringUtils;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.context.annotation.Configuration;
-//import org.springframework.util.ObjectUtils;
-//
-//import javax.annotation.PostConstruct;
-//import javax.annotation.Resource;
-//import java.io.*;
-//import java.text.ParseException;
-//import java.text.SimpleDateFormat;
-//import java.time.LocalDateTime;
-//import java.time.format.DateTimeFormatter;
-//import java.util.*;
-//import java.util.concurrent.Callable;
-//import java.util.concurrent.CompletableFuture;
-//import java.util.concurrent.ExecutionException;
-//import java.util.concurrent.ExecutorService;
-//import java.util.concurrent.Executors;
-//import java.util.concurrent.TimeUnit;
-//import java.util.concurrent.TimeoutException;
-//import java.util.stream.Collectors;
-//import java.util.stream.Stream;
-//
-///**
-// * 相机工具
-// */
-//
-//@Configuration
-//@Slf4j
-//public class CameraUtil {
-//    private static final ExecutorService executor = Executors.newFixedThreadPool(20);
-//
-//    private static String historyUrl;
-//    private static String ffmpegPath;
-//    private static String filePath;
-//    private static String transcribeFilePath;
-//    private static String webUrl;
-//    private static String bakUrl;
-//    private static String bakUrlRtsp;
-//    private static String wsUrl;
-//    private static CmdCameraUtil cUtil;
-//    private static RedisCache rc;
-//    private static ServerConfig sc;
-//    private static String recordUrl;
-//    private static String hkUrl;
-//
-//    @Autowired
-//    private CaneraConfig caneraConfig;
-//
-//    @Autowired
-//    private CmdCameraUtil cmdCameraUtil;
-//
-//    @Autowired
-//    private SysDictDataMapper dictDataMapper;
-//
-//    @Autowired
-//    private RedisCache redisCache;
-//    @Autowired
-//    private ServerConfig serverConfig;
-//    @Autowired
-//    private BaseTerminalService baseTerminalService;
-//    @Autowired
-//    private MsgHeartbeatAlarmMessageService msgHeartbeatAlarmMessageService;
-//    @Autowired
-//    private ISysDictTypeService dictTypeService;
-//
-//    public final static String tsFilekey = "mergeVideoTsFile";
-//
-//
-//    /**
-//     * 历史回放
-//     *
-//     * @param fromVideoFileList
-//     * @param ph
-//     * @return
-//     * @throws IOException
-//     */
-//    public static String historyPlay(List<String> fromVideoFileList, String ph, boolean flay) {
-//        // 视频服务映射路径
-//        String NewfilePath = BaseConfig.getProfile() + "/" + ph;
-//        log.info("NewfilePath:{}", NewfilePath);
-//        log.info("fromVideoFileList:{}", fromVideoFileList);
-//        if (ObjectUtils.isEmpty(fromVideoFileList) || fromVideoFileList.size() <= 0) {
-//            throw new BaseException("当前相机无视频录像");
-//        }
-//        executor.submit(new Runnable() {
-//            @Override
-//            public void run() {
-//                try {
-//                    txConvetor(fromVideoFileList, NewfilePath, flay);
-//                } catch (IOException e) {
-//                    log.error(e.getMessage());
-//                    e.printStackTrace();
-//                }
-//            }
-//        });
-////        executor.shutdown();
-//
-//        return Constants.RESOURCE_PREFIX + "/" + ph;
-//    }
-//
-//
-//    @SneakyThrows
-//    public static void txConvetor(List<String> fromVideoFileList,
-//                                  String newfilePath,
-//                                  boolean fly) throws IOException {
-//        /*
-//        * ffmpeg -i 20230411_155847_155947-d4c2265d-d83e-11ed-8e7f-fa163e4e1e9f.flv -c:v copy 1.ts
-//ffmpeg -i 20230411_155948_160048-f91fea03-d83e-11ed-8e7f-fa163e4e1e9f.flv -c:v copy 2.ts
-//ffmpeg -i "concat:1.ts|2.ts" -c copy output.mp4
-//        * */
-//
-//        File file = new File(newfilePath);
-//        boolean flay = false;
-//        if (!file.getParentFile().exists()) {
-//            boolean mkdirs = file.getParentFile().mkdirs();
-//            log.info("创建文件夹:{}", file.getParentFile().getPath());
-//            log.info("创建文件夹结果:{}", mkdirs);
-//            flay = true;
-//        }
-//        cUtil.cmd("chomd -R 777 " + file.getParentFile().getPath());
-//        log.info("newfilePath:{}", newfilePath);
-//        StringBuffer sm = new StringBuffer(ffmpegPath + " -i \"concat:");
-//        List<String> fileTs = new ArrayList<>();
-//        for (int t = 0; t < fromVideoFileList.size(); t++) {
-//            File ft = new File(fromVideoFileList.get(t));
-//            if (ft.exists()) {
-//                log.info("file:{}", fromVideoFileList.get(t));
-//                String substring = fromVideoFileList.get(t).substring(0, fromVideoFileList.get(t).lastIndexOf("."));
-//                int x;//定义两变量
-//                Random ne = new Random();//实例化一个random的对象ne
-//                x = ne.nextInt(9999 - 1000 + 1) + 1000;//为变量赋随机值1000-9999
-//                substring = substring + x;//定义两变量
-//
-//                String cmdstr = ffmpegPath + " -i " + fromVideoFileList.get(t) + " -c:v copy " + substring + ".ts";
-//                log.info("转换命令:{}", cmdstr);
-//                cUtil.cmd(cmdstr);
-//                fileTs.add(substring + ".ts");
-//                if (t != fromVideoFileList.size() - 1) {
-//                    sm.append(substring + ".ts|");
-//                } else {
-//                    sm.append(substring + ".ts\" ");
-//                }
-//            }
-//        }
-//
-//        if (fileTs.size() > 0) {
-//            Map<String, Object> mergeVideoTsFile = rc.getCacheMap(tsFilekey);
-//            if (ObjectUtils.isEmpty(mergeVideoTsFile)) {
-//                mergeVideoTsFile = new HashMap<>();
-//            }
-//            if (!flay) {
-//                // 如果没有解除,把生成的文件放入要删除的定时任务 redis key 中
-//                fileTs.add(newfilePath);
-//            }
-//            mergeVideoTsFile.put(System.currentTimeMillis() + "", fileTs);
-//            rc.deleteObject(tsFilekey);
-//            if (mergeVideoTsFile.size() > 0) {
-//                rc.setCacheMap(tsFilekey, mergeVideoTsFile);
-//            }
-//
-//            sm.append("-c copy " + newfilePath);
-//            log.info("合并命令:{}", sm.toString());
-//            cUtil.cmd(sm.toString());
-//        }
-//
-//    }
-//
-//    /**
-//     * 实时播放的拼接流
-//     *
-//     * @param cameraCode 相机编码
-//     * @param channel    相机通道
-//     * @return
-//     */
-//    public static String getPlayFlv(String cameraCode, String channel, boolean flay) {
-//        if (!flay) {
-//            return bakUrl + "/hdl/" + channel + "/" + cameraCode + ".flv";
-//        }
-//        return webUrl + "/hdl/" + channel + "/" + cameraCode + ".flv";
-//
-//
-////        if (!flay) {
-////            return bakUrl + "/ws/" + channel + "/" + cameraCode + ".flv";
-////        }
-////        return webUrl + "/ws/" + channel + "/" + cameraCode + ".flv";
-//    }
-//
-//
-//    /**
-//     * Rtsp实时播放的拼接流
-//     *
-//     * @param cameraCode 相机编码
-//     * @param channel    相机通道
-//     * @return
-//     */
-//    public static String getPlayFlvRtsp(String cameraCode, String channel, boolean flay) {
-//        if (!flay) {
-//            return bakUrlRtsp + "/" + channel + "/" + cameraCode;
-//        }
-//        return bakUrlRtsp + "/" + channel + "/" + cameraCode;
-//
-//
-////        if (!flay) {
-////            return bakUrl + "/ws/" + channel + "/" + cameraCode + ".flv";
-////        }
-////        return webUrl + "/ws/" + channel + "/" + cameraCode + ".flv";
-//    }
-//
-//    public static String getPlayFlv(String cameraCode, String channel) {
-//        return getPlayFlv(cameraCode, channel, true);
-//    }
-//
-//    public static String invite(String cameraCode, String channel) {
-//        String result = null;
-//        String url = bakUrl + "/api/gb28181/invite?id=" + cameraCode + "&channel=" + channel;
-//        try {
-//            result = HttpClientUtil.get(url);
-//            log.info("result:{}", result);
-//        } catch (Exception e) {
-//            log.info(e.getMessage());
-//            e.printStackTrace();
-//        }
-//        return result;
-//    }
-//
-//
-//    /**
-//     * 开启录制功能
-//     *
-//     * @param cameraCode 相机编码
-//     * @param channel    相机通道
-//     * @return
-//     */
-//    public static String startRecording(String cameraCode, String channel) {
-//        return historyUrl + "/recordpro/api/start?streamPath=" + channel + "/" + cameraCode;
-//    }
-//
-//    /**
-//     * 关闭录制功能
-//     *
-//     * @param taskId 录像接口返回的任务ID
-//     * @return
-//     */
-//    public static String endRecording(String taskId) {
-//        return historyUrl + "/recordpro/api/stop?id=" + taskId;
-//    }
-//
-//
-//    /**
-//     * 历史回放流(获取)
-//     *
-//     * @param channel 相机通道
-//     * @param startTm 开始时间
-//     * @param endTm   结束时间
-//     * @return
-//     */
-//    public static String historyPlayListStr(String channel, Date startTm, Date endTm, boolean flay) {
-//        List<String> list = filterPlayList(channel, startTm, endTm, filePath);
-//        String uuid = UUID.randomUUID().toString();
-//        String ph = "record/flv/" + DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, new Date())
-//                + "/" + channel + "/"
-//                + uuid + ".mp4";
-//        if (!ObjectUtils.isEmpty(list)) {
-//            try {
-//                return historyPlay(list, ph, flay);
-//            } catch (Exception e) {
-//                log.error(e.getMessage());
-//                e.printStackTrace();
-//            }
-//        } else {
-//            throw new BaseException("当前相机无视频录像");
-//        }
-//        return null;
-//    }
-//
-//
-//    /**
-//     * 过滤符合条件的视频
-//     *
-//     * @param channel
-//     * @param startTm
-//     * @param endTm
-//     * @param mappingUrl
-//     * @return
-//     */
-//    public static List<String> filterPlayList(String channel, Date startTm, Date endTm, String mappingUrl) {
-//        if (StringUtils.isBlank(channel)
-//                || ObjectUtils.isEmpty(startTm)
-//                || ObjectUtils.isEmpty(endTm)) {
-//            return null;
-//        }
-//
-//        List<String> ls = new ArrayList<>();
-//        Map<Date, String> m = new HashMap<>();
-//        // 调用视频服务返回参数
-//        String startTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, startTm);
-//        String endTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, endTm);
-//
-//        String param = "channel=" + channel + "&startTime=" + startTime + "&endTime=" + endTime;
-//        String s = HttpUtils.sendGet(historyUrl + "/api/record/flv/list", param);
-//        // 视频拼接
-//        if (!StringUtils.isBlank(s) && !"null".equals(s) && !s.startsWith("<!DOCTYPE html>")) {
-//            List<Map<String, Object>> maps = JSON.parseArray(s, Map.class);
-//            if (ObjectUtils.isEmpty(maps)) {
-//                return null;
-//            }
-//            for (Map<String, Object> map : maps) {
-//                Object path = map.get("Path");
-//                if (!ObjectUtils.isEmpty(path)) {
-//                    String s1 = path.toString();
-//                    String substring = s1.substring(s1.lastIndexOf("/") + 1, s1.length());
-//                    String substring1 = substring.substring(0, substring.indexOf("-"));
-//                    String[] s2 = substring1.split("_");
-//                    if (!ObjectUtils.isEmpty(s2)) {
-//
-//                        String s3 = s2[0] + s2[1];
-//                        String s4 = s2[0] + s2[2];
-//                        Date sdate = DateUtils.dateTime(DateUtils.YYYYMMDDHHMMSS, s3);
-//                        if (s2[1].startsWith("23") && s2[2].startsWith("00")) {
-//                            sdate = DateUtils.addDays(sdate, -1);
-//                        }
-//                        Date edate = DateUtils.dateTime(DateUtils.YYYYMMDDHHMMSS, s4);
-//                        /*     sdate  |startTm|  edate     |endTm| */
-//                        if (startTm.compareTo(sdate) >= 0
-//                                && startTm.compareTo(edate) <= 0
-//                                && endTm.compareTo(edate) >= 0) {
-//                            m.put(sdate, mappingUrl + path.toString());
-//                            /*  |startTm|   sdate    edate   |endTm| */
-//                        } else if (startTm.compareTo(sdate) <= 0 && endTm.compareTo(edate) >= 0) {
-//                            m.put(sdate, mappingUrl + path.toString());
-//
-//                            /*  |startTm|   sdate     |endTm|  edate  */
-//                        } else if (startTm.compareTo(sdate) <= 0
-//                                && endTm.compareTo(sdate) >= 0
-//                                && endTm.compareTo(edate) <= 0) {
-//                            m.put(sdate, mappingUrl + path.toString());
-//
-//                            /*  sdate |startTm|      |endTm| edate  */
-//                        } else if (startTm.compareTo(sdate) >= 0 && endTm.compareTo(edate) <= 0) {
-//                            m.put(sdate, mappingUrl + path.toString());
-//                        }
-//                    }
-//                }
-//            }
-//        }
-//        if (!ObjectUtils.isEmpty(m) && m.size() > 0) {
-//            Set<Date> dates = m.keySet();
-//            // 排序
-//            dates.stream().parallel().collect(Collectors.toList()).stream().sorted().forEach(d -> {
-//                ls.add(m.get(d));
-//            });
-//            return ls;
-//        }
-//        return null;
-//    }
-//
-//    /**
-//     * 合并视频(转化文件)
-//     *
-//     * @param fromVideoFileList 视频路径
-//     * @param newfilePath       生产新的视频文件路径
-//     * @throws IOException
-//     */
-//    public static Map<String, String> myConvetor(List<String> fromVideoFileList,
-//                                                 String newfilePath,
-//                                                 String uuid) throws IOException {
-//        /*
-//        * for f in *.flv; do echo "file '$f'" >> mylist.txt; done
-//            ffmpeg -f concat -i mylist.txt -c copy output.flv
-//        * */
-//
-//        File file = new File(newfilePath);
-//        boolean flay = false;
-//        if (!file.getParentFile().exists()) {
-//            file.getParentFile().mkdirs();
-//            log.info("创建文件夹:{}", file.getParentFile().getPath());
-//            flay = true;
-//        }
-//        log.info("newfilePath:{}", newfilePath);
-//
-//
-//        StringBuffer sm = new StringBuffer("for f in ");
-//        String pathStr = null;
-//        for (int t = 0; t < fromVideoFileList.size(); t++) {
-//            File ft = new File(fromVideoFileList.get(t));
-//            if (ft.exists()) {
-//                if (t != fromVideoFileList.size() - 1) {
-////                    sm.append(fromVideoFileList.get(t) + " ");
-//                    sm.append(fromVideoFileList.get(t).substring(fromVideoFileList.get(t).lastIndexOf("/") + 1, fromVideoFileList.get(t).length()) + " ");
-//                } else {
-////                    sm.append(fromVideoFileList.get(t));
-//                    sm.append(fromVideoFileList.get(t).substring(fromVideoFileList.get(t).lastIndexOf("/") + 1, fromVideoFileList.get(t).length()));
-//                    pathStr = fromVideoFileList.get(t).substring(0, fromVideoFileList.get(t).lastIndexOf("/"));
-//                }
-//            }
-//        }
-////        String substring = newfilePath.substring(0, newfilePath.lastIndexOf("."));
-////        substring = substring + ".txt";
-//
-//        String substring = uuid + ".txt";
-//        log.info("临时转化的文件:{}", substring);
-//
-//
-//        sm.append("; do echo \"file '$f'\" >> " + substring + "; done");
-//        String commit = sm.toString();
-//        log.info("合并转化文件的命令:{}", commit);
-//        Process proc = Runtime.getRuntime().exec("/bin/bash", null, null);
-//        BufferedReader in = new BufferedReader(new InputStreamReader(proc.getInputStream()));
-//        PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(proc.getOutputStream())), true);
-//
-//        try {
-//            String commit1 = ffmpegPath + " -f concat -safe 0 -i " + pathStr + "/" + substring + " -c copy " + newfilePath;
-//
-//            log.info("合并视频命令:{}", commit1);
-//            List<String> commands = new ArrayList<>();
-//            if (flay) {
-//                commands.add("chomd -R 777 " + file.getParentFile().getPath());
-//            }
-//            //
-//            commands.add("cd " + pathStr);
-//            // 合并成一个临时文件
-//            commands.add(commit);
-//
-//            // 临时文件转化为 flv
-////            commands.add(commit1);
-//            log.info("录像视频命令:{}", commands);
-//            for (String line : commands) {
-//                log.info("命令:{}", line);
-//                out.println(line);
-//            }
-//            out.println("exit");// 这个命令必须执行,否则in流不结束。
-//            log.info("命令:{}", "exit");
-//            String rspLine = "";
-//            while ((rspLine = in.readLine()) != null) {
-//                log.info("*****:{}", rspLine);
-//            }
-//            proc.waitFor();
-//            Map<String, String> map = new HashMap<>();
-//            map.put("cmd", commit1);
-//            map.put("path", pathStr + "/" + substring);
-//            return map;
-//
-//
-//        } catch (InterruptedException e) {
-//            log.error(e.getMessage());
-//            e.printStackTrace();
-//        } finally {
-//            in.close();
-//            out.close();
-//            proc.destroy();
-//        }
-//        return null;
-//    }
-//
-//
-//    @PostConstruct
-//    public void init() {
-//        historyUrl = caneraConfig.getHistoryUrl();
-//        ffmpegPath = caneraConfig.getFfmpegPath();
-//        filePath = caneraConfig.getFilePath();
-//        transcribeFilePath = caneraConfig.getTranscribeFilePath();
-//        webUrl = caneraConfig.getWebUrl();
-//        bakUrl = caneraConfig.getBakUrl();
-//        bakUrlRtsp = caneraConfig.getBakUrlRtsp();
-//        rc = redisCache;
-//        cUtil = cmdCameraUtil;
-//        sc = serverConfig;
-//        wsUrl = caneraConfig.getWsUrl();
-//        recordUrl = caneraConfig.getRecordUrl();
-//        hkUrl = caneraConfig.getHkUrl();
-//    }
-//
-//    /**
-//     * 定时任务参数flv文件
-//     *
-//     * @throws IOException
-//     * @throws InterruptedException
-//     */
-//    public void deleteFlv() throws IOException, InterruptedException {
-//        SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd");
-//        Date date = new Date();
-//        Calendar calendar = new GregorianCalendar();
-//        calendar.setTime(date);
-//        calendar.add(calendar.DATE, -1); //把日期往后增加一天,整数  往后推,负数往前移动
-//        date = calendar.getTime(); //这个时间就是日期往后推一天的结果
-//        String path = BaseConfig.getProfile() + "/flv/" + DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, date);
-//        File file = new File(path);
-//        if (file.exists()) {
-//            List<String> rspList = new ArrayList<String>();
-//            Process proc = Runtime.getRuntime().exec("/bin/bash", null, null);
-//            BufferedReader in = new BufferedReader(new InputStreamReader(proc.getInputStream()));
-//            PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(proc.getOutputStream())), true);
-//            String commit = " rm -rf  " + path;
-//            List<String> commands = new ArrayList<>();
-//
-//            // 删除
-//            commands.add(commit);
-//            log.info("删除昨天的录像视频命令:{}", commands);
-//            for (String line : commands) {
-//                out.println(line);
-//            }
-//            out.println("exit");// 这个命令必须执行,否则in流不结束。
-//            String rspLine = "";
-//            while ((rspLine = in.readLine()) != null) {
-//                System.out.println(rspLine);
-//                rspList.add(rspLine);
-//            }
-//            int i = proc.waitFor();
-//            log.info("执行结果:{}", i);
-//
-//            in.close();
-//            out.close();
-//            proc.destroy();
-//        }
-//    }
-//
-//
-//    /**
-//     * 定时任务:删除超过配置时长的录制视频
-//     *
-//     * @throws IOException
-//     * @throws InterruptedException
-//     */
-//    public void deleteFlvExceed() throws IOException, InterruptedException, ParseException {
-//        //字典中设置的值
-//        List<SysDictData> sysCameraRecordTime = dictDataMapper.selectDictDataByType("sys_camera_record_time");
-//
-//        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
-//        Date date = new Date();
-//        Calendar calendar = new GregorianCalendar();
-//        calendar.setTime(date);
-//        //正数,日期天数加
-//        //负数,日期天数减                         提前45天
-//        if (!ObjectUtils.isEmpty(sysCameraRecordTime)) {
-//            String dictValue = sysCameraRecordTime.get(0).getDictValue();
-//            calendar.add(Calendar.DAY_OF_YEAR, Integer.parseInt("-" + dictValue));
-//        } else {
-//            calendar.add(Calendar.DAY_OF_YEAR, -45);
-//        }
-//        date = calendar.getTime();
-//
-//        //遍历每个进行视频录制的摄像头
-//        File file = new File(transcribeFilePath);
-//        log.info("file.Name()======================================" + file.getName());
-//        log.info("file.exists()======================================" + file.exists());
-//        if (file.exists() && file.isDirectory()) {
-//            //获取文件夹中所有的子文件夹和文件
-//            File[] files = file.listFiles();
-//            if (!ObjectUtils.isEmpty(files) && files.length > 0) {
-//                for (File file1 : files) {
-//                    //   file1=/opt/streams/record/flv/34020000001320000167
-//                    log.info("file1.Name()======================================" + file1.getName());
-//                    if (file1.exists() && file1.isDirectory()) {
-//                        //相机文件
-//                        File[] fs = file1.listFiles();
-//                        if (!ObjectUtils.isEmpty(fs) && fs.length > 0) {
-//                            for (File f : fs) {
-//                                //    f=/opt/streams/record/flv/34020000001320000167/20230328_192033_192037-91509173-cd5a-11ed-8a42-fa163e4e1e9f.flv
-//                                //fName=20230328_192033_192037-91509173-cd5a-11ed-8a42-fa163e4e1e9f.flv
-//                                String fName = f.getName();
-//                                log.info("fName======================================" + fName);
-//                                String[] split = fName.split("_");
-//                                if (split.length > 0) {
-//                                    //20230328
-//                                    String s = split[0];
-//                                    Date parse = sdf.parse(s);
-//                                    long fTime = parse.getTime();
-//                                    long dateTime = date.getTime();
-//                                    //删除过期文件
-//                                    if (fTime < dateTime) {
-//                                        f.delete();
-//                                    }
-//                                }
-//                            }
-//                        }
-//                    }
-//                }
-//            }
-//        }
-//    }
-//
-////    /**
-////     * 定时任务:关闭录制视频
-////     *
-////     * @throws IOException
-////     * @throws InterruptedException
-////     */
-////    public void closeRecording() throws IOException, InterruptedException, ParseException {
-////        LambdaQueryWrapper<BaseCameraManagement> wrapper = new LambdaQueryWrapper<>();
-////        wrapper.eq(BaseCameraManagement::getStartRecording, 1);
-////        wrapper.isNotNull(BaseCameraManagement::getTaskId);
-////        List<BaseCameraManagement> list = baseCameraManagementService.list(wrapper);
-////        log.info("list======================================" + list);
-////        List<String> collect = list.stream().map(BaseCameraManagement::getCameraCode).collect(Collectors.toList());
-//////        List<String> collect = new ArrayList<>();
-//////        collect.add("42010001541320001116");
-////        //遍历每个进行视频录制的摄像头
-////        File file = new File(transcribeFilePath);
-////        log.info("closeRecording-file.Name()======================================" + file.getName());
-////        log.info("closeRecording-file.exists()======================================" + file.exists());
-////        if (file.exists() && file.isDirectory()) {
-////            //获取文件夹中所有的子文件夹和文件
-////            File[] files = file.listFiles();
-////            if (!ObjectUtils.isEmpty(files) && files.length > 0) {
-////                for (File file1 : files) {
-////                    log.info("closeRecording-file1---------------" + file1);
-////                    log.info("closeRecording-cameraCode---------------" + collect);
-////                    String substring = file1.toString().substring(file1.toString().lastIndexOf("\\") + 1);
-////                    if (collect.contains(substring)) {
-////                        File[] files1 = CameraUtil.getCurFilesList(file1.toString());
-////                        if (!ObjectUtils.isEmpty(files1) && files1.length > 0) {
-////                            int length = files1.length;
-////                            File file2 = files1[length - 1];
-////                            log.info("closeRecording-file2---------------" + file2);
-////                            String time = file2.toString().substring(file2.toString().lastIndexOf("\\") + 1);
-////                            String substring1 = time.substring(0, 15);
-////                            String substring2 = substring1.substring(0, 4);
-////                            String substring3 = substring1.substring(4, 6);
-////                            String substring4 = substring1.substring(6, 8);
-////                            String substring5 = substring1.substring(9, 11);
-////                            String substring6 = substring1.substring(11, 13);
-////                            String substring7 = substring1.substring(13, 15);
-////                            String date = substring2 + "-" + substring3 + "-" + substring4 + " " + substring5 + ":" + substring6 + ":" + substring7;
-////                            System.out.println(date);
-////                            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-////                            Date parse = sdf.parse(date);
-////                            //当前时间戳
-////                            long dades = System.currentTimeMillis();
-////                            //文件的时间戳
-////                            long time1 = parse.getTime();
-////                            //当前时间10分钟之前的时间戳
-////                            long time2 = dades - 600000L;
-////                            if (time2 <= time1 && time1 < dades) {
-////                            } else {
-////                                LambdaQueryWrapper<BaseCameraManagement> lw = new LambdaQueryWrapper<BaseCameraManagement>();
-////                                lw.eq(BaseCameraManagement::getCameraCode, substring);
-////                                BaseCameraManagement baseCameraManagement = baseCameraManagementService.getOne(lw);
-////                                log.info("closeRecording-endRecording------------" + baseCameraManagement.getTaskId());
-////                                String start = HttpUtils.sendGet(CameraUtil.endRecording(baseCameraManagement.getTaskId()));
-////                                log.info("closeRecording-endRecording------------" + start);
-////                                if ("success".equals(start)) {
-////                                    baseCameraManagement.setStartRecording(2);
-////                                    baseCameraManagement.setTaskId("");
-////                                } else {
-////                                    baseCameraManagement.setStartRecording(2);
-////                                    baseCameraManagement.setTaskId("");
-////                                    log.error("关闭视频录制异常日志如下:" + start);
-////                                }
-////                                baseCameraManagementService.updateById(baseCameraManagement);
-////                            }
-////                        }
-////                    }
-////                }
-////            }
-////        }
-////    }
-//
-//    public static File[] getCurFilesList(String filePath) {
-//        File path = new File(filePath);
-//        File[] listFiles = path.listFiles(new FileFilter() {
-//
-//            @Override
-//            public boolean accept(File pathname) {
-//                if (pathname.isFile()) {
-//                    return true;
-//                } else {
-//
-//                    return false;
-//                }
-//            }
-//        });
-//
-//        return listFiles;
-//    }
-//
-//    public static void execute(String command) {
-//        try {
-//            ProcessBuilder process = new ProcessBuilder(command);
-//            process.inheritIO().start().waitFor();
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//
-//    }
-//
-//    public static List<Map<String, Object>> getRecordList(String channel, Date startTm, Date endTm) {
-//        return filterRecordList(channel, startTm, endTm, filePath, recordUrl + "profile/");
-//    }
-//
-//
-//    /**
-//     * HTTP流转RTSP流
-//     */
-//    public void streamConversion(String code) {
-//
-//        ExecutorService executor = Executors.newSingleThreadExecutor();
-//        Callable<String> task = new Callable<String>() {
-//            @Override
-//            public String call() throws Exception {
-//                // 执行网络请求...
-//                log.info(ffmpegPath + " -re -i /opt/streams/file/vid/" + code + ".mp4  -c:v copy -c:a copy -f flv rtmp://124.70.58.209:1935/live/" + code);
-//                cmdCameraUtil.cmd(ffmpegPath + " -re -i /opt/streams/file/vid/" + code + ".mp4  -c:v copy -c:a copy -f flv rtmp://124.70.58.209:1935/live/" + code);
-//                return "Response";
-//            }
-//        };
-//
-//        try {
-//            String result = executor.submit(task).get(1, TimeUnit.SECONDS); // 设置5秒超时时间
-//            System.out.println("Response: " + result);
-//        } catch (InterruptedException | ExecutionException | TimeoutException e) {
-//            // 请求超时处理逻辑
-//            System.out.println("Request timeout");
-//        }
-//
-//        executor.shutdown();
-//
-////        try {
-////            Process proc = Runtime.getRuntime().exec("/bin/bash", null, null);
-////            BufferedReader in = new BufferedReader(new InputStreamReader(proc.getInputStream()));
-////            PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(proc.getOutputStream())), true);
-////            String commit = ffmpegPath+" -re -i /opt/streams/file/"+code+".mp4  -c:v copy -c:a copy -f rtsp rtsp://124.70.58.209:8554/live/"+code;
-////            List<String> commands = new ArrayList<>();
-////
-////            // 删除
-////            commands.add(commit);
-////            log.info("HTTP流转RTSP流:{}", commands);
-////            for (String line : commands) {
-////                out.println(line);
-////            }
-////            out.println("exit");// 这个命令必须执行,否则in流不结束。
-////            String rspLine = "";
-////            while ((rspLine = in.readLine()) != null) {
-////                System.out.println(rspLine);
-////
-////            }
-////            int i = proc.waitFor();
-////            log.info("执行结果:{}", i);
-////
-////            in.close();
-////            out.close();
-////            proc.destroy();
-////        } catch (IOException e) {
-////            log.error(e.getMessage());
-////        } catch (InterruptedException e) {
-////            e.printStackTrace();
-////        }
-//
-//    }
-//
-//
-//    /**
-//     * RTSP流下载
-//     */
-//    public static void streamUrlDownload(String url, String code) {
-//        log.info(ffmpegPath + " -i " + url + " -c copy /opt/stream/map" + code);
-//        cUtil.cmd(ffmpegPath + " -i " + url + " -c copy /opt/stream/map" + code);
-//    }
-//
-//
-//    public static List<Map<String, Object>> filterRecordList(String channel,
-//                                                             Date startTm,
-//                                                             Date endTm,
-//                                                             String mappingUrl,
-//                                                             String wUrl) {
-//        List<Map<String, Object>> rmaps = new ArrayList<>();
-//
-//        if (StringUtils.isBlank(channel)
-//                || ObjectUtils.isEmpty(startTm)
-//                || ObjectUtils.isEmpty(endTm)) {
-//            return null;
-//        }
-//        Map<Date, Map<String, Object>> m = new HashMap<>();
-//        // 调用视频服务返回参数
-//        String startTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, startTm);
-//        String endTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, endTm);
-//
-//        String param = "channel=" + channel + "&startTime=" + startTime + "&endTime=" + endTime;
-//        // /api/record/flv/list
-//        String s = HttpUtils.sendGet(webUrl + "/recordpro/api/list", param);
-//        // 视频拼接
-//        if (!StringUtils.isBlank(s) || "null".equals(s)) {
-//            List<Map<String, Object>> maps = JSON.parseArray(s, Map.class);
-//            if (ObjectUtils.isEmpty(maps)) {
-//                return null;
-//            }
-//            for (Map<String, Object> map : maps) {
-//                Object path = map.get("Path");
-//                Object size = map.get("Size");
-//                Object duration = map.get("Duration");
-//                if (!ObjectUtils.isEmpty(path)) {
-//                    String s1 = path.toString();
-//                    String substring = s1.substring(s1.lastIndexOf("/") + 1, s1.length());
-//                    String substring1 = substring.substring(0, substring.indexOf("-"));
-//                    String[] s2 = substring1.split("_");
-//                    if (!ObjectUtils.isEmpty(s2)) {
-//                        Map<String, Object> mo = new HashMap<>();
-//
-//                        String s3 = s2[0] + s2[1];
-//                        String s4 = s2[0] + s2[2];
-//                        Date sdate = DateUtils.dateTime(DateUtils.YYYYMMDDHHMMSS, s3);
-//                        if (s2[1].startsWith("23") && s2[2].startsWith("00")) {
-//                            sdate = DateUtils.addDays(sdate, -1);
-//                        }
-//                        Date edate = DateUtils.dateTime(DateUtils.YYYYMMDDHHMMSS, s4);
-//                        mo.put("startTime", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, sdate));
-//                        mo.put("entTime", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, edate));
-//                        mo.put("url", wUrl + path.toString());
-//                        mo.put("path", mappingUrl + path.toString());
-//                        mo.put("fileName", substring);
-//                        mo.put("size", size);
-//                        mo.put("duration", duration);
-//                        /*     sdate  |startTm|  edate     |endTm| */
-//                        if (startTm.compareTo(sdate) >= 0
-//                                && startTm.compareTo(edate) <= 0
-//                                && endTm.compareTo(edate) >= 0) {
-//                            m.put(sdate, mo);
-//                            /*  |startTm|   sdate    edate   |endTm| */
-//                        } else if (startTm.compareTo(sdate) <= 0 && endTm.compareTo(edate) >= 0) {
-//                            m.put(sdate, mo);
-//
-//                            /*  |startTm|   sdate     |endTm|  edate  */
-//                        } else if (startTm.compareTo(sdate) <= 0
-//                                && endTm.compareTo(sdate) >= 0
-//                                && endTm.compareTo(edate) <= 0) {
-//                            m.put(sdate, mo);
-//
-//                            /*  sdate |startTm|      |endTm| edate  */
-//                        } else if (startTm.compareTo(sdate) >= 0 && endTm.compareTo(edate) <= 0) {
-//                            m.put(sdate, mo);
-//                        }
-//                    }
-//                }
-//            }
-//        }
-//        if (!ObjectUtils.isEmpty(m) && m.size() > 0) {
-//            Set<Date> dates = m.keySet();
-//            // 排序
-//            dates.stream().parallel().collect(Collectors.toList()).stream().sorted().forEach(d -> {
-//
-//                rmaps.add(m.get(d));
-//            });
-//            log.info("rmaps:{}", rmaps);
-//            return rmaps;
-//        }
-//        return null;
-//    }
-//
-//
-//    public void heartbeat() {
-//        List<BaseTerminal> list = baseTerminalService.list();
-//        for (BaseTerminal baseTerminal : list) {
-//            QueryWrapper<MsgHeartbeatAlarmMessage> wrapper = new QueryWrapper<>();
-//            wrapper.eq("terminal_code", wrapper);
-//            wrapper.orderByDesc("create_time");
-//            wrapper.last("limit 1");
-//            MsgHeartbeatAlarmMessage msgHeartbeatAlarmMessage = msgHeartbeatAlarmMessageService.getOne(wrapper);
-//            if (ObjectUtils.isEmpty(msgHeartbeatAlarmMessage)) {
-//                baseTerminal.setStatus(2);
-//                baseTerminalService.updateById(baseTerminal);
-//            } else {
-//                List<SysDictData> heartbeat = dictTypeService.selectDictDataByType("heartbeat");
-//                long timeNow = System.currentTimeMillis();
-//                long createTime = msgHeartbeatAlarmMessage.getCreateTime().getTime();
-//                int times = Integer.parseInt(heartbeat.get(0).getDictValue());
-//                long thereHourMillis = 60 * 1000 * 3 * times;
-//                long timeNew = timeNow - thereHourMillis;
-//                if (timeNew > createTime) {
-//                    baseTerminal.setStatus(2);
-//                    baseTerminalService.updateById(baseTerminal);
-//                } else {
-//                    baseTerminal.setStatus(1);
-//                    baseTerminalService.updateById(baseTerminal);
-//                }
-//            }
-//        }
-//
-//    }
-//
-//
-//    public void previewURLs(CamerasVo camerasVo) {
-//        String result = null;
-//        String url = "http://" + hkUrl + "/api/video/v2/cameras/previewURLs";
-//        try {
-//            result = HttpClientUtil.postJson(url, JSON.toJSONString(camerasVo));
-//        } catch (Exception e) {
-//            log.error("previewURLs------------>" + e.getMessage());
-//            e.printStackTrace();
-//        }
-//        JSONObject outJson = (JSONObject) JSONObject.parse(result);
-//        if ("0".equals(outJson.getString("code"))) {
-//            log.info("outJson----->" + outJson);
-//            JSONObject data = outJson.getJSONObject("data");
-//            String urls = data.getString("url");
-//            HttpUtils.sendGet(historyUrl + "rtsp/api/pull?target=" + urls + "&streamPath=" + camerasVo.getCameraIndexCode() + "/" + camerasVo.getCameraIndexCode() + "&save=0");
-//        }
-//
-//    }
-//
-//    public void playbackURLs(List<String> list) {
-//        CompletableFuture future = CompletableFuture.supplyAsync(() -> {
-//            for (String code : list) {
-//                PlaybackVo playbackVo = new PlaybackVo();
-//                playbackVo.setCameraIndexCode(code);
-//                // 获取当前时间
-//                LocalDateTime currentTime = LocalDateTime.now();
-//                // 获取当前时间的前10分钟时间
-//                LocalDateTime beforeTenMinutes = currentTime.minusMinutes(10);
-//                // 获取当前时间的后10分钟时间
-//                LocalDateTime afterTenMinutes = currentTime.plusMinutes(10);
-//                // 格式化时间
-//                DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-//                playbackVo.setBeginTime(beforeTenMinutes.format(formatter));
-//                playbackVo.setEndTime(afterTenMinutes.format(formatter));
-//
-//
-//                String result = null;
-//                String url = "http://" + hkUrl + "/api/video/v2/cameras/playbackURLs";
-//                try {
-//                    result = HttpClientUtil.postJson(url, JSON.toJSONString(playbackVo));
-//                } catch (Exception e) {
-//                    log.error("playbackURLs------------>" + e.getMessage());
-//                    e.printStackTrace();
-//                }
-//                JSONObject outJson = (JSONObject) JSONObject.parse(result);
-//                if ("0".equals(outJson.getString("code"))) {
-//                    log.info("outJson----->" + outJson);
-//                    JSONObject data = outJson.getJSONObject("data");
-//                    String urls = data.getString("url");
-//                    streamUrlDownload(urls, playbackVo.getCameraIndexCode());
-//                }
-//            }
-//            return 1;
-//        });
-//        future.join();
-//    }
-//
-//    public static void main(String[] args) throws InterruptedException, ParseException, IOException {
-////        CameraUtil cameraUtil = new CameraUtil();
-////        cameraUtil.closeRecording();
-////        String s = "/opt/streams/record/flv/42010001541320001116/20230403_235506_000506-22e1523b-d170-11ed-8a42-fa163e4e1e9f.flv";
-////        String fileStr = s.substring(s.lastIndexOf("/") + 1, s.length());
-////        String pathStr = s.substring(0, s.lastIndexOf("/"));
-////        System.out.println(fileStr);
-////        System.out.println(pathStr);
-//
-//        String s = "20230403235512";
-//        Date sdate = DateUtils.dateTime(DateUtils.YYYYMMDDHHMMSS, s);
-//        sdate = DateUtils.addDays(sdate, -1);
-//        System.out.println(DateUtils.parseDateToStr(DateUtils.YYYYMMDDHHMMSS, sdate));
-//    }
-//}

+ 0 - 81
vehicle-admin/src/main/java/com/ozs/web/core/util/CmdCameraUtil.java

@@ -1,81 +0,0 @@
-//package com.ozs.web.core.util;
-//
-//import com.alibaba.fastjson2.JSONObject;
-//import lombok.extern.slf4j.Slf4j;
-//import org.springframework.stereotype.Component;
-//
-//import java.io.BufferedReader;
-//import java.io.IOException;
-//import java.io.InputStream;
-//import java.io.InputStreamReader;
-//
-//@Slf4j
-//@Component
-//public class CmdCameraUtil {
-//
-//
-//    public void cmd(String cmd) {
-//        long l = System.currentTimeMillis();
-//        Process exec = null;
-//        try {
-//            exec = Runtime.getRuntime().exec(new String[]{"sh", "-c", cmd});
-//            long l1 = System.currentTimeMillis();
-//            log.info("cmd-time:{}", l1 - l);
-//        } catch (IOException e) {
-//            log.error(e.getMessage());
-//            e.printStackTrace();
-//        }
-//        try {
-//            printProcessMsg(exec);
-//        } catch (IOException e) {
-//            log.error(e.getMessage());
-//            e.printStackTrace();
-//        }
-//        try {
-//            int i = exec.waitFor();
-//            log.info("------"+i);
-//        } catch (InterruptedException e) {
-//            log.error(e.getMessage());
-//            e.printStackTrace();
-//        }
-//    }
-//
-//    /**
-//     * 处理process输出流和错误流,防止进程阻塞,在process.waitFor();前调用
-//     *
-//     * @param exec
-//     * @throws IOException
-//     */
-//    private void printProcessMsg(Process exec) throws IOException {
-//        //防止ffmpeg进程塞满缓存造成死锁
-//        InputStream error = exec.getErrorStream();
-//        InputStream is = exec.getInputStream();
-//
-//        StringBuffer result = new StringBuffer();
-//        String line = null;
-//        try {
-//            BufferedReader br = new BufferedReader(new InputStreamReader(error, "GBK"));
-//            BufferedReader br2 = new BufferedReader(new InputStreamReader(is, "GBK"));
-//
-//            while ((line = br.readLine()) != null) {
-//                result.append(line + "\n");
-//            }
-//            log.info("FFMPEG视频合成进程错误信息:" + result.toString());
-//
-//            result = new StringBuffer();
-//            line = null;
-//
-//            while ((line = br2.readLine()) != null) {
-//                result.append(line + "\n");
-//            }
-//            log.info("FFMPEG视频合成进程输出内容为:" + result.toString());
-//        } catch (IOException e2) {
-//            e2.printStackTrace();
-//        } finally {
-//            error.close();
-//            is.close();
-//        }
-//
-//    }
-//
-//}

+ 0 - 1
vehicle-admin/src/main/resources/META-INF/spring-devtools.properties

@@ -1 +0,0 @@
-restart.include.json=/com.alibaba.fastjson.*.jar

+ 0 - 57
vehicle-admin/src/main/resources/application-kdruid.yml

@@ -1,57 +0,0 @@
-# 数据源配置
-spring:
-    datasource:
-        type: com.alibaba.druid.pool.DruidDataSource
-        driverClassName: com.kingbase8.Driver
-        druid:
-            # 主库数据源
-            master:
-                url: jdbc:kingbase8://124.70.58.209:18821/vehicle
-                username: system
-                password: kingbase@@y06
-            # 从库数据源
-            slave:
-                # 从数据源开关/默认关闭
-                enabled: false
-                url:
-                username:
-                password:
-            # 初始连接数
-            initialSize: 5
-            # 最小连接池数量
-            minIdle: 10
-            # 最大连接池数量
-            maxActive: 20
-            # 配置获取连接等待超时的时间
-            maxWait: 60000
-            # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-            timeBetweenEvictionRunsMillis: 60000
-            # 配置一个连接在池中最小生存的时间,单位是毫秒
-            minEvictableIdleTimeMillis: 300000
-            # 配置一个连接在池中最大生存的时间,单位是毫秒
-            maxEvictableIdleTimeMillis: 900000
-            # 配置检测连接是否有效
-            validationQuery: SELECT 1 FROM DUAL
-            testWhileIdle: true
-            testOnBorrow: false
-            testOnReturn: false
-            webStatFilter:
-                enabled: true
-            statViewServlet:
-                enabled: true
-                # 设置白名单,不填则允许所有访问
-                allow:
-                url-pattern: /druid/*
-                # 控制台管理用户名和密码
-                login-username: ruoyi
-                login-password: 123456
-            filter:
-                stat:
-                    enabled: true
-                    # 慢SQL记录
-                    log-slow-sql: true
-                    slow-sql-millis: 1000
-                    merge-sql: true
-                wall:
-                    config:
-                        multi-statement-allow: true

+ 0 - 37
vehicle-admin/src/main/resources/i18n/messages.properties

@@ -1,37 +0,0 @@
-#错误消息
-not.null=* 必须填写
-user.jcaptcha.error=验证码错误
-user.jcaptcha.expire=验证码已失效
-user.not.exists=用户不存在/密码错误
-user.password.not.match=用户不存在/密码错误
-user.password.retry.limit.count=密码输入错误{0}次
-user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟
-user.password.delete=对不起,您的账号已被删除
-user.blocked=用户已封禁,请联系管理员
-role.blocked=角色已封禁,请联系管理员
-user.logout.success=退出成功
-
-length.not.valid=长度必须在{min}到{max}个字符之间
-
-user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
-user.password.not.valid=* 5-50个字符
- 
-user.email.not.valid=邮箱格式错误
-user.mobile.phone.number.not.valid=手机号格式错误
-user.login.success=登录成功
-user.register.success=注册成功
-user.notfound=请重新登录
-user.forcelogout=管理员强制退出,请重新登录
-user.unknown.error=未知错误,请重新登录
-
-##文件上传消息
-upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB!
-upload.filename.exceed.length=上传的文件名最长{0}个字符
-
-##权限
-no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
-no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
-no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
-no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
-no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
-no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]

+ 0 - 5
vehicle-sdk/src/main/java/com/ozs/config/Constant.java

@@ -1,5 +0,0 @@
-package com.ozs.config;
-
-public class Constant {
-    public static final String HERTBEA_KEY ="hertbea_";
-}

+ 0 - 42
vehicle-sdk/src/main/java/com/ozs/config/ShotExecutors.java

@@ -1,42 +0,0 @@
-package com.ozs.config;
-
-import com.alibaba.fastjson2.JSONArray;
-import com.alibaba.fastjson2.JSONObject;
-import com.ozs.common.utils.http.HttpUtils;
-import com.ozs.utils.CameraUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.scheduling.annotation.EnableAsync;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.util.ObjectUtils;
-
-import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author wyy
- * @subject
- * @creat 2023/5/6
- */
-@Configuration
-@EnableScheduling
-@EnableAsync
-@Slf4j
-public class ShotExecutors {
-    @Resource
-    CameraUtil cameraUtil;
-
-    /**
-     * 定时清除流媒体压缩视频
-     */
-    @Async
-    @Scheduled(fixedRate = 3000)
-    public void handleAlarmPicture() {
-//        log.info("-------定时清除流媒体压缩视频--------------");
-//        cameraUtil.heartbeatGetPlayFlv();
-    }
-}

+ 40 - 76
vehicle-sdk/src/main/java/com/ozs/controller/upload/GeoHazardMonitorTokenController.java

@@ -16,7 +16,6 @@ import com.ozs.common.utils.StringUtils;
 import com.ozs.common.utils.http.HttpUtils;
 import com.ozs.common.utils.stateSecrets.SM4Utils;
 import com.ozs.config.AjaxResults;
-import com.ozs.config.Constant;
 import com.ozs.entity.BaseCameraManagement;
 import com.ozs.entity.BaseRailwayManagement;
 import com.ozs.entity.BaseRouteMassage;
@@ -2976,46 +2975,46 @@ public class GeoHazardMonitorTokenController {
         }
     }
 
-    @GetMapping("/test/{key}")
-    public void test(@PathVariable String key) {
-        String heartbeat = heartbeatUtils.getHeartbeat(key);
-        Map maps2 = JSON.parseObject(heartbeat, Map.class);
-        System.out.println(maps2);
-    }
-
-    @GetMapping("/testi")
-    public void testi() {
-        Map<String, String> map = new HashMap<>();
-        map.put("age", "18");
-        map.put("name", "小明");
-        map.put("gender", "男");
-        String string = JSON.toJSONString(map);
-        heartbeatUtils.createHeartbeat("key", string);
-    }
-
-    private String objStr(HeartbeatVo heartbeatVoCH) {
-        JSONObject obj = new JSONObject();
-        //data
-        obj.put("data", heartbeatVoCH);
-        //code
-        obj.put("code", 151);
-        log.info("【websocket消息】 机车地址信息:" + obj.toJSONString());
-        return obj.toJSONString();
-    }
-
-    public static void main(String[] args) {
-        JSONObject res = new JSONObject();
-        res.put("grantType", "1");
-        res.put("clientId", "1005");
-        String s = SM4Utils.encryptData_ECB(JSONObject.toJSONString(res), "4370780c9a8c43e5");
-        System.out.println(s);
-    }
-
-    @PostMapping("/encryptionAlarm")
-    public String encryptionAlarm(@RequestBody ReqMsgAlarmVo vo) {
-        String s1 = JSONObject.toJSONString(vo);
-        return SM4Utils.encryptData_ECB(s1, "4370780c9a8c43e5");
-    }
+//    @GetMapping("/test/{key}")
+//    public void test(@PathVariable String key) {
+//        String heartbeat = heartbeatUtils.getHeartbeat(key);
+//        Map maps2 = JSON.parseObject(heartbeat, Map.class);
+//        System.out.println(maps2);
+//    }
+//
+//    @GetMapping("/testi")
+//    public void testi() {
+//        Map<String, String> map = new HashMap<>();
+//        map.put("age", "18");
+//        map.put("name", "小明");
+//        map.put("gender", "男");
+//        String string = JSON.toJSONString(map);
+//        heartbeatUtils.createHeartbeat("key", string);
+//    }
+//
+//    private String objStr(HeartbeatVo heartbeatVoCH) {
+//        JSONObject obj = new JSONObject();
+//        //data
+//        obj.put("data", heartbeatVoCH);
+//        //code
+//        obj.put("code", 151);
+//        log.info("【websocket消息】 机车地址信息:" + obj.toJSONString());
+//        return obj.toJSONString();
+//    }
+//
+//    public static void main(String[] args) {
+//        JSONObject res = new JSONObject();
+//        res.put("grantType", "1");
+//        res.put("clientId", "1005");
+//        String s = SM4Utils.encryptData_ECB(JSONObject.toJSONString(res), "4370780c9a8c43e5");
+//        System.out.println(s);
+//    }
+//
+//    @PostMapping("/encryptionAlarm")
+//    public String encryptionAlarm(@RequestBody ReqMsgAlarmVo vo) {
+//        String s1 = JSONObject.toJSONString(vo);
+//        return SM4Utils.encryptData_ECB(s1, "4370780c9a8c43e5");
+//    }
 
     /**
      * 添加进路信息
@@ -3066,39 +3065,4 @@ public class GeoHazardMonitorTokenController {
             return AjaxResult.error("ID不存在");
         }
     }
-
-    /**
-     * ttt
-     *
-     * @return
-     */
-    @GetMapping("/api/ttt")
-    public void ttt() {
-        String cameraPreviewURL = cameraUtil.getCameraPreviewURL();
-    }
-
-    @PostMapping("/api/savePreAlarm")
-    public void savePreAlarm(@RequestBody PreAlarmReq preAlarmReq) {
-        List<PreAlarm> list = preAlarmService.list(new LambdaQueryWrapper<PreAlarm>()
-                .ge(PreAlarm::getPreAlarmTime, preAlarmReq.getBeginTime())
-                .le(PreAlarm::getPreAlarmTime, preAlarmReq.getEndTime()).orderByAsc(PreAlarm::getPreAlarmTime));
-        log.info("savePreAlarm---------------" + list.toString());
-        if (!ObjectUtils.isEmpty(list)) {
-            for (PreAlarm preAlarm : list) {
-                try {
-                    TimeUnit.SECONDS.sleep(1);
-                    Calendar cal = Calendar.getInstance();
-                    cal.setTime(new Date());
-                    cal.set(Calendar.MILLISECOND, 0);
-                    cal.set(Calendar.MILLISECOND, 0);
-                    preAlarm.setPreAlarmTime(cal.getTime());
-                    preAlarm.setCreatedTime(new Date());
-                    boolean save = preAlarmService.save(preAlarm);
-                    log.info("savePreAlarm--------------时间-" + new Date() + "----" + save);
-                } catch (InterruptedException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-    }
 }

+ 0 - 39
vehicle-sdk/src/main/java/com/ozs/controller/upload/PressureController.java

@@ -1,39 +0,0 @@
-package com.ozs.controller.upload;
-
-import com.ozs.config.AjaxResults;
-import com.ozs.entity.BaseCameraManagement;
-import com.ozs.entity.vo.CamerasVo;
-import com.ozs.service.BaseCameraManagementService;
-import com.ozs.utils.CameraUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-/**
- * @author Administrator
- */
-@RestController
-@Slf4j
-public class PressureController {
-
-    @Autowired
-    private CameraUtil cameraUtil;
-    @Autowired
-    private BaseCameraManagementService baseCameraManagementService;
-
-    /**
-     * 天网数据压测
-     */
-    @GetMapping("/api/pressurePreviewURLs/{code}")
-    public AjaxResults getWebToken(@PathVariable String code) throws InterruptedException {
-        CamerasVo camerasVo = new CamerasVo();
-        camerasVo.setCameraIndexCode(code);
-        String msg = cameraUtil.apiPreviewURLs(camerasVo);
-        return AjaxResults.success(msg);
-    }
-}

+ 0 - 1
vehicle-sdk/src/main/resources/META-INF/spring-devtools.properties

@@ -1 +0,0 @@
-restart.include.json=/com.alibaba.fastjson.*.jar

+ 0 - 57
vehicle-sdk/src/main/resources/application-kdruid.yml

@@ -1,57 +0,0 @@
-# 数据源配置
-spring:
-    datasource:
-        type: com.alibaba.druid.pool.DruidDataSource
-        driverClassName: com.kingbase8.Driver
-        druid:
-            # 主库数据源
-            master:
-                url: jdbc:kingbase8://124.70.58.209:18821/vehicle
-                username: system
-                password: kingbase@@y06
-            # 从库数据源
-            slave:
-                # 从数据源开关/默认关闭
-                enabled: false
-                url:
-                username:
-                password:
-            # 初始连接数
-            initialSize: 5
-            # 最小连接池数量
-            minIdle: 10
-            # 最大连接池数量
-            maxActive: 20
-            # 配置获取连接等待超时的时间
-            maxWait: 60000
-            # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-            timeBetweenEvictionRunsMillis: 60000
-            # 配置一个连接在池中最小生存的时间,单位是毫秒
-            minEvictableIdleTimeMillis: 300000
-            # 配置一个连接在池中最大生存的时间,单位是毫秒
-            maxEvictableIdleTimeMillis: 900000
-            # 配置检测连接是否有效
-            validationQuery: SELECT 1 FROM DUAL
-            testWhileIdle: true
-            testOnBorrow: false
-            testOnReturn: false
-            webStatFilter:
-                enabled: true
-            statViewServlet:
-                enabled: true
-                # 设置白名单,不填则允许所有访问
-                allow:
-                url-pattern: /druid/*
-                # 控制台管理用户名和密码
-                login-username: ruoyi
-                login-password: 123456
-            filter:
-                stat:
-                    enabled: true
-                    # 慢SQL记录
-                    log-slow-sql: true
-                    slow-sql-millis: 1000
-                    merge-sql: true
-                wall:
-                    config:
-                        multi-statement-allow: true

+ 0 - 37
vehicle-sdk/src/main/resources/i18n/messages.properties

@@ -1,37 +0,0 @@
-#错误消息
-not.null=* 必须填写
-user.jcaptcha.error=验证码错误
-user.jcaptcha.expire=验证码已失效
-user.not.exists=用户不存在/密码错误
-user.password.not.match=用户不存在/密码错误
-user.password.retry.limit.count=密码输入错误{0}次
-user.password.retry.limit.exceed=密码输入错误{0}次,帐户锁定{1}分钟
-user.password.delete=对不起,您的账号已被删除
-user.blocked=用户已封禁,请联系管理员
-role.blocked=角色已封禁,请联系管理员
-user.logout.success=退出成功
-
-length.not.valid=长度必须在{min}到{max}个字符之间
-
-user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
-user.password.not.valid=* 5-50个字符
- 
-user.email.not.valid=邮箱格式错误
-user.mobile.phone.number.not.valid=手机号格式错误
-user.login.success=登录成功
-user.register.success=注册成功
-user.notfound=请重新登录
-user.forcelogout=管理员强制退出,请重新登录
-user.unknown.error=未知错误,请重新登录
-
-##文件上传消息
-upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB!
-upload.filename.exceed.length=上传的文件名最长{0}个字符
-
-##权限
-no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
-no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
-no.update.permission=您没有修改数据的权限,请联系管理员添加权限 [{0}]
-no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
-no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
-no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]