Commit 7c4b0732 authored by ZWT's avatar ZWT

feat(吉林演示): 松原

1.修改天气数据抽取定时任务,解决部分历史数据丢失问题;
2.修改第三方风机电站真实数据定时任务,修改代码逻辑,解决时间未按照15分钟间隔推送问题;
3.修改第三方风机电站模拟数据定时任务,解决时间日期格式错误导致数据重复问题;
4.新建第三方风力发电数据(每日最新数据)表,同时生成对应代码,修改第三方风机电站模拟数据定时任务,增加每日最新数据更新逻辑;
5.修改风资源监控页面场站发电量统计接口,增加模拟数据查询逻辑,修改代码完成冒烟测试;
6.修改风资源监控页面历史风速接口,增加模拟数据查询逻辑,修改代码完成冒烟测试;
7.修改风资源监控页面历史风向接口,增加模拟数据查询逻辑,修改代码完成冒烟测试;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 772f52b7
...@@ -234,6 +234,7 @@ public class WindPredictionFutureService { ...@@ -234,6 +234,7 @@ public class WindPredictionFutureService {
/** /**
* 历史风速 * 历史风速
* todo 模拟数据
* *
* @param context 上下文 * @param context 上下文
* @param input 输入 * @param input 输入
...@@ -320,7 +321,7 @@ public class WindPredictionFutureService { ...@@ -320,7 +321,7 @@ public class WindPredictionFutureService {
/** /**
* 历史风向 * 历史风向
* todo 先用预报风向,后面接数据后改成实际的 * todo 模拟数据
* *
* @param context 上下文 * @param context 上下文
* @param input 输入 * @param input 输入
...@@ -347,47 +348,47 @@ public class WindPredictionFutureService { ...@@ -347,47 +348,47 @@ public class WindPredictionFutureService {
endTime = DateUtil.endOfYear(now); endTime = DateUtil.endOfYear(now);
} }
//分组查询风向 //分组查询风向
WindPredictionFutureMapper futureMapper = context.getBean(WindPredictionFutureMapper.class); ThirdWindPowerGenerationUpdateMapper futureMapper = context.getBean(ThirdWindPowerGenerationUpdateMapper.class);
List<WindPredictionFutureEnt> list = futureMapper.selectList(new QueryWrapper<WindPredictionFutureEnt>() List<ThirdWindPowerGenerationUpdateEnt> list = futureMapper.selectList(new QueryWrapper<ThirdWindPowerGenerationUpdateEnt>()
.select("wind_direction", "COUNT( 1 ) AS wind_speed") .select("actual_wind_direction", "COUNT( 1 ) AS actual_wind_speed")
.lambda() .lambda()
.between(WindPredictionFutureEnt::getDataTime, beginTime, endTime) .between(ThirdWindPowerGenerationUpdateEnt::getCollectTime, beginTime, endTime)
.in(WindPredictionFutureEnt::getStationId, turbineList.stream() .in(ThirdWindPowerGenerationUpdateEnt::getStationName, turbineList.stream()
.map(BaseModel::getId) .map(BaseWindTurbineEnt::getStationName)
.collect(Collectors.toList())) .collect(Collectors.toList()))
.groupBy(WindPredictionFutureEnt::getWindDirection) .groupBy(ThirdWindPowerGenerationUpdateEnt::getActualWindDirection)
); );
if (CollUtil.isEmpty(list)) { if (CollUtil.isEmpty(list)) {
return XSingleResult.success(output); return XSingleResult.success(output);
} }
//取总数 //取总数
BigDecimal total = BigDecimal.ZERO; BigDecimal total = BigDecimal.ZERO;
for (WindPredictionFutureEnt future : list) { for (ThirdWindPowerGenerationUpdateEnt future : list) {
total = total.add(future.getWindSpeed()); total = total.add(future.getActualWindSpeed());
switch (future.getWindDirection()) { switch (future.getActualWindDirection()) {
case 0: case 0:
output.setNorth(future.getWindSpeed()); output.setNorth(future.getActualWindSpeed());
break; break;
case 45: case 45:
output.setNortheast(future.getWindSpeed()); output.setNortheast(future.getActualWindSpeed());
break; break;
case 90: case 90:
output.setEast(future.getWindSpeed()); output.setEast(future.getActualWindSpeed());
break; break;
case 135: case 135:
output.setSoutheast(future.getWindSpeed()); output.setSoutheast(future.getActualWindSpeed());
break; break;
case 180: case 180:
output.setSouth(future.getWindSpeed()); output.setSouth(future.getActualWindSpeed());
break; break;
case 225: case 225:
output.setSouthwest(future.getWindSpeed()); output.setSouthwest(future.getActualWindSpeed());
break; break;
case 270: case 270:
output.setWest(future.getWindSpeed()); output.setWest(future.getActualWindSpeed());
break; break;
case 315: case 315:
output.setNorthwest(future.getWindSpeed()); output.setNorthwest(future.getActualWindSpeed());
break; break;
} }
} }
......
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