|
@@ -16,14 +16,17 @@ import com.ruoyi.ucp.service.IStationInfoDayService;
|
|
|
import com.ruoyi.ucp.service.IStationInfoMinService;
|
|
|
import com.ruoyi.ucp.util.DatePart;
|
|
|
import com.ruoyi.ucp.util.SqlUtil;
|
|
|
+import com.ruoyi.ucp.util.TimeSeriesChart;
|
|
|
import com.ruoyi.web.controller.JavaFunctionJobHandler;
|
|
|
import org.apache.ibatis.reflection.property.PropertyNamer;
|
|
|
+import org.jfree.data.xy.XYSeries;
|
|
|
import org.junit.Test;
|
|
|
import org.junit.runner.RunWith;
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import javax.swing.*;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
@@ -42,12 +45,28 @@ public class NewTests {
|
|
|
private IStationInfoDayService stationInfoDayService;
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- List<Double> list = new ArrayList<>();
|
|
|
- Double o = list.get(0);
|
|
|
- System.out.println();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ List<Double> xdl = new ArrayList<>();
|
|
|
+ xdl.add(0.0);
|
|
|
+ Double v = xdl.get(0);
|
|
|
+ v = v + 3;
|
|
|
+ System.out.println(xdl.get(0));
|
|
|
}
|
|
|
|
|
|
private static void aadd(SFunction<TurbineInfoDay, String> a) {
|
|
@@ -206,25 +225,25 @@ public class NewTests {
|
|
|
|
|
|
@Test
|
|
|
public void test4() {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- DateTime start = DateUtil.parse("2023-12-01");
|
|
|
- DateTime end = DateUtil.parse("2023-12-01");
|
|
|
- DateRange range = DateUtil.range(start, end, DateField.MONTH);
|
|
|
- List<String> stIds = new ArrayList<>();
|
|
|
- stIds.add("GJNY_SXGS_FSG_FDC_STA");
|
|
|
- stIds.add("GJNY_SXGS_JSL_FDC_STA");
|
|
|
- stIds.add("GJNY_SXGS_CSL_FDC_STA");
|
|
|
- stIds.add("GJNY_SXGS_ZZ_FDC_STA");
|
|
|
- stIds.add("GJNY_SXGS_XZ_FDC_STA");
|
|
|
- stIds.add("GJNY_SXGS_LJS_FDC_STA");
|
|
|
- for (DateTime date : range) {
|
|
|
-
|
|
|
- task.predictExaminBc(stIds, date);
|
|
|
- }
|
|
|
-
|
|
|
+ while (true){
|
|
|
+ task.calcStationRealtimeLLgl();
|
|
|
+ ThreadUtil.sleep(6000);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
@@ -333,8 +352,8 @@ public class NewTests {
|
|
|
public void test10() {
|
|
|
|
|
|
|
|
|
- DateTime start = DateUtil.parse("2025-01-02");
|
|
|
- DateTime end = DateUtil.parse("2025-01-15");
|
|
|
+ DateTime start = DateUtil.parse("2025-01-13");
|
|
|
+ DateTime end = DateUtil.parse("2025-01-13");
|
|
|
DateRange range = DateUtil.range(start, end, DateField.DAY_OF_YEAR);
|
|
|
for (DateTime date : range) {
|
|
|
|
|
@@ -343,7 +362,7 @@ public class NewTests {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+ task.calcStationSwGwCyRdl_ha(date);
|
|
|
|
|
|
|
|
|
|
|
@@ -353,7 +372,8 @@ public class NewTests {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+ task.calcTurbine5s2_ha(date);
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -369,16 +389,29 @@ public class NewTests {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
- task.calcHaBbHzSs(date);
|
|
|
+
|
|
|
+
|
|
|
+ DateTime b1 = DateUtil.offsetDay(date, -1);
|
|
|
+ DateTime b2 = DateUtil.endOfDay(b1);
|
|
|
+
|
|
|
+ task.calcHaBbHz(date);
|
|
|
+ task.calcHaBbHzSs(b1, b2);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
public void test11() {
|
|
|
while (true) {
|
|
|
- task.calcRealtimeTurbineZt();
|
|
|
- ThreadUtil.sleep(100000);
|
|
|
+ try {
|
|
|
+ task.calcRealtimeTurbineZt();
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ ThreadUtil.sleep(1000);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -393,13 +426,39 @@ public class NewTests {
|
|
|
public void test13() {
|
|
|
DateTime end = DateUtil.date();
|
|
|
DateTime begin = DateUtil.beginOfDay(end);
|
|
|
- task.calcTurbineRFDL(begin, end);
|
|
|
- task.calcTurbineStateMin(begin, end);
|
|
|
+ DateTime date = DateUtil.date();
|
|
|
+ DateTime yesterday = DateUtil.yesterday();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
task.calcTurbine5s(begin, end, 0.1);
|
|
|
- task.calcTurbineLyxs(begin);
|
|
|
- task.calcStationCftfsfxQfxdl(begin, end);
|
|
|
- task.calcTurbineJfplFxYxfssBll(begin, end);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void test15() {
|
|
|
+ DateTime begin = DateUtil.parse("2025-01-01");
|
|
|
+ DateTime end = DateUtil.parse("2025-01-19");
|
|
|
+ DateRange range = DateUtil.range(begin, end, DateField.DAY_OF_YEAR);
|
|
|
+ for (DateTime begin1 : range) {
|
|
|
+ DateTime end1 = DateUtil.endOfDay(begin1);
|
|
|
+
|
|
|
+ task.calcRYNxdl(begin1, end1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
public void test14() {
|
|
|
DateTime start = DateUtil.parse("2025-01-01");
|
|
@@ -413,4 +472,28 @@ public class NewTests {
|
|
|
System.out.println(sidR.get(0).getRfdlFj());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void test16() {
|
|
|
+ SwingUtilities.invokeLater(() -> {
|
|
|
+
|
|
|
+ });
|
|
|
+ XYSeries seriesAgc = new XYSeries("AGC");
|
|
|
+ seriesAgc.add(1.0, 10.0);
|
|
|
+ seriesAgc.add(2.0, 15.0);
|
|
|
+ seriesAgc.add(3.0, 13.0);
|
|
|
+ XYSeries seriesZs = new XYSeries("自算功率");
|
|
|
+ seriesZs.add(1.0, 10.0);
|
|
|
+ seriesZs.add(2.0, 15.0);
|
|
|
+ seriesZs.add(3.0, 13.0);
|
|
|
+ XYSeries seriesCx = new XYSeries("出线功率");
|
|
|
+ seriesCx.add(1.0, 10.0);
|
|
|
+ seriesCx.add(2.0, 15.0);
|
|
|
+ seriesCx.add(3.0, 13.0);
|
|
|
+ TimeSeriesChart example = new TimeSeriesChart("分析限电", seriesAgc, seriesZs, seriesCx);
|
|
|
+ example.setSize(1280, 600);
|
|
|
+ example.setLocationRelativeTo(null);
|
|
|
+ example.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
|
|
+ example.setVisible(true);
|
|
|
+ }
|
|
|
}
|