|
@@ -185,15 +185,12 @@ public class FileAnalysisService extends BaseService {
|
|
if (firstRow.length==2){
|
|
if (firstRow.length==2){
|
|
// 获取场站名称
|
|
// 获取场站名称
|
|
String czmc = firstRow[0].split("::")[1];
|
|
String czmc = firstRow[0].split("::")[1];
|
|
- if ("龙阜风电场".equals(czmc)){
|
|
|
|
|
|
+ if ("光伏电场".equals(czmc)){
|
|
ycbs = 0;
|
|
ycbs = 0;
|
|
}
|
|
}
|
|
- if ("龙阜风电场一期".equals(czmc)){
|
|
|
|
|
|
+ if ("风电场".equals(czmc)){
|
|
ycbs = 1;
|
|
ycbs = 1;
|
|
}
|
|
}
|
|
- else if ("龙阜风电场二期".equals(czmc)){
|
|
|
|
- ycbs = 2;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -249,40 +246,11 @@ public class FileAnalysisService extends BaseService {
|
|
forecastPowerShortTermOneService.deleteBetweenAndGenTime(startTime, endTime, listDq);
|
|
forecastPowerShortTermOneService.deleteBetweenAndGenTime(startTime, endTime, listDq);
|
|
flag = true;
|
|
flag = true;
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.error("一期文件保存短期数据报错", e);
|
|
|
|
- flag = false;
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- log.info(file.getName() + "一期文件数据内容为空、不能正常解析 、移除该文件、执行数据修正功能");
|
|
|
|
- flag = false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else if (ycbs==2){
|
|
|
|
- // 二期短期文件
|
|
|
|
- List<ForecastPowerShortTermTwo> listDq = fileAnalysisShortTermTwo(file, currentDate);
|
|
|
|
- ForecastPowerShortTermTwo forecastPowerShortTermTwo = null;
|
|
|
|
- if (listDq != null && listDq.size() > 0) {
|
|
|
|
- //如果数据不全,进行补入
|
|
|
|
- while (listDq.get(listDq.size() - 1).getForecastTime() < DateTimeUtil.getMillisecondsSubDay() + 4 * 24 * 60 * 60 * 1000 - timeD) {
|
|
|
|
- forecastPowerShortTermTwo = new ForecastPowerShortTermTwo();
|
|
|
|
- forecastPowerShortTermTwo.setFpValue(listDq.get(listDq.size() - 96).getFpValue());//修正前值
|
|
|
|
- forecastPowerShortTermTwo.setGenDate(new Date()); //装机容量
|
|
|
|
- forecastPowerShortTermTwo.setForecastTime(currentDate);
|
|
|
|
- forecastPowerShortTermTwo.setPredictionModelEnum(PredictionModelEnum.E1);
|
|
|
|
- listDq.add(forecastPowerShortTermTwo);
|
|
|
|
- }
|
|
|
|
- try {
|
|
|
|
- //短期数据修正
|
|
|
|
- Long startTime = listDq.get(0).getForecastTime();
|
|
|
|
- Long endTime = listDq.get(listDq.size() - 1).getForecastTime();//删除相同时间数据
|
|
|
|
- forecastPowerShortTermTwoService.deleteBetweenAndGenTime(startTime, endTime, listDq);
|
|
|
|
- flag = true;
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- log.error("二期文件保存短期数据报错", e);
|
|
|
|
|
|
+ log.error("风电文件保存短期数据报错", e);
|
|
flag = false;
|
|
flag = false;
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- log.info(file.getName() + "二期文件数据内容为空、不能正常解析 、移除该文件、执行数据修正功能");
|
|
|
|
|
|
+ log.info(file.getName() + "风电文件数据内容为空、不能正常解析 、移除该文件、执行数据修正功能");
|
|
flag = false;
|
|
flag = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -345,15 +313,12 @@ public class FileAnalysisService extends BaseService {
|
|
if (firstRow.length==2){
|
|
if (firstRow.length==2){
|
|
// 获取场站名称
|
|
// 获取场站名称
|
|
String czmc = firstRow[0].split("::")[1];
|
|
String czmc = firstRow[0].split("::")[1];
|
|
- if ("龙阜风电场".equals(czmc)){
|
|
|
|
|
|
+ if ("光伏电场".equals(czmc)){
|
|
ycbs = 0;
|
|
ycbs = 0;
|
|
}
|
|
}
|
|
- if ("龙阜风电场一期".equals(czmc)){
|
|
|
|
|
|
+ if ("风电场".equals(czmc)){
|
|
ycbs = 1;
|
|
ycbs = 1;
|
|
}
|
|
}
|
|
- else if ("龙阜风电场二期".equals(czmc)){
|
|
|
|
- ycbs = 2;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -468,7 +433,7 @@ public class FileAnalysisService extends BaseService {
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
flag = false;
|
|
flag = false;
|
|
- log.info(file.getName() + "一期NWP文件数据内容为空、不能正常解析 、移除该文件、执行数据修正功能");
|
|
|
|
|
|
+ log.info(file.getName() + "风电NWP文件数据内容为空、不能正常解析 、移除该文件、执行数据修正功能");
|
|
}
|
|
}
|
|
//保存NWP实时数据
|
|
//保存NWP实时数据
|
|
Long startTime = listNwp.get(0).getPreTime();
|
|
Long startTime = listNwp.get(0).getPreTime();
|
|
@@ -476,64 +441,6 @@ public class FileAnalysisService extends BaseService {
|
|
nwpOneService.deleteBetweenAndPreTime(startTime, endTime, listNwp);
|
|
nwpOneService.deleteBetweenAndPreTime(startTime, endTime, listNwp);
|
|
flag = true;
|
|
flag = true;
|
|
}
|
|
}
|
|
- else if (ycbs==2) {
|
|
|
|
- // 二期
|
|
|
|
- List<NwpTwo> listNwp = fileAnalysisNwpTwo(file);
|
|
|
|
- NwpTwo nwpData = null;
|
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
- if (listNwp != null && listNwp.size() > 0) {
|
|
|
|
- while (listNwp.get(listNwp.size() - 1).getPreTime() < DateTimeUtil.getMillisecondsSubDay() + 4 * 24 * 60 * 60 * 1000 - timeD) {
|
|
|
|
- nwpData = new NwpTwo();
|
|
|
|
- long time = 0;
|
|
|
|
- try {
|
|
|
|
- time = sdf.parse(listNwp.get(listNwp.size() - 96).getPreDate()).getTime() + 24 * 60 * 60 * 1000;
|
|
|
|
- } catch (ParseException e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- }
|
|
|
|
- nwpData.setFarmId(listNwp.get(listNwp.size() - 96).getFarmId());
|
|
|
|
- nwpData.setScDate(listNwp.get(listNwp.size() - 96).getScDate());
|
|
|
|
- nwpData.setScTime(listNwp.get(listNwp.size() - 96).getScTime());
|
|
|
|
- nwpData.setPreDate(sdf.format(time));
|
|
|
|
- nwpData.setPreTime(listNwp.get(listNwp.size() - 1).getPreTime() + timeD);
|
|
|
|
- nwpData.setT(listNwp.get(listNwp.size() - 96).getT());//温度
|
|
|
|
- nwpData.setRh(listNwp.get(listNwp.size() - 96).getRh());//湿度
|
|
|
|
- nwpData.setPressure(listNwp.get(listNwp.size() - 96).getPressure());//气压
|
|
|
|
- nwpData.setSwr(listNwp.get(listNwp.size() - 96).getSwr());//辐射
|
|
|
|
- nwpData.setLwr(listNwp.get(listNwp.size() - 96).getLwr());//辐射
|
|
|
|
- nwpData.setDiffuseRadiation(listNwp.get(listNwp.size() - 96).getDiffuseRadiation());//散接辐射
|
|
|
|
- nwpData.setDirectRadiation(listNwp.get(listNwp.size() - 96).getDirectRadiation());//直接辐射
|
|
|
|
-
|
|
|
|
- nwpData.setSenf(listNwp.get(listNwp.size() - 96).getSenf());//热感通量
|
|
|
|
-
|
|
|
|
- nwpData.setWs10(listNwp.get(listNwp.size() - 96).getWs10());//10 m 风速
|
|
|
|
- nwpData.setWs30(listNwp.get(listNwp.size() - 96).getWs30());//30 m 风速
|
|
|
|
- nwpData.setWs50(listNwp.get(listNwp.size() - 96).getWs50());//50 m 风速
|
|
|
|
- nwpData.setWs70(listNwp.get(listNwp.size() - 96).getWs70());//70 m 风速
|
|
|
|
- nwpData.setWs80(listNwp.get(listNwp.size() - 96).getWs80());//80 m 风速
|
|
|
|
- nwpData.setWs90(listNwp.get(listNwp.size() - 96).getWs90());//90 m 风速
|
|
|
|
- nwpData.setWs100(listNwp.get(listNwp.size() - 96).getWs100());//100 m 风速
|
|
|
|
- nwpData.setWs170(listNwp.get(listNwp.size() - 96).getWs170());//170 m 风速
|
|
|
|
-
|
|
|
|
- nwpData.setWd10(listNwp.get(listNwp.size() - 96).getWd10());//10 m 风向
|
|
|
|
- nwpData.setWd30(listNwp.get(listNwp.size() - 96).getWd30());//30 m 风向
|
|
|
|
- nwpData.setWd50(listNwp.get(listNwp.size() - 96).getWd50());//50 m 风向
|
|
|
|
- nwpData.setWd70(listNwp.get(listNwp.size() - 96).getWd70());//70 m 风向
|
|
|
|
- nwpData.setWd80(listNwp.get(listNwp.size() - 96).getWd80());//80 m 风向
|
|
|
|
- nwpData.setWd90(listNwp.get(listNwp.size() - 96).getWd90());//90 m 风向
|
|
|
|
- nwpData.setWd100(listNwp.get(listNwp.size() - 96).getWd100());//100 m 风向
|
|
|
|
- nwpData.setWd170(listNwp.get(listNwp.size() - 96).getWd170());//170 m 风向
|
|
|
|
- listNwp.add(nwpData);
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- flag = false;
|
|
|
|
- log.info(file.getName() + "二期NWP文件数据内容为空、不能正常解析 、移除该文件、执行数据修正功能");
|
|
|
|
- }
|
|
|
|
- //保存NWP实时数据
|
|
|
|
- Long startTime = listNwp.get(0).getPreTime();
|
|
|
|
- Long endTime = listNwp.get(listNwp.size() - 1).getPreTime();//删除相同时间数据
|
|
|
|
- nwpTwoService.deleteBetweenAndPreTime(startTime, endTime, listNwp);
|
|
|
|
- flag = true;
|
|
|
|
- }
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error("解析NWP文件失败", e);
|
|
log.error("解析NWP文件失败", e);
|
|
flag = false;
|
|
flag = false;
|