Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes
Project
Project
Details
Activity
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
ximai
mes
Commits
03ad0796
Commit
03ad0796
authored
Nov 08, 2024
by
李驰骋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
未找到可排设备时,提示具体异常
parent
8c149b1f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
GreedyAlg.java
mes/src/main/java/com/ximai/mes/pro/schedule/GreedyAlg.java
+3
-1
EquipmentSelectionStrategyImpl.java
...pro/schedule/strategy/EquipmentSelectionStrategyImpl.java
+4
-1
No files found.
mes/src/main/java/com/ximai/mes/pro/schedule/GreedyAlg.java
View file @
03ad0796
...
...
@@ -125,7 +125,7 @@ public class GreedyAlg implements IAlgorithm{
List
<
EvaluateOptionalEquipmentResult
>
evaluateResultList
=
selectionResult
.
getSelectList
();
if
(
task
.
isOutsourced
()){
//查询外委作业单元
Optional
<
Resource
>
equipmentResource
=
this
.
resources
.
stream
().
filter
(
s
->
IMdWorkunitService
.
OUTSOURCE_WORKUNIT_
CODE
.
equals
(((
Equipment
)
s
).
getWorkUnitCode
())).
findFirst
();
Optional
<
Resource
>
equipmentResource
=
this
.
resources
.
stream
().
filter
(
s
->
IMdWorkunitService
.
OUTSOURCE_WORKUNIT_
ID
.
equals
(((
Equipment
)
s
).
getId
())).
findFirst
();
if
(!
equipmentResource
.
isPresent
()){
task
.
setScheduleStatus
(
ScheduleStatus
.
InadequateTime
);
task
.
getJob
().
setScheduleStatus
(
ScheduleStatus
.
InadequateTime
);
...
...
@@ -157,6 +157,8 @@ public class GreedyAlg implements IAlgorithm{
task
.
getJob
().
setScheduleStatus
(
ScheduleStatus
.
InadequateTime
);
if
(
selectionResult
.
getCause
()
==
EquipmentSelectionResult
.
EquipmentSelectionCause
.
UN_MATCH
){
task
.
getJob
().
setScheduleDesc
(
String
.
format
(
"工序%s,未匹配到可排产设备"
,
task
.
getProcessName
()));
}
else
if
(
selectionResult
.
getCause
()
==
EquipmentSelectionResult
.
EquipmentSelectionCause
.
UN_EQUIPMENT
){
task
.
getJob
().
setScheduleDesc
(
String
.
format
(
"工序%s,未找到可排产设备"
,
task
.
getProcessName
()));
}
else
{
StringBuffer
temp
=
new
StringBuffer
();
task
.
getOptionalEquipments
().
forEach
(
s
->
{
...
...
mes/src/main/java/com/ximai/mes/pro/schedule/strategy/EquipmentSelectionStrategyImpl.java
View file @
03ad0796
...
...
@@ -29,7 +29,10 @@ public class EquipmentSelectionStrategyImpl implements EquipmentSelectionStrateg
//必选设备逻辑添加
List
<
Equipment
>
matchEquipments
=
this
.
matchEquipment
(
task
,
task
.
getOptionalEquipments
());
List
<
TaskSchedulingContext
.
TaskSchedulingResultContext
>
taskSchResults
=
new
ArrayList
<>();
if
(
matchEquipments
.
isEmpty
()&&!
task
.
getOptionalEquipments
().
isEmpty
()){
if
(
task
.
getOptionalEquipments
().
isEmpty
()){
rst
.
setCause
(
EquipmentSelectionResult
.
EquipmentSelectionCause
.
UN_EQUIPMENT
);
return
rst
;
}
else
if
(
matchEquipments
.
isEmpty
()){
rst
.
setCause
(
EquipmentSelectionResult
.
EquipmentSelectionCause
.
UN_MATCH
);
return
rst
;
}
...
...
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