1.分组管理名称修改folder-》grouping。
2.去掉多余File业务。
3.航线(kmz)业务 ArdRouteInformation修改ArdRouteInfor。
4.航线业务字段优化修改。
5.返回类型实体修改。
6.工具类优化方法优化。
8 files added
4 files modified
14 files deleted
4 files renamed
| File was renamed from ard-admin/src/main/java/com/ard/web/controller/route/ArdRouteFolderController.java |
| | |
| | | import com.ard.common.core.page.TableDataInfo; |
| | | import com.ard.common.enums.BusinessType; |
| | | import com.ard.common.utils.poi.ExcelUtil; |
| | | import com.ard.route.domain.route.ArdRouteGrouping; |
| | | 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.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ard.route.domain.route.ArdRouteFolder; |
| | | import com.ard.route.service.IArdRouteFolderService; |
| | | import com.ard.route.service.IArdRouteGroupingService; |
| | | |
| | | /** |
| | | * 分组Controller |
| | |
| | | */ |
| | | @Api(tags = "分组管理") |
| | | @RestController |
| | | @RequestMapping("/route/folder") |
| | | public class ArdRouteFolderController extends BaseController { |
| | | @RequestMapping("/route/grouping") |
| | | public class ArdRouteGroupingController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IArdRouteFolderService ardRouteFolderService; |
| | | private IArdRouteGroupingService ardRouteGroupingService; |
| | | |
| | | /** |
| | | * 查询分组列表 |
| | | */ |
| | | @ApiOperation("查询分组列表") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ArdRouteFolder ardRouteFolder) { |
| | | public TableDataInfo list(ArdRouteGrouping ardRouteGrouping) { |
| | | //startPage(); |
| | | List<ArdRouteFolder> list = ardRouteFolderService.selectArdRouteFolderList(ardRouteFolder); |
| | | List<ArdRouteGrouping> list = ardRouteGroupingService.selectArdRouteGroupingList(ardRouteGrouping); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | |
| | | @ApiOperation("导出分组列表") |
| | | @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); |
| | | public void export(HttpServletResponse response, ArdRouteGrouping ardRouteGrouping) { |
| | | List<ArdRouteGrouping> list = ardRouteGroupingService.selectArdRouteGroupingList(ardRouteGrouping); |
| | | ExcelUtil<ArdRouteGrouping> util = new ExcelUtil<ArdRouteGrouping>(ArdRouteGrouping.class); |
| | | util.exportExcel(response, list, "分组数据"); |
| | | } |
| | | |
| | |
| | | @ApiOperation("获取分组详细信息") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") String id) { |
| | | return success(ardRouteFolderService.selectArdRouteFolderById(id)); |
| | | return success(ardRouteGroupingService.selectArdRouteGroupingById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation("新增分组") |
| | | @Log(title = "分组", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ArdRouteFolder ardRouteFolder) { |
| | | ardRouteFolder.setCreateBy(getUsername()); |
| | | return toAjax(ardRouteFolderService.insertArdRouteFolder(ardRouteFolder)); |
| | | public AjaxResult add(@RequestBody ArdRouteGrouping ardRouteGrouping) { |
| | | ardRouteGrouping.setCreateBy(getUsername()); |
| | | return toAjax(ardRouteGroupingService.insertArdRouteGrouping(ardRouteGrouping)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation("修改分组") |
| | | @Log(title = "分组", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ArdRouteFolder ardRouteFolder) { |
| | | ardRouteFolder.setUpdateBy(getUsername()); |
| | | return toAjax(ardRouteFolderService.updateArdRouteFolder(ardRouteFolder)); |
| | | public AjaxResult edit(@RequestBody ArdRouteGrouping ardRouteGrouping) { |
| | | ardRouteGrouping.setUpdateBy(getUsername()); |
| | | return toAjax(ardRouteGroupingService.updateArdRouteGrouping(ardRouteGrouping)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable String[] ids) { |
| | | try { |
| | | Map<String, Integer> result = ardRouteFolderService.deleteArdRouteFolderByIds(ids); |
| | | Map<String, Integer> result = ardRouteGroupingService.deleteArdRouteGroupingByIds(ids); |
| | | if (!result.isEmpty()) { |
| | | return AjaxResult.success("删除成功.分组删除" + result.get("folder") + "文件删除" + result.get("file")); |
| | | return AjaxResult.success("删除成功:分组删除" + result.get("groupingCount") + ",航线删除" + result.get("informationCount")); |
| | | } else { |
| | | return AjaxResult.success("没有删除分组信息。"); |
| | | } |
| File was renamed from ard-admin/src/main/java/com/ard/web/controller/route/ArdRouteInformationController.java |
| | |
| | | |
| | | import com.ard.common.utils.poi.ExcelUtil; |
| | | import com.ard.oss.model.MinioUploadResult; |
| | | import com.ard.route.domain.route.ArdRouteInformation; |
| | | import com.ard.route.domain.route.ArdRouteInfor; |
| | | import com.ard.route.service.IArdRouteInforService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | 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.route.service.IArdRouteInformationService; |
| | | import com.ard.common.core.page.TableDataInfo; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | @Api(tags = "航线信息接口") |
| | | @RestController |
| | | @RequestMapping("/route/information") |
| | | public class ArdRouteInformationController extends BaseController { |
| | | public class ArdRouteInforController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IArdRouteInformationService ardRouteInformationService; |
| | | private IArdRouteInforService ardRouteInforService; |
| | | |
| | | /** |
| | | * 查询航线(kmz)列表 |
| | | */ |
| | | @ApiOperation("查询航线(kmz)列表") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ArdRouteInformation ardRouteInformation) { |
| | | public TableDataInfo list(ArdRouteInfor ardRouteInfor) { |
| | | startPage(); |
| | | List<ArdRouteInformation> list = ardRouteInformationService.selectArdRouteInformationList(ardRouteInformation); |
| | | List<ArdRouteInfor> list = ardRouteInforService.selectArdRouteInforList(ardRouteInfor); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | |
| | | @ApiOperation("导出航线(kmz)列表") |
| | | @Log(title = "航线(kmz)", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ArdRouteInformation ardRouteInformation) { |
| | | List<ArdRouteInformation> list = ardRouteInformationService.selectArdRouteInformationList(ardRouteInformation); |
| | | ExcelUtil<ArdRouteInformation> util = new ExcelUtil<ArdRouteInformation>(ArdRouteInformation.class); |
| | | public void export(HttpServletResponse response, ArdRouteInfor ardRouteInfor) { |
| | | List<ArdRouteInfor> list = ardRouteInforService.selectArdRouteInforList(ardRouteInfor); |
| | | ExcelUtil<ArdRouteInfor> util = new ExcelUtil<ArdRouteInfor>(ArdRouteInfor.class); |
| | | util.exportExcel(response, list, "航线(kmz)数据"); |
| | | } |
| | | |
| | |
| | | @ApiOperation("获取航线(kmz)详细信息") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") String id) { |
| | | return success(ardRouteInformationService.selectArdRouteInformationById(id)); |
| | | return success(ardRouteInforService.selectArdRouteInforById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation("新增航线(kmz)") |
| | | @Log(title = "航线(kmz)", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ArdRouteInformation ardRouteInformation) { |
| | | ardRouteInformation.setCreateBy(getUsername()); |
| | | return success(ardRouteInformationService.insertArdRouteInformation(ardRouteInformation)); |
| | | public AjaxResult add(@RequestBody ArdRouteInfor ardRouteInfor) { |
| | | ardRouteInfor.setCreateBy(getUsername()); |
| | | return success(ardRouteInforService.insertArdRouteInfor(ardRouteInfor)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation("修改航线(kmz)") |
| | | @Log(title = "航线(kmz)", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ArdRouteInformation ardRouteInformation) { |
| | | ardRouteInformation.setUpdateBy(getUsername()); |
| | | return toAjax(ardRouteInformationService.updateArdRouteInformation(ardRouteInformation)); |
| | | public AjaxResult edit(@RequestBody ArdRouteInfor ardRouteInfor) { |
| | | ardRouteInfor.setUpdateBy(getUsername()); |
| | | return toAjax(ardRouteInforService.updateArdRouteInfor(ardRouteInfor)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "航线(kmz)", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable String[] ids) { |
| | | return toAjax(ardRouteInformationService.deleteArdRouteInformationByIds(ids)); |
| | | return toAjax(ardRouteInforService.deleteArdRouteInforByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation("导入航线(kmz)文件") |
| | | @PostMapping("/upload") |
| | | public AjaxResult upload(@RequestPart("file") MultipartFile file) { |
| | | MinioUploadResult minioUploadResult = ardRouteInformationService.uploadArdRouteInformation(file); |
| | | MinioUploadResult minioUploadResult = ardRouteInforService.uploadArdRouteInfor(file); |
| | | return success(minioUploadResult); |
| | | } |
| | | |
| | |
| | | */ |
| | | @ApiOperation("修改航线分组ID") |
| | | @Log(title = "航线(kmz)", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/updateFolderId/{id}/{folderId}") |
| | | public AjaxResult updateFolderId(@PathVariable("id") String id, |
| | | @PathVariable("folderId") String folderId) { |
| | | return toAjax(ardRouteInformationService.updateRouteInformationFolderId(id,folderId)); |
| | | @PutMapping("/updateGroupingId/{id}/{groupingId}") |
| | | public AjaxResult updateGroupingId(@PathVariable("id") String id, |
| | | @PathVariable("groupingId") String groupingId) { |
| | | return toAjax(ardRouteInforService.updateRouteInformationGroupingId(id,groupingId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @GetMapping("/noFly/{longitude}/{latitude}") |
| | | public Boolean noFly(@PathVariable("longitude") Double longitude, |
| | | @PathVariable("latitude") Double latitude) { |
| | | return ardRouteInformationService.selectRouteInformationNoFly(longitude,latitude); |
| | | return ardRouteInforService.selectRouteInformationNoFly(longitude,latitude); |
| | | } |
| | | |
| | | /** |
| | | * 上传航线到边缘服务器 |
| | | */ |
| | | // @ApiOperation("上传航线到边缘服务器") |
| | | // @PostMapping |
| | | // public AjaxResult uploadRouteInformation(@RequestBody ArdRouteInfor ArdRouteInfor) { |
| | | // return success(ArdRouteInforService.selectArdRouteInforByName(ArdRouteInfor.getName())); |
| | | // } |
| | | |
| | | } |
| File was renamed from ard-route/src/main/java/com/ard/route/domain/route/ArdRouteFolder.java |
| | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 分组对象 ard_route_folder |
| | | * 分组对象 ard_route_grouping |
| | | * |
| | | * @author xia |
| | | * @date 2025-10-18 |
| | | */ |
| | | @Data |
| | | public class ArdRouteFolder extends BaseEntity { |
| | | public class ArdRouteGrouping extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | |
| | | /** 文件夹名称 */ |
| | | @Excel(name = "文件夹名称") |
| | | private String fileName; |
| | | private String groupingName; |
| | | |
| | | /** 序列号 */ |
| | | @Excel(name = "序列号") |
| | | private Integer serialNumber; |
| | | |
| | | private List<ArdRouteInformation> ardRouteInformationLs; |
| | | private List<ArdRouteInfor> ardRouteInforLS; |
| | | |
| | | } |
| New file |
| | |
| | | package com.ard.route.domain.route; |
| | | |
| | | import com.ard.common.annotation.Excel; |
| | | import com.ard.common.core.domain.BaseEntity; |
| | | import com.ard.route.domain.UavRouteReq; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 航线(kmz)对象 ard_route_infor |
| | | * |
| | | * @author xia |
| | | * @date 2025-10-23 |
| | | */ |
| | | @Data |
| | | public class ArdRouteInfor extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** ID */ |
| | | private String id; |
| | | |
| | | /** 文件名称 */ |
| | | @Excel(name = "文件名称") |
| | | private String kmzName; |
| | | |
| | | /** 文件路径 */ |
| | | @Excel(name = "文件路径") |
| | | private String upPath; |
| | | |
| | | /** 分组ID */ |
| | | @Excel(name = "分组ID") |
| | | private String groupingId; |
| | | |
| | | /** 航线类型 */ |
| | | @Excel(name = "航线类型") |
| | | private String type; |
| | | |
| | | /** 飞行器产品 */ |
| | | @Excel(name = "飞行器产品") |
| | | private String aircraft; |
| | | |
| | | /** 负载类型 */ |
| | | @Excel(name = "负载类型") |
| | | private String payload; |
| | | |
| | | /** |
| | | * 生成kmz文件实体类 |
| | | */ |
| | | private UavRouteReq uavRouteReq; |
| | | |
| | | /** 航线数据 */ |
| | | private byte[] routeData; |
| | | |
| | | } |
| | |
| | | @Data |
| | | public class KmzResultVo { |
| | | |
| | | /** 新文件名称 */ |
| | | private String fileNameNew; |
| | | |
| | | /** Minio文件路径 */ |
| | | private String minioUpPath; |
| | | |
| | | /** 文件路径 */ |
| | | private String upPath; |
| | | |
| | | /** 文件大小 */ |
| | | private Double upFileSize; |
| | | |
| | | /** 返回数据 */ |
| | | private String data; |
| New file |
| | |
| | | package com.ard.route.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.ard.route.domain.route.ArdRouteGrouping; |
| | | |
| | | /** |
| | | * 分组Mapper接口 |
| | | * |
| | | * @author xia |
| | | * @date 2025-10-18 |
| | | */ |
| | | public interface ArdRouteGroupingMapper { |
| | | |
| | | /** |
| | | * 查询分组 |
| | | * |
| | | * @param id 分组主键 |
| | | * @return 分组 |
| | | */ |
| | | public ArdRouteGrouping selectArdRouteGroupingById(String id); |
| | | |
| | | /** |
| | | * 查询分组列表 |
| | | * |
| | | * @param ardRouteGrouping 分组 |
| | | * @return 分组集合 |
| | | */ |
| | | public List<ArdRouteGrouping> selectArdRouteGroupingList(ArdRouteGrouping ardRouteGrouping); |
| | | |
| | | /** |
| | | * 新增分组 |
| | | * |
| | | * @param ardRouteGrouping 分组 |
| | | * @return 结果 |
| | | */ |
| | | public int insertArdRouteGrouping(ArdRouteGrouping ardRouteGrouping); |
| | | |
| | | /** |
| | | * 修改分组 |
| | | * |
| | | * @param ardRouteGrouping 分组 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdRouteGrouping(ArdRouteGrouping ardRouteGrouping); |
| | | |
| | | /** |
| | | * 删除分组 |
| | | * |
| | | * @param id 分组主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdRouteGroupingById(String id); |
| | | |
| | | /** |
| | | * 批量删除分组 |
| | | * |
| | | * @param ids 需要删除的数据主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdRouteGroupingByIds(String[] ids); |
| | | |
| | | } |
| New file |
| | |
| | | package com.ard.route.mapper; |
| | | |
| | | import com.ard.route.domain.route.ArdRouteInfor; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 航线(kmz)Mapper接口 |
| | | * |
| | | * @author xia |
| | | * @date 2025-10-23 |
| | | */ |
| | | public interface ArdRouteInforMapper { |
| | | |
| | | /** |
| | | * 查询航线(kmz) |
| | | * |
| | | * @param id 航线(kmz)主键 |
| | | * @return 航线(kmz) |
| | | */ |
| | | public ArdRouteInfor selectArdRouteInforById(String id); |
| | | |
| | | /** |
| | | * 查询航线(kmz)列表 |
| | | * |
| | | * @param ardRouteInfor 航线(kmz) |
| | | * @return 航线(kmz)集合 |
| | | */ |
| | | public List<ArdRouteInfor> selectArdRouteInforList(ArdRouteInfor ardRouteInfor); |
| | | |
| | | /** |
| | | * 新增航线(kmz) |
| | | * |
| | | * @param ardRouteInfor 航线(kmz) |
| | | * @return 结果 |
| | | */ |
| | | public int insertArdRouteInfor(ArdRouteInfor ardRouteInfor); |
| | | |
| | | /** |
| | | * 修改航线(kmz) |
| | | * |
| | | * @param ardRouteInfor 航线(kmz) |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdRouteInfor(ArdRouteInfor ardRouteInfor); |
| | | |
| | | /** |
| | | * 删除航线(kmz) |
| | | * |
| | | * @param id 航线(kmz)主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdRouteInforById(String id); |
| | | |
| | | /** |
| | | * 批量删除航线(kmz) |
| | | * |
| | | * @param ids 需要删除的数据主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdRouteInforByIds(String[] ids); |
| | | |
| | | /** |
| | | * 根据文件名称查询航线信息 |
| | | * |
| | | * @param fileName 文件名称 |
| | | * @return 结果 |
| | | */ |
| | | public ArdRouteInfor selectArdRouteInforByName(String fileName); |
| | | |
| | | /** |
| | | * 根据所属分组ID,删除信息 |
| | | * |
| | | * @param groupingIds 所属文件夹ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteRouteInforByGroupingIds(String[] groupingIds); |
| | | |
| | | /** |
| | | * 查询航线(kmz)列表 |
| | | * |
| | | * @param groupingId 所属分组ID |
| | | * @return 航线(kmz)集合 |
| | | */ |
| | | public List<ArdRouteInfor> selectArdRouteInforByGroupingId(String groupingId); |
| | | |
| | | /** |
| | | * 修改航线分组ID |
| | | * |
| | | * @param id ID |
| | | * @param groupingId 分组ID |
| | | * @return 结果 |
| | | */ |
| | | public int updateRouteInforGroupingId(@Param("id") String id, @Param("groupingId")String groupingId); |
| | | |
| | | } |
| New file |
| | |
| | | package com.ard.route.service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.ard.route.domain.route.ArdRouteGrouping; |
| | | |
| | | /** |
| | | * 分组Service接口 |
| | | * |
| | | * @author xia |
| | | * @date 2025-10-18 |
| | | */ |
| | | public interface IArdRouteGroupingService { |
| | | |
| | | /** |
| | | * 查询分组 |
| | | * |
| | | * @param id 分组主键 |
| | | * @return 分组 |
| | | */ |
| | | public ArdRouteGrouping selectArdRouteGroupingById(String id); |
| | | |
| | | /** |
| | | * 查询分组列表 |
| | | * |
| | | * @param ardRouteGrouping 分组 |
| | | * @return 分组集合 |
| | | */ |
| | | public List<ArdRouteGrouping> selectArdRouteGroupingList(ArdRouteGrouping ardRouteGrouping); |
| | | |
| | | /** |
| | | * 新增分组 |
| | | * |
| | | * @param ardRouteGrouping 分组 |
| | | * @return 结果 |
| | | */ |
| | | public int insertArdRouteGrouping(ArdRouteGrouping ardRouteGrouping); |
| | | |
| | | /** |
| | | * 修改分组 |
| | | * |
| | | * @param ardRouteGrouping 分组 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdRouteGrouping(ArdRouteGrouping ardRouteGrouping); |
| | | |
| | | /** |
| | | * 批量删除分组 |
| | | * |
| | | * @param ids 需要删除的分组主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public Map<String, Integer> deleteArdRouteGroupingByIds(String[] ids); |
| | | |
| | | /** |
| | | * 删除分组信息 |
| | | * |
| | | * @param id 分组主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdRouteGroupingById(String id); |
| | | } |
| New file |
| | |
| | | package com.ard.route.service; |
| | | |
| | | import com.ard.oss.model.MinioUploadResult; |
| | | import com.ard.route.domain.route.ArdRouteInfor; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 航线(kmz)Service接口 |
| | | * |
| | | * @author xia |
| | | * @date 2025-10-23 |
| | | */ |
| | | public interface IArdRouteInforService { |
| | | |
| | | /** |
| | | * 查询航线(kmz) |
| | | * |
| | | * @param id 航线(kmz)主键 |
| | | * @return 航线(kmz) |
| | | */ |
| | | public ArdRouteInfor selectArdRouteInforById(String id); |
| | | |
| | | /** |
| | | * 查询航线(kmz)列表 |
| | | * |
| | | * @param ardRouteInfor 航线(kmz) |
| | | * @return 航线(kmz)集合 |
| | | */ |
| | | public List<ArdRouteInfor> selectArdRouteInforList(ArdRouteInfor ardRouteInfor); |
| | | |
| | | /** |
| | | * 新增航线(kmz) |
| | | * |
| | | * @param ardRouteInfor 航线(kmz) |
| | | * @return 结果 |
| | | */ |
| | | public String insertArdRouteInfor(ArdRouteInfor ardRouteInfor); |
| | | |
| | | /** |
| | | * 修改航线(kmz) |
| | | * |
| | | * @param ardRouteInfor 航线(kmz) |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdRouteInfor(ArdRouteInfor ardRouteInfor); |
| | | |
| | | /** |
| | | * 批量删除航线(kmz) |
| | | * |
| | | * @param ids 需要删除的航线(kmz)主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdRouteInforByIds(String[] ids); |
| | | |
| | | /** |
| | | * 删除航线(kmz)信息 |
| | | * |
| | | * @param id 航线(kmz)主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdRouteInforById(String id); |
| | | |
| | | /** |
| | | * 导入航线(kmz)文件 |
| | | * |
| | | * @param file 文件 |
| | | * @return 结果 |
| | | */ |
| | | public MinioUploadResult uploadArdRouteInfor(MultipartFile file); |
| | | |
| | | /** |
| | | * 根据文件名称查询航线信息 |
| | | * |
| | | * @param name 文件 |
| | | * @return 结果 |
| | | */ |
| | | public ArdRouteInfor selectArdRouteInforByName(String name); |
| | | |
| | | /** |
| | | * 修改航线分组ID |
| | | * |
| | | * @param id ID |
| | | * @param groupingId 分组ID |
| | | * @return 结果 |
| | | */ |
| | | public int updateRouteInformationGroupingId(String id,String groupingId); |
| | | |
| | | /** |
| | | * 判断行点是否在禁飞区 |
| | | * |
| | | * @param longitude 经度 |
| | | * @param latitude 纬度 |
| | | * @return 结果 |
| | | */ |
| | | public Boolean selectRouteInformationNoFly(Double longitude, Double latitude); |
| | | |
| | | } |
| | |
| | | /** |
| | | * 生成kmz文件(带航点) |
| | | */ |
| | | public KmzResultVo buildKmz(UavRouteReq uavRouteReq, String fileName); |
| | | public KmzResultVo buildKmz(UavRouteReq uavRouteReq, String kmzName); |
| | | |
| | | /** |
| | | * 解析kmz文件 |
| New file |
| | |
| | | package com.ard.route.service.impl; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.ard.common.annotation.DataScope; |
| | | import com.ard.common.utils.DateUtils; |
| | | import com.ard.common.utils.uuid.IdUtils; |
| | | import com.ard.route.domain.route.ArdRouteGrouping; |
| | | import com.ard.route.mapper.ArdRouteGroupingMapper; |
| | | import com.ard.route.mapper.ArdRouteInforMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ard.route.service.IArdRouteGroupingService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * 文件夹Service业务层处理 |
| | | * |
| | | * @author xia |
| | | * @date 2025-10-18 |
| | | */ |
| | | @Service |
| | | public class ArdRouteGroupingServiceImpl implements IArdRouteGroupingService { |
| | | |
| | | @Autowired |
| | | private ArdRouteGroupingMapper ardRouteGroupingMapper; |
| | | |
| | | @Autowired |
| | | private ArdRouteInforMapper ardRouteInforMapper; |
| | | |
| | | /** |
| | | * 查询分组 |
| | | * |
| | | * @param id 分组主键 |
| | | * @return 分组 |
| | | */ |
| | | @Override |
| | | public ArdRouteGrouping selectArdRouteGroupingById(String id) { |
| | | ArdRouteGrouping ardRouteGrouping = ardRouteGroupingMapper.selectArdRouteGroupingById(id); |
| | | ardRouteGrouping.setArdRouteInforLS(ardRouteInforMapper.selectArdRouteInforByGroupingId(id)); |
| | | return ardRouteGrouping; |
| | | } |
| | | |
| | | /** |
| | | * 查询分组列表 |
| | | * |
| | | * @param ardRouteGrouping 分组 |
| | | * @return 分组 |
| | | */ |
| | | @Override |
| | | @DataScope(deptAlias = "d", userAlias = "u") |
| | | public List<ArdRouteGrouping> selectArdRouteGroupingList(ArdRouteGrouping ardRouteGrouping) { |
| | | List<ArdRouteGrouping> list = ardRouteGroupingMapper.selectArdRouteGroupingList(ardRouteGrouping); |
| | | for (ArdRouteGrouping routeGrouping : list) { |
| | | routeGrouping.setArdRouteInforLS(ardRouteInforMapper.selectArdRouteInforByGroupingId(routeGrouping.getId())); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 新增分组 |
| | | * |
| | | * @param ardRouteGrouping 分组 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertArdRouteGrouping(ArdRouteGrouping ardRouteGrouping) { |
| | | ardRouteGrouping.setId(IdUtils.simpleUUID()); |
| | | ardRouteGrouping.setCreateTime(DateUtils.getNowDate()); |
| | | // 获取当前数据条数 |
| | | int count = ardRouteGroupingMapper.selectArdRouteGroupingList(null).size(); |
| | | ardRouteGrouping.setSerialNumber(count + 1); |
| | | return ardRouteGroupingMapper.insertArdRouteGrouping(ardRouteGrouping); |
| | | } |
| | | |
| | | /** |
| | | * 修改分组 |
| | | * |
| | | * @param ardRouteGrouping 分组 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateArdRouteGrouping(ArdRouteGrouping ardRouteGrouping) { |
| | | // 不能修改默认分组 |
| | | if ("0".equals(ardRouteGrouping.getId())) { |
| | | throw new RuntimeException("不能修改默认分组"); |
| | | } |
| | | ardRouteGrouping.setUpdateTime(DateUtils.getNowDate()); |
| | | return ardRouteGroupingMapper.updateArdRouteGrouping(ardRouteGrouping); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除分组 |
| | | * |
| | | * @param ids 需要删除的分组主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Map<String, Integer> deleteArdRouteGroupingByIds(String[] ids) { |
| | | // 检查是否包含默认分组,不能删除默认分组 |
| | | for (String id : ids) { |
| | | if ("0".equals(id)) { |
| | | throw new RuntimeException("不能删除默认分组"); |
| | | } |
| | | } |
| | | |
| | | Map<String, Integer> result = new HashMap<>(); |
| | | try { |
| | | // 先删除航线信息 |
| | | int informationCount = ardRouteInforMapper.deleteRouteInforByGroupingIds(ids); |
| | | result.put("informationCount", informationCount); |
| | | |
| | | // 再删除分组 |
| | | int groupingCount = ardRouteGroupingMapper.deleteArdRouteGroupingByIds(ids); |
| | | result.put("groupingCount", groupingCount); |
| | | |
| | | return result; |
| | | } catch (Exception e) { |
| | | throw e; // 抛出异常让事务回滚 |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除分组信息 |
| | | * |
| | | * @param id 分组主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteArdRouteGroupingById(String id) { |
| | | return ardRouteGroupingMapper.deleteArdRouteGroupingById(id); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.ard.route.service.impl; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | |
| | | import com.ard.common.exception.ControlException; |
| | | import com.ard.common.utils.DateUtils; |
| | | import com.ard.common.utils.file.FileUtils; |
| | | import com.ard.common.utils.uuid.IdUtils; |
| | | import com.ard.data.noflyzone.domain.ArdNoFlyZone; |
| | | import com.ard.data.noflyzone.domain.Vertex; |
| | | import com.ard.data.noflyzone.service.IArdNoFlyZoneService; |
| | | import com.ard.data.noflyzone.utils.NoFlyZoneUtils; |
| | | import com.ard.oss.model.MinioUploadResult; |
| | | import com.ard.oss.service.impl.OssServiceContext; |
| | | import com.ard.route.domain.UavRouteReq; |
| | | import com.ard.route.domain.route.ArdRouteInfor; |
| | | import com.ard.route.domain.vo.KmzResultVo; |
| | | import com.ard.route.mapper.ArdRouteInforMapper; |
| | | import com.ard.route.service.IArdRouteInforService; |
| | | import com.ard.route.service.UavRouteService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import static com.ard.route.util.ToolUtils.*; |
| | | |
| | | /** |
| | | * 航线(kmz)Service业务层处理 |
| | | * |
| | | * @author xia |
| | | * @date 2025-10-23 |
| | | */ |
| | | @Service |
| | | public class ArdRouteInforServiceImpl implements IArdRouteInforService { |
| | | |
| | | @Autowired |
| | | private ArdRouteInforMapper ardRouteInforMapper; |
| | | |
| | | @Autowired |
| | | private OssServiceContext ossService; |
| | | |
| | | @Autowired |
| | | private UavRouteService routeService; |
| | | |
| | | @Resource |
| | | private IArdNoFlyZoneService ardNoFlyZoneService; |
| | | |
| | | /** |
| | | * 查询航线(kmz) |
| | | * |
| | | * @param id 航线(kmz)主键 |
| | | * @return 航线(kmz) |
| | | */ |
| | | @Override |
| | | public ArdRouteInfor selectArdRouteInforById(String id) { |
| | | ArdRouteInfor ardRouteInfor = ardRouteInforMapper.selectArdRouteInforById(id); |
| | | try { |
| | | ardRouteInfor.setUavRouteReq((UavRouteReq) deserialize(ardRouteInfor.getRouteData())); |
| | | } catch (IOException | ClassNotFoundException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return ardRouteInfor; |
| | | } |
| | | |
| | | /** |
| | | * 查询航线(kmz)列表 |
| | | * |
| | | * @param ardRouteInfor 航线(kmz) |
| | | * @return 航线(kmz) |
| | | */ |
| | | @Override |
| | | public List<ArdRouteInfor> selectArdRouteInforList(ArdRouteInfor ardRouteInfor) { |
| | | return ardRouteInforMapper.selectArdRouteInforList(ardRouteInfor); |
| | | } |
| | | |
| | | /** |
| | | * 新增航线(kmz) |
| | | * |
| | | * @param ardRouteInfor 航线(kmz) |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public String insertArdRouteInfor(ArdRouteInfor ardRouteInfor) { |
| | | ardRouteInfor.setId(IdUtils.simpleUUID()); |
| | | ardRouteInfor.setCreateTime(DateUtils.getNowDate()); |
| | | if (ardRouteInfor.getGroupingId() == null){ |
| | | ardRouteInfor.setGroupingId("0"); |
| | | } |
| | | // 航线数据 |
| | | byte[] routeData; |
| | | try { |
| | | routeData = serialize(ardRouteInfor.getUavRouteReq()); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | ardRouteInfor.setRouteData(routeData); |
| | | KmzResultVo kmzResult = routeService.buildKmz(ardRouteInfor.getUavRouteReq(), ardRouteInfor.getKmzName()); |
| | | ardRouteInfor.setUpPath(kmzResult.getUpPath()); |
| | | ardRouteInforMapper.insertArdRouteInfor(ardRouteInfor); |
| | | return kmzResult.getUpPath(); |
| | | } |
| | | |
| | | /** |
| | | * 修改航线(kmz) |
| | | * |
| | | * @param ardRouteInfor 航线(kmz) |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateArdRouteInfor(ArdRouteInfor ardRouteInfor) { |
| | | ardRouteInfor.setUpdateTime(DateUtils.getNowDate()); |
| | | KmzResultVo kmzResult = new KmzResultVo(); |
| | | // 获取源文件名字 |
| | | ArdRouteInfor route = ardRouteInforMapper.selectArdRouteInforById(ardRouteInfor.getId()); |
| | | if (route.getKmzName().equals(ardRouteInfor.getKmzName())) { |
| | | kmzResult = routeService.updateKmz(ardRouteInfor.getUavRouteReq(), ardRouteInfor.getKmzName()); |
| | | }else { |
| | | kmzResult = routeService.updateKmzNew(ardRouteInfor.getUavRouteReq(), route.getKmzName(), ardRouteInfor.getKmzName()); |
| | | } |
| | | if ("更新航线kmz文件失败".equals(kmzResult.getData())) { |
| | | return 0; |
| | | } |
| | | ardRouteInfor.setUpPath(kmzResult.getUpPath()); |
| | | return ardRouteInforMapper.updateArdRouteInfor(ardRouteInfor); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除航线(kmz) |
| | | * |
| | | * @param ids 需要删除的航线(kmz)主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteArdRouteInforByIds(String[] ids) { |
| | | // 删除航线(kmz)文件 |
| | | for (String id : ids) { |
| | | ArdRouteInfor information = ardRouteInforMapper.selectArdRouteInforById(id); |
| | | ossService.deleteObject("kmz", subStringMinioUrlName(information.getUpPath())); |
| | | } |
| | | return ardRouteInforMapper.deleteArdRouteInforByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * 删除航线(kmz)信息 |
| | | * |
| | | * @param id 航线(kmz)主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteArdRouteInforById(String id) { |
| | | return ardRouteInforMapper.deleteArdRouteInforById(id); |
| | | } |
| | | |
| | | /** |
| | | * 导入航线(kmz)文件 |
| | | * |
| | | * @param file 文件 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public MinioUploadResult uploadArdRouteInfor(MultipartFile file) { |
| | | try { |
| | | String url = ossService.upload("kmz",file); |
| | | ArdRouteInfor information = new ArdRouteInfor(); |
| | | information.setKmzName(file.getOriginalFilename()); |
| | | information.setUpPath(url); |
| | | information.setGroupingId("0"); // 默认分组 |
| | | insertRouteInformation(information); |
| | | return MinioUploadResult.builder() |
| | | .url(url) |
| | | .newFileName(FileUtils.getName(url)) |
| | | .originalFilename(file.getOriginalFilename()) |
| | | .build(); |
| | | }catch (Exception e){ |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据文件名称查询航线信息 |
| | | * |
| | | * @param name 文件名称 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public ArdRouteInfor selectArdRouteInforByName(String name) { |
| | | return ardRouteInforMapper.selectArdRouteInforByName(name); |
| | | } |
| | | |
| | | /** |
| | | * 修改航线分组ID |
| | | * |
| | | * @param id ID |
| | | * @param groupingId 分组ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateRouteInformationGroupingId(String id, String groupingId) { |
| | | return ardRouteInforMapper.updateRouteInforGroupingId(id, groupingId); |
| | | } |
| | | |
| | | /** |
| | | * 判断行点是否在禁飞区 |
| | | * |
| | | * @param longitude 经度 |
| | | * @param latitude 纬度 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public Boolean selectRouteInformationNoFly(Double longitude, Double latitude) { |
| | | if (longitude == null || latitude == null) { |
| | | throw new ControlException("方法参数中未找到有效经纬度字段,无法判断禁飞区!"); |
| | | } |
| | | List<ArdNoFlyZone> ardNoFlyZones = ardNoFlyZoneService.selectArdNoFlyZoneList(new ArdNoFlyZone()); |
| | | if (!ardNoFlyZones.isEmpty()) { |
| | | Vertex vertex = new Vertex(longitude, latitude); |
| | | boolean inNoFlyZones = NoFlyZoneUtils.isInNoFlyZones(vertex, ardNoFlyZones); |
| | | if (inNoFlyZones) { |
| | | throw new ControlException("目标点在禁飞区内,无法执行操作!"); |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 数据新增航线信息 |
| | | */ |
| | | private void insertRouteInformation(ArdRouteInfor ardRouteInfor){ |
| | | ardRouteInfor.setId(IdUtils.simpleUUID()); |
| | | ardRouteInfor.setCreateTime(DateUtils.getNowDate()); |
| | | ardRouteInforMapper.insertArdRouteInfor(ardRouteInfor); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.io.FileUtil; |
| | | import com.ard.common.utils.SecurityUtils; |
| | | import com.ard.oss.service.impl.OssServiceContext; |
| | | import com.ard.route.constant.FileTypeConstants; |
| | | import com.ard.route.domain.RoutePointReq; |
| | |
| | | import com.ard.route.domain.WaypointHeadingReq; |
| | | import com.ard.route.domain.WaypointTurnReq; |
| | | import com.ard.route.domain.kml.*; |
| | | import com.ard.route.domain.route.ArdRouteInformation; |
| | | import com.ard.route.domain.route.ArdRouteInfor; |
| | | import com.ard.route.domain.vo.KmzInfoVO; |
| | | import com.ard.route.domain.vo.KmzResultVo; |
| | | import com.ard.route.enums.kml.ExitOnRCLostEnums; |
| | | import com.ard.route.service.IArdRouteInformationService; |
| | | import com.ard.route.util.FileUtils; |
| | | import com.ard.route.service.IArdRouteInforService; |
| | | import com.ard.route.util.InitializationUtils; |
| | | import com.ard.route.util.RouteFileUtils; |
| | | import com.ard.route.service.UavRouteService; |
| | |
| | | import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.mock.web.MockMultipartFile; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | private OssServiceContext ossService; |
| | | |
| | | @Resource |
| | | private IArdRouteInformationService ardRouteInformationService; |
| | | private IArdRouteInforService ardRouteInformationService; |
| | | |
| | | InitializationUtils init = new InitializationUtils(); |
| | | |
| | |
| | | public KmzResultVo updateKmz(UavRouteReq uavRouteReq,String fileName){ |
| | | KmzResultVo result = new KmzResultVo(); |
| | | // 校验修改的文件是否存在 |
| | | ArdRouteInformation routeInformation = ardRouteInformationService.selectArdRouteInformationByName(fileName); |
| | | ArdRouteInfor routeInformation = ardRouteInformationService.selectArdRouteInforByName(fileName); |
| | | if ( routeInformation == null ){ |
| | | result.setData("修改航线文件失败,请检查文件是否存在"); |
| | | return result; |
| | | } |
| | | |
| | | // 获取文件 |
| | | String minioUrl = routeInformation.getMinioUpPath(); |
| | | try (InputStream inputStream = ossService.getObject(kmzPath,minioUrl); |
| | | String minioUrlName = subStringMinioUrlName(routeInformation.getUpPath()); |
| | | try (InputStream inputStream = ossService.getObject(kmzPath,minioUrlName); |
| | | ArchiveInputStream archiveInputStream = new ZipArchiveInputStream(inputStream)){ |
| | | ArchiveEntry entry; |
| | | KmlInfo kmlInfo = new KmlInfo(); |
| | |
| | | } |
| | | } |
| | | // 删除文件 |
| | | ossService.deleteObject(kmzPath, minioUrl); |
| | | return buildKmzMethod(routeInformation.getFileName(), kmlInfo, wpmlInfo); |
| | | ossService.deleteObject(kmzPath, minioUrlName); |
| | | return buildKmzMethod(routeInformation.getKmzName(), kmlInfo, wpmlInfo); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | result.setData("更新航线kmz文件失败"); |
| | |
| | | * 生成kmz文件(带航点) |
| | | */ |
| | | @Override |
| | | public KmzResultVo buildKmz(UavRouteReq uavRouteReq, String fileName) { |
| | | public KmzResultVo buildKmz(UavRouteReq uavRouteReq, String kmzName) { |
| | | // 赋值默认参数 |
| | | init.initialization(uavRouteReq); |
| | | KmlParams kmlParams = new KmlParams(); |
| | | BeanUtils.copyProperties(uavRouteReq, kmlParams); |
| | | kmlParams.setRoutePointList(BeanUtil.copyToList(uavRouteReq.getRoutePointList(), RoutePointInfo.class)); |
| | | return buildKmz(fileName, kmlParams); |
| | | return buildKmz(kmzName, kmlParams); |
| | | } |
| | | |
| | | /** |
| | |
| | | new ByteArrayInputStream(baos.toByteArray()) |
| | | ); |
| | | String kmzFilePath = ossService.upload(kmzPath,multipartFile); |
| | | result.setFileNameNew(getFileNameWithoutExtension(kmzFilePath)); |
| | | result.setMinioUpPath(extractFilePath(kmzFilePath)); |
| | | result.setUpPath(kmzFilePath); |
| | | result.setUpFileSize(fileSize); |
| | | return result; |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("KMZ文件生成或上传失败", e); |
| | |
| | | public KmzResultVo updateKmzNew(UavRouteReq uavRouteReq, String oldFile, String newFile) { |
| | | KmzResultVo result = new KmzResultVo(); |
| | | // 校验修改的文件是否存在 |
| | | ArdRouteInformation routeInformation = ardRouteInformationService.selectArdRouteInformationByName(oldFile); |
| | | ArdRouteInfor routeInformation = ardRouteInformationService.selectArdRouteInforByName(oldFile); |
| | | if ( routeInformation == null ){ |
| | | result.setData("修改航线文件失败,请检查文件是否存在"); |
| | | return result; |
| | | } |
| | | |
| | | // 获取文件 |
| | | String minioUrl = routeInformation.getMinioUpPath(); |
| | | String minioUrl = subStringMinioUrlName(routeInformation.getUpPath()); |
| | | try (InputStream inputStream = ossService.getObject(kmzPath,minioUrl); |
| | | ArchiveInputStream archiveInputStream = new ZipArchiveInputStream(inputStream)){ |
| | | ArchiveEntry entry; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 截取字符串 |
| | | * 参数: https://xxx.xxx.xxx.xxx:xxx/kmz/2025/11/08/文件名_20251108152249A001.kmz |
| | | */ |
| | | public static String subStringMinioName(String url) { |
| | | return new File(url).getName(); |
| | | } |
| | | |
| | | /** |
| | | * 截取字符串 |
| | | * minio里面文件夹路径名称 |
| | | */ |
| | | public static String subStringMinioUrlName(String url) { |
| | | int kmzIndex = url.indexOf("/kmz/"); |
| | | return url.substring(kmzIndex + 5); // +5 是为了跳过 "/kmz/" |
| | | } |
| | | |
| | | } |
| File was renamed from ard-route/src/main/resources/mapper/ArdRouteFolderMapper.xml |
| | |
| | | <!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"> |
| | | <mapper namespace="com.ard.route.mapper.ArdRouteGroupingMapper"> |
| | | |
| | | <resultMap type="ArdRouteFolder" id="ArdRouteFolderResult"> |
| | | <resultMap type="ArdRouteGrouping" id="ArdRouteGroupingResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="fileName" column="file_name" /> |
| | | <result property="groupingName" column="grouping_name" /> |
| | | <result property="serialNumber" column="serial_number" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | |
| | | <result property="updateTime" column="update_time" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdRouteFolderVo"> |
| | | <sql id="selectArdRouteGroupingVo"> |
| | | select id, |
| | | file_name, |
| | | grouping_name, |
| | | serial_number, |
| | | create_by, |
| | | create_time, |
| | | update_by, |
| | | update_time |
| | | from ard_route_folder |
| | | from ard_route_grouping |
| | | </sql> |
| | | |
| | | <select id="selectArdRouteFolderList" parameterType="ArdRouteFolder" resultMap="ArdRouteFolderResult"> |
| | | <include refid="selectArdRouteFolderVo"/> |
| | | <select id="selectArdRouteGroupingList" parameterType="ArdRouteGrouping" resultMap="ArdRouteGroupingResult"> |
| | | <include refid="selectArdRouteGroupingVo"/> |
| | | <where> |
| | | <if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if> |
| | | <if test="groupingName != null and groupingName != ''"> and grouping_name like concat('%', #{groupingName}, '%')</if> |
| | | <if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if> |
| | | <if test="createTime != null "> and create_time = #{createTime}</if> |
| | | <if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if> |
| | |
| | | order by serial_number asc |
| | | </select> |
| | | |
| | | <select id="selectArdRouteFolderById" parameterType="String" resultMap="ArdRouteFolderResult"> |
| | | <include refid="selectArdRouteFolderVo"/> |
| | | <select id="selectArdRouteGroupingById" parameterType="String" resultMap="ArdRouteGroupingResult"> |
| | | <include refid="selectArdRouteGroupingVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertArdRouteFolder" parameterType="ArdRouteFolder"> |
| | | insert into ard_route_folder |
| | | <insert id="insertArdRouteGrouping" parameterType="ArdRouteGrouping"> |
| | | insert into ard_route_grouping |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="fileName != null">file_name,</if> |
| | | <if test="groupingName != null">grouping_name,</if> |
| | | <if test="serialNumber != null">serial_number,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="fileName != null">#{fileName},</if> |
| | | <if test="groupingName != null">#{groupingName},</if> |
| | | <if test="serialNumber != null">#{serialNumber},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateArdRouteFolder" parameterType="ArdRouteFolder"> |
| | | update ard_route_folder |
| | | <update id="updateArdRouteGrouping" parameterType="ArdRouteGrouping"> |
| | | update ard_route_grouping |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="fileName != null">file_name = #{fileName},</if> |
| | | <if test="groupingName != null">grouping_name = #{groupingName},</if> |
| | | <if test="serialNumber != null">serial_number = #{serialNumber},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteArdRouteFolderById" parameterType="String"> |
| | | delete from ard_route_folder where id = #{id} |
| | | <delete id="deleteArdRouteGroupingById" parameterType="String"> |
| | | delete from ard_route_grouping where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteArdRouteFolderByIds" parameterType="String"> |
| | | delete from ard_route_folder where id in |
| | | <delete id="deleteArdRouteGroupingByIds" parameterType="String"> |
| | | delete from ard_route_grouping where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| New file |
| | |
| | | <?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.ArdRouteInforMapper"> |
| | | |
| | | <resultMap type="ArdRouteInfor" id="ArdRouteInforResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="kmzName" column="kmz_name" /> |
| | | <result property="upPath" column="up_path" /> |
| | | <result property="groupingId" column="grouping_id" /> |
| | | <result property="type" column="type" /> |
| | | <result property="aircraft" column="aircraft" /> |
| | | <result property="payload" column="payload" /> |
| | | <result property="routeData" column="route_data" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdRouteInforVo"> |
| | | select id, |
| | | kmz_name, |
| | | up_path, |
| | | grouping_id, |
| | | type, |
| | | aircraft, |
| | | payload, |
| | | route_data, |
| | | create_by, |
| | | create_time, |
| | | update_by, |
| | | update_time |
| | | from ard_route_infor |
| | | </sql> |
| | | |
| | | <select id="selectArdRouteInforList" parameterType="ArdRouteInfor" resultMap="ArdRouteInforResult"> |
| | | <include refid="selectArdRouteInforVo"/> |
| | | <where> |
| | | <if test="kmzName != null and kmzName != ''"> and kmz_name like concat('%', #{kmzName}, '%')</if> |
| | | <if test="aircraft != null and aircraft != ''"> and aircraft = #{aircraft}</if> |
| | | <if test="payload != null and payload != ''"> and payload = #{payload}</if> |
| | | <if test="type != null and type != ''"> and type = #{type}</if> |
| | | <if test="upPath != null and upPath != ''"> and up_path = #{upPath}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectArdRouteInforById" parameterType="String" resultMap="ArdRouteInforResult"> |
| | | <include refid="selectArdRouteInforVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertArdRouteInfor" parameterType="ArdRouteInfor"> |
| | | insert into ard_route_infor |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="kmzName != null">kmz_name,</if> |
| | | <if test="upPath != null">up_path,</if> |
| | | <if test="groupingId != null">grouping_id,</if> |
| | | <if test="type != null">type,</if> |
| | | <if test="aircraft != null">aircraft,</if> |
| | | <if test="payload != null">payload,</if> |
| | | <if test="routeData != null">route_data,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="kmzName != null">#{kmzName},</if> |
| | | <if test="upPath != null">#{upPath},</if> |
| | | <if test="groupingId != null">#{groupingId},</if> |
| | | <if test="type != null">#{type},</if> |
| | | <if test="aircraft != null">#{aircraft},</if> |
| | | <if test="payload != null">#{payload},</if> |
| | | <if test="routeData != null">#{routeData},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateArdRouteInfor" parameterType="ArdRouteInfor"> |
| | | update ard_route_infor |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="kmzName != null">kmz_name = #{kmzName},</if> |
| | | <if test="upPath != null">up_path = #{upPath},</if> |
| | | <if test="type != null">type = #{type},</if> |
| | | <if test="aircraft != null">aircraft = #{aircraft},</if> |
| | | <if test="payload != null">payload = #{payload},</if> |
| | | <if test="routeData != null">route_data = #{routeData},</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> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteArdRouteInforById" parameterType="String"> |
| | | delete from ard_route_infor where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteArdRouteInforByIds" parameterType="String"> |
| | | delete from ard_route_infor where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <select id="selectArdRouteInforByName" parameterType="String" resultMap="ArdRouteInforResult"> |
| | | <include refid="selectArdRouteInforVo"/> |
| | | where file_name = #{fileName} |
| | | </select> |
| | | |
| | | <delete id="deleteRouteInforByGroupingIds" parameterType="String"> |
| | | delete from ard_route_infor where grouping_id in |
| | | <foreach item="groupingIId" collection="array" open="(" separator="," close=")"> |
| | | #{groupingIId} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <select id="selectArdRouteInforByGroupingId" parameterType="String" resultMap="ArdRouteInforResult"> |
| | | select id,kmz_name,up_path,grouping_id,type,aircraft,payload,create_by,create_time,update_by,update_time from ard_route_infor |
| | | <where> |
| | | <if test="groupingId != null "> and grouping_id = #{groupingId}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <update id="updateRouteInforGroupingId"> |
| | | update ard_route_infor |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="groupingId != null">grouping_id = #{groupingId},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | </mapper> |