1.增加注释,修改字段名称和代码格式。
2.合并无人机盒子和无人机管理代码。
3.地图管理和tile管理增加字段名称。
4.增加根据boxSn获取六合盒子列表接口。
11 files modified
1 files deleted
279 ■■■■■ changed files
ard-admin/src/main/java/com/ard/web/controller/work/UavBaseController.java 14 ●●●●● patch | view | raw | blame | history
ard-admin/src/main/java/com/ard/web/controller/work/uav/UavBoxController.java 109 ●●●●● patch | view | raw | blame | history
ard-system/src/main/java/com/ard/data/domain/ArdMapManagement.java 8 ●●●●● patch | view | raw | blame | history
ard-system/src/main/java/com/ard/data/domain/ArdTileManagement.java 23 ●●●●● patch | view | raw | blame | history
ard-system/src/main/resources/mapper/system/ArdMapManagementMapper.xml 12 ●●●●● patch | view | raw | blame | history
ard-system/src/main/resources/mapper/system/ArdTileManagementMapper.xml 32 ●●●●● patch | view | raw | blame | history
ard-work/src/main/java/com/ard/work/mapper/ArdDroneInfoMapper.java 1 ●●●●● patch | view | raw | blame | history
ard-work/src/main/java/com/ard/work/service/IArdDroneService.java 20 ●●●●● patch | view | raw | blame | history
ard-work/src/main/java/com/ard/work/service/ITyService.java 6 ●●●●● patch | view | raw | blame | history
ard-work/src/main/java/com/ard/work/service/impl/ArdDroneServiceImpl.java 11 ●●●●● patch | view | raw | blame | history
ard-work/src/main/java/com/ard/work/service/impl/TyServiceImpl.java 42 ●●●●● patch | view | raw | blame | history
ard-work/src/main/resources/mapper/ArdServerInfoMapper.xml 1 ●●●●● patch | view | raw | blame | history
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);
    }
}
ard-admin/src/main/java/com/ard/web/controller/work/uav/UavBoxController.java
File was deleted
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;
}
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;
}
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>
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>
ard-work/src/main/java/com/ard/work/mapper/ArdDroneInfoMapper.java
@@ -66,4 +66,5 @@
     * @return 结果
     */
    int deleteArdDroneByIds(String[] ids);
}
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);
    /**
     * 批量删除无人机盒子
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);
}
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);
    }
    /**
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();
        return getBoxList(ardServerInfos);
                    }
                })
                .collect(Collectors.toList());
    }
    /**
     * 获取直播地址
@@ -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);
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>