| | |
| | | |
| | | // 飞行命令先注释掉 |
| | | // Issue an immediate task execution command. |
| | | // if (WaylineTaskTypeEnum.IMMEDIATE.getVal() == waylineJob.getTaskType()) { |
| | | // if (!executeFlightTask(waylineJob.getJobId())) { |
| | | // return ResponseResult.error("Failed to execute job."); |
| | | // } |
| | | // } |
| | | // |
| | | // if (WaylineTaskTypeEnum.TIMED.getVal() == waylineJob.getTaskType()) { |
| | | // boolean isAdd = RedisOpsUtils.zAdd(RedisConst.WAYLINE_JOB_TIMED_EXECUTE, |
| | | // waylineJob.getDockSn() + RedisConst.DELIMITER + waylineJob.getJobId(), |
| | | // waylineJob.getBeginTime().atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()); |
| | | // if (!isAdd) { |
| | | // return ResponseResult.error("Failed to create scheduled job."); |
| | | // } |
| | | // } |
| | | if (WaylineTaskTypeEnum.IMMEDIATE.getVal() == waylineJob.getTaskType()) { |
| | | if (!executeFlightTask(waylineJob.getJobId())) { |
| | | return ResponseResult.error("Failed to execute job."); |
| | | } |
| | | } |
| | | |
| | | if (WaylineTaskTypeEnum.TIMED.getVal() == waylineJob.getTaskType()) { |
| | | boolean isAdd = RedisOpsUtils.zAdd(RedisConst.WAYLINE_JOB_TIMED_EXECUTE, |
| | | waylineJob.getDockSn() + RedisConst.DELIMITER + waylineJob.getJobId(), |
| | | waylineJob.getBeginTime().atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()); |
| | | if (!isAdd) { |
| | | return ResponseResult.error("Failed to create scheduled job."); |
| | | } |
| | | } |
| | | |
| | | return ResponseResult.success(); |
| | | } |
| | |
| | | |
| | | // 飞行命令先注释掉 |
| | | // Issue an immediate task execution command. |
| | | // if (WaylineTaskTypeEnum.IMMEDIATE.getVal() == waylineJob.getTaskType()) { |
| | | // if (!executeFlightTask(waylineJob.getJobId())) { |
| | | // return ResponseResult.error("Failed to execute job."); |
| | | // } |
| | | // } |
| | | // |
| | | // if (WaylineTaskTypeEnum.TIMED.getVal() == waylineJob.getTaskType()) { |
| | | // boolean isAdd = RedisOpsUtils.zAdd(RedisConst.WAYLINE_JOB_TIMED_EXECUTE, |
| | | // waylineJob.getDockSn() + RedisConst.DELIMITER + waylineJob.getJobId(), |
| | | // waylineJob.getBeginTime().atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()); |
| | | // if (!isAdd) { |
| | | // return ResponseResult.error("Failed to create scheduled job."); |
| | | // } |
| | | // } |
| | | if (WaylineTaskTypeEnum.IMMEDIATE.getVal() == waylineJob.getTaskType()) { |
| | | if (!executeFlightTask(waylineJob.getJobId())) { |
| | | return ResponseResult.error("Failed to execute job."); |
| | | } |
| | | } |
| | | |
| | | if (WaylineTaskTypeEnum.TIMED.getVal() == waylineJob.getTaskType()) { |
| | | boolean isAdd = RedisOpsUtils.zAdd(RedisConst.WAYLINE_JOB_TIMED_EXECUTE, |
| | | waylineJob.getDockSn() + RedisConst.DELIMITER + waylineJob.getJobId(), |
| | | waylineJob.getBeginTime().atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()); |
| | | if (!isAdd) { |
| | | return ResponseResult.error("Failed to create scheduled job."); |
| | | } |
| | | } |
| | | |
| | | return ResponseResult.success(); |
| | | } |