From fc7cd4be1d6335cd3497fe5b1bed1d23eb8d9303 Mon Sep 17 00:00:00 2001
From: liusuyi <1951119284@qq.com>
Date: Fri, 05 Dec 2025 15:38:23 +0800
Subject: [PATCH] 修改盒子名称之前先修改六合盒子名称

---
 ard-work/src/main/java/com/ard/work/service/impl/TyServiceImpl.java |   72 ++++++++++++++++++++++++++++++++---
 1 files changed, 65 insertions(+), 7 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 22b68f0..c9b84d4 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
@@ -29,6 +29,7 @@
 import com.ard.work.domain.cache.UavSignalInfoCache;
 import com.ard.work.domain.cache.UavStateCache;
 import com.ard.work.domain.cache.UavTelemetryDataCache;
+import com.ard.work.domain.cache.UavWaylineCache;
 import com.ard.work.domain.dto.BoxHistoryDTO;
 import com.ard.work.domain.dto.BoxPhotosDTO;
 import com.ard.work.domain.dto.BoxSettingsDTO;
@@ -123,8 +124,8 @@
         if (ardDroneInfo == null) {
             throw new ControlException("未找到对应的飞行器信息,boxSn:{}" + boxSn);
         }
-        
-        
+
+
         TyHttpCommonReceiver<BoxStreamUrlReceiver> boxLiveUrl = tyClient.getBoxLiveUrl(ardDroneInfo.getServerId(),
                 boxSn);
         return boxLiveUrl == null ? null : boxLiveUrl.getContent();
@@ -175,7 +176,7 @@
             throw new ControlException("未找到对应的飞行器信息,boxSn:{}" + boxSn);
         }
         TyHttpCommonReceiver<?> result = tyClient.updateBoxSettings(ardDroneInfo.getServerId(), boxSettingsDTO);
-        return result.getState() == 1;
+        return result.getState() == 0;
     }
 
     /**
@@ -284,6 +285,18 @@
         }
         SpeedControlCmd speedControlCommand = new SpeedControlCmd(speedControlDto);
         this.sendMessage(ardDroneInfo.getServerId(), speedControlCommand);
+        return true;
+    }
+
+    @Override
+    public Boolean formatSdCard(FormatSdCardDTO formatSdCardDTO) {
+        String boxSn = formatSdCardDTO.getBoxSn();
+        ArdDroneInfo ardDroneInfo = ardDroneService.selectArdDroneByboxSn(boxSn);
+        if (ardDroneInfo == null) {
+            throw new ControlException("未找到对应的飞行器信息,boxSn:{}" + boxSn);
+        }
+        FormatSdCardCmd formatSdCardCmd = new FormatSdCardCmd(formatSdCardDTO);
+        this.sendMessage(ardDroneInfo.getServerId(), formatSdCardCmd);
         return true;
     }
 
@@ -584,10 +597,41 @@
         if (ardDroneInfo == null) {
             throw new ControlException("未找到对应的飞行器信息,boxSn:{}" + boxSn);
         }
-        
-        
+
+
         FlyPointControlCancelCmd flyPointControlCancelCmd = new FlyPointControlCancelCmd(flyPointControlCancelDTO);
         this.sendMessage(ardDroneInfo.getServerId(), flyPointControlCancelCmd);
+        return true;
+    }
+
+
+    /**
+     * 环绕飞行控制
+     */
+    @Override
+    public Boolean FlyRoundControl(FlyRoundControlDTO flyRoundControlDTO) {
+        String boxSn = flyRoundControlDTO.getBoxSn();
+        ArdDroneInfo ardDroneInfo = ardDroneService.selectArdDroneByboxSn(boxSn);
+        if (ardDroneInfo == null) {
+            throw new ControlException("未找到对应的飞行器信息,boxSn:{}" + boxSn);
+        }
+        FlyRoundControlCmd flyRoundControlCmd = new FlyRoundControlCmd(flyRoundControlDTO);
+        this.sendMessage(ardDroneInfo.getServerId(), flyRoundControlCmd);
+        return true;
+    }
+
+    /**
+     * 停止环绕飞行控制
+     */
+    @Override
+    public Boolean FlyRoundControlCancel(FlyRoundControlCancelDTO flyRoundControlCancelDTO) {
+        String boxSn = flyRoundControlCancelDTO.getBoxSn();
+        ArdDroneInfo ardDroneInfo = ardDroneService.selectArdDroneByboxSn(boxSn);
+        if (ardDroneInfo == null) {
+            throw new ControlException("未找到对应的飞行器信息,boxSn:{}" + boxSn);
+        }
+        FlyRoundControlCancelCmd flyRoundControlCancelCmd = new FlyRoundControlCancelCmd(flyRoundControlCancelDTO);
+        this.sendMessage(ardDroneInfo.getServerId(), flyRoundControlCancelCmd);
         return true;
     }
 
@@ -602,8 +646,8 @@
         if (ardDroneInfo == null) {
             throw new ControlException("未找到对应的飞行器信息,boxSn:{}" + boxSn);
         }
-        
-        
+
+
         EmergencyBrakeCmd emergencyBrakeCmd = new EmergencyBrakeCmd(emeragencyBrakeDTO);
         this.sendMessage(ardDroneInfo.getServerId(), emergencyBrakeCmd);
         return true;
@@ -750,7 +794,10 @@
             throw new ControlException("未找到对应的飞行器信息,boxSn:{}" + boxSn);
         }
         //wayLineUploadDTO.setWayLineData(this.CreatePlanLineData());//设置航线数据
+        System.out.println("wayLineUploadDTO:-----------------" + wayLineUploadDTO);
+        log.info("打印数据 ++++ wayLineUploadDTO:-----------------" + wayLineUploadDTO);
         WayLineUploadCmd wayLineUploadCmd = new WayLineUploadCmd(wayLineUploadDTO);
+        System.out.println("wayLineUploadCmd:-----------------" + wayLineUploadCmd);
         this.sendMessage(ardDroneInfo.getServerId(), wayLineUploadCmd);
         return true;
     }
@@ -932,6 +979,11 @@
                     FlyWayEndReplyCmd flyWayEndReplyCmd = (FlyWayEndReplyCmd) tyCommand;
                     logPrint("无人机飞行结束", flyWayEndReplyCmd.getResult(), flyWayEndReplyCmd.getErrorCode());
                 }
+                //格式化存储卡
+                if (tyCommand instanceof FormatSdCardReplyCmd) {
+                    FormatSdCardReplyCmd formatSdCardReplyCmd = (FormatSdCardReplyCmd) tyCommand;
+                    logPrint("格式化存储卡", formatSdCardReplyCmd.getResult(), formatSdCardReplyCmd.getErrorCode());
+                }
                 if (tyCommand instanceof CapturePicReplyCmd) {
                     CapturePicReplyCmd capturePicReplyCommand = (CapturePicReplyCmd) tyCommand;
                     logPrint("无人机拍照", capturePicReplyCommand.getResult(), capturePicReplyCommand.getErrorCode());
@@ -1022,6 +1074,12 @@
                     logPrint("设置返航点", returnPointSettingReplyCmd.getResult(),
                             returnPointSettingReplyCmd.getErrorCode());
                 }
+                //到达环绕位置回复
+                if (tyCommand instanceof FlyRoundReplyCmd) {
+                    FlyRoundReplyCmd flyRoundReplyCmd = (FlyRoundReplyCmd) tyCommand;
+                    logPrint("到达环绕位置", flyRoundReplyCmd.getResult(),
+                            flyRoundReplyCmd.getErrorCode());
+                }
                 break;
             case (byte) 0xD2:
                 //设置视频码流回复

--
Gitblit v1.9.3