| | |
| | | } |
| | | Optional<WaylineJobDTO> waylineJobOpt = this.createWaylineJob(param, loginUser.getUsername(), |
| | | param.getExecuteTime(), param.getExecuteTime()); |
| | | if (waylineJobOpt.isEmpty()) { |
| | | return ResponseResult.error("创建机场任务失败!"); |
| | | } |
| | | // 循环任务 |
| | | if (param.getTaskType() == WaylineTaskTypeEnum.LOOP.getVal()) { |
| | | // 循环任务,不立即执行,由定时任务发布 |
| | | return ResponseResult.success(); |
| | | } |
| | | |
| | | if (waylineJobOpt.isEmpty()) { |
| | | return ResponseResult.error("创建机场任务失败!"); |
| | | } |
| | | |
| | | WaylineJobDTO waylineJob = waylineJobOpt.get(); |
| | |
| | | // Check if the task status is correct. |
| | | boolean isErr = !jobIds.removeAll(waylineJobIds) || !jobIds.isEmpty(); |
| | | if (isErr) { |
| | | throw new IllegalArgumentException("These tasks have an incorrect status and cannot be canceled. " |
| | | + Arrays.toString(jobIds.toArray())); |
| | | throw new IllegalArgumentException("任务开始后,无法取消。" + Arrays.toString(jobIds.toArray())); |
| | | // throw new IllegalArgumentException("These tasks have an incorrect status and cannot be canceled. " |
| | | // + Arrays.toString(jobIds.toArray())); |
| | | } |
| | | |
| | | // Group job id by dock sn. |
| | |
| | | return null; |
| | | } |
| | | // 修改航线文件名称,从ard_route_info航线表中取; |
| | | String fileId = entity.getFileId(); |
| | | String fileName = ""; |
| | | try { |
| | | if (fileId != null) { |
| | | ArdRouteInfo ardRouteInfo = _ardRouteInfoService.selectArdRouteInfoById(fileId); |
| | | if (ardRouteInfo != null) { |
| | | fileName = Optional.ofNullable(ardRouteInfo.getName()).orElse(""); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception e) { |
| | | log.info("获取航线名称失败,fileId:{},异常原因:{}", fileId,e.getMessage()); |
| | | fileName = ""; |
| | | } |
| | | WaylineJobDTO.WaylineJobDTOBuilder builder = WaylineJobDTO.builder() |
| | | .jobId(entity.getJobId()) |
| | | .jobName(entity.getName()) |
| | | .fileId(entity.getFileId()) |
| | | // .fileName(waylineFileService.getWaylineByWaylineId(entity.getFileId()) |
| | | // .orElse(WaylineFileDTO.builder().build()).getName()) |
| | | .fileName(_ardRouteInfoService.selectArdRouteInfoById(entity.getFileId()) |
| | | .getName()) |
| | | .fileName(fileName) |
| | | .dockSn(entity.getDockSn()) |
| | | .dockName(deviceService.getDeviceBySn(entity.getDockSn()) |
| | | .orElse(DeviceDTO.builder().build()).getNickname()) |