1.需求
2.实现
2.1创建任务Action
@Component
@CompileStatic
@Scope(value="prototype")
@DCComponent(namespace = "IDaaS系统.60_测试.题目六",displayName = "PlanTaskZYQAction",description = "计划任务Action",type = DCType.scheduleTaskExecutor)
public class PlanTaskZYQAction extends AbScheduleTask<NoConfig> {
@Override
public void init() {
}
@Autowired
DataStoreService dataStoreService;
@Override
public void run(){
Date date = new Date();
SimpleDateFormat simpleDateFormat =
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("Normal Type Date time is: " +
simpleDateFormat.format(date));
}
}
2.2创建计划任务
添加组件——》数据组件——》添加计划任务
添加刚刚创建的组件
3.结果
重启adminApplication后,如图