Sfoglia il codice sorgente

修改定时任务时间

xiaowang 9 mesi fa
parent
commit
9c47855a75

+ 2 - 2
src/main/java/com/example/mdd/job/Download.java

@@ -17,8 +17,8 @@ public class Download {
     MeteorologicalDataDownload md;
 
     //每天10点下载数据
-    @Scheduled(fixedDelay = 100000)
-    //@Scheduled(cron = "0 0 10 * * ?")
+    //@Scheduled(fixedDelay = 1000)
+    @Scheduled(cron = "0 0 10 * * ?")
     public void download() {
         md.download();
     }

+ 2 - 0
src/main/java/com/example/mdd/service/BaiDuDownload.java

@@ -446,6 +446,7 @@ public class BaiDuDownload {
     }
 
     public void complements() {
+        log.info("补数开始");
         String body = HttpUtil.get("http://itil.jiayuepowertech.com:9958/itil/api/power-station", 10000);
         JSONObject json = JSONUtil.parseObj(body);
         String code = json.get("code").toString();
@@ -475,6 +476,7 @@ public class BaiDuDownload {
             }
 
         }
+        log.info("补数结束");
     }
 
     //去预测15天的数据   8月5号取8月6号到8月20号的数据

+ 3 - 3
src/main/java/com/example/mdd/service/MeteorologicalDataDownload.java

@@ -43,9 +43,9 @@ public class MeteorologicalDataDownload {
                 Connection conn = DbUtil.use(ds).getConnection();
                 for (PowerStation powerStation : list) {
                     if (!"".equals(powerStation.getLongitude()) && !"".equals(powerStation.getLatitude())) {
-                        //heFengDownload.download(conn, powerStation.getStationCode(), powerStation.getLongitude(), powerStation.getLatitude());
-                        //caiYunDownload.download(conn, powerStation.getStationCode(), powerStation.getLongitude(), powerStation.getLatitude());
-                        //xinZhiDownload.download(conn, powerStation.getStationCode(), powerStation.getLongitude(), powerStation.getLatitude());
+                        heFengDownload.download(conn, powerStation.getStationCode(), powerStation.getLongitude(), powerStation.getLatitude());
+                        caiYunDownload.download(conn, powerStation.getStationCode(), powerStation.getLongitude(), powerStation.getLatitude());
+                        xinZhiDownload.download(conn, powerStation.getStationCode(), powerStation.getLongitude(), powerStation.getLatitude());
                         baiDuDownload.download(conn, powerStation.getStationCode(), powerStation.getLongitude(), powerStation.getLatitude());
                     }
                 }