Commit b9cf1527 authored by ZWT's avatar ZWT

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

1.开发间开优化长期间开优化定时任务,完成并网流程绿电消纳优先策略;
2.开发间开优化长期间开优化定时任务,完成并网流程消峰平谷策略;
3.开发间开优化中短期间开优化定时任务,创建定时任务并添加配置;
4.抽取间开优化定时任务逻辑处理父类,对长期间开优化定时任务/中短期间开优化定时任务代码结构进行优化;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 6ad5dbda
...@@ -104,9 +104,24 @@ public class BaseUtils { ...@@ -104,9 +104,24 @@ public class BaseUtils {
*/ */
public static String getExecutionCycleForMonth(Date date) { public static String getExecutionCycleForMonth(Date date) {
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(DateUtil.format(DateUtil.beginOfMonth(date), "yyyy-MM-dd")) stringBuilder.append(DateUtil.format(DateUtil.beginOfMonth(date), BusinessConstant.DATE_FORMAT_DAY))
.append('-') .append('-')
.append(DateUtil.format(DateUtil.endOfMonth(date), "yyyy-MM-dd")); .append(DateUtil.format(DateUtil.endOfMonth(date), BusinessConstant.DATE_FORMAT_DAY));
return stringBuilder.toString();
}
/**
* 获取周执行周期
*
* @param date 日期
* @return {@link String}
*/
public static String getExecutionCycleForWeek(DateTime date) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(date.year())
.append("年第")
.append(date.weekOfYear())
.append('周');
return stringBuilder.toString(); return stringBuilder.toString();
} }
......
...@@ -53,8 +53,6 @@ public class SpaceOptimizeMidCloudServiceImpl extends SpaceOptimizeBaseService i ...@@ -53,8 +53,6 @@ public class SpaceOptimizeMidCloudServiceImpl extends SpaceOptimizeBaseService i
SpaceOptimizeWellheadAndPlant wellheadAndPlant = super.getWellheadAndPlant(context, detailEntList); SpaceOptimizeWellheadAndPlant wellheadAndPlant = super.getWellheadAndPlant(context, detailEntList);
List<SpaceInstitutionWellheadView> spaceWellheadList = wellheadAndPlant.getSpaceWellheadList(); List<SpaceInstitutionWellheadView> spaceWellheadList = wellheadAndPlant.getSpaceWellheadList();
Map<String, List<String>> plantIdsByLineIdMap = wellheadAndPlant.getPlantIdsByLineIdMap(); Map<String, List<String>> plantIdsByLineIdMap = wellheadAndPlant.getPlantIdsByLineIdMap();
//下一周
String nextWeek = DateUtil.nextWeek().toString(BusinessConstant.DATE_FORMAT_DAY);
//月份要加一 //月份要加一
int monthNum = date.month() + 1; int monthNum = date.month() + 1;
SpaceInstitutionDurationMapper durationMapper = context.getBean(SpaceInstitutionDurationMapper.class); SpaceInstitutionDurationMapper durationMapper = context.getBean(SpaceInstitutionDurationMapper.class);
...@@ -62,14 +60,16 @@ public class SpaceOptimizeMidCloudServiceImpl extends SpaceOptimizeBaseService i ...@@ -62,14 +60,16 @@ public class SpaceOptimizeMidCloudServiceImpl extends SpaceOptimizeBaseService i
List<SpaceOptimizeMidWellheadView> midWellheadList = new ArrayList<>(64); List<SpaceOptimizeMidWellheadView> midWellheadList = new ArrayList<>(64);
List<SpaceOptimizeMidDurationView> midDurationList = new ArrayList<>(128); List<SpaceOptimizeMidDurationView> midDurationList = new ArrayList<>(128);
List<SpaceOptimizeMidDurationView> unOptimizeDurationList = new ArrayList<>(128); List<SpaceOptimizeMidDurationView> unOptimizeDurationList = new ArrayList<>(128);
String executionCycleForMonth = BaseUtils.getExecutionCycleForMonth(date); String executionCycleForWeek = BaseUtils.getExecutionCycleForWeek(date);
DateTime optimizeDeadline = DateUtil.endOfMonth(date); DateTime optimizeDeadline = DateUtil.nextWeek();
//下一周
String nextWeek = optimizeDeadline.toString(BusinessConstant.DATE_FORMAT_DAY);
//优化 //优化
for (SpaceInstitutionDetailEnt detail : detailEntList) { for (SpaceInstitutionDetailEnt detail : detailEntList) {
String detailId = detail.getId(); String detailId = detail.getId();
String lineId = detail.getLineId(); String lineId = detail.getLineId();
//创建记录 //创建记录
String midPeriodId = this.createOptimizeMidPeriod(midPeriodList, detailId, lineId, executionCycleForMonth, optimizeDeadline); String midPeriodId = this.createOptimizeMidPeriod(midPeriodList, detailId, lineId, executionCycleForWeek, optimizeDeadline);
switch (detail.getGridTypeKey()) { switch (detail.getGridTypeKey()) {
//并网型优化 //并网型优化
case "1": case "1":
......
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