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
90219e38
Commit
90219e38
authored
Jun 11, 2026
by
DESKTOP-VKRD9QF\Administration
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日志
parent
fef1ef87
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
1 deletion
+75
-1
PlanResultService.java
src/main/java/com/aps/service/plan/PlanResultService.java
+75
-1
No files found.
src/main/java/com/aps/service/plan/PlanResultService.java
View file @
90219e38
...
@@ -2047,6 +2047,7 @@ public class PlanResultService {
...
@@ -2047,6 +2047,7 @@ public class PlanResultService {
public
void
WriteScheduleSummary
(
Chromosome
schedule
)
{
public
void
WriteScheduleSummary
(
Chromosome
schedule
)
{
WriteOperationIntegrityLog
(
schedule
);
// 写入日志
// 写入日志
FileHelper
.
writeLogFile
(
"\n=== Schedule Summary === "
);
FileHelper
.
writeLogFile
(
"\n=== Schedule Summary === "
);
FileHelper
.
writeLogFile
(
String
.
format
(
"ID: %s"
,
schedule
.
getID
()));
FileHelper
.
writeLogFile
(
String
.
format
(
"ID: %s"
,
schedule
.
getID
()));
...
@@ -2085,6 +2086,9 @@ public class PlanResultService {
...
@@ -2085,6 +2086,9 @@ public class PlanResultService {
.
collect
(
Collectors
.
joining
(
","
));
.
collect
(
Collectors
.
joining
(
","
));
}
}
Order
order
=
orders
.
get
(
job
.
getGroupId
());
Order
order
=
orders
.
get
(
job
.
getGroupId
());
String
orderDueDate
=
order
!=
null
&&
order
.
getDueDate
()
!=
null
?
order
.
getDueDate
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
))
:
""
;
sb
.
append
(
String
.
format
(
sb
.
append
(
String
.
format
(
"[%d-%d]:[%s-%s] Order %d,OrderID %s,OrderDueDate %s, Machine %d, Operation %d, Quantity %.1f, processingTime %.1f, 前处理 %d, 后处理 %d, 离散参数 %d, bomtime %s,TargetOperationId %s"
,
"[%d-%d]:[%s-%s] Order %d,OrderID %s,OrderDueDate %s, Machine %d, Operation %d, Quantity %.1f, processingTime %.1f, 前处理 %d, 后处理 %d, 离散参数 %d, bomtime %s,TargetOperationId %s"
,
job
.
getStartTime
(),
job
.
getStartTime
(),
...
@@ -2093,7 +2097,7 @@ public class PlanResultService {
...
@@ -2093,7 +2097,7 @@ public class PlanResultService {
ConvertTime
(
job
.
getEndTime
()),
ConvertTime
(
job
.
getEndTime
()),
job
.
getGroupId
(),
job
.
getGroupId
(),
job
.
getOrderId
(),
job
.
getOrderId
(),
order
.
getDueDate
().
format
(
DateTimeFormatter
.
ofPattern
(
"YYYY-MM-dd HH:mm:ss"
))
,
order
DueDate
,
job
.
getMachineId
(),
job
.
getMachineId
(),
job
.
getOperationId
(),
job
.
getOperationId
(),
job
.
getQuantity
(),
job
.
getQuantity
(),
...
@@ -2127,6 +2131,76 @@ if(job.getGeneDetails()!=null)
...
@@ -2127,6 +2131,76 @@ if(job.getGeneDetails()!=null)
FileHelper
.
writeLogFile
(
""
);
FileHelper
.
writeLogFile
(
""
);
}
}
}
}
private
void
WriteOperationIntegrityLog
(
Chromosome
schedule
)
{
if
(
schedule
==
null
)
{
return
;
}
List
<
Entry
>
allOperations
=
schedule
.
getAllOperations
()
==
null
?
Collections
.
emptyList
()
:
schedule
.
getAllOperations
();
List
<
GAScheduleResult
>
result
=
schedule
.
getResult
()
==
null
?
Collections
.
emptyList
()
:
schedule
.
getResult
();
String
id
=
schedule
.
getID
()
==
null
?
""
:
schedule
.
getID
();
int
maxOperationId
=
allOperations
.
stream
()
.
mapToInt
(
Entry:
:
getId
)
.
max
()
.
orElse
(
0
);
int
maxResultOperationId
=
result
.
stream
()
.
mapToInt
(
GAScheduleResult:
:
getOperationId
)
.
max
()
.
orElse
(
0
);
long
distinctResultOperationCount
=
result
.
stream
()
.
map
(
GAScheduleResult:
:
getOperationId
)
.
distinct
()
.
count
();
int
operationSequencingCount
=
schedule
.
getOperationSequencing
()
==
null
?
0
:
schedule
.
getOperationSequencing
().
size
();
FileHelper
.
writeLogFile
(
id
+
"工序数: "
+
allOperations
.
size
()
+
"----"
+
maxOperationId
+
"----"
+
operationSequencingCount
);
FileHelper
.
writeLogFile
(
id
+
"结果数: "
+
result
.
size
()
+
"----"
+
maxResultOperationId
+
"----"
+
distinctResultOperationCount
);
Set
<
Integer
>
operationIds
=
allOperations
.
stream
()
.
map
(
Entry:
:
getId
)
.
collect
(
Collectors
.
toSet
());
List
<
Integer
>
missingOperationIds
=
result
.
stream
()
.
map
(
GAScheduleResult:
:
getOperationId
)
.
filter
(
operationId
->
!
operationIds
.
contains
(
operationId
))
.
distinct
()
.
sorted
()
.
collect
(
Collectors
.
toList
());
if
(
missingOperationIds
.
isEmpty
())
{
FileHelper
.
writeLogFile
(
id
+
"Result中OperationId全部在allOperations中存在"
);
}
else
{
FileHelper
.
writeLogFile
(
id
+
"Result中OperationId不在allOperations中("
+
missingOperationIds
.
size
()
+
"个): "
+
missingOperationIds
);
}
Map
<
Integer
,
Long
>
duplicateOperationIds
=
result
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
GAScheduleResult:
:
getOperationId
,
TreeMap:
:
new
,
Collectors
.
counting
()));
List
<
String
>
duplicateDesc
=
duplicateOperationIds
.
entrySet
().
stream
()
.
filter
(
entry
->
entry
.
getValue
()
>
1
)
.
map
(
entry
->
entry
.
getKey
()
+
"("
+
entry
.
getValue
()
+
"次)"
)
.
collect
(
Collectors
.
toList
());
if
(
duplicateDesc
.
isEmpty
())
{
FileHelper
.
writeLogFile
(
id
+
"Result中OperationId无重复"
);
}
else
{
FileHelper
.
writeLogFile
(
id
+
"Result中重复OperationId("
+
duplicateDesc
.
size
()
+
"个): ["
+
String
.
join
(
", "
,
duplicateDesc
)
+
"]"
);
}
}
private
String
ConvertTime
(
int
minute
)
{
private
String
ConvertTime
(
int
minute
)
{
return
baseTime
.
plusSeconds
(
minute
).
format
(
DateTimeFormatter
.
ofPattern
(
"YYYY-MM-dd HH:mm:ss"
));
return
baseTime
.
plusSeconds
(
minute
).
format
(
DateTimeFormatter
.
ofPattern
(
"YYYY-MM-dd HH:mm:ss"
));
}
}
...
...
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