Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gf_back
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tianchao
gf_back
Commits
e79709ef
Commit
e79709ef
authored
Sep 15, 2023
by
ZWT
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(能源管理系统): 间开优化定时任务
1.开发间开优化长期间开优化定时任务,完成并网流程绿电消纳优先策略; BREAKING CHANGE: 无 Closes 无 [skip ci]
parent
b6eb6ea2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
5 deletions
+91
-5
C11-space/pps-core-space/src/main/java/pps/core/space/service/SpaceOptimizeLongCloudServiceImpl.java
...core/space/service/SpaceOptimizeLongCloudServiceImpl.java
+91
-5
No files found.
C11-space/pps-core-space/src/main/java/pps/core/space/service/SpaceOptimizeLongCloudServiceImpl.java
View file @
e79709ef
...
...
@@ -105,7 +105,7 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
for
(
SpaceInstitutionDetailEnt
detail
:
detailEntList
)
{
String
detailId
=
detail
.
getId
();
String
lineId
=
detail
.
getLineId
();
Integer
startInterval
=
detail
.
getStartInterval
()
;
Integer
startInterval
=
0
;
//创建记录
String
longPeriodId
=
this
.
createOptimizeLongPeriod
(
longPeriodList
,
detailId
,
lineId
,
executionCycleForMonth
,
optimizeDeadline
);
switch
(
detail
.
getGridTypeKey
())
{
...
...
@@ -183,6 +183,9 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
isFirstWellhead
=
true
;
totalOperatingPower
.
add
(
serviceRating
);
}
else
{
//累加
totalOperatingPower
=
totalOperatingPower
.
add
(
serviceRating
);
startInterval
=
startInterval
+
detail
.
getStartInterval
();
isFirstWellhead
=
false
;
}
for
(
int
d
=
0
,
durationSize
=
durationConfigList
.
size
();
d
<
durationSize
;
d
++)
{
...
...
@@ -258,9 +261,6 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
if
(
endTimeOptimize
.
compareTo
(
endTime
)
<
0
)
{
between
=
~
between
+
1
;
}
//累加
totalOperatingPower
=
totalOperatingPower
.
add
(
serviceRating
);
startInterval
=
startInterval
+
startInterval
;
}
else
{
//无法优化
}
...
...
@@ -299,6 +299,7 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
int
lowWellheadListSize
=
lowWellheadList
.
size
();
//光伏出力峰值<任何一口井的运行功率:消峰平谷策略
if
(
size
==
lowWellheadListSize
)
{
//---------------------------------井口优化---------------------------------
//通过线路ID和月份获取市电峰谷策略明细配置
List
<
GetBasePriceStrategyDetailOutput
>
strategyDetailList
=
ServiceUtil
.
getStrategyDetailList
(
context
,
GetBasePriceStrategyDetailInput
.
builder
()
...
...
@@ -310,8 +311,93 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
//没有配置,不优化
continue
;
}
//---------------------------------井口优化---------------------------------
//获取第一段谷电阶段的开始时间为第一口井的开井时间
Optional
<
GetBasePriceStrategyDetailOutput
>
low
=
strategyDetailList
.
stream
()
.
filter
(
s
->
!
StringUtils
.
isAnyBlank
(
s
.
getEndTime
(),
s
.
getStartTime
())
&&
StringUtils
.
equals
(
"LOW"
,
s
.
getPeriodTypeKey
()))
.
findFirst
();
if
(!
low
.
isPresent
())
{
//没有谷电,不优化
continue
;
}
GetBasePriceStrategyDetailOutput
strategyDetailOutput
=
low
.
get
();
//第一口井启动时间
DateTime
firstStartTime
=
DateUtil
.
parse
(
strategyDetailOutput
.
getStartTime
()
+
BusinessConstant
.
INITIALIZATION_SECOND
,
BusinessConstant
.
TIME_FORMAT
);
DateTime
firstEndTime
=
DateUtil
.
parse
(
strategyDetailOutput
.
getEndTime
()
+
BusinessConstant
.
INITIALIZATION_SECOND
,
BusinessConstant
.
TIME_FORMAT
);
//判断是否第一口井
boolean
isFirstWellhead
;
//优化时间间隔
int
between
=
0
;
for
(
int
w
=
0
,
wellheadSize
=
wellheadViewList
.
size
();
w
<
wellheadSize
;
w
++)
{
SpaceInstitutionWellheadView
wellhead
=
wellheadViewList
.
get
(
w
);
String
wellheadId
=
wellhead
.
getWellheadId
();
String
recordId
=
this
.
createOptimizeLongWellhead
(
longWellheadList
,
longPeriodId
,
wellheadId
,
wellhead
.
getWellNumber
());
List
<
SpaceInstitutionDurationEnt
>
durationConfigList
=
durationMap
.
get
(
wellhead
);
if
(
CollUtil
.
isEmpty
(
durationConfigList
))
{
//没有设置时间段,无法优化
continue
;
}
if
(
w
==
0
)
{
//第一个井口
isFirstWellhead
=
true
;
}
else
{
//计算启动间隔
startInterval
=
startInterval
+
detail
.
getStartInterval
();
isFirstWellhead
=
false
;
}
for
(
int
d
=
0
,
durationSize
=
durationConfigList
.
size
();
d
<
durationSize
;
d
++)
{
SpaceInstitutionDurationEnt
duration
=
durationConfigList
.
get
(
d
);
String
openWellTime
=
duration
.
getOpenWellTime
();
DateTime
startTime
=
DateUtil
.
parse
(
openWellTime
+
BusinessConstant
.
INITIALIZATION_SECOND
,
BusinessConstant
.
TIME_FORMAT
);
DateTime
endTime
=
DateUtil
.
parse
(
duration
.
getCloseWellTime
()
+
BusinessConstant
.
INITIALIZATION_SECOND
,
BusinessConstant
.
TIME_FORMAT
);
//第一次启动
if
(
d
==
0
)
{
//第一口井的启动时间
if
(
isFirstWellhead
)
{
//计算优化后的时间差优化后的第一口井开井时间-优化前第一次开井时间
//取时间间隔(分钟)
between
=
(
int
)
firstEndTime
.
between
(
endTime
,
DateUnit
.
MINUTE
);
if
(
firstEndTime
.
compareTo
(
endTime
)
<
0
)
{
between
=
~
between
+
1
;
}
this
.
createOptimizeLongDuration
(
longDurationList
,
duration
,
longPeriodId
,
recordId
,
wellheadId
,
null
,
strategyDetailOutput
.
getStartTime
(),
strategyDetailOutput
.
getEndTime
()
);
}
//其它井口的第一次启动时间
else
{
//其它井启动时间:第一口井启动时间+启动间隔
DateTime
startTimeOffset
=
firstStartTime
.
offset
(
DateField
.
MINUTE
,
startInterval
);
DateTime
endTimeOffset
=
firstEndTime
.
offset
(
DateField
.
MINUTE
,
startInterval
);
//取时间间隔(分钟)
between
=
(
int
)
firstEndTime
.
between
(
endTime
,
DateUnit
.
MINUTE
);
if
(
firstEndTime
.
compareTo
(
endTime
)
<
0
)
{
between
=
~
between
+
1
;
}
this
.
createOptimizeLongDuration
(
longDurationList
,
duration
,
longPeriodId
,
recordId
,
wellheadId
,
null
,
startTimeOffset
.
toString
(
BusinessConstant
.
MINUTES_FORMAT
),
endTimeOffset
.
toString
(
BusinessConstant
.
MINUTES_FORMAT
)
);
}
}
else
{
DateTime
offset
=
startTime
.
offset
(
DateField
.
MINUTE
,
between
);
if
(
offset
.
compareTo
(
dateFlag
)
>
0
)
{
//如果时间超过当天,舍弃
continue
;
}
DateTime
endDate
=
DateUtil
.
parse
(
duration
.
getCloseWellTime
()
+
BusinessConstant
.
INITIALIZATION_SECOND
,
BusinessConstant
.
TIME_FORMAT
)
.
offset
(
DateField
.
MINUTE
,
between
);
String
closeWellTime
;
if
(
endDate
.
compareTo
(
dateFlag
)
>
0
)
{
closeWellTime
=
BusinessConstant
.
END_OF_DAY_TIME
;
}
else
{
closeWellTime
=
endDate
.
toString
(
BusinessConstant
.
MINUTES_FORMAT
);
}
//计算偏移
this
.
createOptimizeLongDuration
(
longDurationList
,
duration
,
longPeriodId
,
recordId
,
wellheadId
,
null
,
offset
.
toString
(
BusinessConstant
.
MINUTES_FORMAT
),
closeWellTime
);
}
}
}
}
//光伏出力峰值>=线路哪部分井口运行功率:满足的部分井口采用绿电消纳优先,不满足的井采用消峰平谷
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment