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
51f71b5f
Commit
51f71b5f
authored
Sep 08, 2026
by
Tong Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MP
parent
38a88ea8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
optimization_result_1.json
mp/result/optimization_result_1.json
+1
-1
MacroPlannerDataConverter.java
.../com/aps/macroplanner/data/MacroPlannerDataConverter.java
+10
-4
No files found.
mp/result/optimization_result_1.json
View file @
51f71b5f
{
"timestamp"
:
"2026-09-08 14:11:57"
,
"solver"
:
"MP"
,
"version"
:
"1.0.0"
,
"periodTasks"
:[],
"salesDemands"
:[],
"pispips"
:[],
"productNetwork"
:{
"finishedGoods"
:[],
"allNodes"
:{}},
"unitCapacities"
:[],
"demandSummary"
:[],
"kpis"
:{
"objectiveValue"
:
0.0
,
"entries"
:[{
"name"
:
"需求缺口(Fulfillment)"
,
"rawValue"
:
0.0
,
"weight"
:
100.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
},{
"name"
:
"需求满足数(FulfilledDemands)"
,
"rawValue"
:
0.0
,
"weight"
:
0.0
,
"penalty"
:
-0.0
,
"isBenefit"
:
true
},{
"name"
:
"批次偏差(LotSize)"
,
"rawValue"
:
0.0
,
"weight"
:
10.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
},{
"name"
:
"超库存(MaxInventory)"
,
"rawValue"
:
0.0
,
"weight"
:
5.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
},{
"name"
:
"欠库存(MinInventory)"
,
"rawValue"
:
0.0
,
"weight"
:
5.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
},{
"name"
:
"目标库存偏差(TargetInv)"
,
"rawValue"
:
0.0
,
"weight"
:
8.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
},{
"name"
:
"产能超载(UnitCapacity)"
,
"rawValue"
:
0.0
,
"weight"
:
3.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
},{
"name"
:
"供应目标偏差(SupplyTarget)"
,
"rawValue"
:
0.0
,
"weight"
:
8.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
},{
"name"
:
"最小供应不足(MinSupply)"
,
"rawValue"
:
0.0
,
"weight"
:
5.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
},{
"name"
:
"最大供应超出(MaxSupply)"
,
"rawValue"
:
0.0
,
"weight"
:
5.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
},{
"name"
:
"销售优先级(SalesPriority)"
,
"rawValue"
:
0.0
,
"weight"
:
1.0
,
"penalty"
:
-0.0
,
"isBenefit"
:
true
},{
"name"
:
"推迟惩罚(Postponement)"
,
"rawValue"
:
0.0
,
"weight"
:
20.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
},{
"name"
:
"过程最大量(ProcessMax)"
,
"rawValue"
:
0.0
,
"weight"
:
5.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
}]},
"statistics"
:{
"status"
:
"OPTIMAL"
,
"numVariables"
:
12
,
"numConstraints"
:
13
,
"elapsedSeconds"
:
0.266
,
"objectiveValue"
:
0.0
,
"bestBound"
:
null
,
"gap"
:
null
,
"iterations"
:
0
}}
{
"timestamp"
:
"2026-09-08 14:26:19"
,
"solver"
:
"MP"
,
"version"
:
"1.0.0"
,
"periodTasks"
:[],
"salesDemands"
:[],
"pispips"
:[],
"productNetwork"
:{
"finishedGoods"
:[],
"allNodes"
:{}},
"unitCapacities"
:[],
"demandSummary"
:[],
"kpis"
:{
"objectiveValue"
:
0.0
,
"entries"
:[{
"name"
:
"需求缺口(Fulfillment)"
,
"rawValue"
:
0.0
,
"weight"
:
100.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
},{
"name"
:
"需求满足数(FulfilledDemands)"
,
"rawValue"
:
0.0
,
"weight"
:
0.0
,
"penalty"
:
-0.0
,
"isBenefit"
:
true
},{
"name"
:
"批次偏差(LotSize)"
,
"rawValue"
:
0.0
,
"weight"
:
10.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
},{
"name"
:
"超库存(MaxInventory)"
,
"rawValue"
:
0.0
,
"weight"
:
5.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
},{
"name"
:
"欠库存(MinInventory)"
,
"rawValue"
:
0.0
,
"weight"
:
5.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
},{
"name"
:
"目标库存偏差(TargetInv)"
,
"rawValue"
:
0.0
,
"weight"
:
8.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
},{
"name"
:
"产能超载(UnitCapacity)"
,
"rawValue"
:
0.0
,
"weight"
:
3.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
},{
"name"
:
"供应目标偏差(SupplyTarget)"
,
"rawValue"
:
0.0
,
"weight"
:
8.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
},{
"name"
:
"最小供应不足(MinSupply)"
,
"rawValue"
:
0.0
,
"weight"
:
5.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
},{
"name"
:
"最大供应超出(MaxSupply)"
,
"rawValue"
:
0.0
,
"weight"
:
5.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
},{
"name"
:
"销售优先级(SalesPriority)"
,
"rawValue"
:
0.0
,
"weight"
:
1.0
,
"penalty"
:
-0.0
,
"isBenefit"
:
true
},{
"name"
:
"推迟惩罚(Postponement)"
,
"rawValue"
:
0.0
,
"weight"
:
20.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
},{
"name"
:
"过程最大量(ProcessMax)"
,
"rawValue"
:
0.0
,
"weight"
:
5.0
,
"penalty"
:
0.0
,
"isBenefit"
:
false
}]},
"statistics"
:{
"status"
:
"OPTIMAL"
,
"numVariables"
:
12
,
"numConstraints"
:
13
,
"elapsedSeconds"
:
0.342
,
"objectiveValue"
:
0.0
,
"bestBound"
:
null
,
"gap"
:
null
,
"iterations"
:
0
}}
\ No newline at end of file
\ No newline at end of file
src/main/java/com/aps/macroplanner/data/MacroPlannerDataConverter.java
View file @
51f71b5f
...
@@ -135,7 +135,9 @@ public class MacroPlannerDataConverter {
...
@@ -135,7 +135,9 @@ public class MacroPlannerDataConverter {
* @return 填充好的 TestDataBuilder, 可直接传给 MacroPlannerOptimizer
* @return 填充好的 TestDataBuilder, 可直接传给 MacroPlannerOptimizer
*/
*/
public
TestDataBuilder
convert
(
String
sceneId
)
{
public
TestDataBuilder
convert
(
String
sceneId
)
{
return
MacroSceneContext
.
execute
(
sceneId
,
()
->
convertScoped
(
sceneId
));
// return MacroSceneContext.execute(sceneId, () -> convertScoped(sceneId));
return
convertScoped
(
sceneId
);
}
}
private
TestDataBuilder
convertScoped
(
String
sceneId
)
{
private
TestDataBuilder
convertScoped
(
String
sceneId
)
{
...
@@ -165,11 +167,15 @@ public class MacroPlannerDataConverter {
...
@@ -165,11 +167,15 @@ public class MacroPlannerDataConverter {
// 0. 读取时间配置, 计算 horizonEnd
// 0. 读取时间配置, 计算 horizonEnd
// endCount = 期数 (与 periodDimension 结合决定实际天数)
// endCount = 期数 (与 periodDimension 结合决定实际天数)
ApsTimeConfig
timeConfig
=
apsTimeConfigService
.
getOne
(
LambdaQueryWrapper
<
ApsTimeConfig
>
wrapper
=
new
LambdaQueryWrapper
<
ApsTimeConfig
>();
new
LambdaQueryWrapper
());
if
(!
sceneId
.
isEmpty
())
{
// wrapper.eq(ApsTimeConfig::getMpSceneId,sceneId);
}
ApsTimeConfig
timeConfig
=
apsTimeConfigService
.
getOne
(
wrapper
);
ctx
.
baseTime
=
LocalDateTime
.
of
(
2026
,
9
,
28
,
0
,
0
,
0
);
ctx
.
baseTime
=
LocalDateTime
.
of
(
2026
,
9
,
28
,
0
,
0
,
0
);
ctx
.
periodDimension
=
"
DAY
"
;
ctx
.
periodDimension
=
"
WEEK
"
;
if
(
timeConfig
!=
null
&&
timeConfig
.
getPeriodDimension
()
!=
null
if
(
timeConfig
!=
null
&&
timeConfig
.
getPeriodDimension
()
!=
null
&&
!
timeConfig
.
getPeriodDimension
().
trim
().
isEmpty
())
{
&&
!
timeConfig
.
getPeriodDimension
().
trim
().
isEmpty
())
{
ctx
.
periodDimension
=
timeConfig
.
getPeriodDimension
().
trim
().
toUpperCase
();
ctx
.
periodDimension
=
timeConfig
.
getPeriodDimension
().
trim
().
toUpperCase
();
...
...
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