3 files added
9 files modified
3 files deleted
3 files renamed
| File was renamed from ard-admin/src/main/java/com/ard/web/controller/route/ArdRouteGroupingController.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 com.ard.route.domain.route.ArdRouteGroup; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | 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.service.IArdRouteGroupingService; |
| | | import com.ard.route.service.IArdRouteGroupService; |
| | | |
| | | /** |
| | | * 分组Controller |
| | |
| | | @Api(tags = "分组管理") |
| | | @RestController |
| | | @RequestMapping("/route/grouping") |
| | | public class ArdRouteGroupingController extends BaseController { |
| | | public class ArdRouteGroupController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IArdRouteGroupingService ardRouteGroupingService; |
| | | private IArdRouteGroupService ardRouteGroupService; |
| | | |
| | | /** |
| | | * 查询分组列表 |
| | | */ |
| | | @ApiOperation("查询分组列表") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ArdRouteGrouping ardRouteGrouping) { |
| | | public TableDataInfo list(ArdRouteGroup ardRouteGroup) { |
| | | //startPage(); |
| | | List<ArdRouteGrouping> list = ardRouteGroupingService.selectArdRouteGroupingList(ardRouteGrouping); |
| | | List<ArdRouteGroup> list = ardRouteGroupService.selectArdRouteGroupList(ardRouteGroup); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | |
| | | @ApiOperation("导出分组列表") |
| | | @Log(title = "分组", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ArdRouteGrouping ardRouteGrouping) { |
| | | List<ArdRouteGrouping> list = ardRouteGroupingService.selectArdRouteGroupingList(ardRouteGrouping); |
| | | ExcelUtil<ArdRouteGrouping> util = new ExcelUtil<ArdRouteGrouping>(ArdRouteGrouping.class); |
| | | public void export(HttpServletResponse response, ArdRouteGroup ardRouteGroup) { |
| | | List<ArdRouteGroup> list = ardRouteGroupService.selectArdRouteGroupList(ardRouteGroup); |
| | | ExcelUtil<ArdRouteGroup> util = new ExcelUtil<ArdRouteGroup>(ArdRouteGroup.class); |
| | | util.exportExcel(response, list, "分组数据"); |
| | | } |
| | | |
| | |
| | | @ApiOperation("获取分组详细信息") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") String id) { |
| | | return success(ardRouteGroupingService.selectArdRouteGroupingById(id)); |
| | | return success(ardRouteGroupService.selectArdRouteGroupById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation("新增分组") |
| | | @Log(title = "分组", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ArdRouteGrouping ardRouteGrouping) { |
| | | ardRouteGrouping.setCreateBy(getUsername()); |
| | | return toAjax(ardRouteGroupingService.insertArdRouteGrouping(ardRouteGrouping)); |
| | | public AjaxResult add(@RequestBody ArdRouteGroup ardRouteGroup) { |
| | | ardRouteGroup.setCreateBy(getUsername()); |
| | | return toAjax(ardRouteGroupService.insertArdRouteGroup(ardRouteGroup)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation("修改分组") |
| | | @Log(title = "分组", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ArdRouteGrouping ardRouteGrouping) { |
| | | ardRouteGrouping.setUpdateBy(getUsername()); |
| | | return toAjax(ardRouteGroupingService.updateArdRouteGrouping(ardRouteGrouping)); |
| | | public AjaxResult edit(@RequestBody ArdRouteGroup ardRouteGroup) { |
| | | ardRouteGroup.setUpdateBy(getUsername()); |
| | | return toAjax(ardRouteGroupService.updateArdRouteGroup(ardRouteGroup)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable String[] ids) { |
| | | try { |
| | | Map<String, Integer> result = ardRouteGroupingService.deleteArdRouteGroupingByIds(ids); |
| | | Map<String, Integer> result = ardRouteGroupService.deleteArdRouteGroupByIds(ids); |
| | | if (!result.isEmpty()) { |
| | | return AjaxResult.success("删除成功:分组删除" + result.get("groupingCount") + ",航线删除" + result.get("informationCount")); |
| | | } else { |
| | |
| | | */ |
| | | @ApiOperation("修改航线分组ID") |
| | | @Log(title = "航线(kmz)", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/updateGroupingId/{id}/{groupingId}") |
| | | public AjaxResult updateGroupingId(@PathVariable("id") String id, |
| | | @PathVariable("groupingId") String groupingId) { |
| | | return toAjax(ardRouteInfoService.updateRouteInfomationGroupingId(id,groupingId)); |
| | | @PutMapping("/updateGroupId/{id}/{GroupId}") |
| | | public AjaxResult updateGroupId(@PathVariable("id") String id, |
| | | @PathVariable("GroupId") String GroupId) { |
| | | return toAjax(ardRouteInfoService.updateRouteInfomationGroupId(id,GroupId)); |
| | | } |
| | | |
| | | /** |
| File was renamed from ard-route/src/main/java/com/ard/route/domain/route/ArdRouteGrouping.java |
| | |
| | | * @date 2025-10-18 |
| | | */ |
| | | @Data |
| | | public class ArdRouteGrouping extends BaseEntity { |
| | | public class ArdRouteGroup extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | |
| | | /** 文件路径 */ |
| | | @Excel(name = "文件路径") |
| | | private String upPath; |
| | | private String path; |
| | | |
| | | /** 分组ID */ |
| | | @Excel(name = "分组ID") |
| | | private String groupingId; |
| | | private String groupId; |
| | | |
| | | /** 航线类型 */ |
| | | @Excel(name = "航线类型") |
| | |
| | | public class KmzResultVo { |
| | | |
| | | /** 文件路径 */ |
| | | private String upPath; |
| | | private String path; |
| | | |
| | | /** 返回数据 */ |
| | | private String data; |
| New file |
| | |
| | | package com.ard.route.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ard.route.domain.route.ArdRouteGroup; |
| | | |
| | | /** |
| | | * 分组Mapper接口 |
| | | * |
| | | * @author xia |
| | | * @date 2025-10-18 |
| | | */ |
| | | public interface ArdRouteGroupMapper { |
| | | |
| | | /** |
| | | * 查询分组 |
| | | * |
| | | * @param id 分组主键 |
| | | * @return 分组 |
| | | */ |
| | | public ArdRouteGroup selectArdRouteGroupById(String id); |
| | | |
| | | /** |
| | | * 查询分组列表 |
| | | * |
| | | * @param ardRouteGroup 分组 |
| | | * @return 分组集合 |
| | | */ |
| | | public List<ArdRouteGroup> selectArdRouteGroupList(ArdRouteGroup ardRouteGroup); |
| | | |
| | | /** |
| | | * 新增分组 |
| | | * |
| | | * @param ardRouteGroup 分组 |
| | | * @return 结果 |
| | | */ |
| | | public int insertArdRouteGroup(ArdRouteGroup ardRouteGroup); |
| | | |
| | | /** |
| | | * 修改分组 |
| | | * |
| | | * @param ardRouteGroup 分组 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdRouteGroup(ArdRouteGroup ardRouteGroup); |
| | | |
| | | /** |
| | | * 删除分组 |
| | | * |
| | | * @param id 分组主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdRouteGroupById(String id); |
| | | |
| | | /** |
| | | * 批量删除分组 |
| | | * |
| | | * @param ids 需要删除的数据主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdRouteGroupByIds(String[] ids); |
| | | |
| | | } |
| | |
| | | /** |
| | | * 根据所属分组ID,删除信息 |
| | | * |
| | | * @param groupingIds 所属文件夹ID |
| | | * @param GroupIds 所属文件夹ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteRouteInforByGroupingIds(String[] groupingIds); |
| | | public int deleteRouteInforByGroupIds(String[] GroupIds); |
| | | |
| | | /** |
| | | * 查询航线(kmz)列表 |
| | | * |
| | | * @param groupingId 所属分组ID |
| | | * @param GroupId 所属分组ID |
| | | * @return 航线(kmz)集合 |
| | | */ |
| | | public List<ArdRouteInfo> selectArdRouteInfoByGroupingId(String groupingId); |
| | | public List<ArdRouteInfo> selectArdRouteInfoByGroupId(String GroupId); |
| | | |
| | | /** |
| | | * 修改航线分组ID |
| | | * |
| | | * @param id ID |
| | | * @param groupingId 分组ID |
| | | * @param GroupId 分组ID |
| | | * @return 结果 |
| | | */ |
| | | public int updateRouteInforGroupingId(@Param("id") String id, @Param("groupingId")String groupingId); |
| | | public int updateRouteInforGroupId(@Param("id") String id, @Param("GroupId")String GroupId); |
| | | |
| | | } |
| New file |
| | |
| | | package com.ard.route.service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.ard.route.domain.route.ArdRouteGroup; |
| | | |
| | | /** |
| | | * 分组Service接口 |
| | | * |
| | | * @author xia |
| | | * @date 2025-10-18 |
| | | */ |
| | | public interface IArdRouteGroupService { |
| | | |
| | | /** |
| | | * 查询分组 |
| | | * |
| | | * @param id 分组主键 |
| | | * @return 分组 |
| | | */ |
| | | public ArdRouteGroup selectArdRouteGroupById(String id); |
| | | |
| | | /** |
| | | * 查询分组列表 |
| | | * |
| | | * @param ardRouteGroup 分组 |
| | | * @return 分组集合 |
| | | */ |
| | | public List<ArdRouteGroup> selectArdRouteGroupList(ArdRouteGroup ardRouteGroup); |
| | | |
| | | /** |
| | | * 新增分组 |
| | | * |
| | | * @param ardRouteGroup 分组 |
| | | * @return 结果 |
| | | */ |
| | | public int insertArdRouteGroup(ArdRouteGroup ardRouteGroup); |
| | | |
| | | /** |
| | | * 修改分组 |
| | | * |
| | | * @param ardRouteGroup 分组 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdRouteGroup(ArdRouteGroup ardRouteGroup); |
| | | |
| | | /** |
| | | * 批量删除分组 |
| | | * |
| | | * @param ids 需要删除的分组主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public Map<String, Integer> deleteArdRouteGroupByIds(String[] ids); |
| | | |
| | | /** |
| | | * 删除分组信息 |
| | | * |
| | | * @param id 分组主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdRouteGroupById(String id); |
| | | } |
| | |
| | | * 修改航线分组ID |
| | | * |
| | | * @param id ID |
| | | * @param groupingId 分组ID |
| | | * @param GroupId 分组ID |
| | | * @return 结果 |
| | | */ |
| | | public int updateRouteInfomationGroupingId(String id,String groupingId); |
| | | public int updateRouteInfomationGroupId(String id,String GroupId); |
| | | |
| | | /** |
| | | * 判断行点是否在禁飞区 |
| 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.ArdRouteGroup; |
| | | import com.ard.route.mapper.ArdRouteGroupMapper; |
| | | import com.ard.route.mapper.ArdRouteInfoMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ard.route.service.IArdRouteGroupService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * 文件夹Service业务层处理 |
| | | * |
| | | * @author xia |
| | | * @date 2025-10-18 |
| | | */ |
| | | @Service |
| | | public class ArdRouteGroupServiceImpl implements IArdRouteGroupService { |
| | | |
| | | @Autowired |
| | | private ArdRouteGroupMapper ardRouteGroupMapper; |
| | | |
| | | @Autowired |
| | | private ArdRouteInfoMapper ardRouteInfoMapper; |
| | | |
| | | /** |
| | | * 查询分组 |
| | | * |
| | | * @param id 分组主键 |
| | | * @return 分组 |
| | | */ |
| | | @Override |
| | | public ArdRouteGroup selectArdRouteGroupById(String id) { |
| | | ArdRouteGroup ardRouteGroup = ardRouteGroupMapper.selectArdRouteGroupById(id); |
| | | ardRouteGroup.setArdRouteInfoLS(ardRouteInfoMapper.selectArdRouteInfoByGroupId(id)); |
| | | return ardRouteGroup; |
| | | } |
| | | |
| | | /** |
| | | * 查询分组列表 |
| | | * |
| | | * @param ardRouteGroup 分组 |
| | | * @return 分组 |
| | | */ |
| | | @Override |
| | | @DataScope(deptAlias = "d", userAlias = "u") |
| | | public List<ArdRouteGroup> selectArdRouteGroupList(ArdRouteGroup ardRouteGroup) { |
| | | List<ArdRouteGroup> list = ardRouteGroupMapper.selectArdRouteGroupList(ardRouteGroup); |
| | | for (ArdRouteGroup routeGrouping : list) { |
| | | routeGrouping.setArdRouteInfoLS(ardRouteInfoMapper.selectArdRouteInfoByGroupId(routeGrouping.getId())); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 新增分组 |
| | | * |
| | | * @param ardRouteGroup 分组 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertArdRouteGroup(ArdRouteGroup ardRouteGroup) { |
| | | ardRouteGroup.setId(IdUtils.simpleUUID()); |
| | | ardRouteGroup.setCreateTime(DateUtils.getNowDate()); |
| | | // 获取当前数据条数 |
| | | int count = ardRouteGroupMapper.selectArdRouteGroupList(null).size(); |
| | | ardRouteGroup.setSerialNumber(count + 1); |
| | | return ardRouteGroupMapper.insertArdRouteGroup(ardRouteGroup); |
| | | } |
| | | |
| | | /** |
| | | * 修改分组 |
| | | * |
| | | * @param ardRouteGroup 分组 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateArdRouteGroup(ArdRouteGroup ardRouteGroup) { |
| | | // 不能修改默认分组 |
| | | if ("0".equals(ardRouteGroup.getId())) { |
| | | throw new RuntimeException("不能修改默认分组"); |
| | | } |
| | | ardRouteGroup.setUpdateTime(DateUtils.getNowDate()); |
| | | return ardRouteGroupMapper.updateArdRouteGroup(ardRouteGroup); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除分组 |
| | | * |
| | | * @param ids 需要删除的分组主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Map<String, Integer> deleteArdRouteGroupByIds(String[] ids) { |
| | | // 检查是否包含默认分组,不能删除默认分组 |
| | | for (String id : ids) { |
| | | if ("0".equals(id)) { |
| | | throw new RuntimeException("不能删除默认分组"); |
| | | } |
| | | } |
| | | |
| | | Map<String, Integer> result = new HashMap<>(); |
| | | try { |
| | | // 先删除航线信息 |
| | | int informationCount = ardRouteInfoMapper.deleteRouteInforByGroupIds(ids); |
| | | result.put("informationCount", informationCount); |
| | | |
| | | // 再删除分组 |
| | | int groupingCount = ardRouteGroupMapper.deleteArdRouteGroupByIds(ids); |
| | | result.put("groupingCount", groupingCount); |
| | | |
| | | return result; |
| | | } catch (Exception e) { |
| | | throw e; // 抛出异常让事务回滚 |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除分组信息 |
| | | * |
| | | * @param id 分组主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteArdRouteGroupById(String id) { |
| | | return ardRouteGroupMapper.deleteArdRouteGroupById(id); |
| | | } |
| | | |
| | | } |
| | |
| | | public String insertArdRouteInfo(ArdRouteInfo ardRouteInfo) { |
| | | ardRouteInfo.setId(IdUtils.simpleUUID()); |
| | | ardRouteInfo.setCreateTime(DateUtils.getNowDate()); |
| | | if (ardRouteInfo.getGroupingId() == null){ |
| | | ardRouteInfo.setGroupingId("0"); |
| | | if (ardRouteInfo.getGroupId() == null){ |
| | | ardRouteInfo.setGroupId("0"); |
| | | } |
| | | // 航线数据 |
| | | byte[] routeData; |
| | |
| | | } |
| | | ardRouteInfo.setRouteData(routeData); |
| | | KmzResultVo kmzResult = routeService.buildKmz(ardRouteInfo.getUavRouteReq(), ardRouteInfo.getName()); |
| | | ardRouteInfo.setUpPath(kmzResult.getUpPath()); |
| | | ardRouteInfo.setPath(kmzResult.getPath()); |
| | | ardRouteInfoMapper.insertArdRouteInfo(ardRouteInfo); |
| | | return kmzResult.getUpPath(); |
| | | return kmzResult.getPath(); |
| | | } |
| | | |
| | | /** |
| | |
| | | if ("更新航线kmz文件失败".equals(kmzResult.getData())) { |
| | | return 0; |
| | | } |
| | | ardRouteInfo.setUpPath(kmzResult.getUpPath()); |
| | | ardRouteInfo.setPath(kmzResult.getPath()); |
| | | return ardRouteInfoMapper.updateArdRouteInfo(ardRouteInfo); |
| | | } |
| | | |
| | |
| | | // 删除航线(kmz)文件 |
| | | for (String id : ids) { |
| | | ArdRouteInfo information = ardRouteInfoMapper.selectArdRouteInfoById(id); |
| | | ossService.deleteObject("kmz", subStringMinioUrlName(information.getUpPath())); |
| | | ossService.deleteObject("kmz", subStringMinioUrlName(information.getPath())); |
| | | } |
| | | return ardRouteInfoMapper.deleteArdRouteInfoByIds(ids); |
| | | } |
| | |
| | | String url = ossService.upload("kmz",file); |
| | | ArdRouteInfo information = new ArdRouteInfo(); |
| | | information.setName(file.getOriginalFilename()); |
| | | information.setUpPath(url); |
| | | information.setGroupingId("0"); // 默认分组 |
| | | information.setPath(url); |
| | | information.setGroupId("0"); // 默认分组 |
| | | insertRouteInfomation(information); |
| | | return MinioUploadResult.builder() |
| | | .url(url) |
| | |
| | | * 修改航线分组ID |
| | | * |
| | | * @param id ID |
| | | * @param groupingId 分组ID |
| | | * @param GroupId 分组ID |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateRouteInfomationGroupingId(String id, String groupingId) { |
| | | return ardRouteInfoMapper.updateRouteInforGroupingId(id, groupingId); |
| | | public int updateRouteInfomationGroupId(String id, String GroupId) { |
| | | return ardRouteInfoMapper.updateRouteInforGroupId(id, GroupId); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | // 获取文件 |
| | | String minioUrlName = subStringMinioUrlName(routeInformation.getUpPath()); |
| | | String minioUrlName = subStringMinioUrlName(routeInformation.getPath()); |
| | | try (InputStream inputStream = ossService.getObject(kmzPath,minioUrlName); |
| | | ArchiveInputStream archiveInputStream = new ZipArchiveInputStream(inputStream)){ |
| | | ArchiveEntry entry; |
| | |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | result.setUpPath(localFilePath + fileName + ".kmz"); |
| | | result.setPath(localFilePath + fileName + ".kmz"); |
| | | return result; |
| | | }else { |
| | | try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
| | |
| | | new ByteArrayInputStream(baos.toByteArray()) |
| | | ); |
| | | String kmzFilePath = ossService.upload(kmzPath,multipartFile); |
| | | result.setUpPath(kmzFilePath); |
| | | result.setPath(kmzFilePath); |
| | | return result; |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("KMZ文件生成或上传失败", e); |
| | |
| | | } |
| | | |
| | | // 获取文件 |
| | | String minioUrl = subStringMinioUrlName(routeInformation.getUpPath()); |
| | | String minioUrl = subStringMinioUrlName(routeInformation.getPath()); |
| | | try (InputStream inputStream = ossService.getObject(kmzPath,minioUrl); |
| | | ArchiveInputStream archiveInputStream = new ZipArchiveInputStream(inputStream)){ |
| | | ArchiveEntry entry; |
| File was renamed from ard-route/src/main/resources/mapper/ArdRouteGroupingMapper.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.ArdRouteGroupingMapper"> |
| | | <mapper namespace="com.ard.route.mapper.ArdRouteGroupMapper"> |
| | | |
| | | <resultMap type="ArdRouteGrouping" id="ArdRouteGroupingResult"> |
| | | <resultMap type="ArdRouteGroup" id="ArdRouteGroupResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="groupingName" column="grouping_name" /> |
| | | <result property="serialNumber" column="serial_number" /> |
| | |
| | | <result property="updateTime" column="update_time" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdRouteGroupingVo"> |
| | | <sql id="selectArdRouteGroupVo"> |
| | | select id, |
| | | grouping_name, |
| | | serial_number, |
| | |
| | | from ard_route_grouping |
| | | </sql> |
| | | |
| | | <select id="selectArdRouteGroupingList" parameterType="ArdRouteGrouping" resultMap="ArdRouteGroupingResult"> |
| | | <include refid="selectArdRouteGroupingVo"/> |
| | | <select id="selectArdRouteGroupList" parameterType="ArdRouteGroup" resultMap="ArdRouteGroupResult"> |
| | | <include refid="selectArdRouteGroupVo"/> |
| | | <where> |
| | | <if test="groupingName != null and groupingName != ''"> and grouping_name like concat('%', #{groupingName}, '%')</if> |
| | | <if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if> |
| | |
| | | order by serial_number asc |
| | | </select> |
| | | |
| | | <select id="selectArdRouteGroupingById" parameterType="String" resultMap="ArdRouteGroupingResult"> |
| | | <include refid="selectArdRouteGroupingVo"/> |
| | | <select id="selectArdRouteGroupById" parameterType="String" resultMap="ArdRouteGroupResult"> |
| | | <include refid="selectArdRouteGroupVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertArdRouteGrouping" parameterType="ArdRouteGrouping"> |
| | | <insert id="insertArdRouteGroup" parameterType="ArdRouteGroup"> |
| | | insert into ard_route_grouping |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateArdRouteGrouping" parameterType="ArdRouteGrouping"> |
| | | <update id="updateArdRouteGroup" parameterType="ArdRouteGroup"> |
| | | update ard_route_grouping |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="groupingName != null">grouping_name = #{groupingName},</if> |
| | |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteArdRouteGroupingById" parameterType="String"> |
| | | <delete id="deleteArdRouteGroupById" parameterType="String"> |
| | | delete from ard_route_grouping where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteArdRouteGroupingByIds" parameterType="String"> |
| | | <delete id="deleteArdRouteGroupByIds" parameterType="String"> |
| | | delete from ard_route_grouping where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | |
| | | <result property="id" column="id" /> |
| | | <result property="name" column="name" /> |
| | | <result property="upPath" column="up_path" /> |
| | | <result property="groupingId" column="grouping_id" /> |
| | | <result property="GroupId" column="grouping_id" /> |
| | | <result property="type" column="type" /> |
| | | <result property="aircraft" column="aircraft" /> |
| | | <result property="payload" column="payload" /> |
| | |
| | | <if test="id != null">id,</if> |
| | | <if test="name != null">name,</if> |
| | | <if test="upPath != null">up_path,</if> |
| | | <if test="groupingId != null">grouping_id,</if> |
| | | <if test="GroupId != null">grouping_id,</if> |
| | | <if test="type != null">type,</if> |
| | | <if test="aircraft != null">aircraft,</if> |
| | | <if test="payload != null">payload,</if> |
| | |
| | | <if test="id != null">#{id},</if> |
| | | <if test="name != null">#{name},</if> |
| | | <if test="upPath != null">#{upPath},</if> |
| | | <if test="groupingId != null">#{groupingId},</if> |
| | | <if test="GroupId != null">#{GroupId},</if> |
| | | <if test="type != null">#{type},</if> |
| | | <if test="aircraft != null">#{aircraft},</if> |
| | | <if test="payload != null">#{payload},</if> |
| | |
| | | where file_name = #{fileName} |
| | | </select> |
| | | |
| | | <delete id="deleteRouteInforByGroupingIds" parameterType="String"> |
| | | <delete id="deleteRouteInforByGroupIds" parameterType="String"> |
| | | delete from ard_route_info where grouping_id in |
| | | <foreach item="groupingIId" collection="array" open="(" separator="," close=")"> |
| | | #{groupingIId} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <select id="selectArdRouteInfoByGroupingId" parameterType="String" resultMap="ArdRouteInfoResult"> |
| | | <select id="selectArdRouteInfoByGroupId" parameterType="String" resultMap="ArdRouteInfoResult"> |
| | | select id,name,up_path,grouping_id,type,aircraft,payload,is_import,create_by,create_time,update_by,update_time from ard_route_info |
| | | <where> |
| | | <if test="groupingId != null "> and grouping_id = #{groupingId}</if> |
| | | <if test="GroupId != null "> and grouping_id = #{GroupId}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <update id="updateRouteInforGroupingId"> |
| | | <update id="updateRouteInforGroupId"> |
| | | update ard_route_info |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="groupingId != null">grouping_id = #{groupingId},</if> |
| | | <if test="GroupId != null">grouping_id = #{GroupId},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | // get file url |
| | | // URL url = waylineFileService.getObjectUrl(waylineFile.get().getWaylineId()); |
| | | URL url= null; |
| | | String minioUrl = subStringMinioUrlName(ardRouteOpt.getUpPath()); |
| | | String minioUrl = subStringMinioUrlName(ardRouteOpt.getPath()); |
| | | String md5 = ""; |
| | | try (InputStream inputStream = _ossService.getObject(kmzPath,minioUrl)) |
| | | { |
| | | md5 = DigestUtils.md5Hex(inputStream); |
| | | url = new URL(ardRouteOpt.getUpPath()); |
| | | url = new URL(ardRouteOpt.getPath()); |
| | | } |
| | | catch (Exception e) { |
| | | return ResponseResult.error("机场任务航线文件地址错误!" + e.getMessage()); |
| | |
| | | |
| | | // get file url |
| | | URL url = null; |
| | | String minioUrl = subStringMinioUrlName(ardRouteOpt.getUpPath()); |
| | | String minioUrl = subStringMinioUrlName(ardRouteOpt.getPath()); |
| | | String md5 = ""; |
| | | try (InputStream inputStream = _ossService.getObject(kmzPath,minioUrl)) |
| | | { |
| | | md5 = DigestUtils.md5Hex(inputStream); |
| | | url = new URL(ardRouteOpt.getUpPath()); |
| | | url = new URL(ardRouteOpt.getPath()); |
| | | // } |
| | | // try { |
| | | // url = waylineFileService.getObjectUrl(waylineFile.get().getWaylineId()); |