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
6e9f161f
Commit
6e9f161f
authored
Sep 15, 2023
by
ZWT
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(能源管理系统): 间开优化定时任务
1.开发间开优化长期间开优化定时任务,完成并网流程绿电消纳优先策略; BREAKING CHANGE: 无 Closes 无 [skip ci]
parent
83b06c1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
34 deletions
+85
-34
C11-space/pps-core-space/src/main/java/pps/core/space/service/SpaceOptimizeLongCloudServiceImpl.java
...core/space/service/SpaceOptimizeLongCloudServiceImpl.java
+85
-34
No files found.
C11-space/pps-core-space/src/main/java/pps/core/space/service/SpaceOptimizeLongCloudServiceImpl.java
View file @
6e9f161f
...
@@ -106,6 +106,7 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
...
@@ -106,6 +106,7 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
for
(
SpaceInstitutionDetailEnt
detail
:
detailEntList
)
{
for
(
SpaceInstitutionDetailEnt
detail
:
detailEntList
)
{
String
detailId
=
detail
.
getId
();
String
detailId
=
detail
.
getId
();
String
lineId
=
detail
.
getLineId
();
String
lineId
=
detail
.
getLineId
();
Integer
startInterval
=
detail
.
getStartInterval
();
//创建记录
//创建记录
String
longPeriodId
=
this
.
createOptimizeLongPeriod
(
longPeriodList
,
detailId
,
lineId
,
executionCycleForMonth
,
optimizeDeadline
);
String
longPeriodId
=
this
.
createOptimizeLongPeriod
(
longPeriodList
,
detailId
,
lineId
,
executionCycleForMonth
,
optimizeDeadline
);
switch
(
detail
.
getGridTypeKey
())
{
switch
(
detail
.
getGridTypeKey
())
{
...
@@ -157,15 +158,20 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
...
@@ -157,15 +158,20 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
//没有设置时间段,无法优化
//没有设置时间段,无法优化
continue
;
continue
;
}
}
//---------------------------------井口优化---------------------------------
Map
<
String
,
List
<
SpaceInstitutionDurationEnt
>>
durationMap
=
durationList
.
stream
()
Map
<
String
,
List
<
SpaceInstitutionDurationEnt
>>
durationMap
=
durationList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
SpaceInstitutionDurationEnt:
:
getWellheadId
));
.
collect
(
Collectors
.
groupingBy
(
SpaceInstitutionDurationEnt:
:
getWellheadId
));
int
between
=
0
;
int
between
=
0
;
//---------------------------------井口优化---------------------------------
//判断是否第一口井
boolean
isFirstWellhead
;
//第一口井启动时间
DateTime
firstStartTime
=
null
;
//井口累积运行总功率
BigDecimal
totalOperatingPower
=
BigDecimal
.
ZERO
;
for
(
int
w
=
0
,
wellheadSize
=
wellheadViewList
.
size
();
w
<
wellheadSize
;
w
++)
{
for
(
int
w
=
0
,
wellheadSize
=
wellheadViewList
.
size
();
w
<
wellheadSize
;
w
++)
{
SpaceInstitutionWellheadView
wellhead
=
wellheadViewList
.
get
(
w
);
SpaceInstitutionWellheadView
wellhead
=
wellheadViewList
.
get
(
w
);
String
wellheadId
=
wellhead
.
getWellheadId
();
String
wellheadId
=
wellhead
.
getWellheadId
();
this
.
createOptimizeLongWellhead
(
longWellheadList
,
longPeriodId
,
wellheadId
,
wellhead
.
getWellNumber
());
this
.
createOptimizeLongWellhead
(
longWellheadList
,
longPeriodId
,
wellheadId
,
wellhead
.
getWellNumber
());
//取当前井口最大发电量
//取当前井口最大发电量
BigDecimal
serviceRating
=
wellhead
.
getServiceRating
();
BigDecimal
serviceRating
=
wellhead
.
getServiceRating
();
List
<
SpaceInstitutionDurationEnt
>
durationConfigList
=
durationMap
.
get
(
wellhead
);
List
<
SpaceInstitutionDurationEnt
>
durationConfigList
=
durationMap
.
get
(
wellhead
);
...
@@ -173,45 +179,92 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
...
@@ -173,45 +179,92 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
//没有设置时间段,无法优化
//没有设置时间段,无法优化
continue
;
continue
;
}
}
if
(
w
==
0
)
{
//第一个井口
isFirstWellhead
=
true
;
totalOperatingPower
.
add
(
serviceRating
);
}
else
{
isFirstWellhead
=
false
;
}
for
(
int
d
=
0
,
durationSize
=
durationConfigList
.
size
();
d
<
durationSize
;
d
++)
{
for
(
int
d
=
0
,
durationSize
=
durationConfigList
.
size
();
d
<
durationSize
;
d
++)
{
SpaceInstitutionDurationEnt
duration
=
durationConfigList
.
get
(
d
);
SpaceInstitutionDurationEnt
duration
=
durationConfigList
.
get
(
d
);
if
(
d
==
0
)
{
//第一个井口
}
String
openWellTime
=
duration
.
getOpenWellTime
();
String
openWellTime
=
duration
.
getOpenWellTime
();
DateTime
startTime
=
DateUtil
.
parse
(
openWellTime
+
BusinessConstant
.
INITIALIZATION_SECOND
,
BusinessConstant
.
TIME_FORMAT
);
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
(
d
==
0
)
{
//累计发电量
//第一口井的启动时间
BigDecimal
totalPower
=
BigDecimal
.
ZERO
;
if
(
isFirstWellhead
)
{
//计算开井时间
firstStartTime
=
startTime
;
int
endIndex
=
0
;
//计算关井时间
DynamicQueryPlantPredictedPowerOutput
predictedPower
;
int
endIndex
=
0
;
for
(
int
a
=
0
,
avgPowerSize
=
avgPowerList
.
size
();
a
<
avgPowerSize
;
a
++)
{
for
(
int
a
=
0
,
avgPowerSize
=
avgPowerList
.
size
();
a
<
avgPowerSize
;
a
++)
{
predictedPower
=
avgPowerList
.
get
(
a
);
DynamicQueryPlantPredictedPowerOutput
predictedPower
=
avgPowerList
.
get
(
a
);
if
(
DateUtil
.
parse
(
predictedPower
.
getHourTime
()
+
predictedPower
.
getMinTime
(),
BusinessConstant
.
TIME_FORMAT
).
compareTo
(
startTime
)
<
0
)
{
if
(
DateUtil
.
parse
(
predictedPower
.
getHourTime
()
+
predictedPower
.
getMinTime
(),
BusinessConstant
.
TIME_FORMAT
).
compareTo
(
startTime
)
<
0
)
{
continue
;
continue
;
}
//当日时间段平均光伏出力>第一口井运行负荷时,该时间为第一口井运行时间
if
(
predictedPower
.
getPower
().
compareTo
(
serviceRating
)
>=
BusinessConstant
.
ZERO
)
{
endIndex
=
a
;
break
;
}
}
}
totalPower
.
add
(
predictedPower
.
getPower
());
DynamicQueryPlantPredictedPowerOutput
end
=
avgPowerList
.
get
(
endIndex
);
//当日时间段平均光伏出力总和>第一口井运行负荷时,该时间为第一口井启动时间
String
endTimeString
=
end
.
getHourTime
()
+
end
.
getMinTime
();
if
(
totalPower
.
compareTo
(
serviceRating
)
>=
BusinessConstant
.
ZERO
)
{
this
.
createOptimizeLongDuration
(
longDurationList
,
duration
,
longPeriodId
,
wellheadId
,
null
,
endIndex
=
a
;
openWellTime
,
StringUtils
.
substringBeforeLast
(
endTimeString
,
BusinessConstant
.
INITIALIZATION_SECOND
)
break
;
);
//计算
DateTime
endTimeOptimize
=
DateUtil
.
parse
(
endTimeString
,
BusinessConstant
.
TIME_FORMAT
);
//取时间间隔(分钟)
between
=
(
int
)
endTimeOptimize
.
between
(
endTime
,
DateUnit
.
MINUTE
);
if
(
endTimeOptimize
.
compareTo
(
endTime
)
<
0
)
{
between
=
~
between
+
1
;
}
}
}
}
DynamicQueryPlantPredictedPowerOutput
end
=
avgPowerList
.
get
(
endIndex
);
//其它井口的第一次启动时间
String
endTimeString
=
end
.
getHourTime
()
+
end
.
getMinTime
();
else
{
this
.
createOptimizeLongDuration
(
longDurationList
,
duration
,
longPeriodId
,
wellheadId
,
null
,
DateTime
startTimeOffset
=
firstStartTime
.
offset
(
DateField
.
MINUTE
,
startInterval
);
openWellTime
,
StringUtils
.
substringBeforeLast
(
endTimeString
,
":00"
)
int
startIndex
=
-
1
;
);
BigDecimal
add
=
serviceRating
.
add
(
totalOperatingPower
);
//计算
for
(
int
a
=
0
,
avgPowerSize
=
avgPowerList
.
size
();
a
<
avgPowerSize
;
a
++)
{
DateTime
endTimeOptimize
=
DateUtil
.
parse
(
endTimeString
,
BusinessConstant
.
TIME_FORMAT
);
DynamicQueryPlantPredictedPowerOutput
predictedPower
=
avgPowerList
.
get
(
a
);
DateTime
endTime
=
DateUtil
.
parse
(
duration
.
getCloseWellTime
()
+
BusinessConstant
.
INITIALIZATION_SECOND
,
BusinessConstant
.
TIME_FORMAT
);
if
(
DateUtil
.
parse
(
predictedPower
.
getHourTime
()
+
predictedPower
.
getMinTime
(),
BusinessConstant
.
TIME_FORMAT
)
//取时间间隔(分钟)
.
compareTo
(
startTimeOffset
)
>=
0
)
{
between
=
(
int
)
endTimeOptimize
.
between
(
endTime
,
DateUnit
.
MINUTE
);
//判断第一口井启动时间+启动间隔时日平均光伏出力-前两口井的运行功率是否为正数
if
(
endTimeOptimize
.
compareTo
(
endTime
)
<
0
)
{
if
(
predictedPower
.
getPower
().
compareTo
(
add
)
>=
0
)
{
between
=
~
between
+
1
;
//确定第二口井第一次开井时间为第一口井启动时间+启动间隔
startIndex
=
a
;
break
;
}
}
}
if
(
startIndex
>
-
1
)
{
DynamicQueryPlantPredictedPowerOutput
start
=
avgPowerList
.
get
(
startIndex
);
DateTime
startTimeOptimize
=
DateUtil
.
parse
(
start
.
getHourTime
()
+
start
.
getMinTime
(),
BusinessConstant
.
TIME_FORMAT
);
//计算未优化启动间隔
int
openDuration
=
(
int
)
startTime
.
between
(
endTime
,
DateUnit
.
MINUTE
);
DateTime
endTimeOptimize
=
startTimeOptimize
.
offset
(
DateField
.
MINUTE
,
openDuration
);
String
endTimeString
;
if
(
endTimeOptimize
.
compareTo
(
dateFlag
)
>
0
)
{
endTimeString
=
BusinessConstant
.
END_OF_DAY_TIME
;
}
else
{
endTimeString
=
endTimeOptimize
.
toString
(
BusinessConstant
.
MINUTES_FORMAT
);
}
this
.
createOptimizeLongDuration
(
longDurationList
,
duration
,
longPeriodId
,
wellheadId
,
null
,
openWellTime
,
endTimeString
);
//取时间间隔(分钟)
between
=
(
int
)
endTimeOptimize
.
between
(
endTime
,
DateUnit
.
MINUTE
);
if
(
endTimeOptimize
.
compareTo
(
endTime
)
<
0
)
{
between
=
~
between
+
1
;
}
//累加
totalOperatingPower
=
totalOperatingPower
.
add
(
serviceRating
);
startInterval
=
startInterval
+
startInterval
;
}
else
{
//无法优化
}
}
}
}
else
{
}
else
{
DateTime
offset
=
startTime
.
offset
(
DateField
.
MINUTE
,
between
);
DateTime
offset
=
startTime
.
offset
(
DateField
.
MINUTE
,
between
);
...
@@ -234,8 +287,6 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
...
@@ -234,8 +287,6 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
}
}
}
}
}
}
}
else
{
}
else
{
//遍历井口,按发电功率大于等于光伏出力峰值条件分组
//遍历井口,按发电功率大于等于光伏出力峰值条件分组
Map
<
Boolean
,
List
<
SpaceInstitutionWellheadView
>>
collect
=
spaceWellheadList
.
stream
()
Map
<
Boolean
,
List
<
SpaceInstitutionWellheadView
>>
collect
=
spaceWellheadList
.
stream
()
...
...
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