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
1224455a
Commit
1224455a
authored
Sep 18, 2023
by
ZWT
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(能源管理系统): 间开优化定时任务
1.开发间开优化长期间开优化定时任务,完成并网流程绿电消纳优先策略; BREAKING CHANGE: 无 Closes 无 [skip ci]
parent
9465f72e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
18 deletions
+27
-18
C00-common/pps-common/src/main/java/pps/core/common/utils/BaseUtils.java
...common/src/main/java/pps/core/common/utils/BaseUtils.java
+17
-0
C11-space/pps-core-space/src/main/java/pps/core/space/service/SpaceOptimizeLongCloudServiceImpl.java
...core/space/service/SpaceOptimizeLongCloudServiceImpl.java
+10
-18
No files found.
C00-common/pps-common/src/main/java/pps/core/common/utils/BaseUtils.java
View file @
1224455a
package
pps.core.common.utils
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUnit
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.lang.UUID
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -106,4 +108,19 @@ public class BaseUtils {
.
append
(
DateUtil
.
format
(
DateUtil
.
endOfMonth
(
date
),
"yyyy-MM-dd"
));
return
stringBuilder
.
toString
();
}
/**
* 获取时差分钟
*
* @param optimizeTime 优化后时间
* @param originalTime 原始时间
* @return int
*/
public
static
int
getTimeDifferenceMinute
(
DateTime
optimizeTime
,
DateTime
originalTime
)
{
int
between
=
(
int
)
optimizeTime
.
between
(
originalTime
,
DateUnit
.
MINUTE
);
if
(
optimizeTime
.
compareTo
(
originalTime
)
<
0
)
{
between
=
~
between
+
1
;
}
return
between
;
}
}
\ No newline at end of file
C11-space/pps-core-space/src/main/java/pps/core/space/service/SpaceOptimizeLongCloudServiceImpl.java
View file @
1224455a
...
...
@@ -218,10 +218,7 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
//计算时间偏移
DateTime
startTimeOptimize
=
DateUtil
.
parse
(
startTimeString
,
BusinessConstant
.
TIME_FORMAT
);
//取时间间隔(分钟)
between
=
(
int
)
startTimeOptimize
.
between
(
startTime
,
DateUnit
.
MINUTE
);
if
(
startTimeOptimize
.
compareTo
(
startTime
)
<
0
)
{
between
=
~
between
+
1
;
}
between
=
BaseUtils
.
getTimeDifferenceMinute
(
startTimeOptimize
,
startTime
);
}
//其它井口的第一次启动时间
else
{
...
...
@@ -256,10 +253,7 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
openWellTime
,
endTimeString
);
//取时间间隔(分钟)
between
=
(
int
)
endTimeOptimize
.
between
(
endTime
,
DateUnit
.
MINUTE
);
if
(
endTimeOptimize
.
compareTo
(
endTime
)
<
0
)
{
between
=
~
between
+
1
;
}
between
=
BaseUtils
.
getTimeDifferenceMinute
(
endTimeOptimize
,
endTime
);
}
else
{
//无法优化
}
...
...
@@ -353,24 +347,21 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
//第一口井的启动时间
if
(
isFirstWellhead
)
{
//计算优化后的时间差优化后的第一口井开井时间-优化前第一次开井时间
//取时间间隔(分钟)
between
=
(
int
)
firstEndTime
.
between
(
endTime
,
DateUnit
.
MINUTE
);
if
(
firstEndTime
.
compareTo
(
endTime
)
<
0
)
{
between
=
~
between
+
1
;
}
int
startDuration
=
(
int
)
startTime
.
between
(
endTime
,
DateUnit
.
MINUTE
);
//第一次关井时间按照启动时长顺延
DateTime
endTimeOptimize
=
startTime
.
offset
(
DateField
.
MINUTE
,
startDuration
);
this
.
createOptimizeLongDuration
(
longDurationList
,
duration
,
longPeriodId
,
recordId
,
wellheadId
,
null
,
strategyDetailOutput
.
getStartTime
(),
strategyDetailOutput
.
getEndTime
(
)
strategyDetailOutput
.
getStartTime
(),
endTimeOptimize
.
toString
(
BusinessConstant
.
MINUTES_FORMAT
)
);
//取时间间隔(分钟)
between
=
BaseUtils
.
getTimeDifferenceMinute
(
firstEndTime
,
endTime
);
}
//其它井口的第一次启动时间
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
;
}
between
=
BaseUtils
.
getTimeDifferenceMinute
(
firstEndTime
,
endTime
);
this
.
createOptimizeLongDuration
(
longDurationList
,
duration
,
longPeriodId
,
recordId
,
wellheadId
,
null
,
startTimeOffset
.
toString
(
BusinessConstant
.
MINUTES_FORMAT
),
endTimeOffset
.
toString
(
BusinessConstant
.
MINUTES_FORMAT
)
);
...
...
@@ -452,6 +443,7 @@ public class SpaceOptimizeLongCloudServiceImpl implements ISpaceOptimizeLongClou
/*-----------------------------------private-----------------------------------*/
/**
* 创建长期优化信息
*
...
...
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