1.增加注释,修改字段名称和代码格式。
2.合并无人机盒子和无人机管理代码。
3.地图管理和tile管理增加字段名称。
4.增加根据boxSn获取六合盒子列表接口。
11 files modified
1 files deleted
| | |
| | | @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) |
| | |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | |
| | | } |
| | |
| | | @Excel(name = "发布状态") |
| | | private String releaseStatus; |
| | | |
| | | /** 默认加载 */ |
| | | @Excel(name = "默认加载") |
| | | private String defaultLoading; |
| | | |
| | | /** 路径 */ |
| | | @Excel(name = "路径") |
| | | private String mapPath; |
| | | |
| | | } |
| | |
| | | @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; |
| | | } |
| | |
| | | <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"> |
| | |
| | | map_name, |
| | | map_type, |
| | | file_name, |
| | | release_status |
| | | release_status, |
| | | default_loading, |
| | | map_path |
| | | from ard_map_management |
| | | </sql> |
| | | |
| | |
| | | <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> |
| | |
| | | <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> |
| | | |
| | |
| | | <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> |
| | |
| | | <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> |
| | | |
| | |
| | | <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> |
| | | |
| | |
| | | <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> |
| | |
| | | * @return 结果 |
| | | */ |
| | | int deleteArdDroneByIds(String[] ids); |
| | | |
| | | } |
| | |
| | | * @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); |
| | | |
| | | /** |
| | | * 批量删除无人机盒子 |
| | |
| | | */ |
| | | void processReplyMessage(String key, BaseCmd tyMessage); |
| | | |
| | | /** |
| | | * 根据boxSn获取六合盒子列表 |
| | | * @return List<BoxInfoReceiver> |
| | | */ |
| | | List<BoxInfoReceiver> getBoxSnToList(String boxSn); |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.Stack; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 新增无人机盒子 |
| | | * |
| | | * @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); |
| | | } |
| | | |
| | | /** |
| | |
| | | @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(); |
| | | return getBoxList(ardServerInfos); |
| | | } |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取直播地址 |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据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); |
| | |
| | | <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> |
| | | |