|
@@ -0,0 +1,25 @@
|
|
|
+package com.usky.iot.controller.web;
|
|
|
+
|
|
|
+import com.usky.iot.service.job.DmpDataOverviewJob;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author zyj
|
|
|
+ * @since 2023-06-05
|
|
|
+ */
|
|
|
+@EnableScheduling
|
|
|
+@Component
|
|
|
+public class TaskController {
|
|
|
+ @Autowired
|
|
|
+ private DmpDataOverviewJob dmpDataOverviewJob;
|
|
|
+
|
|
|
+ @Scheduled(cron = "0 0 1 * * ? ") //每天凌晨1点执行
|
|
|
+ public void task() {
|
|
|
+ System.out.println(Thread.currentThread().getName() + "定时任务执行中");
|
|
|
+ dmpDataOverviewJob.execute();
|
|
|
+ }
|
|
|
+
|
|
|
+}
|