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
365ed564
Commit
365ed564
authored
May 19, 2026
by
DESKTOP-VKRD9QF\Administration
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
供应关系修改
parent
9190eaa3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
13 deletions
+52
-13
Paged.java
src/main/java/com/aps/entity/common/Paged.java
+9
-0
PlanResultService.java
src/main/java/com/aps/service/plan/PlanResultService.java
+43
-13
No files found.
src/main/java/com/aps/entity/common/Paged.java
View file @
365ed564
package
com
.
aps
.
entity
.
common
;
import
com.fasterxml.jackson.annotation.JsonAlias
;
import
com.fasterxml.jackson.annotation.JsonSetter
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -65,10 +68,16 @@ public class Paged {
return
desc
;
}
@JsonAlias
(
"isDesc"
)
public
void
setDesc
(
Boolean
desc
)
{
this
.
desc
=
desc
;
}
@JsonSetter
(
"isDesc"
)
public
void
setIsDesc
(
Boolean
isDesc
)
{
this
.
desc
=
isDesc
;
}
public
List
<
ConditionEntity
>
getConditions
()
{
return
conditions
;
}
...
...
src/main/java/com/aps/service/plan/PlanResultService.java
View file @
365ed564
...
...
@@ -2460,21 +2460,23 @@ if(job.getGeneDetails()!=null)
}
}
// 处理TargetFinishedOperationId
if
(
currentEntry
.
getTargetFinishedOperationId
()
!=
null
&&
!
currentEntry
.
getTargetFinishedOperationId
().
isEmpty
())
{
for
(
Integer
targetId
:
currentEntry
.
getTargetFinishedOperationId
())
{
Entry
supplyEntry
=
findLastOperationInSameOrder
(
entries
,
currentEntry
);
List
<
Integer
>
targetFinishedOperationIds
=
getTargetFinishedOperationIds
(
supplyEntry
,
currentEntry
);
if
(
supplyEntry
!=
null
&&
targetFinishedOperationIds
!=
null
&&
!
targetFinishedOperationIds
.
isEmpty
())
{
for
(
Integer
targetId
:
targetFinishedOperationIds
)
{
Entry
targetEntry
=
entries
.
stream
().
filter
(
e
->
e
.
getId
()
==
targetId
).
findFirst
().
orElse
(
null
);
if
(
targetEntry
!=
null
)
{
// 找到当前工序的结束时间
LocalDateTime
currentEndTime
=
getEntryEndTime
(
current
Entry
,
results
,
baseTime
);
LocalDateTime
currentEndTime
=
getEntryEndTime
(
supply
Entry
,
results
,
baseTime
);
// 找到目标工序的开始时间
LocalDateTime
targetStartTime
=
getEntryStartTime
(
targetEntry
,
results
,
baseTime
);
Order
fromOrder2
=
orders
!=
null
?
orders
.
stream
().
filter
(
o
->
o
.
getOrderId
()
!=
null
&&
o
.
getOrderId
().
equals
(
current
Entry
.
getOrderId
())).
findFirst
().
orElse
(
null
)
:
null
;
Order
fromOrder2
=
orders
!=
null
?
orders
.
stream
().
filter
(
o
->
o
.
getOrderId
()
!=
null
&&
o
.
getOrderId
().
equals
(
supply
Entry
.
getOrderId
())).
findFirst
().
orElse
(
null
)
:
null
;
Order
toOrder2
=
orders
!=
null
?
orders
.
stream
().
filter
(
o
->
o
.
getOrderId
()
!=
null
&&
o
.
getOrderId
().
equals
(
targetEntry
.
getOrderId
())).
findFirst
().
orElse
(
null
)
:
null
;
long
fromEquipId2
=
results
.
stream
().
filter
(
r
->
r
.
getOperationId
()
==
current
Entry
.
getId
()).
mapToLong
(
r
->
r
.
getMachineId
()).
findFirst
().
orElse
(-
1L
);
long
fromEquipId2
=
results
.
stream
().
filter
(
r
->
r
.
getOperationId
()
==
supply
Entry
.
getId
()).
mapToLong
(
r
->
r
.
getMachineId
()).
findFirst
().
orElse
(-
1L
);
long
toEquipId2
=
results
.
stream
().
filter
(
r
->
r
.
getOperationId
()
==
targetEntry
.
getId
()).
mapToLong
(
r
->
r
.
getMachineId
()).
findFirst
().
orElse
(-
1L
);
Map
<
String
,
Object
>
item
=
new
HashMap
<>();
item
.
put
(
"fromId"
,
String
.
valueOf
(
current
Entry
.
getId
()));
item
.
put
(
"fromId"
,
String
.
valueOf
(
supply
Entry
.
getId
()));
item
.
put
(
"fromPlanId"
,
fromOrder2
!=
null
?
String
.
valueOf
(
fromOrder2
.
getId
())
:
""
);
item
.
put
(
"fromEquipId"
,
String
.
valueOf
(
fromEquipId2
));
item
.
put
(
"fromTime"
,
currentEndTime
!=
null
?
currentEndTime
.
toString
()
:
"2025-12-13"
);
...
...
@@ -2605,20 +2607,24 @@ if(job.getGeneDetails()!=null)
* @param supplyRelations 供给关系列表
*/
private
void
checkAndAddTargetRelations
(
List
<
Entry
>
entries
,
List
<
Order
>
orders
,
List
<
GAScheduleResult
>
results
,
LocalDateTime
baseTime
,
Entry
currentEntry
,
List
<
Object
>
supplyRelations
)
{
if
(
currentEntry
.
getTargetFinishedOperationId
()
!=
null
&&
!
currentEntry
.
getTargetFinishedOperationId
().
isEmpty
())
{
for
(
Integer
targetId
:
currentEntry
.
getTargetFinishedOperationId
())
{
Entry
supplyEntry
=
findLastOperationInSameOrder
(
entries
,
currentEntry
);
List
<
Integer
>
targetFinishedOperationIds
=
getTargetFinishedOperationIds
(
supplyEntry
,
currentEntry
);
if
(
supplyEntry
==
null
||
targetFinishedOperationIds
==
null
||
targetFinishedOperationIds
.
isEmpty
())
{
return
;
}
for
(
Integer
targetId
:
targetFinishedOperationIds
)
{
Entry
targetEntry
=
entries
.
stream
().
filter
(
e
->
e
.
getId
()
==
targetId
).
findFirst
().
orElse
(
null
);
if
(
targetEntry
!=
null
)
{
// 找到当前工序的结束时间
LocalDateTime
currentEndTime
=
getEntryEndTime
(
current
Entry
,
results
,
baseTime
);
LocalDateTime
currentEndTime
=
getEntryEndTime
(
supply
Entry
,
results
,
baseTime
);
// 找到目标工序的开始时间
LocalDateTime
targetStartTime
=
getEntryStartTime
(
targetEntry
,
results
,
baseTime
);
Order
fromOrder
=
orders
!=
null
?
orders
.
stream
().
filter
(
o
->
o
.
getOrderId
()
!=
null
&&
o
.
getOrderId
().
equals
(
current
Entry
.
getOrderId
())).
findFirst
().
orElse
(
null
)
:
null
;
Order
fromOrder
=
orders
!=
null
?
orders
.
stream
().
filter
(
o
->
o
.
getOrderId
()
!=
null
&&
o
.
getOrderId
().
equals
(
supply
Entry
.
getOrderId
())).
findFirst
().
orElse
(
null
)
:
null
;
Order
toOrder
=
orders
!=
null
?
orders
.
stream
().
filter
(
o
->
o
.
getOrderId
()
!=
null
&&
o
.
getOrderId
().
equals
(
targetEntry
.
getOrderId
())).
findFirst
().
orElse
(
null
)
:
null
;
long
fromEquipId4
=
results
.
stream
().
filter
(
r
->
r
.
getOperationId
()
==
current
Entry
.
getId
()).
mapToLong
(
r
->
r
.
getMachineId
()).
findFirst
().
orElse
(-
1L
);
long
fromEquipId4
=
results
.
stream
().
filter
(
r
->
r
.
getOperationId
()
==
supply
Entry
.
getId
()).
mapToLong
(
r
->
r
.
getMachineId
()).
findFirst
().
orElse
(-
1L
);
long
toEquipId4
=
results
.
stream
().
filter
(
r
->
r
.
getOperationId
()
==
targetEntry
.
getId
()).
mapToLong
(
r
->
r
.
getMachineId
()).
findFirst
().
orElse
(-
1L
);
Map
<
String
,
Object
>
item
=
new
HashMap
<>();
item
.
put
(
"fromId"
,
String
.
valueOf
(
current
Entry
.
getId
()));
item
.
put
(
"fromId"
,
String
.
valueOf
(
supply
Entry
.
getId
()));
item
.
put
(
"fromPlanId"
,
fromOrder
!=
null
?
String
.
valueOf
(
fromOrder
.
getId
())
:
""
);
item
.
put
(
"fromEquipId"
,
String
.
valueOf
(
fromEquipId4
));
item
.
put
(
"fromTime"
,
currentEndTime
!=
null
?
currentEndTime
.
toString
()
:
"2025-12-13"
);
...
...
@@ -2629,10 +2635,34 @@ if(job.getGeneDetails()!=null)
supplyRelations
.
add
(
item
);
checkAndAddTargetRelations
(
entries
,
orders
,
results
,
baseTime
,
targetEntry
,
supplyRelations
);
// 递归调用
}
}
}
}
private
Entry
findLastOperationInSameOrder
(
List
<
Entry
>
entries
,
Entry
entry
)
{
if
(
entry
==
null
||
entries
==
null
)
{
return
null
;
}
Entry
lastEntry
=
entries
.
stream
()
.
filter
(
e
->
e
.
getOrderId
()
!=
null
&&
e
.
getOrderId
().
equals
(
entry
.
getOrderId
()))
.
max
(
Comparator
.
comparingInt
(
Entry:
:
getSequence
))
.
orElse
(
null
);
if
(
lastEntry
!=
null
)
{
return
lastEntry
;
}
return
entries
.
stream
()
.
filter
(
e
->
e
.
getGroupId
()
==
entry
.
getGroupId
())
.
max
(
Comparator
.
comparingInt
(
Entry:
:
getSequence
))
.
orElse
(
entry
);
}
private
List
<
Integer
>
getTargetFinishedOperationIds
(
Entry
sourceEntry
,
Entry
fallbackEntry
)
{
if
(
sourceEntry
!=
null
&&
sourceEntry
.
getTargetFinishedOperationId
()
!=
null
&&
!
sourceEntry
.
getTargetFinishedOperationId
().
isEmpty
())
{
return
sourceEntry
.
getTargetFinishedOperationId
();
}
return
fallbackEntry
!=
null
?
fallbackEntry
.
getTargetFinishedOperationId
()
:
null
;
}
private
Map
<
Integer
,
Object
>
InitEntrys
(
String
SceneId
,
List
<
ProdEquipment
>
ProdEquipments
,
List
<
Order
>
ProdLaunchOrders
)
{
FileHelper
.
writeLogFile
(
"初始化工单-----------开始-------"
);
...
...
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