|
|
@@ -142,6 +142,8 @@ public class DataMediumTermPowerForecastCorrectController extends BaseController
|
|
|
continue;
|
|
|
}
|
|
|
String newPower = multiplyPower(report.getPower(), factor);
|
|
|
+ report.setPower(newPower);
|
|
|
+ dataMediumTermPowerForecastReportMapper.updateDataMediumTermPowerForecastReport(report);
|
|
|
DataMediumTermPowerForecastCorrect existing = dataMediumTermPowerForecastCorrectMapper.selectLatestByEntityAndForecastTime(entityId, report.getForecastTime());
|
|
|
if (existing != null)
|
|
|
{
|
|
|
@@ -195,17 +197,23 @@ public class DataMediumTermPowerForecastCorrectController extends BaseController
|
|
|
return AjaxResult.error("修正功率必须为数字");
|
|
|
}
|
|
|
|
|
|
+ // 取该时刻最新一条上报数据: 同步回写修正功率, 无修正数据时作为新增模板
|
|
|
+ List<DataMediumTermPowerForecastReport> reportList = dataMediumTermPowerForecastReportMapper.selectLatestByWindow(entityId, forecastTime - 1, forecastTime);
|
|
|
+ DataMediumTermPowerForecastReport report = (reportList == null || reportList.isEmpty()) ? null : reportList.get(0);
|
|
|
+
|
|
|
DataMediumTermPowerForecastCorrect existing = dataMediumTermPowerForecastCorrectMapper.selectLatestByEntityAndForecastTime(entityId, forecastTime);
|
|
|
if (existing != null)
|
|
|
{
|
|
|
existing.setPower(power.trim());
|
|
|
dataMediumTermPowerForecastCorrectMapper.updateDataMediumTermPowerForecastCorrect(existing);
|
|
|
+ if (report != null)
|
|
|
+ {
|
|
|
+ report.setPower(power.trim());
|
|
|
+ dataMediumTermPowerForecastReportMapper.updateDataMediumTermPowerForecastReport(report);
|
|
|
+ }
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
|
- // 无修正数据时, 取该时刻最新一条上报数据作为新增模板
|
|
|
- List<DataMediumTermPowerForecastReport> reportList = dataMediumTermPowerForecastReportMapper.selectLatestByWindow(entityId, forecastTime - 1, forecastTime);
|
|
|
- DataMediumTermPowerForecastReport report = (reportList == null || reportList.isEmpty()) ? null : reportList.get(0);
|
|
|
if (report == null)
|
|
|
{
|
|
|
return AjaxResult.error("未找到对应时刻的上报数据,无法新增修正数据");
|