贴标申请,仓储转运

This commit is contained in:
2026-09-20 15:06:17 +08:00
parent a7d458cddd
commit 02844da360
56 changed files with 2121 additions and 111 deletions
@@ -352,6 +352,42 @@ class WarehouseTransferServiceTest {
assertEquals("WAREHOUSE_PICKUP", transfer.getValue().getDeliveryMethod());
}
@Test
void bindingDestinationReleasesLinkedRelabelForPreDispatch() {
WarehouseTransferOrder transfer = transfer(WarehouseTransferService.WAIT_FBA_DESTINATION);
transfer.setNeedRelabel(true);
transfer.setRelabelNo("FBR-1");
transfer.setFbaWarehouseCode(null);
LastlegOrder order = tailOrder();
RelabelApplication relabel = new RelabelApplication();
relabel.setId(71L);
relabel.setCustomerId("TENANT-A");
relabel.setRelabelNo("FBR-1");
relabel.setFulfillmentStatus("WAIT_FBA_DESTINATION");
InboundPlan plan = new InboundPlan();
plan.setId(81L);
when(transfers.lockNo("TENANT-A", "WTR-1")).thenReturn(transfer);
when(transfers.findNo("TENANT-A", "WTR-1")).thenReturn(transfer);
when(orders.selectById(transfer.getLastlegOrderId())).thenReturn(order);
when(orderDetails.selectList(any())).thenReturn(List.of());
when(inboundPlans.findBySourceOrder("TENANT-A", transfer.getLastlegOrderId())).thenReturn(plan);
when(inboundPlanLines.selectList(any())).thenReturn(List.of());
when(inboundPlanPallets.selectList(any())).thenReturn(List.of());
when(relabelApplications.lockNo("TENANT-A", "FBR-1")).thenReturn(relabel);
when(transferItems.selectList(any())).thenReturn(List.of());
when(sourceOrders.selectList(any())).thenReturn(List.of());
when(transferPallets.listOrder("TENANT-A", transfer.getId())).thenReturn(List.of());
service.bindDestination("OP-1", new WarehouseTransferRequests.BindDestination(
List.of(new WarehouseTransferRequests.DestinationSelection("TENANT-A", "WTR-1")),
"FBA", null, "ONT8", "ONT8", null, null, null, null, "BIND-1"));
assertEquals(WarehouseTransferService.READY_FOR_DISPATCH, transfer.getStatus());
assertEquals("WAIT_PRE_DISPATCH", relabel.getFulfillmentStatus());
verify(relabelApplications).updateById(relabel);
}
@Test
void newTransitInboundCreatesSnapshotAndImmutableCartonMarksWithoutHistoricalInventory() {
WarehouseTransferRequests.Create request = new WarehouseTransferRequests.Create(
@@ -645,6 +681,7 @@ class WarehouseTransferServiceTest {
ArgumentCaptor.forClass(com.baiyue.lastleg.inventory.command.dto.InventoryCommandRequests.StockIn.class);
verify(inventory).stockIn(eq("TENANT-A"), eq("USER-1"), stockIn.capture());
assertEquals(5, stockIn.getValue().packages());
assertEquals("Customer A", stockIn.getValue().customerName());
assertEquals("SKU-TRANSFER", stockIn.getValue().skuCode());
assertEquals("WTR-1", stockIn.getValue().businessOrderNo());
assertEquals("WAREHOUSE_TRANSFER_RECEIPT:WTR-1:501", stockIn.getValue().idempotencyKey());
@@ -840,6 +877,7 @@ class WarehouseTransferServiceTest {
private static InventoryBalance balance(long id, long inboundOrderId, String inboundCode) {
InventoryBalance balance = new InventoryBalance();
balance.setId(id); balance.setCustomerId("TENANT-A"); balance.setInboundOrderId(inboundOrderId);
balance.setCustomerName("Customer A");
balance.setInboundCode(inboundCode); balance.setSkuCode("SKU-TRANSFER");
return balance;
}