代码备份
parent
61a8006c10
commit
665380dad5
@ -1,44 +0,0 @@
|
|||||||
package com.glxp.udidl.admin.thread;
|
|
||||||
|
|
||||||
import com.glxp.udidl.admin.dao.info.ScheduledMapper;
|
|
||||||
import com.glxp.udidl.admin.service.dataSync.DeviceSyncService;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
||||||
import org.springframework.scheduling.annotation.SchedulingConfigurer;
|
|
||||||
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
@EnableScheduling
|
|
||||||
public class DownloadTask2 implements SchedulingConfigurer {
|
|
||||||
|
|
||||||
final Logger logger = LoggerFactory.getLogger(DownloadTask.class);
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ScheduledMapper scheduledDao;
|
|
||||||
@Resource
|
|
||||||
DeviceSyncService deviceSyncService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
|
|
||||||
/*scheduledTaskRegistrar.addTriggerTask(() -> process(),
|
|
||||||
triggerContext -> {
|
|
||||||
ScheduledRequest scheduledRequest = new ScheduledRequest();
|
|
||||||
scheduledRequest.setCronName("downloadUdi2");
|
|
||||||
ScheduledEntity scheduledEntity = scheduledDao.findScheduled(scheduledRequest);
|
|
||||||
String cron = scheduledEntity.getCron();//"0 55 5 * * ?";
|
|
||||||
if (cron.isEmpty()) {
|
|
||||||
logger.error("cron is null");
|
|
||||||
}
|
|
||||||
return new CronTrigger(cron).nextExecutionTime(triggerContext);
|
|
||||||
});*/
|
|
||||||
}
|
|
||||||
|
|
||||||
private void process() {
|
|
||||||
deviceSyncService.downloadUdi(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue