zhaowenyu
2025-11-18 d2b4f1493696c28355242deda4eaa66ceb1ec7d6
ard-sample/src/main/java/com/ard/sample/wayline/service/impl/WaylineJobServiceImpl.java
@@ -179,13 +179,14 @@
        }
        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();
@@ -439,8 +440,9 @@
        // 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.