|
|
@@ -138,6 +138,13 @@ public class DataPowerForecastReportBatchTask
|
|
|
log.warn("[PowerForecastReportBatch] period 非 daily, 跳过, stationCode={}", config.getStationCode());
|
|
|
return;
|
|
|
}
|
|
|
+ if (!DataPowerForecastReportBatch.TYPE_SHORT.equals(config.getType())
|
|
|
+ && !DataPowerForecastReportBatch.TYPE_ULTRA.equals(config.getType()))
|
|
|
+ {
|
|
|
+ log.warn("[PowerForecastReportBatch] type 未知, 跳过, stationCode={}, type={}",
|
|
|
+ config.getStationCode(), config.getType());
|
|
|
+ return;
|
|
|
+ }
|
|
|
ConfigStation q = new ConfigStation();
|
|
|
q.setStationCode(config.getStationCode());
|
|
|
List<ConfigStation> stations = configStationService.selectConfigStationList(q);
|
|
|
@@ -156,9 +163,20 @@ public class DataPowerForecastReportBatchTask
|
|
|
times.sort(Comparator.naturalOrder());
|
|
|
for (String t : times)
|
|
|
{
|
|
|
+ LocalTime slotTime;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ slotTime = LocalTime.parse(t);
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ log.warn("[PowerForecastReportBatch] 时点格式非法, 跳过, stationCode={}, time={}",
|
|
|
+ config.getStationCode(), t);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
LocalDateTime now = LocalDateTime.now(ZONE_SH);
|
|
|
LocalDate today = LocalDate.now(ZONE_SH);
|
|
|
- LocalDateTime slot = today.atTime(LocalTime.parse(t));
|
|
|
+ LocalDateTime slot = today.atTime(slotTime);
|
|
|
// 已过时点, 跳过后续更远的时点
|
|
|
if (now.isAfter(slot))
|
|
|
{
|