Commit 6a0ded71 authored by ZWT's avatar ZWT

feat(吉林演示): 松原

1.修改风电站运行状态接口,增加模拟实际发电功率处理逻辑,完成接口冒烟测试;
2.修改天气数据处理定时任务,解决晚上十一点半天气预报数据处理异常问题,修改风资源预测数据和光伏资源预测数据时间处理逻辑,完成接口冒烟测试;
3.修改风机预测数据模块相关功能接口,增加判断当前部署环境逻辑,解决查询全量数据问题;
4.修改风机预测数据生成模块第三方风力发电数据生成功能,增加数据拆分逻辑,区分15分数据层级,完成功能冒烟测试;
5.修改风机预测监控页面历史风速统计接口,统计数据不显示问题及小数位过多问题;
6.修改天气预报数据爬取定时任务,解决8:00-11:00期间没有数据问题,完成功能验证;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent c896940d
...@@ -9,6 +9,7 @@ import pps.core.base.entity.*; ...@@ -9,6 +9,7 @@ import pps.core.base.entity.*;
import pps.core.base.excel.ThirdApiWeatherDataListener; import pps.core.base.excel.ThirdApiWeatherDataListener;
import pps.core.base.excel.WindPredictionDataListener; import pps.core.base.excel.WindPredictionDataListener;
import pps.core.base.mapper.*; import pps.core.base.mapper.*;
import pps.core.base.service.data.base_data.GetBaseDataInput;
import pps.core.base.service.data.base_excel.WindPredictionExcelData; import pps.core.base.service.data.base_excel.WindPredictionExcelData;
import pps.core.base.service.data.third_weather_data.ThirdApiWeatherExcelData; import pps.core.base.service.data.third_weather_data.ThirdApiWeatherExcelData;
import pps.core.base.service.data.third_weather_data.WeatherDeleteCondition; import pps.core.base.service.data.third_weather_data.WeatherDeleteCondition;
......
...@@ -590,7 +590,7 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService { ...@@ -590,7 +590,7 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
.collect(Collectors.groupingBy(BaseWindTurbineView::getCityCode)); .collect(Collectors.groupingBy(BaseWindTurbineView::getCityCode));
int count = 0; int count = 0;
for (JSONObject jsonObject : jsonObjectList) { for (JSONObject jsonObject : jsonObjectList) {
this.dataFractionation(jsonObject, turbineMap, deleteList, batchList); this.windDataFractionation(jsonObject, turbineMap, deleteList, batchList);
if (count == 0) { if (count == 0) {
batchList.sort(Comparator.comparing(WindPredictionFutureView::getDataTime)); batchList.sort(Comparator.comparing(WindPredictionFutureView::getDataTime));
create = DateUtil.offsetMinute(batchList.get(0).getDataTime(), -5); create = DateUtil.offsetMinute(batchList.get(0).getDataTime(), -5);
...@@ -667,7 +667,7 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService { ...@@ -667,7 +667,7 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
* @param deleteList 删除列表 * @param deleteList 删除列表
* @param batchList 批次列表 * @param batchList 批次列表
*/ */
private void dataFractionation(JSONObject jsonObject, Map<String, List<BaseWindTurbineView>> turbineMap, List<String> deleteList, private void windDataFractionation(JSONObject jsonObject, Map<String, List<BaseWindTurbineView>> turbineMap, List<String> deleteList,
List<WindPredictionFutureView> batchList) { List<WindPredictionFutureView> batchList) {
Map<String, List<DailyData>> cityDataMap = new HashMap<>(16); Map<String, List<DailyData>> cityDataMap = new HashMap<>(16);
for (Map.Entry<String, Object> entry : jsonObject.entrySet()) { for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
...@@ -690,11 +690,12 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService { ...@@ -690,11 +690,12 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
//遍历预测数据列表 //遍历预测数据列表
for (DailyData dailyData : dailyDataList) { for (DailyData dailyData : dailyDataList) {
for (BaseWindTurbineView plant : plantViewList) { for (BaseWindTurbineView plant : plantViewList) {
DateTime dateTime = DateUtil.date(dailyData.getDateTime());
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 = DateUtil.date(dailyData.getDateTime());
String plantId = plant.getId(); String plantId = plant.getId();
DateTime date; DateTime date;
int flag = 0;
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();
...@@ -707,9 +708,11 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService { ...@@ -707,9 +708,11 @@ 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); DateTime parse = DateUtil.parse(DateUtil.formatDate(dateTime) + ' ' + this.int2Str(hour) + ':' + BusinessConstant.START_OF_DAY_TIME);
if (DateUtil.compare(parse, dateTime) < 0) { if (DateUtil.compare(parse, dateTime) < 0 && flag == 0) {
parse = DateUtil.offsetDay(parse, 1); parse = DateUtil.offsetDay(parse, 1);
dateTime = DateUtil.offsetDay(dateTime, 1);
flag++;
} }
WindPredictionFutureView dao = WindPredictionFutureView.builder() WindPredictionFutureView dao = WindPredictionFutureView.builder()
.stationId(plantId) .stationId(plantId)
...@@ -822,7 +825,7 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService { ...@@ -822,7 +825,7 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
.collect(Collectors.groupingBy(BasePhotovoltaicPlantView::getCityCode)); .collect(Collectors.groupingBy(BasePhotovoltaicPlantView::getCityCode));
int count = 0; int count = 0;
for (JSONObject jsonObject : jsonObjectList) { for (JSONObject jsonObject : jsonObjectList) {
this.dataFractionation(jsonObject, plantMap, deleteList, create, end, batchList); this.dataFractionation(jsonObject, plantMap, deleteList, batchList);
if (count == 0) { if (count == 0) {
batchList.sort(Comparator.comparing(PlantPredictedPowerDataEnt::getDataDate)); batchList.sort(Comparator.comparing(PlantPredictedPowerDataEnt::getDataDate));
create = DateUtil.offsetMinute(DateUtil.parse(batchList.get(0).getDataDate()), -5); create = DateUtil.offsetMinute(DateUtil.parse(batchList.get(0).getDataDate()), -5);
...@@ -853,12 +856,9 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService { ...@@ -853,12 +856,9 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
* @param jsonObject json对象 * @param jsonObject json对象
* @param plantMap 植物地图 * @param plantMap 植物地图
* @param deleteList 删除列表 * @param deleteList 删除列表
* @param create 创造
* @param end 结束
* @param batchList 批次列表 * @param batchList 批次列表
*/ */
private void dataFractionation(JSONObject jsonObject, Map<String, List<BasePhotovoltaicPlantView>> plantMap, List<String> deleteList, private void dataFractionation(JSONObject jsonObject, Map<String, List<BasePhotovoltaicPlantView>> plantMap, List<String> deleteList, List<PlantPredictedPowerDataEnt> batchList) {
DateTime create, DateTime end, List<PlantPredictedPowerDataEnt> batchList) {
Map<String, List<DailyData>> cityDataMap = new HashMap<>(16); Map<String, List<DailyData>> cityDataMap = new HashMap<>(16);
for (Map.Entry<String, Object> entry : jsonObject.entrySet()) { for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
...@@ -880,11 +880,12 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService { ...@@ -880,11 +880,12 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
//遍历预测数据列表 //遍历预测数据列表
for (DailyData dailyData : dailyDataList) { for (DailyData dailyData : dailyDataList) {
for (BasePhotovoltaicPlantView plant : plantViewList) { for (BasePhotovoltaicPlantView plant : plantViewList) {
DateTime dateTime = DateUtil.date(dailyData.getDateTime());
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 = DateUtil.date(dailyData.getDateTime());
String plantId = plant.getId(); String plantId = plant.getId();
DateTime date; DateTime date;
int flag = 0;
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();
...@@ -897,9 +898,11 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService { ...@@ -897,9 +898,11 @@ 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); DateTime parse = DateUtil.parse(DateUtil.formatDate(dateTime) + ' ' + this.int2Str(hour) + ':' + BusinessConstant.START_OF_DAY_TIME);
if (DateUtil.compare(parse, dateTime) < 0) { if (DateUtil.compare(parse, dateTime) < 0 && flag == 0) {
parse = DateUtil.offsetDay(parse, 1); parse = DateUtil.offsetDay(parse, 1);
dateTime = DateUtil.offsetDay(dateTime, 1);
flag++;
} }
PlantPredictedPowerDataEnt dao = this.getPlantPredictedPowerEnt(plantId, PlantPredictedPowerDataEnt dao = this.getPlantPredictedPowerEnt(plantId,
this.int2Str(hour), this.int2Str(hour),
......
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