test: align PDA operator warehouse contract

This commit is contained in:
2026-09-23 10:56:42 +08:00
parent 267e32ba0f
commit aa02ec9df8
2 changed files with 7 additions and 6 deletions
@@ -790,7 +790,8 @@ class LoadingListServiceTest {
@Test
void rejectsInvalidPdaOperatorBeforeConfirmingAnyPreload() {
when(domesticPdaOperators.required(any(), eq(77L)))
when(repository.aggregate(10L)).thenReturn(row("EDITING", 3));
when(domesticPdaOperators.required(any(), eq(77L), eq(100L)))
.thenReturn(ApiResponse.success(new DomesticPdaOperatorClient.Operator(88L, "其他人")));
assertThatThrownBy(() -> service.confirmPreload(10L, 9L, "operator", "invalid-operator",
@@ -826,7 +827,7 @@ class LoadingListServiceTest {
when(repository.confirmLinkedPreload(301L, "PENDING", 2, 9L, "operator")).thenReturn(1);
when(repository.confirmLinkedPreload(302L, "CONFIRMING", 5, 9L, "operator")).thenReturn(1);
when(repository.preloadDetail(after)).thenReturn(detail);
when(domesticPdaOperators.required(any(), eq(77L)))
when(domesticPdaOperators.required(any(), eq(77L), eq(100L)))
.thenReturn(ApiResponse.success(new DomesticPdaOperatorClient.Operator(77L, "作业员")));
LoadingPickTaskEntity pickTask = new LoadingPickTaskEntity();
pickTask.setId(80L);
@@ -862,7 +863,7 @@ class LoadingListServiceTest {
when(fbaPricingService.recalculateUnlockedContainerCustomerFees(eq(30L), eq(101L), anyString()))
.thenReturn(new FbaPricingService.ContainerFeeRecalculationResult(
FbaPricingService.ContainerFeeRecalculationStatus.NOT_READY, 0));
when(domesticPdaOperators.required(any(), eq(77L)))
when(domesticPdaOperators.required(any(), eq(77L), eq(100L)))
.thenReturn(ApiResponse.success(new DomesticPdaOperatorClient.Operator(77L, "作业员")));
assertThatThrownBy(() -> service.confirmPreload(
@@ -924,7 +925,7 @@ class LoadingListServiceTest {
AggregateRow confirmed = row("EDITING", 4);
when(repository.history(anyString())).thenReturn(null);
when(repository.aggregate(10L)).thenReturn(confirmed);
when(domesticPdaOperators.required(any(), eq(77L)))
when(domesticPdaOperators.required(any(), eq(77L), eq(100L)))
.thenReturn(ApiResponse.success(new DomesticPdaOperatorClient.Operator(77L, "作业员")));
when(loadingPickService.requirePreloadConfirmationReady(10L))
.thenThrow(new BizException(ResultCode.CONFLICT, "预装计划已确认"));
@@ -947,7 +948,7 @@ class LoadingListServiceTest {
AggregateRow before = row("EDITING", 3);
when(repository.history(anyString())).thenReturn(null);
when(repository.aggregate(10L)).thenReturn(before);
when(domesticPdaOperators.required(any(), eq(77L)))
when(domesticPdaOperators.required(any(), eq(77L), eq(100L)))
.thenReturn(ApiResponse.success(new DomesticPdaOperatorClient.Operator(77L, "作业员")));
when(loadingPickService.requirePreloadConfirmationReady(10L))
.thenThrow(new BizException(ResultCode.CONFLICT, "第二票订舱尚未放舱"));
@@ -630,7 +630,7 @@ class LoadingPickServiceTest {
when(repository.taskForUpdate(20L)).thenReturn(task);
when(repository.task(20L)).thenReturn(task);
when(repository.items(20L)).thenReturn(List.of());
when(domesticPdaOperators.required(any(), eq(11L)))
when(domesticPdaOperators.required(any(), eq(11L), eq(101L)))
.thenReturn(ApiResponse.success(new DomesticPdaOperatorClient.Operator(11L, "picker")));
Task replay = service.assign(20L, new AssignRequest(11L, "picker", 0, "assign-race"),