|
@@ -1,6 +1,7 @@
|
|
|
package com.cpp.web.service.cloud;
|
|
|
|
|
|
import com.cpp.common.utils.StringUtils;
|
|
|
+import com.cpp.web.domain.BaseForecastEntity;
|
|
|
import com.cpp.web.domain.cloud.ForecastPowerShortTermCloud;
|
|
|
import com.cpp.web.domain.cloud.NwpCloud;
|
|
|
import com.cpp.web.domain.datafactory.ParsingLog;
|
|
@@ -110,22 +111,24 @@ public class CloudFileParsing {
|
|
|
try {
|
|
|
parsingLog.setFileType(FileTypeEnum.dq);
|
|
|
// 解析短期文件
|
|
|
- List<ForecastPowerShortTermCloud> listDq = fileAnalysisShortTerm(file, new Date(currentDate));
|
|
|
+ List<BaseForecastEntity> listDq = new ArrayList<>();
|
|
|
+ listDq.addAll(fileAnalysisShortTerm(file, new Date(currentDate)));
|
|
|
if (!listDq.isEmpty()) {
|
|
|
try {
|
|
|
- parsingLog.setStationCode(listDq.get(0).getStationCode());
|
|
|
- forecastPowerShortTermCloudService.saveBatch(listDq);
|
|
|
+ String stationCode = listDq.get(0).getStationCode();
|
|
|
+ parsingLog.setStationCode(stationCode);
|
|
|
+ forecastPowerShortTermCloudService.saveBatch(overhaulPlanService.getCorrectionData(listDq, FileTypeEnum.dq.name(), fileName, stationCode));
|
|
|
flag = true;
|
|
|
} catch (Exception e) {
|
|
|
log.error("保存短期数据报错:" + fileName, e);
|
|
|
parsingLog.setParsingDescribe("保存短期数据报错:" + fileName);
|
|
|
- LogUtil.info(DataSourcesEnum.E2, AlarmEnum.E4,"保存短期数据报错:" + fileName,null);
|
|
|
+ LogUtil.info(DataSourcesEnum.E2, AlarmEnum.E4, "保存短期数据报错:" + fileName, null);
|
|
|
flag = false;
|
|
|
}
|
|
|
} else {
|
|
|
log.info(file.getName() + "文件数据内容为空、不能正常解析 、移除该文件:" + fileName);
|
|
|
parsingLog.setParsingDescribe("文件数据内容为空、不能正常解析 、移除该文件:" + fileName);
|
|
|
- LogUtil.info(DataSourcesEnum.E2, AlarmEnum.E4,"文件数据内容为空、不能正常解析 、移除该文件::" + fileName,null);
|
|
|
+ LogUtil.info(DataSourcesEnum.E2, AlarmEnum.E4, "文件数据内容为空、不能正常解析 、移除该文件::" + fileName, null);
|
|
|
flag = false;
|
|
|
}
|
|
|
|
|
@@ -133,7 +136,7 @@ public class CloudFileParsing {
|
|
|
} catch (Exception e) {
|
|
|
flag = false;
|
|
|
parsingLog.setParsingDescribe("解析DQ文件异常:" + fileName);
|
|
|
- LogUtil.info(DataSourcesEnum.E2, AlarmEnum.E4,"解析DQ文件失败:" + fileName,null);
|
|
|
+ LogUtil.info(DataSourcesEnum.E2, AlarmEnum.E4, "解析DQ文件失败:" + fileName, null);
|
|
|
log.error("解析DQ文件失败:" + fileName, e);
|
|
|
}
|
|
|
}
|
|
@@ -149,19 +152,19 @@ public class CloudFileParsing {
|
|
|
nwpCloudService.saveBatch(listNwp);
|
|
|
flag = true;
|
|
|
} catch (Exception e) {
|
|
|
- LogUtil.info(DataSourcesEnum.E2, AlarmEnum.E4,"保存NWP数据报错:" + fileName,null);
|
|
|
+ LogUtil.info(DataSourcesEnum.E2, AlarmEnum.E4, "保存NWP数据报错:" + fileName, null);
|
|
|
log.error("保存NWP数据报错:" + fileName, e);
|
|
|
parsingLog.setParsingDescribe("保存NWP数据报错:" + fileName);
|
|
|
flag = false;
|
|
|
}
|
|
|
} else {
|
|
|
- LogUtil.info(DataSourcesEnum.E2, AlarmEnum.E4,"文件数据内容为空、不能正常解析 、移除该文件:" + fileName,null);
|
|
|
+ LogUtil.info(DataSourcesEnum.E2, AlarmEnum.E4, "文件数据内容为空、不能正常解析 、移除该文件:" + fileName, null);
|
|
|
parsingLog.setParsingDescribe("文件数据内容为空、不能正常解析 、移除该文件:" + fileName);
|
|
|
log.info(file.getName() + "文件数据内容为空、不能正常解析 、移除该文件");
|
|
|
flag = false;
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- LogUtil.info(DataSourcesEnum.E2, AlarmEnum.E4,"解析NWP文件失败:" + fileName,null);
|
|
|
+ LogUtil.info(DataSourcesEnum.E2, AlarmEnum.E4, "解析NWP文件失败:" + fileName, null);
|
|
|
log.error("解析NWP文件失败:" + fileName, e);
|
|
|
parsingLog.setParsingDescribe("解析NWP文件失败:" + fileName);
|
|
|
flag = false;
|
|
@@ -420,7 +423,7 @@ public class CloudFileParsing {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return overhaulPlanService.getCorrectionData(forecastPowerShortTerm,"","");
|
|
|
+ return forecastPowerShortTerm;
|
|
|
}
|
|
|
|
|
|
|