From 6f4bba5d1c3444af4a7975b6b7601584c373d65d Mon Sep 17 00:00:00 2001
From: zhaowenyu <35589726@qq.com>
Date: Sat, 06 Dec 2025 15:27:45 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev

---
 ard-vtdu/src/main/java/com/ard/vtdu/service/impl/ArdArdMediaServiceImpl.java          |    7 +++
 ard-work/src/main/java/com/ard/work/service/impl/ArdFlightTaskServiceServiceImpl.java |    4 ++
 ard-work/src/main/java/com/ard/work/domain/entity/ArdDroneInfo.java                   |    5 --
 ard-work/src/main/resources/mapper/ArdFlightTaskMapper.xml                            |   20 ++++++++++
 ard-work/src/main/java/com/ard/work/service/impl/ArdDroneInfoServiceImpl.java         |    7 ++-
 ard-system/src/main/java/com/ard/data/model/domain/ArdModel.java                      |    8 ++--
 ard-work/src/main/java/com/ard/work/service/impl/TyServiceImpl.java                   |    2 
 ard-work/src/main/java/com/ard/work/domain/entity/ArdFlightTask.java                  |    4 ++
 ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml                             |    9 ----
 9 files changed, 45 insertions(+), 21 deletions(-)

diff --git a/ard-system/src/main/java/com/ard/data/model/domain/ArdModel.java b/ard-system/src/main/java/com/ard/data/model/domain/ArdModel.java
index 8488424..9e6416b 100644
--- a/ard-system/src/main/java/com/ard/data/model/domain/ArdModel.java
+++ b/ard-system/src/main/java/com/ard/data/model/domain/ArdModel.java
@@ -25,19 +25,19 @@
 
     /** 经度 */
     @Excel(name = "经度")
-    private Long longitude;
+    private Double longitude;
 
     /** 纬度 */
     @Excel(name = "纬度")
-    private Long latitude;
+    private Double latitude;
 
     /** 高度 */
     @Excel(name = "高度")
-    private Long height;
+    private Double height;
 
     /** 比例 */
     @Excel(name = "比例")
-    private Long proportion;
+    private Double proportion;
 
     /** 模型路径 */
     @Excel(name = "模型路径")
diff --git a/ard-vtdu/src/main/java/com/ard/vtdu/service/impl/ArdArdMediaServiceImpl.java b/ard-vtdu/src/main/java/com/ard/vtdu/service/impl/ArdArdMediaServiceImpl.java
index c4e181f..533f3bc 100644
--- a/ard-vtdu/src/main/java/com/ard/vtdu/service/impl/ArdArdMediaServiceImpl.java
+++ b/ard-vtdu/src/main/java/com/ard/vtdu/service/impl/ArdArdMediaServiceImpl.java
@@ -61,6 +61,9 @@
 
             Conf conf = new Conf();
             conf.setSource(ardVtdu.getRtspSource());
+            if(!"publisher".equalsIgnoreCase(conf.getSource())) {
+                conf.setSourceOnDemand(true);
+            }
             conf.setRunOnDemandRestart(false);
             conf.setRunOnDemandCloseAfter("5s");
             conf.setMaxReaders(100);
@@ -96,7 +99,9 @@
             Conf conf = new Conf();
             conf.setSource(ardVtdu.getRtspSource());
             conf.setName(ardVtdu.getName());
-            conf.setRunOnDemand("");
+            if(!"publisher".equalsIgnoreCase(conf.getSource())) {
+                conf.setSourceOnDemand(true);
+            }
             conf.setRunOnDemandRestart(false);
             conf.setRunOnDemandCloseAfter("5s");
             conf.setMaxReaders(100);
diff --git a/ard-work/src/main/java/com/ard/work/domain/entity/ArdDroneInfo.java b/ard-work/src/main/java/com/ard/work/domain/entity/ArdDroneInfo.java
index 80a43c9..f04f06a 100644
--- a/ard-work/src/main/java/com/ard/work/domain/entity/ArdDroneInfo.java
+++ b/ard-work/src/main/java/com/ard/work/domain/entity/ArdDroneInfo.java
@@ -96,11 +96,6 @@
     @Excel(name = "服务器管理ID")
     private String serverId;
 
-    /**
-     * 盒子别名
-     */
-    @Excel(name = "盒子别名")
-    private String boxAliasName;
 
     /**
      * 服务器实体对象
diff --git a/ard-work/src/main/java/com/ard/work/domain/entity/ArdFlightTask.java b/ard-work/src/main/java/com/ard/work/domain/entity/ArdFlightTask.java
index 62a8d23..0556aba 100644
--- a/ard-work/src/main/java/com/ard/work/domain/entity/ArdFlightTask.java
+++ b/ard-work/src/main/java/com/ard/work/domain/entity/ArdFlightTask.java
@@ -25,6 +25,10 @@
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date endTime;               // 任务结束时间
     private Long duration;              // 持续时长(单位:秒)
+    private Integer flightDuration;     // 飞行时长(单位:秒)
+    private Integer flightMileage;      // 飞行里程
+    private Float aveSpeed;             // 平均速度
+    private Float maxSpeed;             // 最大速度
     private String serverId;            // 服务器ID
 
     // 计算持续时长,单位:秒
diff --git a/ard-work/src/main/java/com/ard/work/service/impl/ArdDroneInfoServiceImpl.java b/ard-work/src/main/java/com/ard/work/service/impl/ArdDroneInfoServiceImpl.java
index 09b3fdc..051b21b 100644
--- a/ard-work/src/main/java/com/ard/work/service/impl/ArdDroneInfoServiceImpl.java
+++ b/ard-work/src/main/java/com/ard/work/service/impl/ArdDroneInfoServiceImpl.java
@@ -8,13 +8,13 @@
 import com.ard.common.utils.DateUtils;
 import com.ard.common.utils.uuid.IdUtils;
 import com.ard.system.authorize.service.AuthorizeService;
+import com.ard.work.domain.dto.BoxSettingsDTO;
 import com.ard.work.domain.entity.ArdDroneInfo;
 import com.ard.work.domain.receiver.BoxInfoReceiver;
 import com.ard.work.domain.receiver.BoxStreamUrlReceiver;
 import com.ard.work.mapper.ArdDroneInfoMapper;
 import com.ard.work.service.IArdDroneInfoService;
 import com.ard.work.service.ITyService;
-import com.ard.work.util.UtilMethod;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
@@ -113,6 +113,10 @@
      */
     @Override
     public int updateArdDrone(ArdDroneInfo ArdDroneInfo) {
+        Boolean b = tyService.updateBoxSettings(BoxSettingsDTO.builder().boxSn(ArdDroneInfo.getBoxSn()).boxName(ArdDroneInfo.getBoxName()).build());
+        if (!b) {
+            throw new ServiceException("修改无人机盒子名称失败");
+        }
         ArdDroneInfo.setUpdateTime(DateUtils.getNowDate());
         return ArdDroneInfoMapper.updateArdDrone(ArdDroneInfo);
     }
@@ -236,7 +240,6 @@
         drone.setId(IdUtils.simpleUUID());
         drone.setBoxSn(box.getBoxSn());
         drone.setBoxName(box.getBoxName());
-        drone.setBoxAliasName(box.getBoxName());
         drone.setStartTime(new Date());
         drone.setOnLine(box.getOnLine());
         drone.setVideoServer(box.getVideoServer());
diff --git a/ard-work/src/main/java/com/ard/work/service/impl/ArdFlightTaskServiceServiceImpl.java b/ard-work/src/main/java/com/ard/work/service/impl/ArdFlightTaskServiceServiceImpl.java
index 4365828..70f86ab 100644
--- a/ard-work/src/main/java/com/ard/work/service/impl/ArdFlightTaskServiceServiceImpl.java
+++ b/ard-work/src/main/java/com/ard/work/service/impl/ArdFlightTaskServiceServiceImpl.java
@@ -135,6 +135,10 @@
                     .serverId(serverId)
                     .startTime(DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, boxHistoryReceiver.getStartTime()))
                     .endTime(DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, boxHistoryReceiver.getEndTime()))
+                    .flightMileage(boxHistoryReceiver.getFlightMileage())
+                    .flightDuration(boxHistoryReceiver.getFlightDuration())
+                    .aveSpeed(boxHistoryReceiver.getAveSpeed())
+                    .maxSpeed(boxHistoryReceiver.getMaxSpeed())
                     .build();
 
             Long flyUserId = uavControlService.getCurrentController(flightTask.getBoxSn(), "fly");
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 31228ab..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
@@ -176,7 +176,7 @@
             throw new ControlException("未找到对应的飞行器信息,boxSn:{}" + boxSn);
         }
         TyHttpCommonReceiver<?> result = tyClient.updateBoxSettings(ardDroneInfo.getServerId(), boxSettingsDTO);
-        return result.getState() == 1;
+        return result.getState() == 0;
     }
 
     /**
diff --git a/ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml b/ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml
index 71440a6..ed3958f 100644
--- a/ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml
+++ b/ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml
@@ -16,7 +16,6 @@
         <result property="lastTaskId"    column="last_task_id"    />
         <result property="userId"    column="user_id"    />
         <result property="deptId"    column="dept_id"    />
-        <result property="boxAliasName"    column="box_alias_name"    />
         <result property="createBy"    column="create_by"    />
         <result property="createTime"    column="create_time"    />
         <result property="updateBy"    column="update_by"    />
@@ -48,8 +47,7 @@
                c.last_task_id,
                c.server_id,
                c.user_id,
-               c.dept_id,
-               c.box_alias_name
+               c.dept_id
         from ard_drone c
                  left join sys_dept d on d.dept_id = c.dept_id
                  left join sys_user u on u.user_id = c.user_id
@@ -96,7 +94,6 @@
             <if test="serverId != null">server_id,</if>
             <if test="userId != null">user_id,</if>
             <if test="deptId != null">dept_id,</if>
-            <if test="boxAliasName != null">box_alias_name,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
@@ -116,7 +113,6 @@
             <if test="serverId != null">#{serverId},</if>
             <if test="userId != null">#{userId},</if>
             <if test="deptId != null">#{deptId},</if>
-            <if test="boxAliasName != null">#{boxAliasName},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
@@ -139,7 +135,6 @@
             <if test="serverId != null">server_id = #{serverId},</if>
             <if test="userId != null">user_id = #{userId},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
-            <if test="boxAliasName != null">box_alias_name = #{boxAliasName},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
@@ -174,7 +169,6 @@
             server_id,
             user_id,
             dept_id,
-            box_alias_name,
             create_by,
             create_time,
             update_by,
@@ -194,7 +188,6 @@
             #{item.serverId},
             #{item.userId},
             #{item.deptId},
-            #{item.boxAliasName},
             #{item.createBy},
             #{item.createTime},
             #{item.updateBy},
diff --git a/ard-work/src/main/resources/mapper/ArdFlightTaskMapper.xml b/ard-work/src/main/resources/mapper/ArdFlightTaskMapper.xml
index dae11c0..51b88d3 100644
--- a/ard-work/src/main/resources/mapper/ArdFlightTaskMapper.xml
+++ b/ard-work/src/main/resources/mapper/ArdFlightTaskMapper.xml
@@ -14,6 +14,10 @@
         <result property="videoPath" column="video_path"/>
         <result property="startTime" column="start_time"/>
         <result property="endTime" column="end_time"/>
+        <result property="flightDuration" column="flight_duration"/>
+        <result property="flightMileage" column="flight_mileage"/>
+        <result property="aveSpeed" column="ave_speed"/>
+        <result property="maxSpeed" column="max_speed"/>
         <result property="serverId" column="server_id"/>
         <result property="createBy" column="create_by"/>
         <result property="createTime" column="create_time"/>
@@ -33,6 +37,10 @@
         aft.video_path,
         aft.start_time,
         aft.end_time,
+        aft.flight_duration,
+        aft.flight_mileage,
+        aft.ave_speed,
+        aft.max_speed,
         aft.server_id,
         aft.create_by,
         aft.create_time,
@@ -67,6 +75,10 @@
             <if test="videoPath != null">video_path,</if>
             <if test="startTime != null">start_time,</if>
             <if test="endTime != null">end_time,</if>
+            <if test="flightDuration != null">flight_duration,</if>
+            <if test="flightMileage != null">flight_mileage,</if>
+            <if test="aveSpeed != null">ave_speed,</if>
+            <if test="maxSpeed != null">max_speed,</if>
             <if test="serverId != null">server_id,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
@@ -84,6 +96,10 @@
             <if test="videoPath != null">#{videoPath},</if>
             <if test="startTime != null">#{startTime},</if>
             <if test="endTime != null">#{endTime},</if>
+            <if test="flightDuration != null">#{flightDuration},</if>
+            <if test="flightMileage != null">#{flightMileage},</if>
+            <if test="aveSpeed != null">#{aveSpeed},</if>
+            <if test="maxSpeed != null">#{maxSpeed},</if>
             <if test="serverId != null">#{serverId},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
@@ -105,6 +121,10 @@
             <if test="videoPath != null">video_path = #{videoPath},</if>
             <if test="startTime != null">start_time = #{startTime},</if>
             <if test="endTime != null">end_time = #{endTime},</if>
+            <if test="flightDuration != null">flight_duration = #{flightDuration},</if>
+            <if test="flightMileage != null">flight_mileage = #{flightMileage},</if>
+            <if test="aveSpeed != null">ave_speed = #{aveSpeed},</if>
+            <if test="maxSpeed != null">max_speed = #{maxSpeed},</if>
             <if test="serverId != null">server_id = #{serverId},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>

--
Gitblit v1.9.3