Commit e0f8c52b authored by ZWT's avatar ZWT

feat(零碳): 长庆

1.修复登录页面登录接口验证码输入后不需要验证直接能登录的问题;
2.长庆演示,首页展示大屏功能修改,修改线路详情接口,增加查询日平均用电量逻辑,同时重构查询日产液量和日发电量逻辑,更新接口文档并完成接口冒烟测试,同时生成用例;
3.长庆极短期间开优化随动算法功能开发,设置自定义参数,初步完成极短时间,间开时间段优化测试功能;
4.间开制度管理模块,间开制度关联井口信息表表结构修改,增加"单次最高开井时长(h)","单次最低开井时长(h)","单次最高关井时长(h)","单次最低关井时长(h)"字段,同时修改数据表对应代码实体及表单参数,修改部分相关模块功能查询修改逻辑;
5.接收天气服务定时任务优化,优化代码结构,修改保存删除逻辑,减少数据库链接次数,优化各类变量大小,修改日期拆分逻辑,解决插入重复数据bug,修改查询电站信息逻辑,增加过滤条件排除第二采油厂数据;
6.修改发送邮件服务,增加获取心知天气未来15天天气预测数据接口,同时创建定时任务,添加获取天气数据后发送到邮箱逻辑;
7.创建定时任务,用于接收心知天气预测数据;
8.设计并创建心知天气数据接收表,生成相关代码并上传到远程git仓库,修改心知天气数据接收定时任务逻辑,增加天气数据新增及删除逻辑;
9.修改心知天气预测数据接收定时任务,增加向旧功率预测表插入删除电站15天天气数据逻辑;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 12615648
......@@ -273,19 +273,8 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
NioUtil.close(folder);
NioUtil.close(store);
}
int size;
this.deletePlantPredictedPowerList(context, deleteList);
if (CollUtil.isNotEmpty(batchList)) {
PlantPredictedPowerDataViewMapper dataViewMapper = context.getBean(PlantPredictedPowerDataViewMapper.class);
size = batchList.size();
logger.info("------ weatherDataProcess batchList insert size: {}", size);
if (size > BaseUtils.BATCH_SIZE) {
List<List<PlantPredictedPowerDataEnt>> subList = BaseUtils.getSubList(batchList);
subList.forEach(dataViewMapper::insertBatch);
} else {
dataViewMapper.insertBatch(batchList);
}
}
this.insertBatchPlantPredictedPowerList(context, batchList);
return XServiceResult.OK;
}
......@@ -382,6 +371,10 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
thirdWeatherDataView.setUpdateTime(timeUpdated);
thirdWeatherDataView.setCreateTime(date);
weatherDataViewList.add(thirdWeatherDataView);
//todo 老表逻辑(后期删除):封装预测数据
for (BasePhotovoltaicPlantView plantView : plantList) {
this.addPlantPredictedPower(oldBatchList, plantView.getId(), thirdWeatherDataView);
}
}
}
}
......@@ -403,8 +396,9 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
NioUtil.close(folder);
NioUtil.close(store);
}
//todo 老表逻辑(后期删除):删除预测数据
//todo 老表逻辑(后期删除):删除/新增预测数据
this.deletePlantPredictedPowerList(context, oldDeleteList);
this.insertBatchPlantPredictedPowerList(context, oldBatchList);
int size;
if (CollUtil.isNotEmpty(deleteList)) {
ThirdWeatherDataMapper dataMapper = context.getBean(ThirdWeatherDataMapper.class);
......@@ -449,6 +443,35 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
/*------------------------- private -------------------------*/
/**
* 添加电厂预测功率
*
* @param batchList 批处理列表
* @param plantId 植物id
* @param thirdWeatherDataView 第三天气数据视图
*/
private void addPlantPredictedPower(List<PlantPredictedPowerDataEnt> batchList, String plantId, ThirdWeatherDataView thirdWeatherDataView) {
DateTime date = DateUtil.date(thirdWeatherDataView.getForecastTime());
batchList.add(PlantPredictedPowerDataEnt.builder()
.plantId(plantId)
.createTime(thirdWeatherDataView.getCreateTime())
.yearTime(String.valueOf(date.year()))
.monthTime(this.zeroFill(date.monthBaseOne()))
.dayTime(this.zeroFill(date.dayOfMonth()))
.hourTime(this.zeroFill(date.hour(true)))
.minTime(this.zeroFill(date.minute()))
.dataDate(date.toString("yyyy-MM-dd HH:mm"))
.temperature(thirdWeatherDataView.getTem())
.windSpeed(thirdWeatherDataView.getWns100m())
.windDirection(new BigDecimal(thirdWeatherDataView.getWnd()))
.pressure(thirdWeatherDataView.getPrsQfe())
.humidity(thirdWeatherDataView.getRhu())
.planeIrradiance(thirdWeatherDataView.getDni())
.horizontalIrradiance(thirdWeatherDataView.getGhi())
.power(BigDecimal.ZERO)
.build());
}
/**
* 获取电厂预测功率ent
*
......@@ -597,4 +620,37 @@ public class BaseWeatherCloudServiceImpl implements IBaseWeatherCloudService {
}
}
}
/**
* 插入间歇装置预测功率列表
*
* @param context 上下文
* @param batchList 批处理列表
*/
private void insertBatchPlantPredictedPowerList(XContext context, List<PlantPredictedPowerDataEnt> batchList) {
if (CollUtil.isNotEmpty(batchList)) {
PlantPredictedPowerDataViewMapper dataViewMapper = context.getBean(PlantPredictedPowerDataViewMapper.class);
int size = batchList.size();
context.getLogger().info("------ insertBatchPlantPredictedPowerList batchList insert size: {}", size);
if (size > BaseUtils.BATCH_SIZE) {
List<List<PlantPredictedPowerDataEnt>> subList = BaseUtils.getSubList(batchList);
subList.forEach(dataViewMapper::insertBatch);
} else {
dataViewMapper.insertBatch(batchList);
}
}
}
/**
* 零填充
*
* @param number 数字
* @return {@link String}
*/
private String zeroFill(int number) {
if (number < 10) {
return "0" + number;
}
return String.valueOf(number);
}
}
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