1. 新增航线任务接口。
2. 新增查询航线任务列表接口。
3. 新增获取航线任务详细信息。
4. 新增航线任务接口。
5. 新增修改航线任务接口。
6. 新增删除航线任务接口。
7. 新增修改航线任务状态接口。
8. 优化查询分组业务逻辑。
9. 航线(kmz)对象增加航线任务ID信息。
10. 新增航线(kmz)业务增加航线任务数据加工校验相关业务逻辑。
11. 新增航向任务下航点信息业务相关接口。
11 files added
4 files modified
| New file |
| | |
| | | package com.ard.web.controller.route; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ard.route.domain.route.ArdRouteMission; |
| | | 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.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.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.IArdRouteMissionService; |
| | | import com.ard.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * 航线任务Controller |
| | | * |
| | | * @author xia |
| | | * @date 2026-01-20 |
| | | */ |
| | | @Api(tags = "航线任务接口") |
| | | @RestController |
| | | @RequestMapping("/route/mission") |
| | | public class ArdRouteMissionController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IArdRouteMissionService ardRouteMissionService; |
| | | |
| | | /** |
| | | * 查询航线任务列表 |
| | | */ |
| | | @ApiOperation("查询航线任务列表") |
| | | @PreAuthorize("@ss.hasPermi('route:mission:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ArdRouteMission ardRouteMission) { |
| | | startPage(); |
| | | List<ArdRouteMission> list = ardRouteMissionService.selectArdRouteMissionList(ardRouteMission); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 获取航线任务详细信息 |
| | | */ |
| | | @ApiOperation("获取航线任务详细信息") |
| | | @PreAuthorize("@ss.hasPermi('route:mission:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") String id) { |
| | | return success(ardRouteMissionService.selectArdRouteMissionById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增航线任务 |
| | | */ |
| | | @ApiOperation("新增航线任务") |
| | | @PreAuthorize("@ss.hasPermi('route:mission:add')") |
| | | @Log(title = "航线任务", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ArdRouteMission ardRouteMission) { |
| | | ardRouteMission.setCreateBy(getUsername()); |
| | | return toAjax(ardRouteMissionService.insertArdRouteMission(ardRouteMission)); |
| | | } |
| | | |
| | | /** |
| | | * 修改航线任务 |
| | | */ |
| | | @ApiOperation("修改航线任务") |
| | | @PreAuthorize("@ss.hasPermi('route:mission:edit')") |
| | | @Log(title = "航线任务", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ArdRouteMission ardRouteMission) { |
| | | ardRouteMission.setUpdateBy(getUsername()); |
| | | return toAjax(ardRouteMissionService.updateArdRouteMission(ardRouteMission)); |
| | | } |
| | | |
| | | /** |
| | | * 删除航线任务 |
| | | */ |
| | | @ApiOperation("删除航线任务") |
| | | @PreAuthorize("@ss.hasPermi('route:mission:remove')") |
| | | @Log(title = "航线任务", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable String[] ids) { |
| | | return toAjax(ardRouteMissionService.deleteArdRouteMissionByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | | * 修改航线任务状态 |
| | | */ |
| | | @ApiOperation("修改航线任务状态") |
| | | @PreAuthorize("@ss.hasPermi('route:mission:edit')") |
| | | @Log(title = "航线任务", businessType = BusinessType.UPDATE) |
| | | @PutMapping("updateStatus/{id}/{status}") |
| | | public AjaxResult updateExecuteStatus(@PathVariable String id, |
| | | @PathVariable String status) { |
| | | return toAjax(ardRouteMissionService.updateArdRouteMissionStatus(id,status)); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ard.route.domain.route; |
| | | |
| | | import com.ard.common.annotation.Excel; |
| | | import com.ard.common.core.domain.BaseEntity; |
| | | import com.ard.route.domain.djuav.UavRouteReq; |
| | | import lombok.Data; |
| | |
| | | private String id; |
| | | |
| | | /** 文件名称 */ |
| | | @Excel(name = "文件名称") |
| | | private String name; |
| | | |
| | | /** 文件路径 */ |
| | | @Excel(name = "文件路径") |
| | | private String path; |
| | | |
| | | /** 分组ID */ |
| | | @Excel(name = "分组ID") |
| | | private String groupId; |
| | | |
| | | /** 航线类型 */ |
| | | @Excel(name = "航线类型") |
| | | /** |
| | | * 航线类型 |
| | | * 1:逐点巡检 |
| | | * 2:沿线巡检 |
| | | * 3:任务航线 |
| | | * 4:巡检航线 |
| | | * */ |
| | | private String type; |
| | | |
| | | /** 飞行器产品 */ |
| | | @Excel(name = "飞行器产品") |
| | | private String aircraft; |
| | | |
| | | /** 负载类型 */ |
| | | @Excel(name = "负载类型") |
| | | private String payload; |
| | | |
| | | /** |
| | |
| | | * 0:否 |
| | | * 1:是 |
| | | */ |
| | | @Excel(name = "是否只读") |
| | | private String readOnly; |
| | | |
| | | /** |
| | |
| | | * 0:正序 |
| | | * 1:倒序 |
| | | */ |
| | | @Excel(name = "时间排序") |
| | | private String orderByTime; |
| | | |
| | | /** |
| | |
| | | * 0:否 |
| | | * 1:是 |
| | | */ |
| | | @Excel(name = "是否循环") |
| | | private String isLoop; |
| | | |
| | | /** |
| | |
| | | /** 行点总数 */ |
| | | private Integer pointCount; |
| | | |
| | | /** 航线任务ID */ |
| | | private String missionId; |
| | | |
| | | } |
| New file |
| | |
| | | package com.ard.route.domain.route; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.ard.common.core.domain.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 航线任务对象 ard_route_mission |
| | | * |
| | | * @author xia |
| | | * @date 2026-01-20 |
| | | */ |
| | | @Data |
| | | public class ArdRouteMission extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** ID */ |
| | | private String id; |
| | | |
| | | /** 航线ID */ |
| | | private String routeId; |
| | | |
| | | /** 任务名称 */ |
| | | private String missionName; |
| | | |
| | | /** |
| | | * 执行状态 |
| | | * 0:未执行 |
| | | * 1:已执行 |
| | | */ |
| | | private String executeStatus; |
| | | |
| | | /** 执行人 */ |
| | | private String executeBy; |
| | | |
| | | /** 执行时间 */ |
| | | private Date executeTime; |
| | | |
| | | /** 航线任务航点列表 */ |
| | | private List<ArdRoutePoint> missionDetailList; |
| | | |
| | | } |
| New file |
| | |
| | | package com.ard.route.domain.route; |
| | | |
| | | import com.ard.common.core.domain.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 航线任务航点对象 ard_route_point |
| | | * |
| | | * @author xia |
| | | * @date 2026-01-20 |
| | | */ |
| | | @Data |
| | | public class ArdRoutePoint{ |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 航线任务ID */ |
| | | private String missionId; |
| | | |
| | | /** 航点编号 */ |
| | | private Long pointNum; |
| | | |
| | | /** 经度 */ |
| | | private Long longitude; |
| | | |
| | | /** 纬度 */ |
| | | private Long latitude; |
| | | |
| | | /** 高度 */ |
| | | private Long height; |
| | | |
| | | } |
| New file |
| | |
| | | package com.ard.route.mapper; |
| | | |
| | | import com.ard.route.domain.route.ArdRouteMission; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 航线任务Mapper接口 |
| | | * |
| | | * @author xia |
| | | * @date 2026-01-20 |
| | | */ |
| | | public interface ArdRouteMissionMapper { |
| | | |
| | | /** |
| | | * 查询航线任务 |
| | | * |
| | | * @param id 航线任务主键 |
| | | * @return 航线任务 |
| | | */ |
| | | public ArdRouteMission selectArdRouteMissionById(String id); |
| | | |
| | | /** |
| | | * 查询航线任务列表 |
| | | * |
| | | * @param ardRouteMission 航线任务 |
| | | * @return 航线任务集合 |
| | | */ |
| | | public List<ArdRouteMission> selectArdRouteMissionList(ArdRouteMission ardRouteMission); |
| | | |
| | | /** |
| | | * 新增航线任务 |
| | | * |
| | | * @param ardRouteMission 航线任务 |
| | | * @return 结果 |
| | | */ |
| | | public int insertArdRouteMission(ArdRouteMission ardRouteMission); |
| | | |
| | | /** |
| | | * 修改航线任务 |
| | | * |
| | | * @param ardRouteMission 航线任务 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdRouteMission(ArdRouteMission ardRouteMission); |
| | | |
| | | /** |
| | | * 删除航线任务 |
| | | * |
| | | * @param id 航线任务主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdRouteMissionById(String id); |
| | | |
| | | /** |
| | | * 批量删除航线任务 |
| | | * |
| | | * @param ids 需要删除的数据主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdRouteMissionByIds(String[] ids); |
| | | |
| | | /** |
| | | * 修改航线任务状态 |
| | | * |
| | | * @param id 航线任务主键 |
| | | * @param executeStatus 状态类型 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdRouteMissionStatus(@Param("id")String id, @Param("executeStatus")String executeStatus); |
| | | |
| | | } |
| New file |
| | |
| | | package com.ard.route.mapper; |
| | | |
| | | import com.ard.route.domain.route.ArdRoutePoint; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 航线任务航点Mapper接口 |
| | | * |
| | | * @author xia |
| | | * @date 2026-01-20 |
| | | */ |
| | | public interface ArdRoutePointMapper { |
| | | |
| | | /** |
| | | * 查询航线任务航点 |
| | | * |
| | | * @param missionId 航线任务航点主键 |
| | | * @return 航线任务航点 |
| | | */ |
| | | public List<ArdRoutePoint> selectArdRoutePointByMissionId(String missionId); |
| | | |
| | | /** |
| | | * 查询航线任务航点列表 |
| | | * |
| | | * @param ardRoutePoint 航线任务航点 |
| | | * @return 航线任务航点集合 |
| | | */ |
| | | public List<ArdRoutePoint> selectArdRoutePointList(ArdRoutePoint ardRoutePoint); |
| | | |
| | | /** |
| | | * 新增航线任务航点 |
| | | * |
| | | * @param ardRoutePoint 航线任务航点 |
| | | * @return 结果 |
| | | */ |
| | | public int insertArdRoutePoint(ArdRoutePoint ardRoutePoint); |
| | | |
| | | /** |
| | | * 修改航线任务航点 |
| | | * |
| | | * @param ardRoutePoint 航线任务航点 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdRoutePoint(ArdRoutePoint ardRoutePoint); |
| | | |
| | | /** |
| | | * 删除航线任务航点 |
| | | * |
| | | * @param missionId 航线任务航点主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdRoutePointByMissionId(String missionId); |
| | | |
| | | /** |
| | | * 批量删除航线任务航点 |
| | | * |
| | | * @param missionIds 需要删除的数据主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdRoutePointByMissionIds(String[] missionIds); |
| | | |
| | | /** |
| | | * 批量新增航线任务航点 |
| | | */ |
| | | public int insertArdRoutePointS(List<ArdRoutePoint> ardRoutePoint); |
| | | |
| | | } |
| New file |
| | |
| | | package com.ard.route.service; |
| | | |
| | | import com.ard.route.domain.route.ArdRouteMission; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 航线任务Service接口 |
| | | * |
| | | * @author xia |
| | | * @date 2026-01-20 |
| | | */ |
| | | public interface IArdRouteMissionService { |
| | | |
| | | /** |
| | | * 查询航线任务 |
| | | * |
| | | * @param id 航线任务主键 |
| | | * @return 航线任务 |
| | | */ |
| | | public ArdRouteMission selectArdRouteMissionById(String id); |
| | | |
| | | /** |
| | | * 查询航线任务列表 |
| | | * |
| | | * @param ardRouteMission 航线任务 |
| | | * @return 航线任务集合 |
| | | */ |
| | | public List<ArdRouteMission> selectArdRouteMissionList(ArdRouteMission ardRouteMission); |
| | | |
| | | /** |
| | | * 新增航线任务 |
| | | * |
| | | * @param ardRouteMission 航线任务 |
| | | * @return 结果 |
| | | */ |
| | | public int insertArdRouteMission(ArdRouteMission ardRouteMission); |
| | | |
| | | /** |
| | | * 修改航线任务 |
| | | * |
| | | * @param ardRouteMission 航线任务 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdRouteMission(ArdRouteMission ardRouteMission); |
| | | |
| | | /** |
| | | * 批量删除航线任务 |
| | | * |
| | | * @param ids 需要删除的航线任务主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdRouteMissionByIds(String[] ids); |
| | | |
| | | /** |
| | | * 删除航线任务信息 |
| | | * |
| | | * @param id 航线任务主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdRouteMissionById(String id); |
| | | |
| | | /** |
| | | * 修改航线任务状态 |
| | | * |
| | | * @param id 航线任务主键 |
| | | * @param status 状态类型 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdRouteMissionStatus(String id,String status); |
| | | |
| | | } |
| New file |
| | |
| | | package com.ard.route.service; |
| | | |
| | | import com.ard.route.domain.route.ArdRoutePoint; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 航线任务航点Service接口 |
| | | * |
| | | * @author xia |
| | | * @date 2026-01-20 |
| | | */ |
| | | public interface IArdRoutePointService { |
| | | |
| | | /** |
| | | * 查询航线任务航点 |
| | | * |
| | | * @param missionId 航线任务航点主键 |
| | | * @return 航线任务航点 |
| | | */ |
| | | public List<ArdRoutePoint> selectArdRoutePointByMissionId(String missionId); |
| | | |
| | | /** |
| | | * 查询航线任务航点列表 |
| | | * |
| | | * @param ardRoutePoint 航线任务航点 |
| | | * @return 航线任务航点集合 |
| | | */ |
| | | public List<ArdRoutePoint> selectArdRoutePointList(ArdRoutePoint ardRoutePoint); |
| | | |
| | | /** |
| | | * 新增航线任务航点 |
| | | * |
| | | * @param ardRoutePoint 航线任务航点 |
| | | * @return 结果 |
| | | */ |
| | | public int insertArdRoutePoint(ArdRoutePoint ardRoutePoint); |
| | | |
| | | /** |
| | | * 修改航线任务航点 |
| | | * |
| | | * @param ardRoutePoint 航线任务航点 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdRoutePoint(ArdRoutePoint ardRoutePoint); |
| | | |
| | | /** |
| | | * 批量删除航线任务航点 |
| | | * |
| | | * @param missionIds 需要删除的航线任务航点主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdRoutePointByMissionIds(String[] missionIds); |
| | | |
| | | /** |
| | | * 删除航线任务航点信息 |
| | | * |
| | | * @param missionId 航线任务航点主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdRoutePointByMissionId(String missionId); |
| | | } |
| | |
| | | import com.ard.common.utils.DateUtils; |
| | | import com.ard.common.utils.uuid.IdUtils; |
| | | import com.ard.route.domain.route.ArdRouteGroup; |
| | | import com.ard.route.domain.route.ArdRouteInfo; |
| | | import com.ard.route.domain.vo.ArdRouteGroupVo; |
| | | import com.ard.route.mapper.ArdRouteGroupMapper; |
| | | import com.ard.route.mapper.ArdRouteInfoMapper; |
| | |
| | | @Override |
| | | public ArdRouteGroup selectArdRouteGroupById(String id) { |
| | | ArdRouteGroup ardRouteGroup = ardRouteGroupMapper.selectArdRouteGroupById(id); |
| | | ardRouteGroup.setArdRouteInfoLS(ardRouteInfoMapper.selectArdRouteInfoByGroupId(id)); |
| | | ardRouteGroup.setArdRouteInfoLS(checkRouteData(id)); |
| | | return ardRouteGroup; |
| | | } |
| | | |
| | |
| | | public List<ArdRouteGroup> selectArdRouteGroupList(ArdRouteGroup ardRouteGroup) { |
| | | List<ArdRouteGroup> list = ardRouteGroupMapper.selectArdRouteGroupList(ardRouteGroup); |
| | | for (ArdRouteGroup routeGroup : list) { |
| | | routeGroup.setArdRouteInfoLS(ardRouteInfoMapper.selectArdRouteInfoByGroupId(routeGroup.getId())); |
| | | routeGroup.setArdRouteInfoLS(checkRouteData(routeGroup.getId())); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | // 清空航线数据 |
| | | private List<ArdRouteInfo> checkRouteData(String id){ |
| | | List<ArdRouteInfo> routeInfos = ardRouteInfoMapper.selectArdRouteInfoByGroupId(id); |
| | | for (ArdRouteInfo ls : routeInfos) { |
| | | ls.setRouteData(null); |
| | | } |
| | | return routeInfos; |
| | | } |
| | | |
| | | /** |
| | | * 新增分组 |
| | | * |
| | |
| | | import com.ard.route.domain.djuav.UavRouteReq; |
| | | import com.ard.route.domain.dto.ArdNoflyDto; |
| | | import com.ard.route.domain.route.ArdRouteInfo; |
| | | import com.ard.route.domain.route.ArdRouteMission; |
| | | import com.ard.route.domain.vo.KmzResultVo; |
| | | import com.ard.route.mapper.ArdRouteInfoMapper; |
| | | import com.ard.route.mapper.ArdRouteMissionMapper; |
| | | import com.ard.route.service.IArdRouteInfoService; |
| | | import com.ard.route.service.UavRouteService; |
| | | import com.ard.work.domain.cache.UavTelemetryDataCache; |
| | |
| | | @Autowired |
| | | private OssServiceContext ossService; |
| | | |
| | | |
| | | @Autowired |
| | | private UavRouteService routeService; |
| | | |
| | | @Autowired |
| | | private ArdRouteMissionMapper ardRouteMissionMapper; |
| | | |
| | | @Resource |
| | | private IArdNoFlyZoneService ardNoFlyZoneService; |
| | |
| | | */ |
| | | @Override |
| | | public String insertArdRouteInfo(ArdRouteInfo ardRouteInfo) { |
| | | processRouteMission(ardRouteInfo); |
| | | ardRouteInfo.setId(IdUtils.simpleUUID()); |
| | | ardRouteInfo.setCreateTime(DateUtils.getNowDate()); |
| | | ardRouteInfo.setUpdateTime(DateUtils.getNowDate()); // 修改时间,用于排序 |
| | |
| | | return kmzResult.getPath(); |
| | | } |
| | | |
| | | // 航线任务数据加工校验 |
| | | private void processRouteMission(ArdRouteInfo ardRouteInfo){ |
| | | if ("3".equals(ardRouteInfo.getType())) { |
| | | ArdRouteMission ardRouteMission = ardRouteMissionMapper.selectArdRouteMissionById(ardRouteInfo.getMissionId()); |
| | | if ("0".equals(ardRouteMission.getRouteId())) { |
| | | ardRouteMission.setRouteId(ardRouteInfo.getId()); |
| | | ardRouteMissionMapper.updateArdRouteMission(ardRouteMission); |
| | | }else { |
| | | throw new RuntimeException("不能修改默认分组"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 修改航线(kmz) |
| | | * |
| New file |
| | |
| | | package com.ard.route.service.impl; |
| | | |
| | | import java.util.List; |
| | | import com.ard.common.utils.DateUtils; |
| | | import com.ard.common.utils.uuid.IdUtils; |
| | | import com.ard.route.domain.route.ArdRouteMission; |
| | | import com.ard.route.domain.route.ArdRoutePoint; |
| | | import com.ard.route.mapper.ArdRoutePointMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ard.route.mapper.ArdRouteMissionMapper; |
| | | import com.ard.route.service.IArdRouteMissionService; |
| | | |
| | | import static com.ard.common.utils.SecurityUtils.getUsername; |
| | | |
| | | /** |
| | | * 航线任务Service业务层处理 |
| | | * |
| | | * @author xia |
| | | * @date 2026-01-20 |
| | | */ |
| | | @Service |
| | | public class ArdRouteMissionServiceImpl implements IArdRouteMissionService { |
| | | |
| | | @Autowired |
| | | private ArdRouteMissionMapper ardRouteMissionMapper; |
| | | |
| | | @Autowired |
| | | private ArdRoutePointMapper ardRoutePointMapper; |
| | | |
| | | /** |
| | | * 查询航线任务 |
| | | * |
| | | * @param id 航线任务主键 |
| | | * @return 航线任务 |
| | | */ |
| | | @Override |
| | | public ArdRouteMission selectArdRouteMissionById(String id) { |
| | | ArdRouteMission ardRouteMission = ardRouteMissionMapper.selectArdRouteMissionById(id); |
| | | ardRouteMission.setMissionDetailList(getMissionDetailList(id)); |
| | | return ardRouteMission; |
| | | } |
| | | |
| | | /** |
| | | * 查询航线任务列表 |
| | | * |
| | | * @param ardRouteMission 航线任务 |
| | | * @return 航线任务 |
| | | */ |
| | | @Override |
| | | public List<ArdRouteMission> selectArdRouteMissionList(ArdRouteMission ardRouteMission) { |
| | | List<ArdRouteMission> list = ardRouteMissionMapper.selectArdRouteMissionList(ardRouteMission); |
| | | for (ArdRouteMission routeMission : list) { |
| | | routeMission.setMissionDetailList(getMissionDetailList(routeMission.getId())); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | private List<ArdRoutePoint> getMissionDetailList(String missionId) { |
| | | return ardRoutePointMapper.selectArdRoutePointByMissionId(missionId); |
| | | } |
| | | |
| | | /** |
| | | * 新增航线任务 |
| | | * |
| | | * @param ardRouteMission 航线任务 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertArdRouteMission(ArdRouteMission ardRouteMission) { |
| | | ardRouteMission.setId(IdUtils.simpleUUID()); |
| | | ardRouteMission.setExecuteStatus("0"); |
| | | ardRouteMission.setCreateTime(DateUtils.getNowDate()); |
| | | dataProcessingRoutePoint(ardRouteMission.getMissionDetailList(),ardRouteMission.getId()); |
| | | return ardRouteMissionMapper.insertArdRouteMission(ardRouteMission); |
| | | } |
| | | |
| | | /** |
| | | * 修改航线任务 |
| | | * |
| | | * @param ardRouteMission 航线任务 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateArdRouteMission(ArdRouteMission ardRouteMission) { |
| | | ardRouteMission.setUpdateTime(DateUtils.getNowDate()); |
| | | // 删除航线任务航点 |
| | | ardRoutePointMapper.deleteArdRoutePointByMissionId(ardRouteMission.getId()); |
| | | // 重新插入航线任务航点 |
| | | dataProcessingRoutePoint(ardRouteMission.getMissionDetailList(),ardRouteMission.getId()); |
| | | return ardRouteMissionMapper.updateArdRouteMission(ardRouteMission); |
| | | } |
| | | |
| | | /** |
| | | * 航线任务航点对象数据加工 |
| | | */ |
| | | private void dataProcessingRoutePoint(List<ArdRoutePoint> missionDetailList,String missionId){ |
| | | for (ArdRoutePoint missionDetail : missionDetailList) { |
| | | missionDetail.setMissionId(missionId); |
| | | } |
| | | ardRoutePointMapper.insertArdRoutePointS(missionDetailList); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除航线任务 |
| | | * |
| | | * @param ids 需要删除的航线任务主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteArdRouteMissionByIds(String[] ids) { |
| | | return ardRouteMissionMapper.deleteArdRouteMissionByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * 删除航线任务信息 |
| | | * |
| | | * @param id 航线任务主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteArdRouteMissionById(String id) { |
| | | return ardRouteMissionMapper.deleteArdRouteMissionById(id); |
| | | } |
| | | |
| | | /** |
| | | * 修改航线任务状态 |
| | | * |
| | | * @param id 航线任务主键 |
| | | * @param status 状态类型 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateArdRouteMissionStatus(String id, String status) { |
| | | ArdRouteMission ardRouteMission = new ArdRouteMission(); |
| | | ardRouteMission.setId(id); |
| | | ardRouteMission.setExecuteStatus(status); |
| | | ardRouteMission.setExecuteBy(getUsername()); |
| | | ardRouteMission.setExecuteTime(DateUtils.getNowDate()); |
| | | ardRouteMission.setUpdateTime(DateUtils.getNowDate()); |
| | | return ardRouteMissionMapper.updateArdRouteMission(ardRouteMission); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.ard.route.service.impl; |
| | | |
| | | import com.ard.route.domain.route.ArdRoutePoint; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ard.route.mapper.ArdRoutePointMapper; |
| | | import com.ard.route.service.IArdRoutePointService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 航线任务航点Service业务层处理 |
| | | * |
| | | * @author xia |
| | | * @date 2026-01-20 |
| | | */ |
| | | @Service |
| | | public class ArdRoutePointServiceImpl implements IArdRoutePointService { |
| | | |
| | | @Autowired |
| | | private ArdRoutePointMapper ardRoutePointMapper; |
| | | |
| | | /** |
| | | * 查询航线任务航点 |
| | | * |
| | | * @param missionId 航线任务航点主键 |
| | | * @return 航线任务航点 |
| | | */ |
| | | @Override |
| | | public List<ArdRoutePoint> selectArdRoutePointByMissionId(String missionId) { |
| | | return ardRoutePointMapper.selectArdRoutePointByMissionId(missionId); |
| | | } |
| | | |
| | | /** |
| | | * 查询航线任务航点列表 |
| | | * |
| | | * @param ardRoutePoint 航线任务航点 |
| | | * @return 航线任务航点 |
| | | */ |
| | | @Override |
| | | public List<ArdRoutePoint> selectArdRoutePointList(ArdRoutePoint ardRoutePoint) { |
| | | return ardRoutePointMapper.selectArdRoutePointList(ardRoutePoint); |
| | | } |
| | | |
| | | /** |
| | | * 新增航线任务航点 |
| | | * |
| | | * @param ardRoutePoint 航线任务航点 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertArdRoutePoint(ArdRoutePoint ardRoutePoint) { |
| | | return ardRoutePointMapper.insertArdRoutePoint(ardRoutePoint); |
| | | } |
| | | |
| | | /** |
| | | * 修改航线任务航点 |
| | | * |
| | | * @param ardRoutePoint 航线任务航点 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateArdRoutePoint(ArdRoutePoint ardRoutePoint) { |
| | | return ardRoutePointMapper.updateArdRoutePoint(ardRoutePoint); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除航线任务航点 |
| | | * |
| | | * @param missionIds 需要删除的航线任务航点主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteArdRoutePointByMissionIds(String[] missionIds) { |
| | | return ardRoutePointMapper.deleteArdRoutePointByMissionIds(missionIds); |
| | | } |
| | | |
| | | /** |
| | | * 删除航线任务航点信息 |
| | | * |
| | | * @param missionId 航线任务航点主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteArdRoutePointByMissionId(String missionId) { |
| | | return ardRoutePointMapper.deleteArdRoutePointByMissionId(missionId); |
| | | } |
| | | |
| | | } |
| | |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="pointCount" column="point_count" /> |
| | | <result property="isLoop" column="is_loop" /> |
| | | <result property="missionId" column="mission_id" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdRouteInfoVo"> |
| | |
| | | update_by, |
| | | update_time, |
| | | point_count, |
| | | is_loop |
| | | is_loop, |
| | | mission_id |
| | | from ard_route_info |
| | | </sql> |
| | | |
| | |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="pointCount != null">point_count,</if> |
| | | <if test="isLoop != null">is_loop,</if> |
| | | <if test="missionId != null">mission_id,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="pointCount != null">#{pointCount},</if> |
| | | <if test="isLoop != null">#{isLoop},</if> |
| | | <if test="missionId != null">#{missionId},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="pointCount != null">point_count = #{pointCount},</if> |
| | | <if test="isLoop != null">is_loop = #{isLoop},</if> |
| | | <if test="missionId != null">mission_id = #{missionId},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | </delete> |
| | | |
| | | <select id="selectArdRouteInfoByGroupId" parameterType="String" resultMap="ArdRouteInfoResult"> |
| | | select id,name,path,group_id,type,aircraft,payload,read_only,create_by,create_time,update_by,update_time,point_count,is_loop from ard_route_info |
| | | <include refid="selectArdRouteInfoVo"/> |
| | | <where> |
| | | <if test="groupId != null "> and group_id = #{groupId}</if> |
| | | </where> |
| 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.ArdRouteMissionMapper"> |
| | | |
| | | <resultMap type="ArdRouteMission" id="ArdRouteMissionResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="routeId" column="route_id" /> |
| | | <result property="missionName" column="mission_name" /> |
| | | <result property="executeStatus" column="execute_status" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="executeBy" column="execute_by" /> |
| | | <result property="executeTime" column="execute_time" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdRouteMissionVo"> |
| | | select id, |
| | | route_id, |
| | | mission_name, |
| | | execute_status, |
| | | create_by, |
| | | create_time, |
| | | update_by, |
| | | update_time, |
| | | execute_by, |
| | | execute_time |
| | | from ard_route_mission |
| | | </sql> |
| | | |
| | | <select id="selectArdRouteMissionList" parameterType="ArdRouteMission" resultMap="ArdRouteMissionResult"> |
| | | <include refid="selectArdRouteMissionVo"/> |
| | | <where> |
| | | <if test="routeId != null and routeId != ''"> and route_id = #{routeId}</if> |
| | | <if test="missionName != null and missionName != ''"> and mission_name like concat('%', #{missionName}, '%')</if> |
| | | <if test="executeStatus != null and executeStatus != ''"> and execute_status = #{executeStatus}</if> |
| | | <if test="executeBy != null and executeBy != ''"> and execute_by = #{executeBy}</if> |
| | | <if test="executeTime != null "> and execute_time = #{executeTime}</if> |
| | | </where> |
| | | order by create_time asc |
| | | </select> |
| | | |
| | | <select id="selectArdRouteMissionById" parameterType="String" resultMap="ArdRouteMissionResult"> |
| | | <include refid="selectArdRouteMissionVo"/> |
| | | where id = #{id} |
| | | order by create_time asc |
| | | </select> |
| | | |
| | | <insert id="insertArdRouteMission" parameterType="ArdRouteMission"> |
| | | insert into ard_route_mission |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="routeId != null">route_id,</if> |
| | | <if test="missionName != null">mission_name,</if> |
| | | <if test="executeStatus != null">execute_status,</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> |
| | | <if test="executeBy != null">execute_by,</if> |
| | | <if test="executeTime != null">execute_time,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="routeId != null">#{routeId},</if> |
| | | <if test="missionName != null">#{missionName},</if> |
| | | <if test="executeStatus != null">#{executeStatus},</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> |
| | | <if test="executeBy != null">#{executeBy},</if> |
| | | <if test="executeTime != null">#{executeTime},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateArdRouteMission" parameterType="ArdRouteMission"> |
| | | update ard_route_mission |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="routeId != null">route_id = #{routeId},</if> |
| | | <if test="missionName != null">mission_name = #{missionName},</if> |
| | | <if test="executeStatus != null">execute_status = #{executeStatus},</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> |
| | | <if test="executeBy != null">execute_by = #{executeBy},</if> |
| | | <if test="executeTime != null">execute_time = #{executeTime},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteArdRouteMissionById" parameterType="String"> |
| | | delete from ard_route_mission where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteArdRouteMissionByIds" parameterType="String"> |
| | | delete from ard_route_mission where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <update id="updateArdRouteMissionStatus"> |
| | | update ard_route_mission |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="executeStatus != null">execute_status = #{executeStatus},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | </mapper> |
| 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.ArdRoutePointMapper"> |
| | | |
| | | <resultMap type="ArdRoutePoint" id="ArdRoutePointResult"> |
| | | <result property="missionId" column="mission_id" /> |
| | | <result property="pointNum" column="point_num" /> |
| | | <result property="longitude" column="longitude" /> |
| | | <result property="latitude" column="latitude" /> |
| | | <result property="height" column="height" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdRoutePointVo"> |
| | | select mission_id, |
| | | point_num, |
| | | longitude, |
| | | latitude, |
| | | height |
| | | from ard_route_point |
| | | </sql> |
| | | |
| | | <select id="selectArdRoutePointList" parameterType="ArdRoutePoint" resultMap="ArdRoutePointResult"> |
| | | <include refid="selectArdRoutePointVo"/> |
| | | <where> |
| | | <if test="pointNum != null "> and point_num = #{pointNum}</if> |
| | | <if test="longitude != null "> and longitude = #{longitude}</if> |
| | | <if test="latitude != null "> and latitude = #{latitude}</if> |
| | | <if test="height != null "> and height = #{height}</if> |
| | | </where> |
| | | order by point_num asc |
| | | </select> |
| | | |
| | | <select id="selectArdRoutePointByMissionId" parameterType="ArdRoutePoint" resultMap="ArdRoutePointResult"> |
| | | <include refid="selectArdRoutePointVo"/> |
| | | where mission_id = #{missionId} |
| | | order by point_num asc |
| | | </select> |
| | | |
| | | <insert id="insertArdRoutePoint" parameterType="ArdRoutePoint"> |
| | | insert into ard_route_point |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="missionId != null">mission_id,</if> |
| | | <if test="pointNum != null">point_num,</if> |
| | | <if test="longitude != null">longitude,</if> |
| | | <if test="latitude != null">latitude,</if> |
| | | <if test="height != null">height,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="missionId != null">#{missionId},</if> |
| | | <if test="pointNum != null">#{pointNum},</if> |
| | | <if test="longitude != null">#{longitude},</if> |
| | | <if test="latitude != null">#{latitude},</if> |
| | | <if test="height != null">#{height},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateArdRoutePoint" parameterType="ArdRoutePoint"> |
| | | update ard_route_point |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="pointNum != null">point_num = #{pointNum},</if> |
| | | <if test="longitude != null">longitude = #{longitude},</if> |
| | | <if test="latitude != null">latitude = #{latitude},</if> |
| | | <if test="height != null">height = #{height},</if> |
| | | </trim> |
| | | where mission_id = #{missionId} |
| | | </update> |
| | | |
| | | <delete id="deleteArdRoutePointByMissionId" parameterType="String"> |
| | | delete from ard_route_point where mission_id = #{missionId} |
| | | </delete> |
| | | |
| | | <delete id="deleteArdRoutePointByMissionIds" parameterType="String"> |
| | | delete from ard_route_point where mission_id in |
| | | <foreach item="missionId" collection="array" open="(" separator="," close=")"> |
| | | #{missionId} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <!-- 批量插入 --> |
| | | <insert id="insertArdRoutePointS" parameterType="java.util.List"> |
| | | INSERT INTO ard_route_point |
| | | ( |
| | | mission_id, |
| | | point_num, |
| | | longitude, |
| | | latitude, |
| | | height |
| | | ) |
| | | VALUES |
| | | <foreach item="item" index="index" collection="list" separator=","> |
| | | ( |
| | | #{item.missionId}, |
| | | #{item.pointNum}, |
| | | #{item.longitude}, |
| | | #{item.latitude}, |
| | | #{item.height} |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | </mapper> |