|
@@ -1598,44 +1598,50 @@ public class WindPowerInfo1Service {
|
|
|
|
|
|
}
|
|
|
|
|
|
-// public void writeReportHistory(Date date) throws Exception {
|
|
|
-//// String[] dateTime = {"2024-12-13 08:00:00","2024-12-13 12:00:00", "2024-12-13 16:00:00", "2024-12-13 20:00:00"};
|
|
|
-// String[] dateTime = {"2025-08-04 12:00:00"};
|
|
|
-// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
-// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+ public void writeReportHistory(Date date) throws Exception {
|
|
|
+// String[] dateTime = {"2024-12-13 08:00:00","2024-12-13 12:00:00", "2024-12-13 16:00:00", "2024-12-13 20:00:00"};
|
|
|
+ String[] dateTime = {"2025-08-04 12:00:00"};
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
+ QueryWrapper<ProBaseBackfill> qwf = new QueryWrapper<>();
|
|
|
+ qwf.lambda().eq(ProBaseBackfill::getType, "AI0005");
|
|
|
+ List<ProBaseBackfill> list = iProBaseBackfillService.list(qwf);
|
|
|
+ List<String> ls = list.stream().map(ProBaseBackfill::getCode).collect(Collectors.toList());
|
|
|
+
|
|
|
// String[] split = repInfo1.split(",");
|
|
|
// List<String> ls = new ArrayList<>(Arrays.asList(split));
|
|
|
-// for (String s : dateTime) {
|
|
|
-// Date date1 = simpleDateFormat.parse(s);
|
|
|
-// long timestamp = date1.getTime();
|
|
|
-//// for (long i = timestamp; i < 1735033631000L; i += 86400000) {
|
|
|
-// List<StationInfoHour> shs = new ArrayList<>();
|
|
|
-// for (String l : ls) {
|
|
|
-//// Map<String, PointData2> historySection = adapter.getHistorySection(goldenUri(), l, i);
|
|
|
-// Map<String, PointData2> historySection = adapter.getHistorySection(goldenUri(), l, timestamp);
|
|
|
-// if (null == historySection || historySection.isEmpty()) {
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// StationInfoHour sh = new StationInfoHour();
|
|
|
-//// sh.setRecordDate(LocalDateTime.ofInstant(Instant.ofEpochMilli(i),ZoneId.systemDefault()));
|
|
|
-// sh.setRecordDate(LocalDateTime.ofInstant(Instant.ofEpochMilli(timestamp), ZoneId.systemDefault()));
|
|
|
-// sh.setWpid("NX_FGS_HA_FDC_STA");
|
|
|
-// sh.setMeterId(l);
|
|
|
-// sh.setMeterName(l);
|
|
|
-// sh.setCode(BigDecimal.valueOf(historySection.get(l).getDoubleValue()));
|
|
|
-// sh.setCodeModify(BigDecimal.valueOf(historySection.get(l).getDoubleValue()));
|
|
|
-// shs.add(sh);
|
|
|
-//
|
|
|
-// }
|
|
|
-// try {
|
|
|
-// boolean b = stationInfoHourService.saveBatch(shs);
|
|
|
-// } catch (Exception e) {
|
|
|
-// e.printStackTrace();
|
|
|
+ for (String s : dateTime) {
|
|
|
+ Date date1 = simpleDateFormat.parse(s);
|
|
|
+ long timestamp = date1.getTime();
|
|
|
+// for (long i = timestamp; i < 1735033631000L; i += 86400000) {
|
|
|
+ List<StationInfoHour> shs = new ArrayList<>();
|
|
|
+ for (String l : ls) {
|
|
|
+// Map<String, PointData2> historySection = adapter.getHistorySection(goldenUri(), l, i);
|
|
|
+ Map<String, PointData2> historySection = adapter.getHistorySection(goldenUri(), l, timestamp);
|
|
|
+ if (null == historySection || historySection.isEmpty()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ StationInfoHour sh = new StationInfoHour();
|
|
|
+// sh.setRecordDate(LocalDateTime.ofInstant(Instant.ofEpochMilli(i),ZoneId.systemDefault()));
|
|
|
+ sh.setRecordDate(LocalDateTime.ofInstant(Instant.ofEpochMilli(timestamp), ZoneId.systemDefault()));
|
|
|
+ sh.setWpid("NX_FGS_HA_FDC_STA");
|
|
|
+ sh.setMeterId(l);
|
|
|
+ sh.setMeterName(l);
|
|
|
+ sh.setCode(BigDecimal.valueOf(historySection.get(l).getDoubleValue()));
|
|
|
+ sh.setCodeModify(BigDecimal.valueOf(historySection.get(l).getDoubleValue()));
|
|
|
+ shs.add(sh);
|
|
|
+
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ boolean b = stationInfoHourService.saveBatch(shs);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
// }
|
|
|
-//// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
|
|
|
/**
|