perf(firstleg): streamline smart loading assignments
This commit is contained in:
+2
@@ -21,6 +21,8 @@ class PlatformSmartLoadingControllerContractTest {
|
||||
String yaml=java.nio.file.Files.readString(java.nio.file.Path.of("src/main/resources/openapi/firstleg-v1.yaml"));
|
||||
assertThat(yaml).contains("/api/platform/v1/first-leg/smart-loading/containers:")
|
||||
.contains("SmartLoadingWorkbenchContainerPageEnvelope:")
|
||||
.contains("capacityCbm: {type: number, nullable: true, description: 柜型基础容积;装柜上限按正式规则计算}")
|
||||
.contains("maxWeightKg: {type: number, nullable: true, description: 柜型基础载重;装柜上限按正式规则计算}")
|
||||
.contains("只返回 WAIT_LOADING、EDITING 或 LOADING");
|
||||
}
|
||||
@Test void openApiFreezesGlobalPagedInboundCandidates() throws Exception {
|
||||
|
||||
@@ -441,6 +441,7 @@ class SmartLoadingServiceTest {
|
||||
void pagesWorkbenchContainersWithTheSameGlobalFilters() {
|
||||
WorkbenchContainer container = new WorkbenchContainer(99L, "CB-1", "CAB-1", null,
|
||||
100L, "义乌仓", "MATSON_CLX_TRUCK", "美森正班海卡", "40HC",
|
||||
new BigDecimal("68"), new BigDecimal("28000"),
|
||||
1L, "LP-1", "EDITING", 2);
|
||||
WorkbenchContainerQuery query = new WorkbenchContainerQuery(List.of("MATSON_CLX"), 100L,
|
||||
9L, "IN-10", LocalDate.parse("2026-09-01"), LocalDate.parse("2026-09-30"),
|
||||
@@ -585,6 +586,7 @@ class SmartLoadingServiceTest {
|
||||
when(repository.plan(1L)).thenAnswer(invocation -> plan("EDITING", version.get()));
|
||||
when(repository.planByBooking(99L)).thenAnswer(invocation -> plan("EDITING", version.get()));
|
||||
when(repository.booking(99L)).thenReturn(booking());
|
||||
when(repository.inbound(10L)).thenReturn(inbound(9L, 10L));
|
||||
when(repository.candidates(100L)).thenReturn(List.of(first, second));
|
||||
when(repository.candidate(1L, 100L, 10L, 20L)).thenReturn(first);
|
||||
when(repository.candidate(1L, 100L, 11L, 21L)).thenReturn(second);
|
||||
@@ -628,6 +630,7 @@ class SmartLoadingServiceTest {
|
||||
org.mockito.ArgumentMatchers.startsWith("LOCK-"), eq(7L), eq("u"));
|
||||
verify(loadingModelBridge, times(2)).bindIncrementalAllocation(eq(1L), anyLong(), anyLong(),
|
||||
eq(7L), eq("u"), anyString());
|
||||
verify(repository, times(1)).candidates(100L);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -721,6 +724,7 @@ class SmartLoadingServiceTest {
|
||||
when(repository.plan(1L)).thenReturn(plan("EDITING", 0));
|
||||
when(repository.planByBooking(99L)).thenReturn(plan("EDITING", 0));
|
||||
when(repository.booking(99L)).thenReturn(small);
|
||||
when(repository.inbound(11L)).thenReturn(inbound(9L, 11L));
|
||||
when(repository.items(1L)).thenReturn(List.of());
|
||||
when(repository.candidates(100L)).thenReturn(List.of(first, second));
|
||||
when(repository.activeItemsByInbound(anyLong(), anyLong())).thenReturn(List.of());
|
||||
@@ -1457,6 +1461,13 @@ class SmartLoadingServiceTest {
|
||||
return candidate(9L, 10L, 20L, 30L, boxes);
|
||||
}
|
||||
|
||||
private static InboundOrderEntity inbound(long tenantId, long inboundId) {
|
||||
InboundOrderEntity value = new InboundOrderEntity();
|
||||
value.setTenantId(tenantId);
|
||||
value.setId(inboundId);
|
||||
return value;
|
||||
}
|
||||
|
||||
private static Candidate candidate(long tenantId, long inboundId, long detailId, long orderId, int boxes) {
|
||||
return candidate(tenantId, inboundId, detailId, orderId, boxes, "FBA1");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user