Просмотр исходного кода

Merge branch 'master' of http://git.jiayuepowertech.com:9022/xusl/focus

wanghc 3 лет назад
Родитель
Сommit
f33abbb7cc

+ 25 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/job/ForecastPowerUltraShortTermJob.java

@@ -0,0 +1,25 @@
+package com.jiayue.ipfcst.console.job;
+
+import com.jiayue.ipfcst.console.service.ForecastPowerUltraShortTermService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Service;
+
+/**
+ * 超短期执行任务
+ *
+ * @author zzy
+ * @version 3.0
+ */
+@Service
+@EnableScheduling
+public class ForecastPowerUltraShortTermJob {
+  @Autowired
+  private ForecastPowerUltraShortTermService forecastPowerUltraShortTermService;
+
+  @Scheduled(fixedDelay = 60000)
+  public void executeForecast() {
+    this.forecastPowerUltraShortTermService.executeForecast();
+  }
+}

+ 0 - 2
ipfcst-console/src/test/java/com/jiayue/ipfcst/console/service/ForecastPowerShortTermServiceTest.java

@@ -24,8 +24,6 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
-import static org.junit.jupiter.api.Assertions.*;
-
 /**
  * 短期测试类
  *

+ 23 - 0
ipfcst-console/src/test/java/com/jiayue/ipfcst/console/service/ForecastPowerUltraShortTermServiceTest.java

@@ -0,0 +1,23 @@
+package com.jiayue.ipfcst.console.service;
+
+import com.jiayue.ipfcst.BaseTest;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+
+/**
+ * 超短期测试类
+ *
+ * @author xsl
+ * @version 3.0
+ */
+public class ForecastPowerUltraShortTermServiceTest extends BaseTest {
+
+  @Autowired
+  ForecastPowerUltraShortTermService forecastPowerUltraShortTermService;
+
+  @Test
+  public void executeForecast() {
+    forecastPowerUltraShortTermService.executeForecast();
+  }
+}