Commit dc9c5ecf authored by ZWT's avatar ZWT

feat(能源管理系统): 间开优化定时任务

1.开发间开优化长期间开优化定时任务,了解长期并网型流程算法;
2.定时任务模块新增CRON常量类,定义常用表达式;
3.基础信息管理--井口配置Cloud模块,添加通过井口ID集合获取井口列表接口,完成接口冒烟测试;
4.基础信息管理--输电线路配置Cloud模块,添加通过线路ID集合获取线路配置光伏电站列表接口,完成接口冒烟测试;
5.光伏预测--光伏预测Cloud模块,添加条件查询获取光伏预测时间段平均值列表接口,完成接口冒烟测试;
6.修改prediction模块pom引用,添加接口;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent c4649e95
......@@ -54,50 +54,50 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
*/
@Override
public XServiceResult optimizeLongJob(XContext context) {
//取生效中的基础间开
SpaceInstitutionDetailMapper detailMapper = context.getBean(SpaceInstitutionDetailMapper.class);
List<SpaceInstitutionDetailEnt> detailEntList = detailMapper.selectList(new LambdaQueryWrapper<SpaceInstitutionDetailEnt>()
.eq(BaseModel::getIsDeleted, BusinessConstant.ONE)
.eq(SpaceInstitutionDetailEnt::getIsCurrentBasic, BusinessConstant.ZERO)
.apply(" institution_end_date >= CURDATE() ")
);
if (CollUtil.isEmpty(detailEntList)) {
//未发现可优化基础间开制度
return XServiceResult.error(context, BusinessError.DidNotFindSpace);
}
Set<String> lineIds = new HashSet<>(32);
Set<String> institutionIds = new HashSet<>(32);
for (SpaceInstitutionDetailEnt spaceInstitutionDetailEnt : detailEntList) {
lineIds.add(spaceInstitutionDetailEnt.getLineId());
institutionIds.add(spaceInstitutionDetailEnt.getId());
}
//取生效中间开的所有井口
SpaceInstitutionWellheadViewMapper wellheadMapper = context.getBean(SpaceInstitutionWellheadViewMapper.class);
List<SpaceInstitutionWellheadView> spaceWellheadList = wellheadMapper.selectListByInstitutionIds(institutionIds);
if (CollUtil.isEmpty(spaceWellheadList)) {
//未发现可优化井口
return XServiceResult.error(context, BusinessError.DidNotFindWellhead);
}
this.setServiceRatingForSpaceWellheadList(context, spaceWellheadList);
//取线路关联的所有光伏电站ID
List<DynamicQueryBasePowerLinePlantOutput> plantList = this.getPowerLinePlantListByLineIds(context, lineIds);
if (CollUtil.isEmpty(plantList)) {
//未发现可用光伏电站
return XServiceResult.error(context, BusinessError.DidNotFindPlant);
}
//取当前时间
DateTime date = DateUtil.date();
int year = date.year();
int monthNum = date.month();
String month;
if (monthNum < BusinessConstant.TEN) {
month = "0" + monthNum;
} else {
month = String.valueOf(monthNum);
}
SpaceInstitutionDurationMapper durationMapper = context.getBean(SpaceInstitutionDurationMapper.class);
DateTime dateFlag = DateUtil.parse("1970-01-02 00:00:00", "yyyy-mm-dd HH:mm:ss");
return XTransactionHelper.begin(context, () -> {
//取生效中的基础间开
SpaceInstitutionDetailMapper detailMapper = context.getBean(SpaceInstitutionDetailMapper.class);
List<SpaceInstitutionDetailEnt> detailEntList = detailMapper.selectList(new LambdaQueryWrapper<SpaceInstitutionDetailEnt>()
.eq(BaseModel::getIsDeleted, BusinessConstant.ONE)
.eq(SpaceInstitutionDetailEnt::getIsCurrentBasic, BusinessConstant.ZERO)
.apply(" institution_end_date >= CURDATE() ")
);
if (CollUtil.isEmpty(detailEntList)) {
//未发现可优化基础间开制度
return XServiceResult.error(context, BusinessError.DidNotFindSpace);
}
Set<String> lineIds = new HashSet<>(32);
Set<String> institutionIds = new HashSet<>(32);
for (SpaceInstitutionDetailEnt spaceInstitutionDetailEnt : detailEntList) {
lineIds.add(spaceInstitutionDetailEnt.getLineId());
institutionIds.add(spaceInstitutionDetailEnt.getId());
}
//取生效中间开的所有井口
SpaceInstitutionWellheadViewMapper wellheadMapper = context.getBean(SpaceInstitutionWellheadViewMapper.class);
List<SpaceInstitutionWellheadView> spaceWellheadList = wellheadMapper.selectListByInstitutionIds(institutionIds);
if (CollUtil.isEmpty(spaceWellheadList)) {
//未发现可优化井口
return XServiceResult.error(context, BusinessError.DidNotFindWellhead);
}
this.setServiceRatingForSpaceWellheadList(context, spaceWellheadList);
//取线路关联的所有光伏电站ID
List<DynamicQueryBasePowerLinePlantOutput> plantList = this.getPowerLinePlantListByLineIds(context, lineIds);
if (CollUtil.isEmpty(plantList)) {
//未发现可用光伏电站
return XServiceResult.error(context, BusinessError.DidNotFindPlant);
}
//取当前时间
DateTime date = DateUtil.date();
int year = date.year();
int monthNum = date.month();
String month;
if (monthNum < BusinessConstant.TEN) {
month = "0" + monthNum;
} else {
month = String.valueOf(monthNum);
}
SpaceInstitutionDurationMapper durationMapper = context.getBean(SpaceInstitutionDurationMapper.class);
DateTime dateFlag = DateUtil.parse("1970-01-02 00:00:00", "yyyy-mm-dd HH:mm:ss");
//优化
for (SpaceInstitutionDetailEnt detail : detailEntList) {
String detailId = detail.getId();
......
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