fix: 按物理箱贯通一件代发履约箱数

This commit is contained in:
2026-09-16 20:49:35 +08:00
parent 8797c0bef9
commit 545ad2083d
34 changed files with 779 additions and 132 deletions
@@ -245,6 +245,29 @@ class InboundStockReceiptServiceTest {
assertEquals("WH-PALLET-21", activationReceipts.getValue().get(0).getPalletNo());
}
@Test
void multiSkuDropshipPalletStocksPhysicalCartonsOnce() {
Fixture fixture = fixture(5, 5, 5, 10);
fixture.order.setOrderType("ONE_CLICK_DROPSHIP");
when(dropshipOrders.palletSnapshots("100", 101L)).thenReturn(List.of(
new DropshipPalletSnapshot("PLT-21", 5, List.of(
new DropshipPalletSnapshot.Sku("SKU-A", "A", 5, 50),
new DropshipPalletSnapshot.Sku("SKU-B", "B", 5, 25)))));
when(orders.selectBatchIds(any())).thenReturn(List.of(fixture.order));
when(inventory.stockIn(eq("100"), eq("operator"), any(InventoryCommandRequests.StockIn.class)))
.thenReturn(new InventoryCommandResponse(8L, "STOCK_IN", 9L, 10L, 5, 0, 0, 0, false, false));
service.stockIn("100", fixture.plan, fixture.task, List.of(fixture.line),
List.of(fixture.allocation), List.of(fixture.pallet), LocalDateTime.now());
ArgumentCaptor<InventoryCommandRequests.StockIn> request =
ArgumentCaptor.forClass(InventoryCommandRequests.StockIn.class);
verify(inventory, times(1)).stockIn(eq("100"), eq("operator"), request.capture());
assertEquals("MIXED", request.getValue().skuCode());
assertEquals(5, request.getValue().packages());
verify(receipts, times(1)).insert(any(InboundStockReceipt.class));
}
@Test
void rejectsDomesticSourceWarehouseAsActualOverseasWarehouse() {
Fixture fixture = fixture(5, 5, 5, 10);