Commit c4b6614c authored by ZWT's avatar ZWT

feat(吉林演示): 松原

1.修改风电站运行状态接口,增加模拟实际发电功率处理逻辑,完成接口冒烟测试;
2.修改天气数据处理定时任务,解决晚上十一点半天气预报数据处理异常问题,修改风资源预测数据和光伏资源预测数据时间处理逻辑,完成接口冒烟测试;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 0926ae03
...@@ -692,17 +692,12 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService { ...@@ -692,17 +692,12 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
for (BaseWindTurbineView plant : plantViewList) { for (BaseWindTurbineView plant : plantViewList) {
List<WindPredictionFutureView> allList = new ArrayList<>(32); List<WindPredictionFutureView> allList = new ArrayList<>(32);
List<WindPredictionFutureView> objList = new ArrayList<>(16); List<WindPredictionFutureView> objList = new ArrayList<>(16);
DateTime dateTime = DateTime.of(dailyData.getDateTime()); DateTime dateTime = DateUtil.date(dailyData.getDateTime());
int hours = 0;
String plantId = plant.getId(); String plantId = plant.getId();
DateTime date; DateTime date;
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
//判断小时数与查到的小时数,如果查到的小时数小,判断为第二天 //判断小时数与查到的小时数,如果查到的小时数小,判断为第二天
int hour = LocalTime.parse(dailyData.getHourTimeArray().get(i)).getHour(); int hour = LocalTime.parse(dailyData.getHourTimeArray().get(i)).getHour();
if (hours >= hour) {
dateTime = DateUtil.offsetDay(dateTime, 1);
}
hours = hour;
int wind = 0; int wind = 0;
if (CollUtil.isNotEmpty(dailyData.getWindDirectionArray())) { if (CollUtil.isNotEmpty(dailyData.getWindDirectionArray())) {
if (i < dailyData.getWindDirectionArray().size()) { if (i < dailyData.getWindDirectionArray().size()) {
...@@ -712,9 +707,13 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService { ...@@ -712,9 +707,13 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
} }
} }
} }
DateTime parse = DateUtil.parse(String.valueOf(dateTime.year()) + '-' + this.int2Str(dateTime.month() + 1) + '-' + this.int2Str(dateTime.dayOfMonth()) + ' ' + this.int2Str(hour) + ':' + BusinessConstant.START_OF_DAY_TIME);
if (DateUtil.compare(parse, dateTime) < 0) {
parse = DateUtil.offsetDay(parse, 1);
}
WindPredictionFutureView dao = WindPredictionFutureView.builder() WindPredictionFutureView dao = WindPredictionFutureView.builder()
.stationId(plantId) .stationId(plantId)
.dataTime(DateUtil.parse(String.valueOf(dateTime.year()) + '-' + this.int2Str(dateTime.month() + 1) + '-' + this.int2Str(dateTime.dayOfMonth()) + ' ' + this.int2Str(hours) + ':' + BusinessConstant.START_OF_DAY_TIME)) .dataTime(parse)
.windDirection(wind) .windDirection(wind)
.windSpeed(new BigDecimal(CharSequenceUtil.replace(dailyData.getWindSpeedArray().get(i), "m/s", ""))) .windSpeed(new BigDecimal(CharSequenceUtil.replace(dailyData.getWindSpeedArray().get(i), "m/s", "")))
.airTemperature(new BigDecimal(CharSequenceUtil.replace(dailyData.getTemperatureArray().get(i), "℃", ""))) .airTemperature(new BigDecimal(CharSequenceUtil.replace(dailyData.getTemperatureArray().get(i), "℃", "")))
...@@ -883,17 +882,12 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService { ...@@ -883,17 +882,12 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
for (BasePhotovoltaicPlantView plant : plantViewList) { for (BasePhotovoltaicPlantView plant : plantViewList) {
List<PlantPredictedPowerDataEnt> allList = new ArrayList<>(32); List<PlantPredictedPowerDataEnt> allList = new ArrayList<>(32);
List<PlantPredictedPowerDataEnt> objList = new ArrayList<>(16); List<PlantPredictedPowerDataEnt> objList = new ArrayList<>(16);
DateTime dateTime = DateTime.of(dailyData.getDateTime()); DateTime dateTime = DateUtil.date(dailyData.getDateTime());
int hours = 0;
String plantId = plant.getId(); String plantId = plant.getId();
DateTime date; DateTime date;
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
//判断小时数与查到的小时数,如果查到的小时数小,判断为第二天 //判断小时数与查到的小时数,如果查到的小时数小,判断为第二天
int hour = LocalTime.parse(dailyData.getHourTimeArray().get(i)).getHour(); int hour = LocalTime.parse(dailyData.getHourTimeArray().get(i)).getHour();
if (hours >= hour) {
dateTime = DateUtil.offsetDay(dateTime, 1);
}
hours = hour;
int wind = 0; int wind = 0;
if (CollUtil.isNotEmpty(dailyData.getWindDirectionArray())) { if (CollUtil.isNotEmpty(dailyData.getWindDirectionArray())) {
if (i < dailyData.getWindDirectionArray().size()) { if (i < dailyData.getWindDirectionArray().size()) {
...@@ -903,16 +897,20 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService { ...@@ -903,16 +897,20 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
} }
} }
} }
DateTime parse = DateUtil.parse(String.valueOf(dateTime.year()) + '-' + this.int2Str(dateTime.month() + 1) + '-' + this.int2Str(dateTime.dayOfMonth()) + ' ' + this.int2Str(hour) + ':' + BusinessConstant.START_OF_DAY_TIME);
if (DateUtil.compare(parse, dateTime) < 0) {
parse = DateUtil.offsetDay(parse, 1);
}
PlantPredictedPowerDataEnt dao = this.getPlantPredictedPowerEnt(plantId, PlantPredictedPowerDataEnt dao = this.getPlantPredictedPowerEnt(plantId,
this.int2Str(hours), this.int2Str(hour),
new BigDecimal(CharSequenceUtil.replace(dailyData.getTemperatureArray().get(i), "℃", "")), new BigDecimal(CharSequenceUtil.replace(dailyData.getTemperatureArray().get(i), "℃", "")),
new BigDecimal(CharSequenceUtil.replace(dailyData.getWindSpeedArray().get(i), "m/s", "")), new BigDecimal(CharSequenceUtil.replace(dailyData.getWindSpeedArray().get(i), "m/s", "")),
new BigDecimal(wind), new BigDecimal(wind),
new BigDecimal(CharSequenceUtil.replace(dailyData.getPressureArray().get(i), "hPa", "")), new BigDecimal(CharSequenceUtil.replace(dailyData.getPressureArray().get(i), "hPa", "")),
new BigDecimal(CharSequenceUtil.replace(dailyData.getHumidityArray().get(i), "%", "")), new BigDecimal(CharSequenceUtil.replace(dailyData.getHumidityArray().get(i), "%", "")),
String.valueOf(dateTime.year()), String.valueOf(parse.year()),
this.int2Str(dateTime.month() + 1), this.int2Str(parse.monthBaseOne()),
this.int2Str(dateTime.dayOfMonth()) this.int2Str(parse.dayOfMonth())
); );
// 5.执行SQL // 5.执行SQL
allList.add(dao); allList.add(dao);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment