ard-admin/src/main/java/com/ard/web/controller/route/ArdRouteFileController.java
New file @@ -0,0 +1,109 @@ package com.ard.web.controller.route; import java.util.List; import javax.servlet.http.HttpServletResponse; import com.ard.common.annotation.Log; import com.ard.common.core.controller.BaseController; import com.ard.common.core.domain.AjaxResult; import com.ard.common.core.page.TableDataInfo; import com.ard.common.enums.BusinessType; import com.ard.common.utils.poi.ExcelUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; 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.route.domain.ArdRouteFile; import com.ard.route.service.IArdRouteFileService; /** * 文件Controller * * @author xia * @date 2025-10-18 */ @Api(tags = "文件") @RestController @RequestMapping("/file") public class ArdRouteFileController extends BaseController { @Autowired private IArdRouteFileService ardRouteFileService; /** * 查询文件列表 */ @ApiOperation("查询文件列表") @PreAuthorize("@ss.hasPermi('route:file:list')") @GetMapping("/list") public TableDataInfo list(ArdRouteFile ardRouteFile) { startPage(); List<ArdRouteFile> list = ardRouteFileService.selectArdRouteFileList(ardRouteFile); return getDataTable(list); } /** * 导出文件列表 */ @ApiOperation("导出文件列表") @PreAuthorize("@ss.hasPermi('route:file:export')") @Log(title = "文件", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, ArdRouteFile ardRouteFile) { List<ArdRouteFile> list = ardRouteFileService.selectArdRouteFileList(ardRouteFile); ExcelUtil<ArdRouteFile> util = new ExcelUtil<ArdRouteFile>(ArdRouteFile.class); util.exportExcel(response, list, "文件数据"); } /** * 获取文件详细信息 */ @ApiOperation("获取文件详细信息") @PreAuthorize("@ss.hasPermi('route:file:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { return success(ardRouteFileService.selectArdRouteFileById(id)); } /** * 新增文件 */ @ApiOperation("新增文件") @PreAuthorize("@ss.hasPermi('route:file:add')") @Log(title = "文件", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody ArdRouteFile ardRouteFile) { return toAjax(ardRouteFileService.insertArdRouteFile(ardRouteFile)); } /** * 修改文件 */ @ApiOperation("修改文件") @PreAuthorize("@ss.hasPermi('route:file:edit')") @Log(title = "文件", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody ArdRouteFile ardRouteFile) { return toAjax(ardRouteFileService.updateArdRouteFile(ardRouteFile)); } /** * 删除文件 */ @ApiOperation("删除文件") @PreAuthorize("@ss.hasPermi('route:file:remove')") @Log(title = "文件", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) { return toAjax(ardRouteFileService.deleteArdRouteFileByIds(ids)); } } ard-admin/src/main/java/com/ard/web/controller/route/ArdRouteFolderController.java
New file @@ -0,0 +1,108 @@ package com.ard.web.controller.route; import java.util.List; import javax.servlet.http.HttpServletResponse; import com.ard.common.annotation.Log; import com.ard.common.core.controller.BaseController; import com.ard.common.core.domain.AjaxResult; import com.ard.common.core.page.TableDataInfo; import com.ard.common.enums.BusinessType; import com.ard.common.utils.poi.ExcelUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; 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.route.domain.ArdRouteFolder; import com.ard.route.service.IArdRouteFolderService; /** * 文件夹Controller * * @author xia * @date 2025-10-18 */ @Api(tags = "文件夹") @RestController @RequestMapping("/folder") public class ArdRouteFolderController extends BaseController { @Autowired private IArdRouteFolderService ardRouteFolderService; /** * 查询文件夹列表 */ @ApiOperation("查询文件夹列表") @PreAuthorize("@ss.hasPermi('route:folder:list')") @GetMapping("/list") public TableDataInfo list(ArdRouteFolder ardRouteFolder) { startPage(); List<ArdRouteFolder> list = ardRouteFolderService.selectArdRouteFolderList(ardRouteFolder); return getDataTable(list); } /** * 导出文件夹列表 */ @ApiOperation("导出文件夹列表") @PreAuthorize("@ss.hasPermi('route:folder:export')") @Log(title = "文件夹", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, ArdRouteFolder ardRouteFolder) { List<ArdRouteFolder> list = ardRouteFolderService.selectArdRouteFolderList(ardRouteFolder); ExcelUtil<ArdRouteFolder> util = new ExcelUtil<ArdRouteFolder>(ArdRouteFolder.class); util.exportExcel(response, list, "文件夹数据"); } /** * 获取文件夹详细信息 */ @ApiOperation("获取文件夹详细信息") @PreAuthorize("@ss.hasPermi('route:folder:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { return success(ardRouteFolderService.selectArdRouteFolderById(id)); } /** * 新增文件夹 */ @ApiOperation("新增文件夹") @PreAuthorize("@ss.hasPermi('route:folder:add')") @Log(title = "文件夹", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody ArdRouteFolder ardRouteFolder) { return toAjax(ardRouteFolderService.insertArdRouteFolder(ardRouteFolder)); } /** * 修改文件夹 */ @ApiOperation("修改文件夹") @PreAuthorize("@ss.hasPermi('route:folder:edit')") @Log(title = "文件夹", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody ArdRouteFolder ardRouteFolder) { return toAjax(ardRouteFolderService.updateArdRouteFolder(ardRouteFolder)); } /** * 删除文件夹 */ @ApiOperation("删除文件夹") @PreAuthorize("@ss.hasPermi('route:folder:remove')") @Log(title = "文件夹", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) { return toAjax(ardRouteFolderService.deleteArdRouteFolderByIds(ids)); } } ard-admin/src/main/java/com/ard/web/controller/work/UavBaseController.java
@@ -36,7 +36,7 @@ @Resource private ITyService tyService; @ApiOperation("获取六合token信息") @ApiOperation("获取边缘服务器token信息") @ApiOperationSupport(order = 1) @GetMapping("/getToken/{serverId}") public AjaxResult getToken(@PathVariable("serverId") String serverId) { @@ -86,7 +86,7 @@ return AjaxResult.success(state); } @ApiOperation("根据[服务器id]获取六合盒子列表") @ApiOperation("根据[服务器id]获取边缘服务器盒子列表") @ApiOperationSupport(order = 8) @GetMapping("/getBoxSnToList/{id}") public TableDataInfo getBoxSnToList(@PathVariable("id") String id) { ard-admin/src/main/java/com/ard/web/core/config/ApiGroup.java
New file @@ -0,0 +1,41 @@ package com.ard.web.core.config; /** * API分组配置枚举 */ public enum ApiGroup { SYSTEM("系统接口", "com.ard.web.controller.system", "系统接口"), DRONE("无人机接口", "com.ard.web.controller.work", "无人机管理接口"), SAMPLE("机场接口", "com.ard.web.controller.sample", "机场管理接口"), MEDIA_MTX("流媒体接口", "com.ard.web.controller.vtdu", "流媒体管理接口"), DEVICE("设备接口", "com.ard.web.controller.device", "设备管理接口"), DATA("数据接口", "com.ard.web.controller.data", "数据管理接口"), STORAGE("存储接口", "com.ard.web.controller.storage", "存储管理接口"), ROUTE("航线接口", "com.ard.web.controller.route", "航线管理接口"); // 分组名 private final String groupName; // 包路径 private final String packagePath; // API文档标题 private final String title; ApiGroup(String groupName, String packagePath, String title) { this.groupName = groupName; this.packagePath = packagePath; this.title = title; } public String getGroupName() { return groupName; } public String getPackagePath() { return packagePath; } public String getTitle() { return title; } } ard-admin/src/main/java/com/ard/web/core/config/SwaggerConfig.java
@@ -27,151 +27,73 @@ * @author ruoyi */ @Configuration public class SwaggerConfig { public class SwaggerConfig { /** 系统基础配置 */ @Autowired private UavConfig uavConfig; /** * 创建API */ private Docket createApiDocket(ApiGroup apiGroup) { return new Docket(DocumentationType.SWAGGER_2) .enable(true) .groupName(apiGroup.getGroupName()) .apiInfo(apiInfo(apiGroup.getTitle())) .select() .apis(requestHandler -> requestHandler.declaringClass().getPackage().getName() .startsWith(apiGroup.getPackagePath()) && requestHandler.isAnnotatedWith(io.swagger.annotations.ApiOperation.class) ) .paths(PathSelectors.any()) .build() .securitySchemes(securitySchemes()) .securityContexts(securityContexts()); } @Bean public Docket systemApi() { return new Docket(DocumentationType.SWAGGER_2) .enable(true) .groupName("系统接口") // 分组名 .apiInfo(apiInfo("系统接口")) .select() // 扫描指定包下,但只扫描加了 @ApiOperation 注解的方法 .apis(requestHandler -> requestHandler.declaringClass().getPackage().getName().startsWith("com.ard.web.controller.system") && requestHandler.isAnnotatedWith(io.swagger.annotations.ApiOperation.class) ) .paths(PathSelectors.any()) .build() /* 设置安全模式,swagger可以设置访问token */ .securitySchemes(securitySchemes()) .securityContexts(securityContexts()); return createApiDocket(ApiGroup.SYSTEM); } @Bean public Docket droneApi() { return new Docket(DocumentationType.SWAGGER_2) .enable(true) .groupName("无人机接口") // 分组名 .apiInfo(apiInfo("无人机管理接口")) .select() // 扫描指定包下,但只扫描加了 @ApiOperation 注解的方法 .apis(requestHandler -> requestHandler.declaringClass().getPackage().getName().startsWith("com.ard.web.controller.work") && requestHandler.isAnnotatedWith(io.swagger.annotations.ApiOperation.class) ) .paths(PathSelectors.any()) .build() /* 设置安全模式,swagger可以设置访问token */ .securitySchemes(securitySchemes()) .securityContexts(securityContexts()); return createApiDocket(ApiGroup.DRONE); } @Bean public Docket sampleApi() { return new Docket(DocumentationType.SWAGGER_2) .enable(true) .groupName("机场接口") // 分组名 .apiInfo(apiInfo("机场管理接口")) .select() // 扫描指定包下,但只扫描加了 @ApiOperation 注解的方法 .apis(requestHandler -> requestHandler.declaringClass().getPackage().getName().startsWith("com.ard.web.controller" + ".sample") && requestHandler.isAnnotatedWith(io.swagger.annotations.ApiOperation.class) ) .paths(PathSelectors.any()) .build() /* 设置安全模式,swagger可以设置访问token */ .securitySchemes(securitySchemes()) .securityContexts(securityContexts()); return createApiDocket(ApiGroup.SAMPLE); } @Bean public Docket mediaMTXApi() { return new Docket(DocumentationType.SWAGGER_2) .enable(true) .groupName("流媒体接口") // 分组名 .apiInfo(apiInfo("流媒体管理接口")) .select() // 扫描指定包下,但只扫描加了 @ApiOperation 注解的方法 .apis(requestHandler -> requestHandler.declaringClass().getPackage().getName().startsWith("com.ard.web.controller" + ".vtdu") && requestHandler.isAnnotatedWith(io.swagger.annotations.ApiOperation.class) ) .paths(PathSelectors.any()) .build() /* 设置安全模式,swagger可以设置访问token */ .securitySchemes(securitySchemes()) .securityContexts(securityContexts()); return createApiDocket(ApiGroup.MEDIA_MTX); } @Bean public Docket deviceApi() { return new Docket(DocumentationType.SWAGGER_2) .enable(true) .groupName("设备接口") // 分组名 .apiInfo(apiInfo("设备管理接口")) .select() // 扫描指定包下,但只扫描加了 @ApiOperation 注解的方法 .apis(requestHandler -> requestHandler.declaringClass().getPackage().getName().startsWith("com.ard.web.controller" + ".device") && requestHandler.isAnnotatedWith(io.swagger.annotations.ApiOperation.class) ) .paths(PathSelectors.any()) .build() /* 设置安全模式,swagger可以设置访问token */ .securitySchemes(securitySchemes()) .securityContexts(securityContexts()); return createApiDocket(ApiGroup.DEVICE); } @Bean public Docket dataApi() { return new Docket(DocumentationType.SWAGGER_2) .enable(true) .groupName("数据接口") // 分组名 .apiInfo(apiInfo("数据管理接口")) .select() // 扫描指定包下,但只扫描加了 @ApiOperation 注解的方法 .apis(requestHandler -> requestHandler.declaringClass().getPackage().getName().startsWith("com.ard.web.controller" + ".data") && requestHandler.isAnnotatedWith(io.swagger.annotations.ApiOperation.class) ) .paths(PathSelectors.any()) .build() /* 设置安全模式,swagger可以设置访问token */ .securitySchemes(securitySchemes()) .securityContexts(securityContexts()); return createApiDocket(ApiGroup.DATA); } @Bean public Docket storageApi() { return new Docket(DocumentationType.SWAGGER_2) .enable(true) .groupName("存储接口") // 分组名 .apiInfo(apiInfo("存储管理接口")) .select() // 扫描指定包下,但只扫描加了 @ApiOperation 注解的方法 .apis(requestHandler -> requestHandler.declaringClass().getPackage().getName().startsWith("com.ard.web.controller" + ".storage") && requestHandler.isAnnotatedWith(io.swagger.annotations.ApiOperation.class) ) .paths(PathSelectors.any()) .build() /* 设置安全模式,swagger可以设置访问token */ .securitySchemes(securitySchemes()) .securityContexts(securityContexts()); return createApiDocket(ApiGroup.STORAGE); } @Bean public Docket routeApi() { return createApiDocket(ApiGroup.ROUTE); } /** * 安全模式,这里指定token通过Authorization头请求头传递 */ private List<SecurityScheme> securitySchemes() { private List<SecurityScheme> securitySchemes() { List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>(); apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue())); return apiKeyList; @@ -207,8 +129,7 @@ /** * 添加摘要信息 */ private ApiInfo apiInfo() { private ApiInfo apiInfo() { // 用ApiInfoBuilder进行定制 return new ApiInfoBuilder() // 设置标题 ard-route/src/main/java/com/ard/route/domain/ArdRouteFile.java
New file @@ -0,0 +1,59 @@ package com.ard.route.domain; import java.util.Date; import java.util.List; import com.ard.common.annotation.Excel; import com.ard.common.core.domain.BaseEntity; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; /** * 文件对象 ard_route_file * * @author xia * @date 2025-10-18 */ @Data public class ArdRouteFile extends BaseEntity { private static final long serialVersionUID = 1L; /** ID */ private String id; /** 文件名称 */ @Excel(name = "文件名称") private String name; /** 所属文件夹ID */ @Excel(name = "所属文件夹ID") private String folderId; /** 文件类型 */ @Excel(name = "文件类型") private String fileType; /** 文件大小(字节) */ @Excel(name = "文件大小(字节)") private Long fileSize; /** 文件存储路径 */ @Excel(name = "文件存储路径") private String filePath; /** 创建者 */ @Excel(name = "创建者") private String createdBy; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createdTime; /** 修改者 */ @Excel(name = "修改者") private String updatedBy; @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date updatedTime; } ard-route/src/main/java/com/ard/route/domain/ArdRouteFolder.java
New file @@ -0,0 +1,47 @@ package com.ard.route.domain; import java.util.Date; import java.util.List; import com.ard.common.annotation.Excel; import com.ard.common.core.domain.BaseEntity; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; /** * 文件夹对象 ard_route_folder * * @author xia * @date 2025-10-18 */ @Data public class ArdRouteFolder extends BaseEntity { private static final long serialVersionUID = 1L; /** ID */ private String id; /** 文件夹名称 */ @Excel(name = "文件夹名称") private String fileName; /** 创建者 */ @Excel(name = "创建者") private String createdBy; /** 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createdTime; /** 修改者 */ @Excel(name = "修改者") private String updatedBy; /** 修改时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date updatedTime; private List<ArdRouteFile> ardRouteFile; } ard-route/src/main/java/com/ard/route/mapper/ArdRouteFileMapper.java
New file @@ -0,0 +1,61 @@ package com.ard.route.mapper; import java.util.List; import com.ard.route.domain.ArdRouteFile; /** * 文件Mapper接口 * * @author xia * @date 2025-10-18 */ public interface ArdRouteFileMapper { /** * 查询文件 * * @param id 文件主键 * @return 文件 */ public ArdRouteFile selectArdRouteFileById(String id); /** * 查询文件列表 * * @param ardRouteFile 文件 * @return 文件集合 */ public List<ArdRouteFile> selectArdRouteFileList(ArdRouteFile ardRouteFile); /** * 新增文件 * * @param ardRouteFile 文件 * @return 结果 */ public int insertArdRouteFile(ArdRouteFile ardRouteFile); /** * 修改文件 * * @param ardRouteFile 文件 * @return 结果 */ public int updateArdRouteFile(ArdRouteFile ardRouteFile); /** * 删除文件 * * @param id 文件主键 * @return 结果 */ public int deleteArdRouteFileById(String id); /** * 批量删除文件 * * @param ids 需要删除的数据主键集合 * @return 结果 */ public int deleteArdRouteFileByIds(String[] ids); } ard-route/src/main/java/com/ard/route/mapper/ArdRouteFolderMapper.java
New file @@ -0,0 +1,62 @@ package com.ard.route.mapper; import java.util.List; import com.ard.route.domain.ArdRouteFolder; /** * 文件夹Mapper接口 * * @author xia * @date 2025-10-18 */ public interface ArdRouteFolderMapper { /** * 查询文件夹 * * @param id 文件夹主键 * @return 文件夹 */ public ArdRouteFolder selectArdRouteFolderById(String id); /** * 查询文件夹列表 * * @param ardRouteFolder 文件夹 * @return 文件夹集合 */ public List<ArdRouteFolder> selectArdRouteFolderList(ArdRouteFolder ardRouteFolder); /** * 新增文件夹 * * @param ardRouteFolder 文件夹 * @return 结果 */ public int insertArdRouteFolder(ArdRouteFolder ardRouteFolder); /** * 修改文件夹 * * @param ardRouteFolder 文件夹 * @return 结果 */ public int updateArdRouteFolder(ArdRouteFolder ardRouteFolder); /** * 删除文件夹 * * @param id 文件夹主键 * @return 结果 */ public int deleteArdRouteFolderById(String id); /** * 批量删除文件夹 * * @param ids 需要删除的数据主键集合 * @return 结果 */ public int deleteArdRouteFolderByIds(String[] ids); } ard-route/src/main/java/com/ard/route/service/IArdRouteFileService.java
New file @@ -0,0 +1,62 @@ package com.ard.route.service; import java.util.List; import com.ard.route.domain.ArdRouteFile; /** * 文件Service接口 * * @author xia * @date 2025-10-18 */ public interface IArdRouteFileService { /** * 查询文件 * * @param id 文件主键 * @return 文件 */ public ArdRouteFile selectArdRouteFileById(String id); /** * 查询文件列表 * * @param ardRouteFile 文件 * @return 文件集合 */ public List<ArdRouteFile> selectArdRouteFileList(ArdRouteFile ardRouteFile); /** * 新增文件 * * @param ardRouteFile 文件 * @return 结果 */ public int insertArdRouteFile(ArdRouteFile ardRouteFile); /** * 修改文件 * * @param ardRouteFile 文件 * @return 结果 */ public int updateArdRouteFile(ArdRouteFile ardRouteFile); /** * 批量删除文件 * * @param ids 需要删除的文件主键集合 * @return 结果 */ public int deleteArdRouteFileByIds(String[] ids); /** * 删除文件信息 * * @param id 文件主键 * @return 结果 */ public int deleteArdRouteFileById(String id); } ard-route/src/main/java/com/ard/route/service/IArdRouteFolderService.java
New file @@ -0,0 +1,61 @@ package com.ard.route.service; import java.util.List; import com.ard.route.domain.ArdRouteFolder; /** * 文件夹Service接口 * * @author xia * @date 2025-10-18 */ public interface IArdRouteFolderService { /** * 查询文件夹 * * @param id 文件夹主键 * @return 文件夹 */ public ArdRouteFolder selectArdRouteFolderById(String id); /** * 查询文件夹列表 * * @param ardRouteFolder 文件夹 * @return 文件夹集合 */ public List<ArdRouteFolder> selectArdRouteFolderList(ArdRouteFolder ardRouteFolder); /** * 新增文件夹 * * @param ardRouteFolder 文件夹 * @return 结果 */ public int insertArdRouteFolder(ArdRouteFolder ardRouteFolder); /** * 修改文件夹 * * @param ardRouteFolder 文件夹 * @return 结果 */ public int updateArdRouteFolder(ArdRouteFolder ardRouteFolder); /** * 批量删除文件夹 * * @param ids 需要删除的文件夹主键集合 * @return 结果 */ public int deleteArdRouteFolderByIds(String[] ids); /** * 删除文件夹信息 * * @param id 文件夹主键 * @return 结果 */ public int deleteArdRouteFolderById(String id); } ard-route/src/main/java/com/ard/route/service/impl/ArdRouteFileServiceImpl.java
New file @@ -0,0 +1,93 @@ package com.ard.route.service.impl; import java.util.List; import java.util.UUID; import com.ard.common.annotation.DataScope; import com.ard.common.utils.uuid.IdUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ard.route.mapper.ArdRouteFileMapper; import com.ard.route.domain.ArdRouteFile; import com.ard.route.service.IArdRouteFileService; /** * 文件Service业务层处理 * * @author xia * @date 2025-10-18 */ @Service public class ArdRouteFileServiceImpl implements IArdRouteFileService { @Autowired private ArdRouteFileMapper ardRouteFileMapper; /** * 查询文件 * * @param id 文件主键 * @return 文件 */ @Override public ArdRouteFile selectArdRouteFileById(String id) { return ardRouteFileMapper.selectArdRouteFileById(id); } /** * 查询文件列表 * * @param ardRouteFile 文件 * @return 文件 */ @Override @DataScope(deptAlias = "d", userAlias = "u") public List<ArdRouteFile> selectArdRouteFileList(ArdRouteFile ardRouteFile) { return ardRouteFileMapper.selectArdRouteFileList(ardRouteFile); } /** * 新增文件 * * @param ardRouteFile 文件 * @return 结果 */ @Override public int insertArdRouteFile(ArdRouteFile ardRouteFile) { ardRouteFile.setId(IdUtils.simpleUUID()); return ardRouteFileMapper.insertArdRouteFile(ardRouteFile); } /** * 修改文件 * * @param ardRouteFile 文件 * @return 结果 */ @Override public int updateArdRouteFile(ArdRouteFile ardRouteFile) { return ardRouteFileMapper.updateArdRouteFile(ardRouteFile); } /** * 批量删除文件 * * @param ids 需要删除的文件主键 * @return 结果 */ @Override public int deleteArdRouteFileByIds(String[] ids) { return ardRouteFileMapper.deleteArdRouteFileByIds(ids); } /** * 删除文件信息 * * @param id 文件主键 * @return 结果 */ @Override public int deleteArdRouteFileById(String id) { return ardRouteFileMapper.deleteArdRouteFileById(id); } } ard-route/src/main/java/com/ard/route/service/impl/ArdRouteFolderServiceImpl.java
New file @@ -0,0 +1,93 @@ package com.ard.route.service.impl; import java.util.List; import com.ard.common.annotation.DataScope; import com.ard.common.utils.uuid.IdUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ard.route.mapper.ArdRouteFolderMapper; import com.ard.route.domain.ArdRouteFolder; import com.ard.route.service.IArdRouteFolderService; /** * 文件夹Service业务层处理 * * @author xia * @date 2025-10-18 */ @Service public class ArdRouteFolderServiceImpl implements IArdRouteFolderService { @Autowired private ArdRouteFolderMapper ardRouteFolderMapper; /** * 查询文件夹 * * @param id 文件夹主键 * @return 文件夹 */ @Override public ArdRouteFolder selectArdRouteFolderById(String id) { return ardRouteFolderMapper.selectArdRouteFolderById(id); } /** * 查询文件夹列表 * * @param ardRouteFolder 文件夹 * @return 文件夹 */ @Override @DataScope(deptAlias = "d", userAlias = "u") public List<ArdRouteFolder> selectArdRouteFolderList(ArdRouteFolder ardRouteFolder) { return ardRouteFolderMapper.selectArdRouteFolderList(ardRouteFolder); } /** * 新增文件夹 * * @param ardRouteFolder 文件夹 * @return 结果 */ @Override public int insertArdRouteFolder(ArdRouteFolder ardRouteFolder) { ardRouteFolder.setId(IdUtils.simpleUUID()); return ardRouteFolderMapper.insertArdRouteFolder(ardRouteFolder); } /** * 修改文件夹 * * @param ardRouteFolder 文件夹 * @return 结果 */ @Override public int updateArdRouteFolder(ArdRouteFolder ardRouteFolder) { return ardRouteFolderMapper.updateArdRouteFolder(ardRouteFolder); } /** * 批量删除文件夹 * * @param ids 需要删除的文件夹主键 * @return 结果 */ @Override public int deleteArdRouteFolderByIds(String[] ids) { return ardRouteFolderMapper.deleteArdRouteFolderByIds(ids); } /** * 删除文件夹信息 * * @param id 文件夹主键 * @return 结果 */ @Override public int deleteArdRouteFolderById(String id) { return ardRouteFolderMapper.deleteArdRouteFolderById(id); } } ard-route/src/main/resources/mapper/ArdRouteFileMapper.xml
New file @@ -0,0 +1,108 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ard.route.mapper.ArdRouteFileMapper"> <resultMap type="ArdRouteFile" id="ArdRouteFileResult"> <result property="id" column="id" /> <result property="name" column="name" /> <result property="folderId" column="folder_id" /> <result property="fileType" column="file_type" /> <result property="fileSize" column="file_size" /> <result property="filePath" column="file_path" /> <result property="createdBy" column="created_by" /> <result property="createdTime" column="created_time" /> <result property="updatedBy" column="updated_by" /> <result property="updatedTime" column="updated_time" /> </resultMap> <sql id="selectArdRouteFileVo"> select id, name, folder_id, file_type, file_size, file_path, created_by, created_time, updated_by, updated_time from ard_route_file </sql> <select id="selectArdRouteFileList" parameterType="ArdRouteFile" resultMap="ArdRouteFileResult"> <include refid="selectArdRouteFileVo"/> <where> <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> <if test="folderId != null and folderId != ''"> and folder_id = #{folderId}</if> <if test="fileType != null and fileType != ''"> and file_type = #{fileType}</if> <if test="fileSize != null "> and file_size = #{fileSize}</if> <if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if> <if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if> <if test="createdTime != null "> and created_time = #{createdTime}</if> <if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if> <if test="updatedTime != null "> and updated_time = #{updatedTime}</if> </where> </select> <select id="selectArdRouteFileById" parameterType="String" resultMap="ArdRouteFileResult"> <include refid="selectArdRouteFileVo"/> where id = #{id} </select> <insert id="insertArdRouteFile" parameterType="ArdRouteFile"> insert into ard_route_file <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">id,</if> <if test="name != null">name,</if> <if test="folderId != null">folder_id,</if> <if test="fileType != null">file_type,</if> <if test="fileSize != null">file_size,</if> <if test="filePath != null">file_path,</if> <if test="createdBy != null">created_by,</if> <if test="createdTime != null">created_time,</if> <if test="updatedBy != null">updated_by,</if> <if test="updatedTime != null">updated_time,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if> <if test="name != null">#{name},</if> <if test="folderId != null">#{folderId},</if> <if test="fileType != null">#{fileType},</if> <if test="fileSize != null">#{fileSize},</if> <if test="filePath != null">#{filePath},</if> <if test="createdBy != null">#{createdBy},</if> <if test="createdTime != null">#{createdTime},</if> <if test="updatedBy != null">#{updatedBy},</if> <if test="updatedTime != null">#{updatedTime},</if> </trim> </insert> <update id="updateArdRouteFile" parameterType="ArdRouteFile"> update ard_route_file <trim prefix="SET" suffixOverrides=","> <if test="name != null">name = #{name},</if> <if test="folderId != null">folder_id = #{folderId},</if> <if test="fileType != null">file_type = #{fileType},</if> <if test="fileSize != null">file_size = #{fileSize},</if> <if test="filePath != null">file_path = #{filePath},</if> <if test="createdBy != null">created_by = #{createdBy},</if> <if test="createdTime != null">created_time = #{createdTime},</if> <if test="updatedBy != null">updated_by = #{updatedBy},</if> <if test="updatedTime != null">updated_time = #{updatedTime},</if> </trim> where id = #{id} </update> <delete id="deleteArdRouteFileById" parameterType="String"> delete from ard_route_file where id = #{id} </delete> <delete id="deleteArdRouteFileByIds" parameterType="String"> delete from ard_route_file where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </delete> </mapper> ard-route/src/main/resources/mapper/ArdRouteFolderMapper.xml
New file @@ -0,0 +1,95 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ard.route.mapper.ArdRouteFolderMapper"> <resultMap type="ArdRouteFolder" id="ArdRouteFolderResult"> <result property="id" column="id" /> <result property="fileName" column="file_name" /> <result property="createdBy" column="created_by" /> <result property="createdTime" column="created_time" /> <result property="updatedBy" column="updated_by" /> <result property="updatedTime" column="updated_time" /> <!-- 关联 ArdRouteFile 对象 --> <association property="ardRouteFile" javaType="com.ard.route.domain.ArdRouteFile" column="folder_id" autoMapping="true" select="selectArdRouteFile"> </association> </resultMap> <select id="selectArdRouteFile" resultType="com.ard.route.domain.ArdRouteFile"> select * from ard_route_file where id = #{folderId} </select> <sql id="selectArdRouteFolderVo"> select id, file_name, created_by, created_time, updated_by, updated_time from ard_route_folder </sql> <select id="selectArdRouteFolderList" parameterType="ArdRouteFolder" resultMap="ArdRouteFolderResult"> <include refid="selectArdRouteFolderVo"/> <where> <if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if> <if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if> <if test="createdTime != null "> and created_time = #{createdTime}</if> <if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if> <if test="updatedTime != null "> and updated_time = #{updatedTime}</if> </where> </select> <select id="selectArdRouteFolderById" parameterType="String" resultMap="ArdRouteFolderResult"> <include refid="selectArdRouteFolderVo"/> where id = #{id} </select> <insert id="insertArdRouteFolder" parameterType="ArdRouteFolder"> insert into ard_route_folder <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">id,</if> <if test="fileName != null">file_name,</if> <if test="createdBy != null">created_by,</if> <if test="createdTime != null">created_time,</if> <if test="updatedBy != null">updated_by,</if> <if test="updatedTime != null">updated_time,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if> <if test="fileName != null">#{fileName},</if> <if test="createdBy != null">#{createdBy},</if> <if test="createdTime != null">#{createdTime},</if> <if test="updatedBy != null">#{updatedBy},</if> <if test="updatedTime != null">#{updatedTime},</if> </trim> </insert> <update id="updateArdRouteFolder" parameterType="ArdRouteFolder"> update ard_route_folder <trim prefix="SET" suffixOverrides=","> <if test="fileName != null">file_name = #{fileName},</if> <if test="createdBy != null">created_by = #{createdBy},</if> <if test="createdTime != null">created_time = #{createdTime},</if> <if test="updatedBy != null">updated_by = #{updatedBy},</if> <if test="updatedTime != null">updated_time = #{updatedTime},</if> </trim> where id = #{id} </update> <delete id="deleteArdRouteFolderById" parameterType="String"> delete from ard_route_folder where id = #{id} </delete> <delete id="deleteArdRouteFolderByIds" parameterType="String"> delete from ard_route_folder where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </delete> </mapper> ard-work/src/main/java/com/ard/work/component/netty/TyTcpClientManager.java
@@ -143,7 +143,7 @@ } /** * 定时向所有已连接的六合服务器发送心跳 * 定时向所有已连接的边缘服务器服务器发送心跳 */ @Scheduled(fixedRate = 5000) // 每5秒执行一次 public void sendHeartBeat() { ard-work/src/main/java/com/ard/work/component/netty/cache/TyTcpServerCache.java
@@ -9,7 +9,7 @@ import java.util.concurrent.ConcurrentHashMap; /** * 六合tcp服务器缓存 * 边缘服务器tcp服务器缓存 * * @author liusuyi * @date 2024年11月01日13:53 ard-work/src/main/java/com/ard/work/component/netty/handler/ClientHandler.java
@@ -86,7 +86,7 @@ InetSocketAddress remoteAddress = (InetSocketAddress) channel.remoteAddress(); String host = remoteAddress.getHostString(); int port = remoteAddress.getPort(); log.error("与六合服务{}:{}连接断开!", host, port); log.error("与边缘服务器服务{}:{}连接断开!", host, port); TyTcpServerCache.putTcpServerCache(serverId, false); super.channelInactive(ctx); } ard-work/src/main/java/com/ard/work/domain/receiver/TyHttpCommonReceiver.java
@@ -8,7 +8,7 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class TyHttpCommonReceiver<T> { /** * 六合http请求返回信息 * 边缘服务器http请求返回信息 */ @JsonProperty("state") private Integer state; ard-work/src/main/java/com/ard/work/service/ITyService.java
@@ -31,7 +31,7 @@ public interface ITyService { /** * 获取六合token信息 * 获取边缘服务器token信息 * @return */ AccessTokenReceiver getAccessToken(String ServerId); @@ -288,7 +288,7 @@ void processReplyMessage(String key, BaseCmd tyMessage); /** * 根据[服务器id]获取六合盒子列表 * 根据[服务器id]获取边缘服务器盒子列表 */ List<BoxInfoReceiver> getBoxSnToList(String id); ard-work/src/main/java/com/ard/work/service/impl/TyServiceImpl.java
@@ -74,7 +74,7 @@ private TyClient tyClient; /** * 获取六合token信息 * 获取边缘服务器token信息 * * @return AccessTokenReceiver */ @@ -184,7 +184,7 @@ } /** * 注册六合平台 * 注册边缘服务器平台 */ @Override public Boolean registerMessage(String serverId) { @@ -193,7 +193,7 @@ RegisterCmd registerMessage = new RegisterCmd(tyToken.getCompanyId(), tyToken.getAccessToken().getBytes()); this.sendMessage(serverId, registerMessage); } catch (Exception e) { log.error("注册六合平台失败:{}", e.getMessage()); log.error("注册边缘服务器平台失败:{}", e.getMessage()); } return true; } @@ -651,7 +651,7 @@ } /** * 处理六合服务器返回的消息 * 处理边缘服务器返回的消息 */ @Override public void processReplyMessage(String key, BaseCmd tyCommand) { @@ -835,7 +835,7 @@ } /** * 根据[服务器id]获取六合盒子列表 * 根据[服务器id]获取边缘服务器盒子列表 */ @Override public List<BoxInfoReceiver> getBoxSnToList(String id) { ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml
@@ -10,7 +10,7 @@ <result property="boxName" column="box_name" /> <result property="boxVersion" column="box_version" /> <result property="startTime" column="start_time" /> <result property="onLine" column="onLine" /> <result property="onLine" column="on_line" /> <result property="videoServer" column="video_server" /> <result property="videoPort" column="video_port" /> <result property="lastTaskId" column="last_task_id" />