Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
HYH.APSJ
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
佟礼
HYH.APSJ
Commits
d98a5bf6
Commit
d98a5bf6
authored
Jan 22, 2026
by
Tong Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备日历缓存
parent
a6a8f36f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
RoutingDataService.java
...in/java/com/aps/service/Algorithm/RoutingDataService.java
+1
-1
MachineSchedulerService.java
...in/java/com/aps/service/plan/MachineSchedulerService.java
+5
-2
PlanResultServiceTest.java
src/test/java/com/aps/demo/PlanResultServiceTest.java
+1
-1
No files found.
src/main/java/com/aps/service/Algorithm/RoutingDataService.java
View file @
d98a5bf6
...
...
@@ -623,7 +623,7 @@ public class RoutingDataService {
// 4. 初始化机器时间线
for
(
Machine
machine
:
machines
)
{
MachineTimeline
timeline
=
machineScheduler
.
getOrCreateTimeline
(
machine
);
MachineTimeline
timeline
=
machineScheduler
.
getOrCreateTimeline
(
machine
,
false
);
machine
.
setAvailability
(
timeline
.
getSegments
());
}
...
...
src/main/java/com/aps/service/plan/MachineSchedulerService.java
View file @
d98a5bf6
...
...
@@ -37,12 +37,12 @@ public class MachineSchedulerService {
public
void
ClearMachineCache
(
long
machineId
)
{
timelineCache
.
remove
(
machineId
);
}
public
MachineTimeline
getOrCreateTimeline
(
Machine
machine
)
{
public
MachineTimeline
getOrCreateTimeline
(
Machine
machine
,
boolean
isCache
)
{
long
machineId
=
machine
.
getId
();
// 尝试从缓存获取
MachineTimeline
timeline
=
timelineCache
.
get
(
machineId
);
if
(
timeline
!=
null
)
{
if
(
timeline
!=
null
&&
isCache
)
{
// 检查有效期(4小时刷新)
if
(
Duration
.
between
(
timeline
.
getLastUpdated
(),
LocalDateTime
.
now
()).
toMinutes
()
<
10
)
{
return
timeline
;
...
...
@@ -56,6 +56,9 @@ public class MachineSchedulerService {
timelineCache
.
put
(
machineId
,
newTimeline
);
return
newTimeline
;
}
public
MachineTimeline
getOrCreateTimeline
(
Machine
machine
)
{
return
getOrCreateTimeline
(
machine
,
true
);
}
private
MachineTimeline
generateTimeline
(
Machine
machine
)
{
MachineTimeline
timeline
=
new
MachineTimeline
();
...
...
src/test/java/com/aps/demo/PlanResultServiceTest.java
View file @
d98a5bf6
...
...
@@ -37,7 +37,7 @@ public class PlanResultServiceTest {
// NSGAIIUtils nsgaiiUtils=new NSGAIIUtils();
// nsgaiiUtils.Test();
planResultService
.
execute2
(
"
FCB16D2535F24078BAD79729894C38D1
"
);
planResultService
.
execute2
(
"
0DCB1301C57C48B68154789B0FAB8B98
"
);
// planResultService.execute2("726D4C1A712B4B1393175BD44B775B66");
// planResultService.execute2("265F24B6DF3C40E4B17D193B0CC8AAF2");
// LocalDateTime t= LocalDateTime.of(2026, 02, 14, 1, 25, 52);
...
...
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