|
@@ -79,10 +79,12 @@ public class ParsingCdqInfoServiceImpl extends ServiceImpl<ParsingCdqInfoMapper,
|
|
|
List<BigDecimal> bigDecimals = parsingFpValue(parsingCdqInfo.getFpValue(), fileContent);
|
|
|
|
|
|
if (!bigDecimals.isEmpty()) {
|
|
|
- Date genDate = parsingGenDate(parsingCdqInfo.getGenDate(), fileContent);
|
|
|
+// Date genDate = parsingGenDate(parsingCdqInfo.getGenDate(), fileContent);
|
|
|
Long forecastTime = parsingForecastTime(parsingCdqInfo.getForecastTime(), fileContent);
|
|
|
-
|
|
|
if (forecastTime != 0L) {
|
|
|
+ // 所属产生时刻用第一个点位减去15分钟
|
|
|
+ long genDate = forecastTime-1000*60*15L;
|
|
|
+
|
|
|
int ago = 1;
|
|
|
List<ForecastPowerUltraShortTermHis> forecastPowerUltraShortTermHisList = new ArrayList<>();
|
|
|
List<ForecastPowerUltraShortTerm> forecastPowerUltraShortTermList = new ArrayList<>();
|
|
@@ -90,7 +92,7 @@ public class ParsingCdqInfoServiceImpl extends ServiceImpl<ParsingCdqInfoMapper,
|
|
|
for (BigDecimal bigDecimal : bigDecimals) {
|
|
|
// 构造ForecastPowerUltraShortTermHis对象
|
|
|
ForecastPowerUltraShortTermHis forecastPowerUltraShortTermHis = new ForecastPowerUltraShortTermHis();
|
|
|
- forecastPowerUltraShortTermHis.setGenDate(genDate);
|
|
|
+ forecastPowerUltraShortTermHis.setGenDate(new Date(genDate));
|
|
|
forecastPowerUltraShortTermHis.setStationCode(parsingUrl.getStationCode());
|
|
|
forecastPowerUltraShortTermHis.setAbleValue(bigDecimal);
|
|
|
Date localDateTime = new Date(forecastTime);
|
|
@@ -104,7 +106,7 @@ public class ParsingCdqInfoServiceImpl extends ServiceImpl<ParsingCdqInfoMapper,
|
|
|
forecastPowerUltraShortTerm.setForecastTime(localDateTime);
|
|
|
forecastPowerUltraShortTerm.setStationCode(parsingUrl.getStationCode());
|
|
|
forecastPowerUltraShortTerm.setFpValue(bigDecimal);
|
|
|
- forecastPowerUltraShortTerm.setGenDate(genDate);
|
|
|
+ forecastPowerUltraShortTerm.setGenDate(new Date(genDate));
|
|
|
forecastPowerUltraShortTerm.setForecastManufactor(parsingUrl.getForecastManufactor());
|
|
|
forecastPowerUltraShortTermList.add(forecastPowerUltraShortTerm);
|
|
|
|
|
@@ -118,16 +120,17 @@ public class ParsingCdqInfoServiceImpl extends ServiceImpl<ParsingCdqInfoMapper,
|
|
|
// 删除之前的ForecastPowerUltraShortTerm记录
|
|
|
LambdaQueryWrapper<ForecastPowerUltraShortTerm> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
lambdaQueryWrapper.eq(ForecastPowerUltraShortTerm::getStationCode, parsingUrl.getStationCode());
|
|
|
+ lambdaQueryWrapper.eq(ForecastPowerUltraShortTerm::getForecastManufactor, parsingUrl.getForecastManufactor());
|
|
|
lambdaQueryWrapper.between(ForecastPowerUltraShortTerm::getForecastTime, forecastPowerUltraShortTermList.get(0).getForecastTime(), forecastPowerUltraShortTermList.get(forecastPowerUltraShortTermList.size() - 1).getForecastTime());
|
|
|
forecastPowerUltraShortTermService.remove(lambdaQueryWrapper);
|
|
|
// 批量保存新的ForecastPowerUltraShortTerm记录
|
|
|
forecastPowerUltraShortTermService.saveBatch(forecastPowerUltraShortTermList);
|
|
|
|
|
|
- LocalDate today = LocalDate.now();
|
|
|
// 删除当天的ForecastPowerUltraShortTermHis记录
|
|
|
LambdaQueryWrapper<ForecastPowerUltraShortTermHis> forecastPowerUltraShortTermHisLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- forecastPowerUltraShortTermHisLambdaQueryWrapper.between(ForecastPowerUltraShortTermHis::getGenDate, today.atStartOfDay(), today.atTime(LocalTime.MAX));
|
|
|
+ forecastPowerUltraShortTermHisLambdaQueryWrapper.eq(ForecastPowerUltraShortTermHis::getGenDate, new Date(genDate));
|
|
|
forecastPowerUltraShortTermHisLambdaQueryWrapper.eq(ForecastPowerUltraShortTermHis::getStationCode, parsingUrl.getStationCode());
|
|
|
+ forecastPowerUltraShortTermHisLambdaQueryWrapper.eq(ForecastPowerUltraShortTermHis::getForecastManufactor, parsingUrl.getForecastManufactor());
|
|
|
forecastPowerUltraShortTermHisService.remove(forecastPowerUltraShortTermHisLambdaQueryWrapper);
|
|
|
// 批量保存新的ForecastPowerUltraShortTermHis记录
|
|
|
forecastPowerUltraShortTermHisService.saveBatch(forecastPowerUltraShortTermHisList);
|