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
748d7839
Commit
748d7839
authored
Jan 19, 2026
by
DESKTOP-VKRD9QF\Administration
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
取消固定日期
parent
019c2aa2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
92 additions
and
2 deletions
+92
-2
ResourceGanttVO.java
src/main/java/com/aps/entity/Gantt/ResourceGanttVO.java
+1
-1
TaskVO.java
src/main/java/com/aps/entity/Gantt/TaskVO.java
+7
-1
Entry.java
src/main/java/com/aps/entity/basic/Entry.java
+6
-0
ScheduleOperationService.java
...a/com/aps/service/Algorithm/ScheduleOperationService.java
+1
-0
ChromosomeDataService.java
...in/java/com/aps/service/common/ChromosomeDataService.java
+41
-0
PlanResultService.java
src/main/java/com/aps/service/plan/PlanResultService.java
+36
-0
No files found.
src/main/java/com/aps/entity/Gantt/ResourceGanttVO.java
View file @
748d7839
...
...
@@ -47,7 +47,7 @@ public class ResourceGanttVO {
@Schema
(
description
=
"任务列表"
)
private
List
<
TaskVO
>
list
;
private
ShiftVO
shift
;
private
ShiftVO
shift
;
...
...
src/main/java/com/aps/entity/Gantt/TaskVO.java
View file @
748d7839
...
...
@@ -2,6 +2,7 @@ package com.aps.entity.Gantt;
import
com.aps.entity.basic.Shift
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
...
...
@@ -114,7 +115,12 @@ public class TaskVO {
private
int
absolutePreparationTime
;
// 新增:绝对准备时间
@Schema
(
description
=
"锁定状态"
)
private
boolean
locked
;
// 改为小写开头
private
boolean
locked
;
@Schema
(
description
=
"指定开始时间"
)
@JsonInclude
(
JsonInclude
.
Include
.
ALWAYS
)
private
LocalDateTime
designatedStartTime
;
}
\ No newline at end of file
src/main/java/com/aps/entity/basic/Entry.java
View file @
748d7839
...
...
@@ -3,7 +3,9 @@ package com.aps.entity.basic;
import
com.aps.entity.Algorithm.OperationDependency
;
import
com.aps.entity.RoutingDiscreteParam
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.databind.annotation.JsonDeserialize
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.math.BigDecimal
;
...
...
@@ -145,4 +147,8 @@ public class Entry {
private
String
equipCode
;
//设备编码
private
String
equipName
;
//设备编码
@Schema
(
description
=
"指定开始时间"
)
@JsonInclude
(
JsonInclude
.
Include
.
ALWAYS
)
private
LocalDateTime
designatedStartTime
;
}
src/main/java/com/aps/service/Algorithm/ScheduleOperationService.java
View file @
748d7839
...
...
@@ -105,6 +105,7 @@ if(targetOp.getSequence()>1) {
// 设置约束
targetResult
.
setDesignatedStartTime
(
newStartTime
);
targetResult
.
setLockStartTime
(
lockStartTime
);
targetOp
.
setDesignatedStartTime
(
chromosome
.
getBaseTime
().
plusSeconds
(
newStartTime
));
// if(targetOp.getSequence()==1) {
...
...
src/main/java/com/aps/service/common/ChromosomeDataService.java
View file @
748d7839
...
...
@@ -23,6 +23,10 @@ import org.springframework.util.CollectionUtils;
import
java.lang.reflect.Field
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.time.LocalDateTime
;
import
java.time.OffsetDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeParseException
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -879,6 +883,16 @@ public class ChromosomeDataService {
// 调用editOperation方法
chromosome
=
planResultService
.
editOperation
(
chromosome
,
sceneId
,
originalEntry
);
if
(
originalEntry
.
getDesignatedStartTime
()==
null
){
planResultService
.
unlockStartTime
(
chromosome
,
originalEntry
.
getId
());
}
else
{
List
<
Integer
>
opids
=
new
ArrayList
<>();
opids
.
add
(
originalEntry
.
getId
());
chromosome
=
planResultService
.
lock
(
chromosome
,
opids
,
originalEntry
.
getDesignatedStartTime
(),
0L
,
1
);
}
}
// 其他字段通过updateObjectFields更新
...
...
@@ -1159,6 +1173,33 @@ public class ChromosomeDataService {
}
else
{
field
.
set
(
obj
,
fieldValue
);
}
}
else
if
(
fieldType
==
LocalDateTime
.
class
)
{
// 特殊处理LocalDateTime类型字段
if
(
fieldValue
instanceof
String
)
{
// 如果是字符串,尝试解析为LocalDateTime
String
dateString
=
(
String
)
fieldValue
;
// 处理不同格式的日期时间字符串,包括带Z后缀的ISO格式
LocalDateTime
parsedDateTime
;
if
(
dateString
.
endsWith
(
"Z"
))
{
// 处理带Z后缀的格式,将其转换为带+00:00时区的格式
dateString
=
dateString
.
substring
(
0
,
dateString
.
length
()
-
1
)
+
"+00:00"
;
parsedDateTime
=
OffsetDateTime
.
parse
(
dateString
).
toLocalDateTime
();
}
else
{
// 尝试解析为OffsetDateTime然后转换为LocalDateTime
try
{
parsedDateTime
=
OffsetDateTime
.
parse
(
dateString
).
toLocalDateTime
();
}
catch
(
DateTimeParseException
e
)
{
// 如果不是偏移格式,尝试直接解析为LocalDateTime
parsedDateTime
=
LocalDateTime
.
parse
(
dateString
,
DateTimeFormatter
.
ISO_LOCAL_DATE_TIME
);
}
}
field
.
set
(
obj
,
parsedDateTime
);
}
else
if
(
fieldValue
instanceof
LocalDateTime
)
{
field
.
set
(
obj
,
(
LocalDateTime
)
fieldValue
);
}
else
{
// 尝试将其他类型转换为字符串再解析
field
.
set
(
obj
,
LocalDateTime
.
parse
(
fieldValue
.
toString
(),
DateTimeFormatter
.
ISO_LOCAL_DATE_TIME
));
}
}
else
{
field
.
set
(
obj
,
fieldValue
);
}
...
...
src/main/java/com/aps/service/plan/PlanResultService.java
View file @
748d7839
...
...
@@ -480,6 +480,13 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
}
public
void
unlockStartTime
(
Chromosome
chromosome
,
int
opId
)
{
ScheduleOperationService
ScheduleOperation
=
new
ScheduleOperationService
();
ScheduleOperation
.
UnlockStartTime
(
chromosome
,
opId
);
}
/**
* 更新订单相关的所有Entry的数量和优先级
*/
...
...
@@ -550,6 +557,28 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
_sceneService
.
saveChromosomeToFile
(
chromosome
,
SceneId
);
return
chromosome
;
}
public
Chromosome
lock
(
Chromosome
chromosome
,
List
<
Integer
>
opId
,
LocalDateTime
newStartTime
,
Long
newMachineId
,
int
lockStartTime
)
{
GlobalParam
globalParam
=
new
GlobalParam
();
// WriteScheduleSummary(chromosome);
ScheduleOperationService
ScheduleOperation
=
new
ScheduleOperationService
();
// WriteScheduleSummary(chromosome);
ScheduleOperation
.
moveOperation
(
chromosome
,
opId
,
(
int
)
ChronoUnit
.
SECONDS
.
between
(
chromosome
.
getBaseTime
(),
newStartTime
),
newMachineId
,
globalParam
,
lockStartTime
);
// WriteScheduleSummary(chromosome);
return
chromosome
;
}
public
void
Redecode
(
String
SceneId
)
{
Chromosome
chromosome
=
_sceneService
.
loadChromosomeFromFile
(
SceneId
);
...
...
@@ -1701,6 +1730,13 @@ private GlobalParam InitGlobalParam()
taskVO
.
setSeqName
(
entry
.
getRoutingDetailName
());
}
if
(
gene
.
getDesignatedStartTime
()!=-
1
)
{
taskVO
.
setDesignatedStartTime
(
scheduleChromosome
.
getBaseTime
().
plusSeconds
(
gene
.
getDesignatedStartTime
()));
}
else
{
taskVO
.
setDesignatedStartTime
(
null
);
}
// taskVO.setDuration(calculateDuration(
// scheduleChromosome.getBaseTime().plusMinutes(gene.getStartTime()),
// scheduleChromosome.getBaseTime().plusMinutes(gene.getEndTime()))); // 计算持续时间
...
...
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