Преглед на файлове

打开定时任务

tags/v1.1.0
wanghaoran преди 2 години
родител
ревизия
a67eac469f
променени са 1 файла, в които са добавени 4 реда и са изтрити 6 реда
  1. +4
    -6
      tuoheng-admin/src/main/java/com/tuoheng/admin/task/ScheduledTask.java

+ 4
- 6
tuoheng-admin/src/main/java/com/tuoheng/admin/task/ScheduledTask.java Целия файл

@@ -33,28 +33,26 @@ public class ScheduledTask {
private final static SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");


/* @Scheduled(fixedRate = 3000)
@Scheduled(fixedRate = 1000)
public void scheduledTask() {

log.info("执行定时执行飞行任务:" + LocalDateTime.now());



List<ThMission> thMissions = missionMapper.selectList(new LambdaQueryWrapper<ThMission>()
.eq(ThMission::getMark, MarkTypeEnum.VALID.getCode())
.ge(ThMission::getExecutionStartTime, dateformat.format(new Date()))
.ge(ThMission::getExecutionStatus, 1)
.eq(ThMission::getStatus, TaskStatusEnum.WAIT.getCode()));

log.info("一秒钟一次");
log.info("执行定时执行飞行任务,一秒钟一次");

for (ThMission thMission : thMissions) {
JsonResult jsonResult = inspectionService.executeTask(String.valueOf(thMission.getId()));
JsonResult jsonResult = inspectionService.executeTask(String.valueOf(thMission.getId()), null);
thMission.setExecutionStatus(2);
if(jsonResult.getCode()!=0 && ObjectUtil.isEmpty(jsonResult.getData())){
thMission.setStatus(TaskStatusEnum.FAIL.getCode());
}
missionMapper.updateById(thMission);
}
}*/
}
}

Loading…
Отказ
Запис