From 49c807f8c2e80cc012ed755acbe1308c5de0c65c Mon Sep 17 00:00:00 2001
From: liusuyi <1951119284@qq.com>
Date: Wed, 24 Dec 2025 11:45:29 +0800
Subject: [PATCH] 增加任务视频 优化权限

---
 ard-work/src/main/java/com/ard/work/service/impl/TyServiceImpl.java |   28 +++++++++++++++++++++++-----
 1 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/ard-work/src/main/java/com/ard/work/service/impl/TyServiceImpl.java b/ard-work/src/main/java/com/ard/work/service/impl/TyServiceImpl.java
index 3d134e3..c6a0d66 100644
--- a/ard-work/src/main/java/com/ard/work/service/impl/TyServiceImpl.java
+++ b/ard-work/src/main/java/com/ard/work/service/impl/TyServiceImpl.java
@@ -33,6 +33,7 @@
 import com.ard.work.domain.dto.BoxHistoryDTO;
 import com.ard.work.domain.dto.BoxPhotosDTO;
 import com.ard.work.domain.dto.BoxSettingsDTO;
+import com.ard.work.domain.dto.BoxVideosDTO;
 import com.ard.work.domain.dto.camera.*;
 import com.ard.work.domain.dto.control.AbsAngleControlDTO;
 import com.ard.work.domain.dto.control.AngleControlDTO;
@@ -157,7 +158,7 @@
     }
 
     /**
-     * 获取盒子图片
+     * 获取任务图片
      *
      * @return List<BoxPhotosReceiver>
      */
@@ -172,7 +173,22 @@
                 boxPhotosDTO);
         return boxPhotos == null ? null : boxPhotos.getContent();
     }
-
+    /**
+     * 获取任务视频
+     *
+     * @return List<BoxVideosReceiver>
+     */
+    @Override
+    public List<BoxVideosReceiver> getBoxVideos(BoxVideosDTO boxVideosDTO) {
+        String boxSn = boxVideosDTO.getBoxSn();
+        ArdDroneInfo ardDroneInfo = ardDroneService.selectArdDroneByboxSn(boxSn);
+        if (ardDroneInfo == null) {
+            throw new ControlException("未找到对应的飞行器信息,boxSn:{}" + boxSn);
+        }
+        TyHttpCommonReceiver<List<BoxVideosReceiver>> boxVideos = tyClient.getBoxVideos(ardDroneInfo.getServerId(),
+                boxVideosDTO);
+        return boxVideos == null ? null : boxVideos.getContent();
+    }
     /**
      * 修改云盒设置
      */
@@ -336,9 +352,10 @@
             throw new ControlException("未找到对应的飞行器信息,boxSn:{}" + boxSn);
         }
         //设置相机模式为拍照模式
-        updateCameraMode(CameraModeDTO.builder().boxSn(capturePicDto.getBoxSn()).actionParam((byte) 0x01).build());
+        //updateCameraMode(CameraModeDTO.builder().boxSn(capturePicDto.getBoxSn()).actionParam((byte) 0x01).build());
         //设置拍照回传
-        photoReturnToggle(PhotoReturnToggleDTO.builder().boxSn(capturePicDto.getBoxSn()).actionParam((byte) 0x01).build());
+        //photoReturnToggle(PhotoReturnToggleDTO.builder().boxSn(capturePicDto.getBoxSn()).actionParam((byte) 0x01)
+        // .build());
 
         CapturePicCmd capturePicCommand = new CapturePicCmd(capturePicDto);
         this.sendMessage(ardDroneInfo.getServerId(), capturePicCommand);
@@ -358,7 +375,7 @@
         }
         BaseCmd baseCmd;
         if (recordDto.getIsRecord()) {
-            updateCameraMode(CameraModeDTO.builder().boxSn(recordDto.getBoxSn()).actionParam((byte) 0x02).build());
+            //updateCameraMode(CameraModeDTO.builder().boxSn(recordDto.getBoxSn()).actionParam((byte) 0x02).build());
             baseCmd = new RecordStartCmd(recordDto);
         } else {
             baseCmd = new RecordStopCmd(recordDto);
@@ -957,6 +974,7 @@
                 // 处理无人机遥测消息
                 UavTelemetryDataCmd uavTelemetryDataCmd = (UavTelemetryDataCmd) tyCommand;
                 TelemetryData telemetryData = uavTelemetryDataCmd.getTelemetryData();
+                telemetryData.setTimestamp(System.currentTimeMillis());//由于六合提供的状态时间戳不准,先以接收状态作为时间戳
                 UavTelemetryDataCache.put(telemetryData);
                 //logPrint("无人机遥测", uavTelemetryDataCmd.getTelemetryData().getBoxSn());
                 //WebSocketUtil.sendMessageAll(uavTelemetryDataCmd.getTelemetryData());

--
Gitblit v1.9.3