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
9190eaa3
Commit
9190eaa3
authored
May 18, 2026
by
DESKTOP-VKRD9QF\Administration
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
策略优化
parent
acfd275e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
4 deletions
+38
-4
GeneticDecoder.java
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
+7
-1
UserStrategyRuleServiceImpl.java
...ava/com/aps/service/impl/UserStrategyRuleServiceImpl.java
+31
-3
No files found.
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
View file @
9190eaa3
...
...
@@ -1378,12 +1378,13 @@ public class GeneticDecoder {
}
// startTime 是相对 baseTime 的秒数,0 表示正好从排产基准时间开始,属于合法结果,不能当成失败。
int
startTime
=
geneDetails
.
stream
()
.
mapToInt
(
ScheduleResultDetail:
:
getStartTime
)
.
min
()
.
orElse
(
0
);
if
(
startTime
==
0
)
{
if
(
startTime
<
0
)
{
if
(
islockMachineTime
)
{
// FileHelper.writeLogFile(" 半成品222222 " + operation.getGroupId() + " - " + operation.getSequence() + ",开始时间: " + startTime + ",结束时间: " + 0 + ",处理时间: " + processingTime + ", 后处理: " + teardownTime +
...
...
@@ -1393,6 +1394,11 @@ public class GeneticDecoder {
return
null
;
}
if
(
startTime
==
0
&&
islockMachineTime
)
{
FileHelper
.
writeLogFile
(
String
.
format
(
"排产结果从基准时间开始,正常写入result,订单:%s,工序:%d,设备:%d"
,
operation
.
getOrderCode
(),
operation
.
getId
(),
machine
.
getId
()));
}
int
endTime
=
geneDetails
.
stream
()
.
mapToInt
(
ScheduleResultDetail:
:
getEndTime
)
.
max
()
...
...
src/main/java/com/aps/service/impl/UserStrategyRuleServiceImpl.java
View file @
9190eaa3
...
...
@@ -9,6 +9,7 @@ import com.aps.service.StrategyRuleService;
import
com.aps.service.UserStrategyRuleService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.fasterxml.jackson.databind.DeserializationFeature
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -346,7 +347,26 @@ public class UserStrategyRuleServiceImpl extends ServiceImpl<UserStrategyRuleMap
}
private
List
<
StrategyScheduling
>
parseForwardScheduling
(
String
json
)
{
return
EnhancedJsonConversionUtil
.
convertJsonToEntities
(
json
,
null
,
StrategyScheduling
.
class
);
if
(!
StringUtils
.
hasText
(
json
))
{
return
new
ArrayList
<>();
}
try
{
JsonNode
root
=
objectMapper
.
readTree
(
json
);
if
(
root
==
null
||
root
.
isNull
())
{
return
new
ArrayList
<>();
}
// 新版用户策略保存的是数组;老的全局策略可能保存为 {kpiList, ruleList}。
JsonNode
schedulingNode
=
root
.
isArray
()
?
root
:
root
.
path
(
"forwardScheduling"
);
if
(!
schedulingNode
.
isArray
())
{
schedulingNode
=
root
.
path
(
"ruleList"
);
}
if
(!
schedulingNode
.
isArray
())
{
return
new
ArrayList
<>();
}
return
EnhancedJsonConversionUtil
.
convertJsonToEntities
(
schedulingNode
.
toString
(),
null
,
StrategyScheduling
.
class
);
}
catch
(
Exception
e
)
{
return
new
ArrayList
<>();
}
}
private
Object
parseJson
(
String
json
)
{
...
...
@@ -397,8 +417,16 @@ public class UserStrategyRuleServiceImpl extends ServiceImpl<UserStrategyRuleMap
return
toLong
(
ruleId
);
}
Long
baseRuleId
=
getLong
(
params
,
"baseRuleId"
);
// 前端保存策略时传的是 referenceId,这里兼容成基础策略 ID。
return
baseRuleId
==
null
?
getLong
(
params
,
"referenceId"
)
:
baseRuleId
;
// 前端保存策略时可能传 referenceId;只有纯数字时才兼容成基础策略 ID,UUID 行引用要忽略。
return
baseRuleId
==
null
?
getLongIfNumeric
(
params
,
"referenceId"
)
:
baseRuleId
;
}
private
Long
getLongIfNumeric
(
Map
<
String
,
Object
>
params
,
String
key
)
{
String
value
=
getString
(
params
,
key
);
if
(!
StringUtils
.
hasText
(
value
)
||
!
value
.
matches
(
"\\d+"
))
{
return
null
;
}
return
toLong
(
value
);
}
private
String
getString
(
Map
<
String
,
Object
>
params
,
String
key
)
{
...
...
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