From 6b4380956666f47a055493dd2c064148e5b7e94a Mon Sep 17 00:00:00 2001
From: Xiajijian <1176061145@qq.com>
Date: Mon, 13 Oct 2025 15:12:53 +0800
Subject: [PATCH] 1.增加注释,修改字段名称和代码格式。 2.合并无人机盒子和无人机管理代码。 3.地图管理和tile管理增加字段名称。 4.增加根据boxSn获取六合盒子列表接口。
---
/dev/null | 109 ---------------------
ard-work/src/main/java/com/ard/work/service/impl/ArdDroneServiceImpl.java | 11 +-
ard-system/src/main/resources/mapper/system/ArdMapManagementMapper.xml | 12 ++
ard-work/src/main/java/com/ard/work/mapper/ArdDroneInfoMapper.java | 1
ard-system/src/main/java/com/ard/data/domain/ArdTileManagement.java | 23 ++++
ard-system/src/main/resources/mapper/system/ArdTileManagementMapper.xml | 32 ++++++
ard-work/src/main/java/com/ard/work/service/impl/TyServiceImpl.java | 42 +++++--
ard-work/src/main/resources/mapper/ArdServerInfoMapper.xml | 1
ard-system/src/main/java/com/ard/data/domain/ArdMapManagement.java | 8 +
ard-admin/src/main/java/com/ard/web/controller/work/UavBaseController.java | 14 ++
ard-work/src/main/java/com/ard/work/service/ITyService.java | 6 +
ard-work/src/main/java/com/ard/work/service/IArdDroneService.java | 20 ++-
12 files changed, 140 insertions(+), 139 deletions(-)
diff --git a/ard-admin/src/main/java/com/ard/web/controller/work/UavBaseController.java b/ard-admin/src/main/java/com/ard/web/controller/work/UavBaseController.java
index 6a97548..06cc14a 100644
--- a/ard-admin/src/main/java/com/ard/web/controller/work/UavBaseController.java
+++ b/ard-admin/src/main/java/com/ard/web/controller/work/UavBaseController.java
@@ -43,10 +43,9 @@
@ApiOperationSupport(order = 2)
@GetMapping("/getBoxList")
public AjaxResult getBoxList() {
- List<BoxInfoReceiver> BoxList = tyService.getBoxList();
- return AjaxResult.success(BoxList);
+ List<BoxInfoReceiver> boxList = tyService.getBoxList();
+ return AjaxResult.success(boxList);
}
-
@ApiOperation("获取飞行历史")
@ApiOperationSupport(order = 3)
@@ -73,10 +72,19 @@
}
@ApiOperation("修改云盒设置")
+ @ApiOperationSupport(order = 6)
@PostMapping("/updateBoxSettings")
public AjaxResult updateBoxSettings(@RequestBody BoxSettingsDTO boxSettingsDTO) {
Boolean state = tyService.updateBoxSettings(boxSettingsDTO);
return AjaxResult.success(state);
}
+ @ApiOperation("根据boxSn获取六合盒子列表")
+ @ApiOperationSupport(order = 7)
+ @GetMapping("/getBoxSnToList")
+ public AjaxResult getBoxSnToList(String boxSn) {
+ List<BoxInfoReceiver> boxList = tyService.getBoxSnToList(boxSn);
+ return AjaxResult.success(boxList);
+ }
+
}
\ No newline at end of file
diff --git a/ard-admin/src/main/java/com/ard/web/controller/work/uav/UavBoxController.java b/ard-admin/src/main/java/com/ard/web/controller/work/uav/UavBoxController.java
deleted file mode 100644
index 4c4718f..0000000
--- a/ard-admin/src/main/java/com/ard/web/controller/work/uav/UavBoxController.java
+++ /dev/null
@@ -1,109 +0,0 @@
-package com.ard.web.controller.work.uav;
-
-import java.util.List;
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
-
-import com.ard.work.domain.entity.ArdDroneInfo;
-import com.ard.work.service.IArdDroneService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.ard.common.annotation.Log;
-import com.ard.common.core.controller.BaseController;
-import com.ard.common.core.domain.AjaxResult;
-import com.ard.common.enums.BusinessType;
-import com.ard.common.utils.poi.ExcelUtil;
-import com.ard.common.core.page.TableDataInfo;
-
-/**
- * 无人机盒子Controller
- *
- * @author ruoyi
- * @date 2025-03-04
- */
-@Api(tags = "无人机盒子")
-@RestController
-@RequestMapping("/uav/box")
-public class UavBoxController extends BaseController {
-
- @Resource
- private IArdDroneService ardDroneService;
-
- /**
- * 查询无人机盒子列表
- */
- @ApiOperation("查询无人机盒子列表")
- @PreAuthorize("@ss.hasPermi('uav:box:list')")
- @GetMapping("/list")
- public TableDataInfo list(ArdDroneInfo ArdDroneInfo)
- {
- startPage();
- List<ArdDroneInfo> list = ardDroneService.selectArdDroneList(ArdDroneInfo);
- return getDataTable(list);
- }
-
- /**
- * 导出无人机盒子列表
- */
- @PreAuthorize("@ss.hasPermi('uav:box:export')")
- @Log(title = "无人机盒子", businessType = BusinessType.EXPORT)
- @PostMapping("/export")
- public void export(HttpServletResponse response, ArdDroneInfo ArdDroneInfo) {
- List<ArdDroneInfo> list = ardDroneService.selectArdDroneList(ArdDroneInfo);
- ExcelUtil<ArdDroneInfo> util = new ExcelUtil<ArdDroneInfo>(ArdDroneInfo.class);
- util.exportExcel(response, list, "无人机盒子数据");
- }
-
- /**
- * 获取无人机盒子详细信息
- */
- @ApiOperation("获取无人机盒子详细信息")
- @PreAuthorize("@ss.hasPermi('uav:box:query')")
- @GetMapping(value = "/{id}")
- public AjaxResult getInfo(@PathVariable("id") String id) {
- return success(ardDroneService.selectArdDroneById(id));
- }
-
- /**
- * 新增无人机盒子
- */
- @ApiOperation("新增无人机盒子")
- @PreAuthorize("@ss.hasPermi('uav:box:add')")
- @Log(title = "无人机盒子", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody ArdDroneInfo ardDroneInfo) {
- return toAjax(ardDroneService.insertArdDrone(ardDroneInfo));
- }
-
- /**
- * 修改无人机盒子
- */
- @ApiOperation("修改无人机盒子")
- @PreAuthorize("@ss.hasPermi('uav:box:edit')")
- @Log(title = "无人机盒子", businessType = BusinessType.UPDATE)
- @PutMapping
- public AjaxResult edit(@RequestBody ArdDroneInfo ArdDroneInfo) {
- return toAjax(ardDroneService.updateArdDrone(ArdDroneInfo));
- }
-
- /**
- * 删除无人机盒子
- */
- @ApiOperation("删除无人机盒子")
- @PreAuthorize("@ss.hasPermi('uav:box:remove')")
- @Log(title = "无人机盒子", businessType = BusinessType.DELETE)
- @DeleteMapping("/{ids}")
- public AjaxResult remove(@PathVariable String[] ids) {
- return toAjax(ardDroneService.deleteArdDroneByIds(ids));
- }
-
-}
diff --git a/ard-system/src/main/java/com/ard/data/domain/ArdMapManagement.java b/ard-system/src/main/java/com/ard/data/domain/ArdMapManagement.java
index a45eac8..b5b0fc0 100644
--- a/ard-system/src/main/java/com/ard/data/domain/ArdMapManagement.java
+++ b/ard-system/src/main/java/com/ard/data/domain/ArdMapManagement.java
@@ -34,4 +34,12 @@
@Excel(name = "发布状态")
private String releaseStatus;
+ /** 默认加载 */
+ @Excel(name = "默认加载")
+ private String defaultLoading;
+
+ /** 路径 */
+ @Excel(name = "路径")
+ private String mapPath;
+
}
diff --git a/ard-system/src/main/java/com/ard/data/domain/ArdTileManagement.java b/ard-system/src/main/java/com/ard/data/domain/ArdTileManagement.java
index baa8399..7002491 100644
--- a/ard-system/src/main/java/com/ard/data/domain/ArdTileManagement.java
+++ b/ard-system/src/main/java/com/ard/data/domain/ArdTileManagement.java
@@ -30,4 +30,27 @@
@Excel(name = "tile地址")
private String tileAddress;
+ /** 屏幕空间误差 */
+ @Excel(name = "屏幕空间误差")
+ private Double screenSpaceError;
+
+ /** 内存最大使用量 */
+ @Excel(name = "内存最大使用量")
+ private Double maximumMemoryUsage;
+
+ /** 自动超清化模型 */
+ @Excel(name = "自动超清化模型")
+ private Double automaticSuperCleaningModel;
+
+ /** 加载速度 */
+ @Excel(name = "加载速度")
+ private Double loadingSpeed;
+
+ /** 用户ID */
+ @Excel(name = "用户ID")
+ private Long userId;
+
+ /** 部门ID */
+ @Excel(name = "部门ID")
+ private Long deptId;
}
diff --git a/ard-system/src/main/resources/mapper/system/ArdMapManagementMapper.xml b/ard-system/src/main/resources/mapper/system/ArdMapManagementMapper.xml
index 229d2f8..ca4da9f 100644
--- a/ard-system/src/main/resources/mapper/system/ArdMapManagementMapper.xml
+++ b/ard-system/src/main/resources/mapper/system/ArdMapManagementMapper.xml
@@ -10,6 +10,8 @@
<result property="mapType" column="map_type" />
<result property="fileName" column="file_name" />
<result property="releaseStatus" column="release_status" />
+ <result property="defaultLoading" column="default_loading" />
+ <result property="mapPath" column="map_path" />
</resultMap>
<sql id="selectArdMapManagementVo">
@@ -17,7 +19,9 @@
map_name,
map_type,
file_name,
- release_status
+ release_status,
+ default_loading,
+ map_path
from ard_map_management
</sql>
@@ -44,6 +48,8 @@
<if test="mapType != null">map_type,</if>
<if test="fileName != null">file_name,</if>
<if test="releaseStatus != null">release_status,</if>
+ <if test="defaultLoading != null">default_loading,</if>
+ <if test="mapPath != null">map_path,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
@@ -51,6 +57,8 @@
<if test="mapType != null">#{mapType},</if>
<if test="fileName != null">#{fileName},</if>
<if test="releaseStatus != null">#{releaseStatus},</if>
+ <if test="defaultLoading != null">#{defaultLoading},</if>
+ <if test="mapPath != null">#{mapPath},</if>
</trim>
</insert>
@@ -61,6 +69,8 @@
<if test="mapType != null">map_type = #{mapType},</if>
<if test="fileName != null">file_name = #{fileName},</if>
<if test="releaseStatus != null">release_status = #{releaseStatus},</if>
+ <if test="defaultLoading != null">default_loading = #{defaultLoading},</if>
+ <if test="mapPath != null">map_path = #{mapPath},</if>
</trim>
where id = #{id}
</update>
diff --git a/ard-system/src/main/resources/mapper/system/ArdTileManagementMapper.xml b/ard-system/src/main/resources/mapper/system/ArdTileManagementMapper.xml
index 053b737..e82120a 100644
--- a/ard-system/src/main/resources/mapper/system/ArdTileManagementMapper.xml
+++ b/ard-system/src/main/resources/mapper/system/ArdTileManagementMapper.xml
@@ -9,13 +9,25 @@
<result property="tilesName" column="tiles_name" />
<result property="tilesHeight" column="tiles_height" />
<result property="tileAddress" column="tile_address" />
+ <result property="screenSpaceError" column="screen_space_error" />
+ <result property="maximumMemoryUsage" column="maximum_memory_usage" />
+ <result property="automaticSuperCleaningModel" column="automatic_super_cleaning_model" />
+ <result property="loadingSpeed" column="loading_speed" />
+ <result property="userId" column="user_id" />
+ <result property="deptId" column="dept_id" />
</resultMap>
<sql id="selectArdTileManagementVo">
select id,
tiles_name,
tiles_height,
- tile_address
+ tile_address,
+ screen_space_error,
+ maximum_memory_usage,
+ automatic_super_cleaning_model,
+ loading_speed,
+ user_id,
+ dept_id
from ard_tile_management
</sql>
@@ -40,12 +52,24 @@
<if test="tilesName != null">tiles_name,</if>
<if test="tilesHeight != null">tiles_height,</if>
<if test="tileAddress != null">tile_address,</if>
+ <if test="screenSpaceError != null">screen_space_error,</if>
+ <if test="maximumMemoryUsage != null">maximum_memory_usage,</if>
+ <if test="automaticSuperCleaningModel != null">automatic_super_cleaning_model,</if>
+ <if test="loadingSpeed != null">loading_speed,</if>
+ <if test="userId != null">user_id,</if>
+ <if test="deptId != null">dept_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="tilesName != null">#{tilesName},</if>
<if test="tilesHeight != null">#{tilesHeight},</if>
<if test="tileAddress != null">#{tileAddress},</if>
+ <if test="screenSpaceError != null">#{screenSpaceError},</if>
+ <if test="maximumMemoryUsage != null">#{maximumMemoryUsage},</if>
+ <if test="automaticSuperCleaningModel != null">#{automaticSuperCleaningModel},</if>
+ <if test="loadingSpeed != null">#{loadingSpeed},</if>
+ <if test="userId != null">#{userId},</if>
+ <if test="deptId != null">#{deptId},</if>
</trim>
</insert>
@@ -55,6 +79,12 @@
<if test="tilesName != null">tiles_name = #{tilesName},</if>
<if test="tilesHeight != null">tiles_height = #{tilesHeight},</if>
<if test="tileAddress != null">tile_address = #{tileAddress},</if>
+ <if test="screenSpaceError != null">screen_space_error = #{screenSpaceError},</if>
+ <if test="maximumMemoryUsage != null">maximum_memory_usage = #{maximumMemoryUsage},</if>
+ <if test="automaticSuperCleaningModel != null">automatic_super_cleaning_model = #{automaticSuperCleaningModel},</if>
+ <if test="loadingSpeed != null">loading_speed = #{loadingSpeed},</if>
+ <if test="userId != null">user_id = #{userId},</if>
+ <if test="deptId != null">dept_id = #{deptId},</if>
</trim>
where id = #{id}
</update>
diff --git a/ard-work/src/main/java/com/ard/work/mapper/ArdDroneInfoMapper.java b/ard-work/src/main/java/com/ard/work/mapper/ArdDroneInfoMapper.java
index a8b760f..5562fc4 100644
--- a/ard-work/src/main/java/com/ard/work/mapper/ArdDroneInfoMapper.java
+++ b/ard-work/src/main/java/com/ard/work/mapper/ArdDroneInfoMapper.java
@@ -66,4 +66,5 @@
* @return 结果
*/
int deleteArdDroneByIds(String[] ids);
+
}
diff --git a/ard-work/src/main/java/com/ard/work/service/IArdDroneService.java b/ard-work/src/main/java/com/ard/work/service/IArdDroneService.java
index cbc9b01..f3ab842 100644
--- a/ard-work/src/main/java/com/ard/work/service/IArdDroneService.java
+++ b/ard-work/src/main/java/com/ard/work/service/IArdDroneService.java
@@ -21,30 +21,38 @@
* @return 无人机盒子
*/
public ArdDroneInfo selectArdDroneById(String id);
+
+ /**
+ * 查询无人机盒子
+ *
+ * @param boxSn 云盒SN编号
+ * @return 无人机盒子
+ */
public ArdDroneInfo selectArdDroneByboxSn(String boxSn);
+
/**
* 查询无人机盒子列表
*
- * @param ArdDroneInfo 无人机盒子
+ * @param ardDroneInfo 无人机盒子
* @return 无人机盒子集合
*/
- public List<ArdDroneInfo> selectArdDroneList(ArdDroneInfo ArdDroneInfo);
+ public List<ArdDroneInfo> selectArdDroneList(ArdDroneInfo ardDroneInfo);
/**
* 新增无人机盒子
*
- * @param ArdDroneInfo 无人机盒子
+ * @param ardDroneInfo 无人机盒子
* @return 结果
*/
- public int insertArdDrone(ArdDroneInfo ArdDroneInfo);
+ public int insertArdDrone(ArdDroneInfo ardDroneInfo);
/**
* 修改无人机盒子
*
- * @param ArdDroneInfo 无人机盒子
+ * @param ardDroneInfo 无人机盒子
* @return 结果
*/
- public int updateArdDrone(ArdDroneInfo ArdDroneInfo);
+ public int updateArdDrone(ArdDroneInfo ardDroneInfo);
/**
* 批量删除无人机盒子
diff --git a/ard-work/src/main/java/com/ard/work/service/ITyService.java b/ard-work/src/main/java/com/ard/work/service/ITyService.java
index a4caeb3..55bccab 100644
--- a/ard-work/src/main/java/com/ard/work/service/ITyService.java
+++ b/ard-work/src/main/java/com/ard/work/service/ITyService.java
@@ -280,4 +280,10 @@
*/
void processReplyMessage(String key, BaseCmd tyMessage);
+ /**
+ * 根据boxSn获取六合盒子列表
+ * @return List<BoxInfoReceiver>
+ */
+ List<BoxInfoReceiver> getBoxSnToList(String boxSn);
+
}
diff --git a/ard-work/src/main/java/com/ard/work/service/impl/ArdDroneServiceImpl.java b/ard-work/src/main/java/com/ard/work/service/impl/ArdDroneServiceImpl.java
index 53bb06e..9b81f7b 100644
--- a/ard-work/src/main/java/com/ard/work/service/impl/ArdDroneServiceImpl.java
+++ b/ard-work/src/main/java/com/ard/work/service/impl/ArdDroneServiceImpl.java
@@ -1,6 +1,7 @@
package com.ard.work.service.impl;
import com.ard.common.utils.DateUtils;
+import com.ard.common.utils.uuid.IdUtils;
import com.ard.work.domain.entity.ArdDroneInfo;
import com.ard.work.domain.receiver.BoxInfoReceiver;
import com.ard.work.mapper.ArdDroneInfoMapper;
@@ -13,7 +14,6 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
-import java.util.Stack;
import java.util.stream.Collectors;
/**
@@ -67,13 +67,14 @@
/**
* 新增无人机盒子
*
- * @param ArdDroneInfo 无人机盒子
+ * @param ardDroneInfo 无人机盒子
* @return 结果
*/
@Override
- public int insertArdDrone(ArdDroneInfo ArdDroneInfo) {
- ArdDroneInfo.setCreateTime(DateUtils.getNowDate());
- return ArdDroneInfoMapper.insertArdDrone(ArdDroneInfo);
+ public int insertArdDrone(ArdDroneInfo ardDroneInfo) {
+ ardDroneInfo.setId(IdUtils.fastUUID());
+ ardDroneInfo.setCreateTime(DateUtils.getNowDate());
+ return ArdDroneInfoMapper.insertArdDrone(ardDroneInfo);
}
/**
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 f746584..a9dbaf2 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
@@ -101,21 +101,8 @@
@Override
public List<BoxInfoReceiver> getBoxList() {
List<ArdServerInfo> ardServerInfos = ardServerService.selectArdServerManagementList(new ArdServerInfo());
-
- return ardServerInfos.stream()
- .flatMap(ardServerInfo -> {
- String baseUrl = "http://" + ardServerInfo.getHost() + ":" + ardServerInfo.getHttpPort();
- try {
- List<BoxInfoReceiver> boxes = tyClient.getBoxList(baseUrl).getContent();
- return Optional.ofNullable(boxes).orElse(Collections.emptyList()).stream();
- } catch (Exception e) {
- log.error("获取云盒列表失败: {}", baseUrl, e);
- return Stream.empty();
- }
- })
- .collect(Collectors.toList());
+ return getBoxList(ardServerInfos);
}
-
/**
* 获取直播地址
@@ -851,6 +838,33 @@
}
}
+ /**
+ * 根据boxSn获取六合盒子列表
+ * @return List<BoxInfoReceiver>
+ */
+ @Override
+ public List<BoxInfoReceiver> getBoxSnToList(String boxSn) {
+ ArdServerInfo serverInfo = new ArdServerInfo();
+ serverInfo.setHost(boxSn);
+ List<ArdServerInfo> ardServerInfos = ardServerService.selectArdServerManagementList(serverInfo);
+ return getBoxList(ardServerInfos);
+ }
+
+ private List<BoxInfoReceiver> getBoxList(List<ArdServerInfo> ls) {
+ return ls.stream()
+ .flatMap(ardServerInfo -> {
+ String baseUrl = "http://" + ardServerInfo.getHost() + ":" + ardServerInfo.getHttpPort();
+ try {
+ List<BoxInfoReceiver> boxes = tyClient.getBoxList(baseUrl).getContent();
+ return Optional.ofNullable(boxes).orElse(Collections.emptyList()).stream();
+ } catch (Exception e) {
+ log.error("获取云盒列表失败: {}", baseUrl, e);
+ return Stream.empty();
+ }
+ })
+ .collect(Collectors.toList());
+ }
+
//公共日志打印
private void logPrint(String message, Object obj) {
log.debug("收到{}回复{}", message, obj);
diff --git a/ard-work/src/main/resources/mapper/ArdServerInfoMapper.xml b/ard-work/src/main/resources/mapper/ArdServerInfoMapper.xml
index 4447c4c..b5ea34b 100644
--- a/ard-work/src/main/resources/mapper/ArdServerInfoMapper.xml
+++ b/ard-work/src/main/resources/mapper/ArdServerInfoMapper.xml
@@ -39,6 +39,7 @@
<include refid="selectArdServerManagementVo"/>
<where>
<if test="serverName != null and serverName != ''"> and server_name like concat('%', #{serverName}, '%')</if>
+ <if test="host != null and host != ''"> and host = #{host}</if>
</where>
</select>
--
Gitblit v1.9.3