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
37065872
Commit
37065872
authored
Jan 14, 2026
by
Tong Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拖到,固定开始日期,锁定
parent
236185e3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
12 deletions
+23
-12
ResourceGanttController.java
...ava/com/aps/controller/gantt/ResourceGanttController.java
+3
-3
GAScheduleResult.java
src/main/java/com/aps/entity/Algorithm/GAScheduleResult.java
+2
-1
GeneticDecoder.java
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
+6
-1
ScheduleOperationService.java
...a/com/aps/service/Algorithm/ScheduleOperationService.java
+9
-4
PlanResultService.java
src/main/java/com/aps/service/plan/PlanResultService.java
+3
-3
No files found.
src/main/java/com/aps/controller/gantt/ResourceGanttController.java
View file @
37065872
...
...
@@ -197,7 +197,7 @@ public class ResourceGanttController {
opids
.
add
(
opid
);
// 3. 执行业务
Chromosome
result
=
planResultService
.
Move
(
sceneId
,
opids
,
newStartTime
,
newMachineId
);
Chromosome
result
=
planResultService
.
Move
(
sceneId
,
opids
,
newStartTime
,
newMachineId
,
0
);
return
R
.
ok
(
"移动成功"
);
}
...
...
@@ -219,7 +219,7 @@ public class ResourceGanttController {
// 3. 执行业务
Chromosome
result
=
planResultService
.
Move
(
sceneId
,
opids
,
newStartTime
,
newMachineId
);
Chromosome
result
=
planResultService
.
Move
(
sceneId
,
opids
,
newStartTime
,
newMachineId
,
0
);
return
R
.
ok
(
"移动成功"
);
}
...
...
@@ -245,7 +245,7 @@ public class ResourceGanttController {
opids
.
add
(
opid
);
// 3. 执行业务
Chromosome
result
=
planResultService
.
Move
(
sceneId
,
opids
,
newStartTime
,
0L
);
Chromosome
result
=
planResultService
.
Move
(
sceneId
,
opids
,
newStartTime
,
0L
,
1
);
return
R
.
ok
(
"固定开始日期成功"
);
}
...
...
src/main/java/com/aps/entity/Algorithm/GAScheduleResult.java
View file @
37065872
...
...
@@ -29,7 +29,8 @@ public class GAScheduleResult {
private
int
teardownTime
;
//后处理
private
double
Quantity
;
// 批次大小(订单可拆分)
private
List
<
ScheduleResultDetail
>
GeneDetails
;
// 时间详情
private
int
designatedStartTime
=
-
1
;
// 设计开始时间(默认-1)
private
int
designatedStartTime
=
-
1
;
// 固定开始时间(默认-1)
private
int
lockStartTime
=
0
;
// 是否固定开始时间(默认-1)
private
Long
forcedMachineId
=-
1L
;
// 强制分配的设备ID(-1表示无强制)
private
boolean
IsLocked
=
false
;
private
double
OneTime
;
// 单件工时
...
...
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
View file @
37065872
...
...
@@ -513,7 +513,12 @@ if(finishedOrder==null||finishedOrder.size()==0)
result
.
setChangeOverTime
(
setupTime
);
result
.
setPreTime
(
preTime
);
result
.
setTeardownTime
(
teardownTime
);
if
(
existingResult
!=
null
)
{
if
(
existingResult
.
getLockStartTime
()==
1
)
{
result
.
setLockStartTime
(
existingResult
.
getLockStartTime
());
result
.
setDesignatedStartTime
(
existingResult
.
getDesignatedStartTime
());
}
}
result
.
setProcessingTime
(
processingTimeTotal
);
...
...
src/main/java/com/aps/service/Algorithm/ScheduleOperationService.java
View file @
37065872
...
...
@@ -33,7 +33,7 @@ public class ScheduleOperationService {
* @param newMachineId 新设备ID
*/
public
void
moveOperation
(
Chromosome
chromosome
,
List
<
Integer
>
opIds
,
int
newStartTime
,
Long
newMachineId
,
GlobalParam
globalParam
)
{
Long
newMachineId
,
GlobalParam
globalParam
,
int
lockStartTime
)
{
List
<
Entry
>
allOperations
=
chromosome
.
getAllOperations
();
int
newStartTime1
=
newStartTime
;
Map
<
Integer
,
Integer
>
opTimeMap
=
chromosome
.
getResult
().
stream
()
...
...
@@ -82,6 +82,7 @@ Integer newMachineId1=newMachineId.intValue();
}
// 设置约束
targetResult
.
setDesignatedStartTime
(
newStartTime
);
targetResult
.
setLockStartTime
(
lockStartTime
);
if
(
targetOp
.
getSequence
()==
1
)
{
...
...
@@ -709,12 +710,16 @@ Integer newMachineId1=newMachineId.intValue();
}
public
void
LockOperation
(
Chromosome
chromosome
,
int
opId
,
boolean
isLocked
,
GlobalParam
globalParam
)
{
GAScheduleResult
targetResult
=
chromosome
.
getResult
().
stream
()
.
filter
(
r
->
r
.
getOperation
Id
()
==
opId
)
Entry
targetOp
=
chromosome
.
getAllOperations
().
stream
()
.
filter
(
o
->
o
.
get
Id
()
==
opId
)
.
findFirst
()
.
orElseThrow
(()
->
new
NoSuchElementException
(
"Operation not found: "
+
opId
));
targetResult
.
setIsLocked
(
isLocked
);
List
<
GAScheduleResult
>
targetResults
=
chromosome
.
getResult
().
stream
()
.
filter
(
r
->
r
.
getGroupId
()==
targetOp
.
getGroupId
()&&
r
.
getOperationId
()
<=
opId
).
collect
(
Collectors
.
toList
());
targetResults
.
forEach
(
t
->
t
.
setIsLocked
(
isLocked
));
// 若解锁,重新解码受影响工序
if
(!
isLocked
)
...
...
src/main/java/com/aps/service/plan/PlanResultService.java
View file @
37065872
...
...
@@ -430,7 +430,7 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
return
chromosome
;
}
public
Chromosome
Move
(
String
SceneId
,
List
<
Integer
>
opId
,
LocalDateTime
newStartTime
,
Long
newMachineId
)
{
Long
newMachineId
,
int
lockStartTime
)
{
GlobalParam
globalParam
=
new
GlobalParam
();
...
...
@@ -440,8 +440,8 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
// WriteScheduleSummary(chromosome);
ScheduleOperationService
ScheduleOperation
=
new
ScheduleOperationService
();
WriteScheduleSummary
(
chromosome
);
ScheduleOperation
.
moveOperation
(
chromosome
,
opId
,
(
int
)
ChronoUnit
.
SECONDS
.
between
(
chromosome
.
getBaseTime
(),
newStartTime
),
newMachineId
,
globalParam
);
WriteScheduleSummary
(
chromosome
);
ScheduleOperation
.
moveOperation
(
chromosome
,
opId
,
(
int
)
ChronoUnit
.
SECONDS
.
between
(
chromosome
.
getBaseTime
(),
newStartTime
),
newMachineId
,
globalParam
,
lockStartTime
);
//
WriteScheduleSummary(chromosome);
_sceneService
.
saveChromosomeToFile
(
chromosome
,
SceneId
);
return
chromosome
;
...
...
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