gao.qiang hai 1 ano
pai
achega
79f8dcb185
Modificáronse 33 ficheiros con 3237 adicións e 1254 borrados
  1. 1 0
      .idea/compiler.xml
  2. 26 1
      business-service/pom.xml
  3. 1 1
      business-service/src/main/java/com/ozs/entity/BaseCameraManagement.java
  4. 13 19
      business-service/src/main/java/com/ozs/service/impl/MsgAlarmServiceImpl.java
  5. 1005 0
      business-service/src/main/java/com/ozs/utils/CameraUtil.java
  6. 62 0
      business-service/src/main/java/com/ozs/utils/CaneraConfig.java
  7. 80 0
      business-service/src/main/java/com/ozs/utils/CmdCameraUtil.java
  8. 88 0
      business-service/src/main/java/com/ozs/utils/RtspToMP4.java
  9. 0 5
      vehicle-admin/pom.xml
  10. 1 1
      vehicle-admin/src/main/java/com/ozs/web/common/Constant.java
  11. 101 65
      vehicle-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseCameraManagementController.java
  12. 1 5
      vehicle-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseVehicleController.java
  13. 0 1
      vehicle-admin/src/main/java/com/ozs/web/controller/accountmanagment/MsgAlarmTemporaryController.java
  14. 37 107
      vehicle-admin/src/main/java/com/ozs/web/controller/sdk/GeoHazardMonitorTokenController.java
  15. 1 5
      vehicle-admin/src/main/java/com/ozs/web/controller/sdk/UploadController.java
  16. 53 53
      vehicle-admin/src/main/java/com/ozs/web/core/config/CaneraConfig.java
  17. 51 2
      vehicle-admin/src/main/java/com/ozs/web/core/config/GetCameraPreviewURL.java
  18. 941 908
      vehicle-admin/src/main/java/com/ozs/web/core/util/CameraUtil.java
  19. 81 81
      vehicle-admin/src/main/java/com/ozs/web/core/util/CmdCameraUtil.java
  20. 5 0
      vehicle-admin/src/main/resources/application.yml
  21. 5 0
      vehicle-sdk/Dockerfile
  22. 110 0
      vehicle-sdk/pom.xml
  23. 21 0
      vehicle-sdk/src/main/java/com/ozs/VehicleSdkApplication.java
  24. 18 0
      vehicle-sdk/src/main/java/com/ozs/VehicleServletInitializer.java
  25. 1 0
      vehicle-sdk/src/main/resources/META-INF/spring-devtools.properties
  26. 57 0
      vehicle-sdk/src/main/resources/application-dmdruid.yml
  27. 57 0
      vehicle-sdk/src/main/resources/application-druid.yml
  28. 57 0
      vehicle-sdk/src/main/resources/application-kdruid.yml
  29. 181 0
      vehicle-sdk/src/main/resources/application.yml
  30. 24 0
      vehicle-sdk/src/main/resources/banner.txt
  31. 37 0
      vehicle-sdk/src/main/resources/i18n/messages.properties
  32. 94 0
      vehicle-sdk/src/main/resources/logback.xml
  33. 27 0
      vehicle-sdk/src/main/resources/mybatis/mybatis-config.xml

+ 1 - 0
.idea/compiler.xml

@@ -10,6 +10,7 @@
         <module name="vehicle-admin" />
         <module name="hazard-admin" />
         <module name="business-service" />
+        <module name="hazard-sdk" />
       </profile>
     </annotationProcessing>
     <bytecodeTargetLevel>

+ 26 - 1
business-service/pom.xml

@@ -54,7 +54,32 @@
             <artifactId>joda-time</artifactId>
             <version>2.10.1</version>
         </dependency>
-
+        <dependency>
+            <groupId>com.hikvision.ga</groupId>
+            <artifactId>artemis-http-client</artifactId>
+            <version>1.1.3</version>
+        </dependency>
+        <!--直播流转视频-->
+        <dependency>
+            <groupId>org.bytedeco</groupId>
+            <artifactId>javacv</artifactId>
+            <version>1.4.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.bytedeco.javacpp-presets</groupId>
+            <artifactId>ffmpeg-platform</artifactId>
+            <version>4.0.2-1.4.3</version>
+        </dependency>
+        <!--这个依赖区分Linux系统和windows系统-->
+        <dependency>
+            <groupId>com.github.hoary.ffmpeg</groupId>
+            <artifactId>FFmpeg-windows-x86_64</artifactId>
+            <version>2.0.1.1</version>
+        </dependency>
+        <dependency>
+            <groupId>com.ozs</groupId>
+            <artifactId>base-framework</artifactId>
+        </dependency>
     </dependencies>
 
 </project>

+ 1 - 1
business-service/src/main/java/com/ozs/entity/BaseCameraManagement.java

@@ -55,7 +55,7 @@ public class BaseCameraManagement extends BaseEntity implements Serializable {
     private String channel;
 
     /**
-     * 所属工务段编码(单位id)
+     * 所属分公司编码(单位id)
      */
     private Long deptId;
 

+ 13 - 19
business-service/src/main/java/com/ozs/service/impl/MsgAlarmServiceImpl.java

@@ -159,6 +159,7 @@ public class MsgAlarmServiceImpl extends ServiceImpl<MsgAlarmMapper, MsgAlarm> i
     @Override
     public AjaxResult getDate(MsgAlarmVo msgAlarmVo) {
         // 查询报警信息
+        MsgAlarmVo msgAlarmVo1 = new MsgAlarmVo();
         MsgAlarm msgAlarm = msgAlarmMapper.selectById(msgAlarmVo.getId());
         if (StringUtils.isEmptySunhh(msgAlarm)) {
             return AjaxResult.error("报警信息不存在!");
@@ -182,30 +183,23 @@ public class MsgAlarmServiceImpl extends ServiceImpl<MsgAlarmMapper, MsgAlarm> i
             lw.gt(BaseCameraManagement::getEndMile, msgAlarmVo.getAlarmMile());
         }
         List<BaseCameraManagement> baseCameraManagementList = baseCameraManagementMapper.selectList(lw);
-        BaseCameraManagement baseCameraManagement = new BaseCameraManagement();
-        if (!StringUtils.isEmptySunhh(baseCameraManagementList) && baseCameraManagementList.size() > 0) {
-            baseCameraManagement = baseCameraManagementList.get(0);
-        }
-//        BaseCameraManagement baseCameraManagement = baseCameraManagementMapper.selectOne(lw);
-        if (StringUtils.isEmptySunhh(baseCameraManagement)) {
-            return AjaxResult.error("线路编码:" + msgAlarmVo.getRailwayCode() + "不存在对应里程范围为:"+ msgAlarmVo.getAlarmMile() +"的相机!");
-        }
-        LambdaQueryWrapper<BaseDeviceDynamicManagement> queryWrapper = new LambdaQueryWrapper<>();
-        if (!ObjectUtils.isEmpty(baseCameraManagement.getCameraCode())) {
-            queryWrapper.eq(BaseDeviceDynamicManagement::getCameraCode, baseCameraManagement.getCameraCode());
+        if (!ObjectUtils.isEmpty(baseCameraManagementList)) {
+            BaseCameraManagement baseCameraManagement = baseCameraManagementList.get(0);
+            if (!ObjectUtils.isEmpty(baseCameraManagement.getCameraCode())) {
+                LambdaQueryWrapper<BaseDeviceDynamicManagement> queryWrapper = new LambdaQueryWrapper<>();
+                queryWrapper.eq(BaseDeviceDynamicManagement::getCameraCode, baseCameraManagement.getCameraCode());
+                BaseDeviceDynamicManagement baseDeviceDynamicManagement = baseDeviceDynamicManagementMapper.selectOne(queryWrapper);
+                if (!StringUtils.isEmptySunhh(baseDeviceDynamicManagement)) {
+                    msgAlarmVo1.setElectricity(baseDeviceDynamicManagement.getElectricity());
+                }
+            }
+            msgAlarmVo1.setLineDirStr(baseCameraManagement.getLineDir() == 1 ? "上行" : "下行");
+            msgAlarmVo1.setCameraCode(baseCameraManagement.getCameraCode());
         }
-        BaseDeviceDynamicManagement baseDeviceDynamicManagement = baseDeviceDynamicManagementMapper.selectOne(queryWrapper);
-        if (StringUtils.isEmptySunhh(baseDeviceDynamicManagement)) {
-            return AjaxResult.error("设备动态管理表中没有该相机编码:" + baseCameraManagement.getCameraCode() + "的数据");
-        }
-        MsgAlarmVo msgAlarmVo1 = new MsgAlarmVo();
         // BeanUtils.copyProperties(msgAlarm, msgAlarmVo1);
         msgAlarmVo1.setRailwayCode(msgAlarm.getRailwayCode());
         msgAlarmVo1.setRailwayCodeName(baseRailwayManagement.getRailwayName());
         msgAlarmVo1.setAlarmMiles(AppendUtils.stringAppend(msgAlarmVo.getAlarmMile()));
-        msgAlarmVo1.setLineDirStr(baseCameraManagement.getLineDir() == 1 ? "上行" : "下行");
-        msgAlarmVo1.setCameraCode(baseCameraManagement.getCameraCode());
-        msgAlarmVo1.setElectricity(baseDeviceDynamicManagement.getElectricity());
         msgAlarmVo1.setIsReleaseName(msgAlarm.getIsRelease() == 1 ? "已解除" : "未解除");
         return AjaxResult.success(msgAlarmVo1);
     }

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1005 - 0
business-service/src/main/java/com/ozs/utils/CameraUtil.java


+ 62 - 0
business-service/src/main/java/com/ozs/utils/CaneraConfig.java

@@ -0,0 +1,62 @@
+package com.ozs.utils;
+
+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;
+
+    @Value("${artemis.host:10.48.253.21:1443}")
+    private String host;
+
+    @Value("${artemis.appKey:20110033}")
+    private String appKey;
+
+    @Value("${artemis.appSecret:QoGESFXOYrC68ixIS7wo}")
+    private String appSecret;
+    
+}

+ 80 - 0
business-service/src/main/java/com/ozs/utils/CmdCameraUtil.java

@@ -0,0 +1,80 @@
+package com.ozs.utils;
+
+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();
+        }
+
+    }
+
+}

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

@@ -0,0 +1,88 @@
+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");
+        command.add("copy");
+        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;
+    }
+}

+ 0 - 5
vehicle-admin/pom.xml

@@ -35,11 +35,6 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-websocket</artifactId>
         </dependency>
-        <dependency>
-            <groupId>com.hikvision.ga</groupId>
-            <artifactId>artemis-http-client</artifactId>
-            <version>1.1.3</version>
-        </dependency>
 
         <!-- swagger3-->
         <!--        <dependency>-->

+ 1 - 1
vehicle-admin/src/main/java/com/ozs/web/common/Constant.java

@@ -1,4 +1,4 @@
-package com.ozs.web.common;
+package com.ozs.config;
 
 public class Constant {
     public static final String HERTBEA_KEY ="hertbea_";

+ 101 - 65
vehicle-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseCameraManagementController.java

@@ -1,5 +1,7 @@
 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;
@@ -23,9 +25,10 @@ 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.web.core.config.CaneraConfig;
+import com.ozs.utils.CameraUtil;
+import com.ozs.utils.CaneraConfig;
+import com.ozs.utils.RtspToMP4;
 import com.ozs.web.core.config.GetCameraPreviewURL;
-import com.ozs.web.core.util.CameraUtil;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
@@ -44,6 +47,8 @@ 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;
 
 /**
@@ -71,10 +76,6 @@ public class BaseCameraManagementController extends BaseController {
     @Autowired
     private BaseRailwayManagementService baseRailwayManagementService;
     @Autowired
-    private ServerConfig serverConfig;
-    @Autowired
-    private CaneraConfig caneraConfig;
-    @Autowired
     private IdempotenceUtils idempotenceUtils;
     @Autowired
     private DataScoreUtil dataScoreUtil;
@@ -84,6 +85,7 @@ public class BaseCameraManagementController extends BaseController {
     @Autowired
     private CameraUtil cameraUtil;
 
+
     /**
      * 所有相机列表+权限
      */
@@ -485,43 +487,55 @@ public class BaseCameraManagementController extends BaseController {
     @GetMapping(value = "/{id}")
     @ApiOperation("根据相机ID获取相机台账管理信息")
     @Log(title = "相机台账管理", businessType = BusinessType.MESSAGE)
-    public AjaxResult getInfo(@PathVariable Long id) {
-        BaseCameraManagement baseCameraManagement = baseCameraManagementService.getById(id);
-        LambdaQueryWrapper<BaseRailwayManagement> queryWrapper = new LambdaQueryWrapper<BaseRailwayManagement>();
-        if (!ObjectUtils.isEmpty(baseCameraManagement.getRailwayCode())) {
-            queryWrapper.eq(BaseRailwayManagement::getRailwayCode, baseCameraManagement.getRailwayCode());
-        }
-        BaseRailwayManagement baseRailwayManagement = baseRailwayManagementService.getOne(queryWrapper);
-//        SysDept sysDept = deptService.selectDeptById(baseCameraManagement.getDeptId());
-//        baseCameraManagement.setDeptName(sysDept.getDeptName());
-        baseCameraManagement.setRailwayName(baseRailwayManagement.getRailwayName());
-        if (!StringUtils.isEmptySunhh(baseCameraManagement.getInstallMile())) {
-            String mils = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
-            baseCameraManagement.setInstallMiles(mils);
-        }
-        String end = "";
-        if (!StringUtils.isEmptySunhh(baseCameraManagement.getEndMile())) {
-            end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
-            baseCameraManagement.setEndMiles(end);
-        }
-        String begin = "";
-        if (!StringUtils.isEmptySunhh(baseCameraManagement.getBeginMile())) {
-            begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
-            baseCameraManagement.setBeginMiles(begin);
-        }
-        if (!StringUtils.isEmptySunhh(baseCameraManagement.getInstallMile())) {
-            baseCameraManagement.setInstallMileBD(new BigDecimal(baseCameraManagement.getInstallMile()).divide(new BigDecimal(1000)).setScale(3, RoundingMode.HALF_UP));
-        }
-        if (!StringUtils.isEmptySunhh(baseCameraManagement.getBeginMile())) {
-            baseCameraManagement.setBeginMileBD(new BigDecimal(baseCameraManagement.getBeginMile()).divide(new BigDecimal(1000)).setScale(3, RoundingMode.HALF_UP));
-        }
-        if (!StringUtils.isEmptySunhh(baseCameraManagement.getEndMile())) {
-            baseCameraManagement.setEndMileBD(new BigDecimal(baseCameraManagement.getEndMile()).divide(new BigDecimal(1000)).setScale(3, RoundingMode.HALF_UP));
-        }
-        baseCameraManagement.setLineDirStr(baseCameraManagement.getLineDir() == 1 ? "上行" : "下行");
-        baseCameraManagement.setMilesRange(begin + "-" + end);
-        baseCameraManagement.setLongitudeAndLatitude(baseCameraManagement.getInstallLongitude() + "," + baseCameraManagement.getInstallLongitude());
-        return AjaxResult.success(baseCameraManagement);
+    public AjaxResult getInfo(@PathVariable Long id) throws InterruptedException {
+//        BaseCameraManagement baseCameraManagement = baseCameraManagementService.getById(id);
+//        LambdaQueryWrapper<BaseRailwayManagement> queryWrapper = new LambdaQueryWrapper<BaseRailwayManagement>();
+//        if (!ObjectUtils.isEmpty(baseCameraManagement.getRailwayCode())) {
+//            queryWrapper.eq(BaseRailwayManagement::getRailwayCode, baseCameraManagement.getRailwayCode());
+//        }
+//        BaseRailwayManagement baseRailwayManagement = baseRailwayManagementService.getOne(queryWrapper);
+////        SysDept sysDept = deptService.selectDeptById(baseCameraManagement.getDeptId());
+////        baseCameraManagement.setDeptName(sysDept.getDeptName());
+//        baseCameraManagement.setRailwayName(baseRailwayManagement.getRailwayName());
+//        if (!StringUtils.isEmptySunhh(baseCameraManagement.getInstallMile())) {
+//            String mils = AppendUtils.stringAppend(baseCameraManagement.getInstallMile());
+//            baseCameraManagement.setInstallMiles(mils);
+//        }
+//        String end = "";
+//        if (!StringUtils.isEmptySunhh(baseCameraManagement.getEndMile())) {
+//            end = AppendUtils.stringAppend(baseCameraManagement.getEndMile());
+//            baseCameraManagement.setEndMiles(end);
+//        }
+//        String begin = "";
+//        if (!StringUtils.isEmptySunhh(baseCameraManagement.getBeginMile())) {
+//            begin = AppendUtils.stringAppend(baseCameraManagement.getBeginMile());
+//            baseCameraManagement.setBeginMiles(begin);
+//        }
+//        if (!StringUtils.isEmptySunhh(baseCameraManagement.getInstallMile())) {
+//            baseCameraManagement.setInstallMileBD(new BigDecimal(baseCameraManagement.getInstallMile()).divide(new BigDecimal(1000)).setScale(3, RoundingMode.HALF_UP));
+//        }
+//        if (!StringUtils.isEmptySunhh(baseCameraManagement.getBeginMile())) {
+//            baseCameraManagement.setBeginMileBD(new BigDecimal(baseCameraManagement.getBeginMile()).divide(new BigDecimal(1000)).setScale(3, RoundingMode.HALF_UP));
+//        }
+//        if (!StringUtils.isEmptySunhh(baseCameraManagement.getEndMile())) {
+//            baseCameraManagement.setEndMileBD(new BigDecimal(baseCameraManagement.getEndMile()).divide(new BigDecimal(1000)).setScale(3, RoundingMode.HALF_UP));
+//        }
+//        baseCameraManagement.setLineDirStr(baseCameraManagement.getLineDir() == 1 ? "上行" : "下行");
+//        baseCameraManagement.setMilesRange(begin + "-" + end);
+//        baseCameraManagement.setLongitudeAndLatitude(baseCameraManagement.getInstallLongitude() + "," + baseCameraManagement.getInstallLongitude());
+//        return AjaxResult.success(baseCameraManagement);
+        String cameraPreviewURL = GetCameraPreviewURL.getPreviewURLs();
+        log.info("-------------------------------->>>>>" + cameraPreviewURL);
+        JSONObject outJson = JSONObject.parse(cameraPreviewURL);
+        log.info("-------------------------------->>>>>outJson------" + outJson);
+        JSONObject data = outJson.getJSONObject("data");
+        log.info("-------------------------------->>>>>data------" + data);
+        String urls = data.getString("url");
+        log.info("-------------------------------->>>>>urls------" + urls);
+        TimeUnit.SECONDS.sleep(5);
+        String msg = HttpUtils.sendGet("http://10.48.36.47:9080/rtsp/api/pull?target=" + urls + "&streamPath=01ea43e6676f4e47bd6c5cd9e02aa006/01ea43e6676f4e47bd6c5cd9e02aa006&save=0");
+//        String msg = HttpUtils.sendGet("http://10.48.36.47:9080/api/gateway/stop?stream=01ea43e6676f4e47bd6c5cd9e02aa006/01ea43e6676f4e47bd6c5cd9e02aa006");
+        return AjaxResult.success(msg);
     }
 
     /**
@@ -664,7 +678,7 @@ public class BaseCameraManagementController extends BaseController {
         if (ObjectUtils.isEmpty(one)) {
             throw new BaseException("相机编号【" + cameraCode + "】不存在");
         }
-        return new AjaxResult(200, "ok", one.getUrl());
+        return new AjaxResult(200, "ok", CameraUtil.getPlayFlv(cameraCode, one.getChannel()));
     }
 
     @ApiOperation("视频邀约")
@@ -742,7 +756,7 @@ public class BaseCameraManagementController extends BaseController {
         if (ObjectUtils.isEmpty(one)) {
             throw new BaseException("相机编号【" + vo.getCameraCode() + "】不存在");
         }
-        return new AjaxResult(200, "ok", CameraUtil.getRecordList(one.getChannel(), vo.getStartTime(), vo.getEntTime()));
+        return new AjaxResult(200, "ok", CameraUtil.getRecordList(one.getCameraCode(), vo.getStartTime(), vo.getEntTime()));
     }
 
     @ApiOperation("批量查询录像")
@@ -905,26 +919,24 @@ public class BaseCameraManagementController extends BaseController {
     @GetMapping("/startRecording/{id}")
     @Log(title = "相机台账管理", businessType = BusinessType.OTHER)
     public AjaxResult startRecording(@PathVariable Long id) {
-        String cameraPreviewURL = GetCameraPreviewURL.getCameraPreviewURL();
-        return AjaxResult.success(cameraPreviewURL);
-//        BaseCameraManagement baseCameraManagement = baseCameraManagementService.getById(id);
-//        log.info("startRecording------CameraCode------" + baseCameraManagement.getCameraCode());
-//        log.info("startRecording------Channel------" + baseCameraManagement.getChannel());
-//        String start = HttpUtils.sendGet(CameraUtil.startRecording(baseCameraManagement.getCameraCode(), baseCameraManagement.getChannel()));
-//        log.info("startRecording------------" + start);
-//        if (start.startsWith(baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel())) {
-//            log.info("startRecording 返回成功!!1");
-//            baseCameraManagement.setStartRecording(1);
-//            baseCameraManagement.setTaskId(start);
-//            baseCameraManagement.setUpdateBy(getUserId());
-//        } else {
-//            return success("视频录制失败:请确认流是否存在或流是否开视频启开启");
-//        }
-//        if (baseCameraManagementService.updateById(baseCameraManagement)) {
-//            return success();
-//        } else {
-//            return error("开启视频录制失败");
-//        }
+        BaseCameraManagement baseCameraManagement = baseCameraManagementService.getById(id);
+        log.info("startRecording------CameraCode------" + baseCameraManagement.getCameraCode());
+        log.info("startRecording------Channel------" + baseCameraManagement.getChannel());
+        String start = HttpUtils.sendGet(CameraUtil.startRecording(baseCameraManagement.getCameraCode(), baseCameraManagement.getChannel()));
+        log.info("startRecording------------" + start);
+        if (start.startsWith(baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel())) {
+            log.info("startRecording 返回成功!!1");
+            baseCameraManagement.setStartRecording(1);
+            baseCameraManagement.setTaskId(start);
+            baseCameraManagement.setUpdateBy(getUserId());
+        } else {
+            return success("视频录制失败:请确认流是否存在或流是否开视频启开启");
+        }
+        if (baseCameraManagementService.updateById(baseCameraManagement)) {
+            return success();
+        } else {
+            return error("开启视频录制失败");
+        }
     }
 
     @GetMapping(value = "/getAlarm/{cameraCode}")
@@ -1009,5 +1021,29 @@ public class BaseCameraManagementController extends BaseController {
         String cameraPreviewURL = GetCameraPreviewURL.getCameraPreviewURL();
         return AjaxResult.success(cameraPreviewURL);
     }
+
+    @GetMapping(value = "/testURL")
+    @ApiOperation("流媒体动态流测试")
+    @Log(title = "相机台账管理", businessType = BusinessType.MESSAGE)
+    public AjaxResult testURL() {
+        return AjaxResult.success(CameraUtil.getPlayFlv("live", "42010001541320000025"));
+    }
+
+    @GetMapping(value = "/getAlarmRecord")
+    @ApiOperation("报警回放本地测试")
+    @Log(title = "相机台账管理", businessType = BusinessType.MESSAGE)
+    public AjaxResult getAlarmRecord() {
+        List<BaseCameraManagement> list = baseCameraManagementService.list(new QueryWrapper<BaseCameraManagement>().eq("line_dir",2));
+        List<String> collect = list.stream().map(BaseCameraManagement::getCameraCode).collect(Collectors.toList());
+        CompletableFuture.runAsync(() -> cameraUtil.playbackURLs(collect));
+        return AjaxResult.success("ok");
+    }
+
+
+    @ApiOperation(value = "结束录制")
+    @GetMapping(value = "/stop")
+    public AjaxResult stop(String id) {
+      return cameraUtil.stop(id);
+    }
 }
 

+ 1 - 5
vehicle-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseVehicleController.java

@@ -1,6 +1,5 @@
 package com.ozs.web.controller.accountmanagment;
 
-import com.alibaba.fastjson2.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ozs.common.annotation.Log;
@@ -9,8 +8,6 @@ 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.enums.BusinessType;
-import com.ozs.common.exception.base.BaseException;
-import com.ozs.common.utils.AppendUtils;
 import com.ozs.common.utils.ChineseToPingyin;
 import com.ozs.common.utils.HeartbeatUtils;
 import com.ozs.common.utils.StringUtils;
@@ -28,8 +25,7 @@ import com.ozs.service.BaseRailwayManagementService;
 import com.ozs.service.BaseVehicleService;
 import com.ozs.system.service.DataScoreUtil;
 import com.ozs.system.service.ISysDictTypeService;
-import com.ozs.web.common.Constant;
-import com.ozs.web.core.util.CameraUtil;
+import com.ozs.utils.CameraUtil;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;

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

@@ -39,7 +39,6 @@ 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 com.ozs.web.core.util.CameraUtil;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;

+ 37 - 107
vehicle-admin/src/main/java/com/ozs/web/controller/sdk/GeoHazardMonitorTokenController.java

@@ -1,4 +1,4 @@
-package com.ozs.web.controller.sdk;
+package com.ozs.controller.upload;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
@@ -7,10 +7,11 @@ import com.ozs.common.core.redis.RedisCache;
 import com.ozs.common.utils.ApiTokenUtils;
 import com.ozs.common.utils.ChineseToPingyin;
 import com.ozs.common.utils.HeartbeatUtils;
+import com.ozs.common.utils.HttpClientUtil;
 import com.ozs.common.utils.IgnoreUtils;
 import com.ozs.common.utils.StringUtils;
-import com.ozs.common.utils.http.HttpUtils;
 import com.ozs.common.utils.stateSecrets.SM4Utils;
+import com.ozs.config.Constant;
 import com.ozs.entity.BaseCameraManagement;
 import com.ozs.entity.BaseRailwayManagement;
 import com.ozs.entity.BaseTerminal;
@@ -20,8 +21,8 @@ import com.ozs.entity.MsgAlarm;
 import com.ozs.entity.MsgAlarmExt;
 import com.ozs.entity.MsgAlarmFrequency;
 import com.ozs.entity.MsgHeartbeatAlarmMessage;
-import com.ozs.entity.SvcAddress;
 import com.ozs.entity.SkynetHeartbeatLog;
+import com.ozs.entity.SvcAddress;
 import com.ozs.entity.TerminalIgnoreAlarm;
 import com.ozs.entity.VehiclePosition;
 import com.ozs.entity.vo.AlarmFilesVo;
@@ -42,27 +43,21 @@ import com.ozs.entity.vo.RespGeoHazardMonitorVo;
 import com.ozs.entity.vo.RespHeartbeatVo;
 import com.ozs.entity.vo.SkynetHeartbeatVo;
 import com.ozs.entity.vo.TerminalIgnoreVo;
-import com.ozs.framework.config.ServerConfig;
 import com.ozs.mapper.AlarmHeartbeatLogMapper;
 import com.ozs.mapper.MsgHeartbeatAlarmMessageMapper;
 import com.ozs.mapper.SkynetHeartbeatLogMapper;
 import com.ozs.service.BaseCameraManagementService;
 import com.ozs.service.BaseRailwayManagementService;
-import com.ozs.service.BaseVehicleTerminalService;
-import com.ozs.service.BaseUserService;
 import com.ozs.service.BaseTerminalService;
+import com.ozs.service.BaseUserService;
+import com.ozs.service.BaseVehicleTerminalService;
 import com.ozs.service.MsgAlarmExtService;
 import com.ozs.service.MsgAlarmFrequencyService;
 import com.ozs.service.MsgAlarmService;
 import com.ozs.service.SvcAddressService;
 import com.ozs.service.TerminalIgnoreAlarmService;
 import com.ozs.service.VehiclePositionService;
-import com.ozs.system.mapper.SysUserMapper;
-import com.ozs.web.common.Constant;
-import com.ozs.web.controller.monitor.SysUserOnlineController;
-import com.ozs.web.controller.websocket.WebSocketCommon;
-import com.ozs.web.controller.websocket.WebSocketServer;
-import com.ozs.web.core.util.CameraUtil;
+import com.ozs.utils.CameraUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -77,6 +72,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
@@ -102,8 +98,6 @@ public class GeoHazardMonitorTokenController {
     @Resource
     private ApiTokenUtils apiTokenUtils;
     @Autowired
-    WebSocketServer webSocketServer;
-    @Autowired
     MsgAlarmService msgAlarmService;
     @Autowired
     MsgAlarmFrequencyService msgAlarmFrequencyService;
@@ -111,10 +105,6 @@ public class GeoHazardMonitorTokenController {
     SvcAddressService svcAddressService;
     @Autowired
     BaseCameraManagementService baseCameraManagementService;
-    @Autowired
-    SysUserOnlineController sysUserOnlineController;
-    //    @Value("${sdk.publish}")
-//    private String sdkUrl;
     @Autowired
     private BaseUserService baseUserService;
     @Autowired
@@ -134,13 +124,7 @@ public class GeoHazardMonitorTokenController {
     @Autowired
     private RedisCache redisCache;
     @Autowired
-    private ServerConfig serverConfig;
-    @Autowired
     private BaseTerminalService baseTerminalService;
-    @Resource
-    private SysUserMapper sysUserMapper;
-    @Autowired
-    WebSocketCommon webSocketCommon;
     @Autowired
     private CameraUtil cameraUtil;
     @Resource
@@ -151,6 +135,8 @@ public class GeoHazardMonitorTokenController {
     private MsgHeartbeatAlarmMessageMapper msgHearbeatAlarmMessageMapper;
     @Value("${base.env}")
     private String env;
+    @Value("${sdk.publish}")
+    private String sdkUrl;
 
     /**
      * 获取web访问令牌
@@ -224,8 +210,8 @@ public class GeoHazardMonitorTokenController {
      * 报警信息数据传输
      */
     @PostMapping("/api/alarm")
-    @Transactional
-    public String alarm(@RequestBody ParameterVo parameterVo, HttpServletRequest request) {
+    @Transactional(rollbackFor = Exception.class)
+    public String alarm(@RequestBody ParameterVo parameterVo, HttpServletRequest request) throws Exception {
         String token = apiTokenUtils.getGeoHazardMonitorToken(request);
         log.info("token:{}", token);
         log.info("parameter:{}", parameterVo);
@@ -235,13 +221,11 @@ public class GeoHazardMonitorTokenController {
             String key = split[split.length - 1];
             String s = SM4Utils.decryptData_ECB(parameterVo.getParameter(), key);
             ReqMsgAlarmVo reqMsgAlarmVo = JSON.parseObject(s, ReqMsgAlarmVo.class);
-            if (!ObjectUtils.isEmpty(reqMsgAlarmVo.getAlarmAttr())) {
-                if (!reqMsgAlarmVo.getAlarmAttr().matches(PATTERN)) {
-                    jsonObject.put("resultCode", 0);
-                    jsonObject.put("message", "失败");
-                    jsonObject.put("data", "你填写的报警病害属性不符合规则!!!");
-                    return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
-                }
+            if (ObjectUtils.isEmpty(reqMsgAlarmVo.getAlarmAttr())) {
+                jsonObject.put("resultCode", 0);
+                jsonObject.put("message", "失败");
+                jsonObject.put("data", "你填写的报警病害属性不符合规则!!!");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
             }
             if (!reqMsgAlarmVo.getAlarmMile().toString().matches(PATTERNS)) {
                 jsonObject.put("resultCode", 0);
@@ -301,6 +285,7 @@ public class GeoHazardMonitorTokenController {
                 wrapper.ge(BaseCameraManagement::getEndMile, reqMsgAlarmVo.getAlarmMile());
                 wrapper.eq(BaseCameraManagement::getRailwayCode, reqMsgAlarmVo.getAlarmRailway());
                 wrapper.eq(BaseCameraManagement::getLineDir, reqMsgAlarmVo.getLineDir());
+                wrapper.eq(BaseCameraManagement::getEnableOrNot, 1);
             }
             List<BaseCameraManagement> baseCameraManagementList = baseCameraManagementService.list(wrapper);
             log.info("baseCameraManagement:{}", baseCameraManagementList);
@@ -358,35 +343,15 @@ public class GeoHazardMonitorTokenController {
                 msgAlarmVice.setRailwayCode(reqMsgAlarmVo.getAlarmRailway());
                 msgAlarmVice.setAlarmTime(new Date(reqMsgAlarmVo.getAlarmTime()));
                 msgAlarmFrequencyService.save(msgAlarmVice);
-                webSocketCommon.publish(msgAlarm);
-                for (BaseCameraManagement baseCameraManagement : baseCameraManagementList) {
-                    String invite = CameraUtil.invite(baseCameraManagement.getCameraCode(), baseCameraManagement.getChannel());
-                    if ("304".equals(invite) || "200".equals(invite)) {
-                        String start = HttpUtils.sendGet(CameraUtil.startRecording(baseCameraManagement.getCameraCode(), baseCameraManagement.getChannel()));
-                        log.info("startRecording------------" + start);
-                        if (start.startsWith(baseCameraManagement.getCameraCode() + "/" + baseCameraManagement.getChannel())) {
-                            baseCameraManagement.setTaskId(start);
-                            baseCameraManagement.setUpdateBy(admin.getUserId());
-                        } else {
-                            jsonObject.put("resultCode", 0);
-                            jsonObject.put("message", "失败");
-                            jsonObject.put("data", "视频录制失败:请确认流是否存在!!!");
-                            return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
-                        }
-                        if (!baseCameraManagementService.updateById(baseCameraManagement)) {
-                            jsonObject.put("resultCode", 0);
-                            jsonObject.put("message", "失败");
-                            jsonObject.put("data", "开启录制视频失败!!!");
-                            return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
-                        }
-                    } else {
-                        jsonObject.put("resultCode", 0);
-                        jsonObject.put("message", "失败");
-                        jsonObject.put("data", "视频邀约失败,视频中心没有该相机编码或通道编码的摄像头!!!");
-                        return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
-                    }
-                }
 
+                log.info("alarmJSON :{}", JSON.toJSONString(msgAlarm));
+                log.info("->>>>>>>>>>>>>>>>>>>>>>>>>>"+msgAlarm);
+                String result = HttpClientUtil.postJson(sdkUrl, JSON.toJSONString(msgAlarm));
+                log.info("->>>>>>>>>>>>>>>>>>>>>>>>>>>>"+result);
+                log.info("result:{}", result);
+
+                List<String> collect = baseCameraManagementList.stream().map(BaseCameraManagement::getCameraCode).collect(Collectors.toList());
+//                CompletableFuture.runAsync(() ->cameraUtil.playbackURLs(collect));
             } else {
                 BeanUtils.copyProperties(reqMsgAlarmVo, msgAlarmVice);
                 msgAlarmVice.setCreateBy(admin.getUserId());
@@ -395,20 +360,6 @@ public class GeoHazardMonitorTokenController {
                 msgAlarmVice.setRailwayCode(reqMsgAlarmVo.getAlarmRailway());
                 msgAlarmFrequencyService.save(msgAlarmVice);
             }
-//            try {
-//                MsgAlarm alarms = msgAlarmService.getOne(lw);
-//                log.info("sdkUrl:{}", sdkUrl);
-//                log.info("alarmJSON :{}", JSON.toJSONString(alarms));
-////                String result = HttpClientUtil.postJson(sdkUrl, JSON.toJSONString(alarms));
-////                log.info("result:{}", result);
-//            } catch (Exception e) {
-//                log.info(e.getMessage());
-//                e.printStackTrace();
-//                jsonObject.put("resultCode", 0);
-//                jsonObject.put("message", "失败");
-//                jsonObject.put("data", "消息推送失败");
-//                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), "4370780c9a8c43e5");
-//            }
             jsonObject.put("resultCode", 1);
             jsonObject.put("message", "ok");
             jsonObject.put("data", null);
@@ -608,27 +559,6 @@ public class GeoHazardMonitorTokenController {
             LambdaQueryWrapper<BaseTerminal> terminal = new LambdaQueryWrapper<>();
             terminal.eq(BaseTerminal::getTerminalCode, vehiclePosition.getTerminalCode());
             boolean update = baseTerminalService.update(baseTerminal1, terminal);
-//            //*******获取终端经度纬度,将车载终端code改为机车的code,便是机车的位置
-//            HeartbeatVo heartbeatVoCH = new HeartbeatVo();
-//            BeanUtils.copyProperties(heartbeatVo, heartbeatVoCH);
-//            //*******将终端关联的机车号赋值给推送信息对象
-//            heartbeatVoCH.setVehicleCode(baseTerminal.getVehicleCode());
-//            String content = objStr(heartbeatVoCH);
-//            //获取在线用户
-//            List<SysUserOnline> rows = (List<SysUserOnline>) sysUserOnlineController.list(null, null).getRows();
-//            if (!ObjectUtils.isEmpty(rows)) {
-//                //拿到用户userNameList
-//                List<String> userNameList = rows.stream().map(SysUserOnline::getUserName).collect(Collectors.toList());
-//                LambdaQueryWrapper<SysUser> userWrapper = new LambdaQueryWrapper<>();
-//                userWrapper.in(SysUser::getUserName, userNameList);
-//                List<SysUser> sysUsers = sysUserMapper.selectList(userWrapper);
-//                //拿到用户userIdList
-//                List<Long> userIdList = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
-//                for (Long userid : userIdList) {
-//                    //推送给在线用户
-//                    webSocketServer.sendOneMessage(String.valueOf(userid), content);
-//                }
-//            }
 
             //目视距离和里程位置
             if (save && update) {
@@ -650,13 +580,13 @@ public class GeoHazardMonitorTokenController {
                     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
                     String currentFormattedDateTime = currentDateTime.format(formatter);
                     String previousFormattedDateTime = previousDateTime.format(formatter);
-                    
+
                     LambdaQueryWrapper<TerminalIgnoreAlarm> queryWrapper1 = new LambdaQueryWrapper<>();
                     List<String> collect = alarmsList.stream().map(MsgAlarm::getAlarmId).collect(Collectors.toList());
                     queryWrapper1.in(TerminalIgnoreAlarm::getAlarmId, collect);
                     queryWrapper1.eq(TerminalIgnoreAlarm::getTerminalCode, heartbeatVo.getTerminalCode());
-                    queryWrapper1.ge(TerminalIgnoreAlarm::getIgnoreTime,previousFormattedDateTime);
-                    queryWrapper1.le(TerminalIgnoreAlarm::getIgnoreTime,currentFormattedDateTime);
+                    queryWrapper1.ge(TerminalIgnoreAlarm::getIgnoreTime, previousFormattedDateTime);
+                    queryWrapper1.le(TerminalIgnoreAlarm::getIgnoreTime, currentFormattedDateTime);
                     List<TerminalIgnoreAlarm> list2 = terminalIgnoreAlarmService.list(queryWrapper1);
                     //找出未忽略的报警信息
                     LambdaQueryWrapper<MsgAlarm> queryWrapper2 = new LambdaQueryWrapper<>();
@@ -667,7 +597,7 @@ public class GeoHazardMonitorTokenController {
                                 .collect(Collectors.toList());
                         if (!ObjectUtils.isEmpty(list)) {
                             queryWrapper2.in(MsgAlarm::getAlarmId, list);
-                        }else {
+                        } else {
                             queryWrapper2.eq(MsgAlarm::getAlarmId, "1111111111111");
                         }
                     } else {
@@ -1430,13 +1360,13 @@ public class GeoHazardMonitorTokenController {
         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);
-    }
+//    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) {

+ 1 - 5
vehicle-admin/src/main/java/com/ozs/web/controller/sdk/UploadController.java

@@ -1,13 +1,10 @@
-package com.ozs.web.controller.sdk;
+package com.ozs.controller.upload;
 
 import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.ozs.common.core.domain.entity.SysDept;
 import com.ozs.common.utils.MinioUtils;
 import com.ozs.common.utils.StringUtils;
-import com.ozs.common.utils.stateSecrets.SM4Utils;
 import com.ozs.common.utils.uuid.IdUtils;
-import com.ozs.entity.BaseCameraManagement;
 import com.ozs.entity.BaseRailwayManagement;
 import com.ozs.service.BaseCameraManagementService;
 import com.ozs.service.BaseRailwayManagementService;
@@ -23,7 +20,6 @@ import javax.annotation.Resource;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 @RestController

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

@@ -1,53 +1,53 @@
-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;
-    
-}
+//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;
+//    
+//}

+ 51 - 2
vehicle-admin/src/main/java/com/ozs/web/core/config/GetCameraPreviewURL.java

@@ -30,7 +30,7 @@ public class GetCameraPreviewURL {
         /**
          * STEP3:设置接口的URI地址
          */
-        final String previewURLsApi = ARTEMIS_PATH + "/api/resource/v2/encodeDevice/search";
+        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
@@ -47,7 +47,56 @@ public class GetCameraPreviewURL {
          */
         JSONObject jsonBody = new JSONObject();
         jsonBody.put("pageNo", 1);
-        jsonBody.put("pageSize", 10);
+        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:调用接口

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 941 - 908
vehicle-admin/src/main/java/com/ozs/web/core/util/CameraUtil.java


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

@@ -1,81 +1,81 @@
-package com.ozs.web.core.util;
-
-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();
-        }
-
-    }
-
-}
+//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();
+//        }
+//
+//    }
+//
+//}

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

@@ -170,3 +170,8 @@ aliyun:
         keyid: LTAI5tGRWozi6CLywJSXMkTh
         keysecret: LhJI1KcaN84MjLvtHzDX3KpXeBnT2p
         bucketname: hxs-1010
+
+artemis:
+  host: 10.48.253.21:1443
+  appKey: 20110033
+  appSecret: QoGESFXOYrC68ixIS7wo

+ 5 - 0
vehicle-sdk/Dockerfile

@@ -0,0 +1,5 @@
+FROM openjdk:8
+ADD target/hazard-sdk.jar app.jar
+EXPOSE 18818
+VOLUME ["/data/service/hazard-sdk/logs","/logs"]
+ENTRYPOINT java -jar /app.jar >/logs/app.log

+ 110 - 0
vehicle-sdk/pom.xml

@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>VehicleMonitor</artifactId>
+        <groupId>com.ozs</groupId>
+        <version>1.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>jar</packaging>
+    <version>1.0-SNAPSHOT</version>
+    <artifactId>vehicle-sdk</artifactId>
+
+    <dependencies>
+        <!-- webSocket web端 消息推送 -->
+<!--        <dependency>-->
+<!--            <groupId>org.springframework.boot</groupId>-->
+<!--            <artifactId>spring-boot-starter-thymeleaf</artifactId>-->
+<!--        </dependency>-->
+
+<!--        <dependency>-->
+<!--            <groupId>org.springframework.boot</groupId>-->
+<!--            <artifactId>spring-boot-starter-websocket</artifactId>-->
+<!--        </dependency>-->
+
+<!--        &lt;!&ndash; 极光推送 &ndash;&gt;-->
+<!--        <dependency>-->
+<!--            <groupId>cn.jpush.api</groupId>-->
+<!--            <artifactId>jpush-client</artifactId>-->
+<!--            <version>3.3.8</version>-->
+<!--        </dependency>-->
+<!--        <dependency>-->
+<!--            <groupId>cn.jpush.api</groupId>-->
+<!--            <artifactId>jmessage-client</artifactId>-->
+<!--            <version>1.1.8</version>-->
+<!--        </dependency>-->
+<!--        <dependency>-->
+<!--            <groupId>cn.jpush.api</groupId>-->
+<!--            <artifactId>jiguang-common</artifactId>-->
+<!--            <version>1.1.3</version>-->
+<!--        </dependency>-->
+<!--        <dependency>-->
+<!--            <groupId>io.netty</groupId>-->
+<!--            <artifactId>netty-all</artifactId>-->
+<!--            <version>4.1.6.Final</version>-->
+<!--            <scope>compile</scope>-->
+<!--        </dependency>-->
+
+        <!--lombok -->
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.16.18</version>
+        </dependency>
+
+        <!-- SpringBoot Web容器 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <!-- Mysql驱动包 -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+        <!-- 阿里数据库连接池 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+            <version>1.2.15</version>
+        </dependency>
+        <!-- 业务代码-->
+        <dependency>
+            <groupId>com.ozs</groupId>
+            <artifactId>business-service</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.1.1.RELEASE</version>
+                <configuration>
+                    <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-war-plugin</artifactId>
+                <version>3.1.0</version>
+                <configuration>
+                    <failOnMissingWebXml>false</failOnMissingWebXml>
+                    <warName>${project.artifactId}</warName>
+                </configuration>
+            </plugin>
+        </plugins>
+        <finalName>${project.artifactId}</finalName>
+    </build>
+</project>

+ 21 - 0
vehicle-sdk/src/main/java/com/ozs/VehicleSdkApplication.java

@@ -0,0 +1,21 @@
+package com.ozs;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+
+/**
+ * 启动程序
+ *
+ * @author ruoyi
+ */
+@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
+public class VehicleSdkApplication
+{
+    public static void main(String[] args)
+    {
+        // System.setProperty("spring.devtools.restart.enabled", "false");
+        SpringApplication.run(VehicleSdkApplication.class, args);
+        System.out.println("(♥◠‿◠)ノ゙  启动成功   ლ(´ڡ`ლ)゙");
+    }
+}

+ 18 - 0
vehicle-sdk/src/main/java/com/ozs/VehicleServletInitializer.java

@@ -0,0 +1,18 @@
+package com.ozs;
+
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
+
+/**
+ * web容器中进行部署
+ *
+ * @author ruoyi
+ */
+public class VehicleServletInitializer extends SpringBootServletInitializer
+{
+    @Override
+    protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
+    {
+        return application.sources(VehicleSdkApplication.class);
+    }
+}

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

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

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

@@ -0,0 +1,57 @@
+# 数据源配置
+spring:
+    datasource:
+        type: com.alibaba.druid.pool.DruidDataSource
+        driverClassName: dm.jdbc.driver.DmDriver
+        druid:
+            # 主库数据源
+            master:
+                url: jdbc:dm://10.48.36.45:5236/vehicle
+                username: VEHICLE
+                password: w9s1KP$BDY8
+            # 从库数据源
+            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

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

@@ -0,0 +1,57 @@
+# 数据源配置
+spring:
+    datasource:
+        type: com.alibaba.druid.pool.DruidDataSource
+        driverClassName: com.mysql.cj.jdbc.Driver
+        druid:
+            # 主库数据源
+            master:
+                url: jdbc:mysql://124.70.58.209:18806/vehicle?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                username: root
+                password: 123.asd
+            # 从库数据源
+            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

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

@@ -0,0 +1,57 @@
+# 数据源配置
+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

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

@@ -0,0 +1,181 @@
+# 项目相关配置
+base:
+  # 名称
+  name: base
+  # 版本
+  version: 1.0
+  # 版权年份
+  copyrightYear: 2023
+  # 实例演示开关
+  demoEnabled: true
+  # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
+  profile: /opt/streams/record/flv
+  # 获取ip地址开关
+  addressEnabled: false
+  # 验证码类型 math 数组计算 char 字符验证
+  captchaType: math
+  #  sqlType: kingbasees  # 数据库类型
+  sqlType: dm  # 数据库类型
+  dbname: vehicle #数据库名
+  #图片路径前缀
+  imgUrl: http://10.48.36.43:18801/picbucket
+  ffmpegPath: /usr/local/ffmpeg/bin/ffmpeg
+  filePath: /opt/streams/record/flv/
+  webUrl: http://10.48.36.47:18812
+  bakUrl: http://10.48.36.47:18891
+  wsUrl: ws://10.48.36.47:9080
+  historyUrl: http:///10.48.36.47:18812
+  recordUrl: http://10.48.36.47:18810${server.servlet.context-path}
+  env: 1
+  hkUrl: http://10:122:1:22:1443
+
+server:
+  # 服务器的HTTP端口,默认为8081
+  port: 18811
+  servlet:
+    # 应用的访问路径
+    context-path: /
+  tomcat:
+    # tomcat的URI编码
+    uri-encoding: UTF-8
+    # 连接数满后的排队数,默认为100
+    accept-count: 1000
+    threads:
+      # tomcat最大线程数,默认为200
+      max: 800
+      # Tomcat启动初始化的线程数,默认值10
+      min-spare: 100
+
+# 日志配置
+logging:
+  level:
+    com.ozs: debug
+    org.springframework: warn
+
+# 用户配置
+user:
+  password:
+    # 密码最大错误次数
+    maxRetryCount: 5
+    # 密码锁定时间(默认10分钟)
+    lockTime: 10
+
+# Spring配置
+spring:
+  # 资源信息
+  messages:
+    # 国际化资源文件路径
+    basename: i18n/messages
+  profiles:
+    #    active: kdruid
+    active: dmdruid
+  # 文件上传
+  servlet:
+    multipart:
+      # 单个文件大小
+      max-file-size:  1000MB
+      # 设置总上传的文件大小
+      max-request-size:  1000MB
+  # 服务模块
+  devtools:
+    restart:
+      # 热部署开关
+      enabled: true
+  # redis 配置
+  redis:
+    # 地址
+    host: 124.70.58.209
+    # 端口,默认为6379
+    port: 7001
+    # 数据库索引
+    database: 1
+    # 密码
+    password: 106@qwe123
+    # 连接超时时间
+    timeout: 100s
+    lettuce:
+      pool:
+        # 连接池中的最小空闲连接
+        min-idle: 0
+        # 连接池中的最大空闲连接
+        max-idle: 8
+        # 连接池的最大数据库连接数
+        max-active: 8
+        # #连接池最大阻塞等待时间(使用负值表示没有限制)
+        max-wait: -1ms
+
+# token配置
+token:
+  # 令牌自定义标识
+  header: Authorization
+  # 令牌密钥
+  secret: abcdefghijklmnopqrstuvwxyz
+  # 令牌有效期(默认30分钟)
+  expireTime: 30
+apptoken:
+  # 令牌自定义标识
+  header: Authorization
+  # 令牌密钥
+  secret: qwertyuiopasdfghjklzxcvbnm
+  # 令牌有效期(默认15天)
+  expireTime: 21600
+
+# MyBatis配置
+mybatis:
+  # 搜索指定包别名
+  typeAliasesPackage: com.ozs.**.domain
+  # 配置mapper的扫描,找到所有的mapper.xml映射文件
+  mapperLocations: classpath*:mapper/**/*Mapper.xml
+  # 加载全局的配置文件
+  configLocation: classpath:mybatis/mybatis-config.xml
+
+# MyBatis-plus配置
+mybatis-plus:
+  config-location: classpath:mybatis/mybatis-config.xml
+  typeAliasesPackage: com.ozs.**.domain
+  mapperLocations: classpath*:mapper/**/*Mapper.xml
+
+
+# PageHelper分页插件
+pagehelper:
+  helperDialect: mysql
+  supportMethodsArguments: true
+  params: count=countSql
+
+# Swagger配置
+swagger:
+  # 是否开启swagger
+  enabled: true
+  # 请求前缀
+  pathMapping: /dev-api
+
+# 防止XSS攻击
+xss:
+  # 过滤开关
+  enabled: true
+  # 排除链接(多个用逗号分隔)
+  excludes: /system/notice
+  # 匹配链接
+  urlPatterns: /system/*,/monitor/*,/tool/*
+
+minio:
+  endpoint: http://10.48.36.43:18801 #Minio服务所在地址
+  bucketName: picbucket #存储桶名称
+  accessKey: admin #访问的key
+  secretKey: admin123 #访问的秘钥
+
+sdk:
+  publish: http://10.48.36.43:18810/sdk/publish
+  
+aliyun:
+  oss:
+    file:
+      endpoint: oss-cn-beijing.aliyuncs.com
+      keyid: LTAI5tGRWozi6CLywJSXMkTh
+      keysecret: LhJI1KcaN84MjLvtHzDX3KpXeBnT2p
+      bucketname: hxs-1010  
+
+artemis:
+  host: 10.48.253.21:1443
+  appKey: 20110033
+  appSecret: QoGESFXOYrC68ixIS7wo

+ 24 - 0
vehicle-sdk/src/main/resources/banner.txt

@@ -0,0 +1,24 @@
+Application Version: ${ruoyi.version}
+Spring Boot Version: ${spring-boot.version}
+////////////////////////////////////////////////////////////////////
+//                          _ooOoo_                               //
+//                         o8888888o                              //
+//                         88" . "88                              //
+//                         (| ^_^ |)                              //
+//                         O\  =  /O                              //
+//                      ____/`---'\____                           //
+//                    .'  \\|     |//  `.                         //
+//                   /  \\|||  :  |||//  \                        //
+//                  /  _||||| -:- |||||-  \                       //
+//                  |   | \\\  -  /// |   |                       //
+//                  | \_|  ''\---/''  |   |                       //
+//                  \  .-\__  `-`  ___/-. /                       //
+//                ___`. .'  /--.--\  `. . ___                     //
+//              ."" '<  `.___\_<|>_/___.'  >'"".                  //
+//            | | :  `- \`.;`\ _ /`;.`/ - ` : | |                 //
+//            \  \ `-.   \_ __\ /__ _/   .-` /  /                 //
+//      ========`-.____`-.___\_____/___.-`____.-'========         //
+//                           `=---='                              //
+//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^        //
+//             佛祖保佑       永不宕机      永无BUG               //
+////////////////////////////////////////////////////////////////////

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

@@ -0,0 +1,37 @@
+#错误消息
+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}]

+ 94 - 0
vehicle-sdk/src/main/resources/logback.xml

@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+    <!-- 日志存放路径 -->
+	<property name="log.path" value="/home/base/logs" />
+<!--    <property name="log.path" value="/Users/sunhuanhuan/Documents/project/106/project/logs"/>-->
+    <!-- 日志输出格式 -->
+	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
+
+	<!-- 控制台输出 -->
+	<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+		<encoder>
+			<pattern>${log.pattern}</pattern>
+		</encoder>
+	</appender>
+
+	<!-- 系统日志输出 -->
+	<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
+	    <file>${log.path}/sys-info.log</file>
+        <!-- 循环政策:基于时间创建日志文件 -->
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 日志文件名格式 -->
+			<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
+			<!-- 日志最大的历史 60天 -->
+			<maxHistory>60</maxHistory>
+		</rollingPolicy>
+		<encoder>
+			<pattern>${log.pattern}</pattern>
+		</encoder>
+		<filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <!-- 过滤的级别 -->
+            <level>INFO</level>
+            <!-- 匹配时的操作:接收(记录) -->
+            <onMatch>ACCEPT</onMatch>
+            <!-- 不匹配时的操作:拒绝(不记录) -->
+            <onMismatch>DENY</onMismatch>
+        </filter>
+	</appender>
+
+	<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
+	    <file>${log.path}/sys-error.log</file>
+        <!-- 循环政策:基于时间创建日志文件 -->
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 日志文件名格式 -->
+            <fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
+			<!-- 日志最大的历史 60天 -->
+			<maxHistory>60</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <!-- 过滤的级别 -->
+            <level>ERROR</level>
+			<!-- 匹配时的操作:接收(记录) -->
+            <onMatch>ACCEPT</onMatch>
+			<!-- 不匹配时的操作:拒绝(不记录) -->
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+	<!-- 用户访问日志输出  -->
+    <appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<file>${log.path}/sys-user.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!-- 按天回滚 daily -->
+            <fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
+            <!-- 日志最大的历史 60天 -->
+            <maxHistory>60</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+    </appender>
+
+	<!-- 系统模块日志级别控制  -->
+	<logger name="com.ozs" level="info" />
+	<!-- Spring日志级别控制  -->
+	<logger name="org.springframework" level="warn" />
+
+	<root level="info">
+		<appender-ref ref="console" />
+	</root>
+
+	<!--系统操作日志-->
+    <root level="info">
+        <appender-ref ref="file_info" />
+        <appender-ref ref="file_error" />
+    </root>
+
+	<!--系统用户操作日志-->
+    <logger name="sys-user" level="info">
+        <appender-ref ref="sys-user"/>
+    </logger>
+</configuration>

+ 27 - 0
vehicle-sdk/src/main/resources/mybatis/mybatis-config.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE configuration
+        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-config.dtd">
+<configuration>
+    <!-- 全局参数 -->
+    <settings>
+        <!-- 使全局的映射器启用或禁用缓存 -->
+        <setting name="cacheEnabled"             value="true"   />
+        <!-- 允许JDBC 支持自动生成主键 -->
+        <setting name="useGeneratedKeys"         value="true"   />
+        <!-- 配置默认的执行器.SIMPLE就是普通执行器;REUSE执行器会重用预处理语句(prepared statements);BATCH执行器将重用语句并执行批量更新 -->
+        <setting name="defaultExecutorType"      value="SIMPLE" />
+        <!-- 指定 MyBatis 所用日志的具体实现 -->
+        <setting name="logImpl"                  value="SLF4J"  />
+        <!-- 使用驼峰命名法转换字段 -->
+        <!-- <setting name="mapUnderscoreToCamelCase" value="true"/> -->
+    </settings>
+
+    <plugins>
+        <!--        配置分页插件-->
+        <plugin interceptor="com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor">
+            <property name="@page" value="com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor"/>
+            <property name="page:dbType" value="MYSQL"/>
+        </plugin>
+    </plugins>
+</configuration>