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
9465f72e
Commit
9465f72e
authored
Sep 18, 2023
by
ZWT
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(能源管理系统): 间开优化定时任务
1.开发间开优化长期间开优化定时任务,完成并网流程绿电消纳优先策略; BREAKING CHANGE: 无 Closes 无 [skip ci]
parent
e3a3823b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
20 deletions
+27
-20
C00-common/pps-common/src/main/java/pps/core/common/constant/BusinessConstant.java
.../main/java/pps/core/common/constant/BusinessConstant.java
+8
-0
C11-space/pps-core-space/src/main/java/pps/core/space/service/SpaceOptimizeLongCloudServiceImpl.java
...core/space/service/SpaceOptimizeLongCloudServiceImpl.java
+19
-20
No files found.
C00-common/pps-common/src/main/java/pps/core/common/constant/BusinessConstant.java
View file @
9465f72e
package
pps.core.common.constant
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
/**
* 业务操作常量
*
...
...
@@ -48,6 +51,11 @@ public class BusinessConstant {
*/
public
static
final
String
END_OF_DAY_TIME
=
"23:59"
;
/**
* 日期标志
*/
public
static
final
DateTime
DATE_FLAG
=
DateUtil
.
parse
(
"1970-01-02 00:00:00"
,
"yyyy-mm-dd HH:mm:ss"
);
/*------------------------------字典------------------------------*/
/**
...
...
C11-space/pps-core-space/src/main/java/pps/core/space/service/SpaceOptimizeLongCloudServiceImpl.java
View file @
9465f72e
...
...
@@ -95,7 +95,6 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
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"
);
List
<
SpaceOptimizeLongPeriodView
>
longPeriodList
=
new
ArrayList
<>(
32
);
List
<
SpaceOptimizeLongWellheadView
>
longWellheadList
=
new
ArrayList
<>(
64
);
List
<
SpaceOptimizeLongDurationView
>
longDurationList
=
new
ArrayList
<>(
128
);
...
...
@@ -198,29 +197,29 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
//第一口井的启动时间
if
(
isFirstWellhead
)
{
firstStartTime
=
startTime
;
//计算
关
井时间
int
end
Index
=
0
;
//计算
开
井时间
int
start
Index
=
0
;
for
(
int
a
=
0
,
avgPowerSize
=
avgPowerList
.
size
();
a
<
avgPowerSize
;
a
++)
{
DynamicQueryPlantPredictedPowerOutput
predictedPower
=
avgPowerList
.
get
(
a
);
if
(
DateUtil
.
parse
(
predictedPower
.
getHourTime
()
+
predictedPower
.
getMinTime
(),
BusinessConstant
.
TIME_FORMAT
).
compareTo
(
startTime
)
<
0
)
{
continue
;
}
//当日时间段平均光伏出力>第一口井运行负荷时,该时间为第一口井运行时间
//当日时间段平均光伏出力>=第一口井运行负荷时,该时间为第一口井运行时间
if
(
predictedPower
.
getPower
().
compareTo
(
serviceRating
)
>=
BusinessConstant
.
ZERO
)
{
end
Index
=
a
;
start
Index
=
a
;
break
;
}
}
DynamicQueryPlantPredictedPowerOutput
end
=
avgPowerList
.
get
(
endIndex
);
String
endTimeString
=
end
.
getHourTime
()
+
end
.
getMinTime
();
DynamicQueryPlantPredictedPowerOutput
start
=
avgPowerList
.
get
(
startIndex
);
String
startTimeString
=
start
.
getHourTime
()
+
start
.
getMinTime
();
//计算第一次关井时间,按照间开时间段顺延
int
startDuration
=
(
int
)
startTime
.
between
(
endTime
,
DateUnit
.
MINUTE
);
DateTime
endTimeOptimize
=
startTime
.
offset
(
DateField
.
MINUTE
,
startDuration
);
this
.
createOptimizeLongDuration
(
longDurationList
,
duration
,
longPeriodId
,
recordId
,
wellheadId
,
null
,
openWellTime
,
StringUtils
.
substringBeforeLast
(
endTimeString
,
BusinessConstant
.
INITIALIZATION_SECOND
)
startTimeString
,
endTimeOptimize
.
toString
(
BusinessConstant
.
MINUTES_FORMAT
)
);
//计算
DateTime
endTimeOptimize
=
DateUtil
.
parse
(
end
TimeString
,
BusinessConstant
.
TIME_FORMAT
);
//计算
时间偏移
DateTime
startTimeOptimize
=
DateUtil
.
parse
(
start
TimeString
,
BusinessConstant
.
TIME_FORMAT
);
//取时间间隔(分钟)
between
=
(
int
)
endTimeOptimize
.
between
(
end
Time
,
DateUnit
.
MINUTE
);
if
(
endTimeOptimize
.
compareTo
(
end
Time
)
<
0
)
{
between
=
(
int
)
startTimeOptimize
.
between
(
start
Time
,
DateUnit
.
MINUTE
);
if
(
startTimeOptimize
.
compareTo
(
start
Time
)
<
0
)
{
between
=
~
between
+
1
;
}
}
...
...
@@ -248,7 +247,7 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
int
openDuration
=
(
int
)
startTime
.
between
(
endTime
,
DateUnit
.
MINUTE
);
DateTime
endTimeOptimize
=
startTimeOptimize
.
offset
(
DateField
.
MINUTE
,
openDuration
);
String
endTimeString
;
if
(
endTimeOptimize
.
compareTo
(
dateFlag
)
>
0
)
{
if
(
endTimeOptimize
.
compareTo
(
BusinessConstant
.
DATE_FLAG
)
>
0
)
{
endTimeString
=
BusinessConstant
.
END_OF_DAY_TIME
;
}
else
{
endTimeString
=
endTimeOptimize
.
toString
(
BusinessConstant
.
MINUTES_FORMAT
);
...
...
@@ -267,14 +266,14 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
}
}
else
{
DateTime
offset
=
startTime
.
offset
(
DateField
.
MINUTE
,
between
);
if
(
offset
.
compareTo
(
dateFlag
)
>
0
)
{
if
(
offset
.
compareTo
(
BusinessConstant
.
DATE_FLAG
)
>
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
)
{
if
(
endDate
.
compareTo
(
BusinessConstant
.
DATE_FLAG
)
>
0
)
{
closeWellTime
=
BusinessConstant
.
END_OF_DAY_TIME
;
}
else
{
closeWellTime
=
endDate
.
toString
(
BusinessConstant
.
MINUTES_FORMAT
);
...
...
@@ -378,14 +377,14 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
}
}
else
{
DateTime
offset
=
startTime
.
offset
(
DateField
.
MINUTE
,
between
);
if
(
offset
.
compareTo
(
dateFlag
)
>
0
)
{
if
(
offset
.
compareTo
(
BusinessConstant
.
DATE_FLAG
)
>
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
)
{
if
(
endDate
.
compareTo
(
BusinessConstant
.
DATE_FLAG
)
>
0
)
{
closeWellTime
=
BusinessConstant
.
END_OF_DAY_TIME
;
}
else
{
closeWellTime
=
endDate
.
toString
(
BusinessConstant
.
MINUTES_FORMAT
);
...
...
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