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
2c825897
Commit
2c825897
authored
Sep 09, 2026
by
DESKTOP-VKRD9QF\Administration
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://39.100.78.207:1213/tongli/hyh.apsj
parents
3a617ad9
7b9698da
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
optimization_result_1.json
mp/result/optimization_result_1.json
+1
-1
MultiLevelBomTestDataBuilder.java
...m/aps/macroplanner/data/MultiLevelBomTestDataBuilder.java
+14
-14
No files found.
mp/result/optimization_result_1.json
View file @
2c825897
This diff is collapsed.
Click to expand it.
src/main/java/com/aps/macroplanner/data/MultiLevelBomTestDataBuilder.java
View file @
2c825897
...
@@ -3,6 +3,7 @@ package com.aps.macroplanner.data;
...
@@ -3,6 +3,7 @@ package com.aps.macroplanner.data;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
/**
/**
* 多级 BOM + 多成品 + 共享半成品 测试数据构建器。
* 多级 BOM + 多成品 + 共享半成品 测试数据构建器。
...
@@ -46,11 +47,11 @@ public class MultiLevelBomTestDataBuilder extends TestDataBuilder {
...
@@ -46,11 +47,11 @@ public class MultiLevelBomTestDataBuilder extends TestDataBuilder {
// === 产品: 成品 P1, P2 + 半成品 S1 + 原材料 R1, R2 ===
// === 产品: 成品 P1, P2 + 半成品 S1 + 原材料 R1, R2 ===
Product
prodP1
=
new
Product
(
"P1"
,
"成品P1"
);
Product
prodP1
=
new
Product
(
"P1"
,
"成品P1"
);
Product
prodP2
=
new
Product
(
"P2"
,
"成品P2"
);
//
Product prodP2 = new Product("P2", "成品P2");
Product
prodS1
=
new
Product
(
"S1"
,
"半成品S1"
);
Product
prodS1
=
new
Product
(
"S1"
,
"半成品S1"
);
Product
prodR1
=
new
Product
(
"R1"
,
"原材料R1"
);
Product
prodR1
=
new
Product
(
"R1"
,
"原材料R1"
);
Product
prodR2
=
new
Product
(
"R2"
,
"原材料R2"
);
Product
prodR2
=
new
Product
(
"R2"
,
"原材料R2"
);
products
.
addAll
(
Arrays
.
asList
(
prodP1
,
prod
P2
,
prod
S1
,
prodR1
,
prodR2
));
products
.
addAll
(
Arrays
.
asList
(
prodP1
,
prodS1
,
prodR1
,
prodR2
));
// === 库存点: 每种产品一个库存点 ===
// === 库存点: 每种产品一个库存点 ===
StockingPoint
spP1
=
new
StockingPoint
(
"SP_P1"
,
"P1成品库"
);
StockingPoint
spP1
=
new
StockingPoint
(
"SP_P1"
,
"P1成品库"
);
...
@@ -62,17 +63,18 @@ public class MultiLevelBomTestDataBuilder extends TestDataBuilder {
...
@@ -62,17 +63,18 @@ public class MultiLevelBomTestDataBuilder extends TestDataBuilder {
// === 产品→库存点映射 ===
// === 产品→库存点映射 ===
productSpMappings
.
add
(
new
ProductSpMapping
(
prodP1
,
spP1
));
productSpMappings
.
add
(
new
ProductSpMapping
(
prodP1
,
spP1
));
productSpMappings
.
add
(
new
ProductSpMapping
(
prodP2
,
spP2
));
//
productSpMappings.add(new ProductSpMapping(prodP2, spP2));
productSpMappings
.
add
(
new
ProductSpMapping
(
prodS1
,
spSemi
));
productSpMappings
.
add
(
new
ProductSpMapping
(
prodS1
,
spSemi
));
productSpMappings
.
add
(
new
ProductSpMapping
(
prodR1
,
spR1
));
productSpMappings
.
add
(
new
ProductSpMapping
(
prodR1
,
spR1
));
productSpMappings
.
add
(
new
ProductSpMapping
(
prodR2
,
spR2
));
productSpMappings
.
add
(
new
ProductSpMapping
(
prodR2
,
spR2
));
// === 生产工序: 成品 + 半成品 ===
// === 生产工序: 成品 + 半成品 ===
List
<
UnitOperation
>
UnitOperations
=
Arrays
.
asList
(
new
UnitOperation
(
"Unit_P1"
,
""
,
1
,
false
,
0
,
1
),
new
UnitOperation
(
"Unit_P1_1"
,
""
,
2
,
false
,
0
,
1
));
// P1: 消耗 S1×2.0 + R1×3.0, 产出 P1@SP_P1
// P1: 消耗 S1×2.0 + R1×3.0, 产出 P1@SP_P1
Operation
opP1
=
new
Operation
(
"OP_P1"
,
"生产P1"
,
"Unit_P1"
,
Operation
opP1
=
new
Operation
(
"OP_P1"
,
"生产P1"
,
UnitOperations
,
new
OperationOutput
(
prodP1
,
spP1
),
1.0
,
1.0
,
false
,
0
,
1.0
);
new
OperationOutput
(
prodP1
,
spP1
),
1.0
,
0
);
Operation
opP1_1
=
new
Operation
(
"OP_P1_1"
,
"生产P1"
,
"Unit_P1_1"
,
new
OperationOutput
(
prodP1
,
spP1
),
2.0
,
1.0
,
false
,
0
,
1.0
);
// P2: 消耗 S1×1.0, 产出 P2@SP_P2
// P2: 消耗 S1×1.0, 产出 P2@SP_P2
// Operation opP2 = new Operation("OP_P2", "生产P2", "Unit_P2",
// Operation opP2 = new Operation("OP_P2", "生产P2", "Unit_P2",
...
@@ -81,7 +83,7 @@ public class MultiLevelBomTestDataBuilder extends TestDataBuilder {
...
@@ -81,7 +83,7 @@ public class MultiLevelBomTestDataBuilder extends TestDataBuilder {
Operation
opS1
=
new
Operation
(
"OP_S1"
,
"生产S1"
,
"Unit_S1"
,
Operation
opS1
=
new
Operation
(
"OP_S1"
,
"生产S1"
,
"Unit_S1"
,
new
OperationOutput
(
prodS1
,
spSemi
),
1.0
,
1.0
,
false
,
0
,
1.0
);
new
OperationOutput
(
prodS1
,
spSemi
),
1.0
,
1.0
,
false
,
0
,
1.0
);
// operations.addAll(Arrays.asList(opP1,opP1_1, opP2, opS1));
// operations.addAll(Arrays.asList(opP1,opP1_1, opP2, opS1));
operations
.
addAll
(
Arrays
.
asList
(
opP1
,
opP1_1
,
opS1
));
operations
.
addAll
(
Arrays
.
asList
(
opP1
,
opS1
));
// === 原材料采购工序 ===
// === 原材料采购工序 ===
Operation
opProcureR1
=
new
Operation
(
"OP_Procure_R1"
,
"采购R1"
,
"Unit_R1"
,
Operation
opProcureR1
=
new
Operation
(
"OP_Procure_R1"
,
"采购R1"
,
"Unit_R1"
,
...
@@ -94,8 +96,6 @@ public class MultiLevelBomTestDataBuilder extends TestDataBuilder {
...
@@ -94,8 +96,6 @@ public class MultiLevelBomTestDataBuilder extends TestDataBuilder {
operationInputs
.
add
(
new
OperationInput
(
opP1
,
prodS1
,
spSemi
,
2.0
));
operationInputs
.
add
(
new
OperationInput
(
opP1
,
prodS1
,
spSemi
,
2.0
));
operationInputs
.
add
(
new
OperationInput
(
opP1
,
prodR1
,
spR1
,
3.0
));
operationInputs
.
add
(
new
OperationInput
(
opP1
,
prodR1
,
spR1
,
3.0
));
operationInputs
.
add
(
new
OperationInput
(
opP1_1
,
prodS1
,
spSemi
,
2.0
));
operationInputs
.
add
(
new
OperationInput
(
opP1_1
,
prodR1
,
spR1
,
3.0
));
// === BOM 投料: P2 消耗 S1×1.0 ===
// === BOM 投料: P2 消耗 S1×1.0 ===
// operationInputs.add(new OperationInput(opP2, prodS1, spSemi, 1.0));
// operationInputs.add(new OperationInput(opP2, prodS1, spSemi, 1.0));
...
@@ -116,7 +116,7 @@ public class MultiLevelBomTestDataBuilder extends TestDataBuilder {
...
@@ -116,7 +116,7 @@ public class MultiLevelBomTestDataBuilder extends TestDataBuilder {
// === 初始库存: 全部从 0 开始 ===
// === 初始库存: 全部从 0 开始 ===
initialInventories
.
add
(
new
InitialInventory
(
prodP1
,
spP1
,
0.0
));
initialInventories
.
add
(
new
InitialInventory
(
prodP1
,
spP1
,
0.0
));
initialInventories
.
add
(
new
InitialInventory
(
prodP2
,
spP2
,
0.0
));
//
initialInventories.add(new InitialInventory(prodP2, spP2, 0.0));
initialInventories
.
add
(
new
InitialInventory
(
prodS1
,
spSemi
,
0.0
));
initialInventories
.
add
(
new
InitialInventory
(
prodS1
,
spSemi
,
0.0
));
initialInventories
.
add
(
new
InitialInventory
(
prodR1
,
spR1
,
0.0
));
initialInventories
.
add
(
new
InitialInventory
(
prodR1
,
spR1
,
0.0
));
initialInventories
.
add
(
new
InitialInventory
(
prodR2
,
spR2
,
0.0
));
initialInventories
.
add
(
new
InitialInventory
(
prodR2
,
spR2
,
0.0
));
...
@@ -131,8 +131,8 @@ public class MultiLevelBomTestDataBuilder extends TestDataBuilder {
...
@@ -131,8 +131,8 @@ public class MultiLevelBomTestDataBuilder extends TestDataBuilder {
for
(
Period
p
:
periods
)
{
for
(
Period
p
:
periods
)
{
inventorySpecs
.
add
(
new
InventorySpec
(
prodP1
,
spP1
,
p
,
inventorySpecs
.
add
(
new
InventorySpec
(
prodP1
,
spP1
,
p
,
80.0
,
10.0
,
200.0
,
true
,
true
,
true
));
80.0
,
10.0
,
200.0
,
true
,
true
,
true
));
inventorySpecs
.
add
(
new
InventorySpec
(
prodP2
,
spP2
,
p
,
//
inventorySpecs.add(new InventorySpec(prodP2, spP2, p,
60.0
,
10.0
,
200.0
,
true
,
true
,
true
));
//
60.0, 10.0, 200.0, true, true, true));
inventorySpecs
.
add
(
new
InventorySpec
(
prodS1
,
spSemi
,
p
,
inventorySpecs
.
add
(
new
InventorySpec
(
prodS1
,
spSemi
,
p
,
100.0
,
10.0
,
300.0
,
true
,
true
,
true
));
100.0
,
10.0
,
300.0
,
true
,
true
,
true
));
inventorySpecs
.
add
(
new
InventorySpec
(
prodR1
,
spR1
,
p
,
inventorySpecs
.
add
(
new
InventorySpec
(
prodR1
,
spR1
,
p
,
...
...
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