feat:出库单一键设置功能及移库单CRUD

This commit is contained in:
zhouz
2026-07-28 16:21:22 +08:00
parent 9e43129c37
commit 04ffd865a3
56 changed files with 2638 additions and 23 deletions

View File

@@ -0,0 +1,47 @@
package cn.code.nl.module.wms.service.iostorinv;
import org.junit.jupiter.api.Test;
import java.util.List;
import static org.junit.jupiter.api.Assertions.assertEquals;
class OutboundPlacementPlannerTest {
@Test
void shouldMoveBlockingBoxBeforeOutboundFromLeft() {
List<OutboundPlacementPlanner.Action> actions = OutboundPlacementPlanner.plan("02", List.of(
new OutboundPlacementPlanner.Slot("S1", 1, "BLOCKER", false),
new OutboundPlacementPlanner.Slot("S2", 2, "TARGET", true),
new OutboundPlacementPlanner.Slot("S3", 3, null, false)));
assertEquals(List.of(
new OutboundPlacementPlanner.Action("MOVE", "S1", "BLOCKER"),
new OutboundPlacementPlanner.Action("OUT", "S2", "TARGET")), actions);
}
@Test
void shouldMoveBlockingBoxBeforeOutboundFromRight() {
List<OutboundPlacementPlanner.Action> actions = OutboundPlacementPlanner.plan("03", List.of(
new OutboundPlacementPlanner.Slot("S1", 1, null, false),
new OutboundPlacementPlanner.Slot("S2", 2, "TARGET", true),
new OutboundPlacementPlanner.Slot("S3", 3, "BLOCKER", false)));
assertEquals(List.of(
new OutboundPlacementPlanner.Action("MOVE", "S3", "BLOCKER"),
new OutboundPlacementPlanner.Action("OUT", "S2", "TARGET")), actions);
}
@Test
void shouldChooseSideWithFewerBlockingBoxesForDoubleAccess() {
List<OutboundPlacementPlanner.Action> actions = OutboundPlacementPlanner.plan("01", List.of(
new OutboundPlacementPlanner.Slot("S1", 1, "BLOCKER-1", false),
new OutboundPlacementPlanner.Slot("S2", 2, "BLOCKER-2", false),
new OutboundPlacementPlanner.Slot("S3", 3, "TARGET", true),
new OutboundPlacementPlanner.Slot("S4", 4, "BLOCKER-3", false)));
assertEquals(List.of(
new OutboundPlacementPlanner.Action("MOVE", "S4", "BLOCKER-3"),
new OutboundPlacementPlanner.Action("OUT", "S3", "TARGET")), actions);
}
}

View File

@@ -0,0 +1,34 @@
package cn.code.nl.module.wms.service.moveinv;
import cn.code.nl.module.wms.dal.dataobject.structAttr.StrucAttrDO;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.List;
import java.util.Set;
class MoveTargetStructSelectorTest {
@Test
void shouldSelectNearestAvailableStructAndExcludeUsedTarget() {
StrucAttrDO source = struct("S", 1, 10, 2, 1);
StrucAttrDO farther = struct("T1", 1, 15, 2, 1);
StrucAttrDO nearest = struct("T2", 1, 11, 2, 1);
StrucAttrDO used = struct("T3", 1, 9, 2, 1);
StrucAttrDO result = MoveTargetStructSelector.select(
source, List.of(farther, nearest, used), Set.of("T3"));
Assertions.assertEquals("T2", result.getStructId());
}
private StrucAttrDO struct(String id, int row, int col, int layer, int block) {
return StrucAttrDO.builder()
.structId(id)
.rowNum(row)
.colNum(col)
.layerNum(layer)
.blockNum(block)
.build();
}
}