fix(lastleg): generate sequenced outbound task numbers

This commit is contained in:
2026-10-23 18:45:47 +08:00
parent 7ef8411ea4
commit a8192f51fe
6 changed files with 12 additions and 9 deletions
@@ -845,9 +845,13 @@ class DeliveryTransferServiceTest {
when(inventoryPositions.selectById(901L)).thenReturn(position);
when(inventoryBalances.selectById(801L)).thenReturn(balance);
service.createOneClick("TENANT-A", "U-1", new DeliveryRequests.OneClickOutbound("recipient", List.of(
var result = service.createOneClick("TENANT-A", "U-1", new DeliveryRequests.OneClickOutbound("recipient", List.of(
new DeliveryRequests.OneClickItem(901L, 2L, "SKU-1")), null, "split-metrics"));
// 出库单和作业任务各自使用独立日流水,不暴露内部雪花 ID。
assertEquals("DFCK202610200001", result.outboundNo());
assertEquals("PDA202610200001", result.taskNo());
ArgumentCaptor<OutboundPalletItem> item = ArgumentCaptor.forClass(OutboundPalletItem.class);
verify(outboundPallets).insert(item.capture());
assertEquals(new BigDecimal("20.000"), item.getValue().getGrossWeightKg());