fix(lastleg): restore overseas receiving build
This commit is contained in:
+1
-1
@@ -451,7 +451,7 @@ public class ReceivingContainerService {
|
|||||||
.map(ReceivingContainerRequests.SignedPhoto::role).collect(Collectors.toSet());
|
.map(ReceivingContainerRequests.SignedPhoto::role).collect(Collectors.toSet());
|
||||||
if (roles.size() != 3 || roles.contains(null)) throw conflict("Each unload photo role is required exactly once");
|
if (roles.size() != 3 || roles.contains(null)) throw conflict("Each unload photo role is required exactly once");
|
||||||
Set<Long> fileIds = request.photos().stream().map(ReceivingContainerRequests.SignedPhoto::fileId)
|
Set<Long> fileIds = request.photos().stream().map(ReceivingContainerRequests.SignedPhoto::fileId)
|
||||||
.boxed().collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
if (fileIds.size() != 3 || fileIds.stream().anyMatch(value -> value == null || value <= 0)) {
|
if (fileIds.size() != 3 || fileIds.stream().anyMatch(value -> value == null || value <= 0)) {
|
||||||
throw conflict("Unload photo file IDs must be positive and unique");
|
throw conflict("Unload photo file IDs must be positive and unique");
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-3
@@ -65,8 +65,9 @@ class ReceivingContainerContractTest {
|
|||||||
assertTrue(schema.contains("create table if not exists ll_receiving_container_operation"));
|
assertTrue(schema.contains("create table if not exists ll_receiving_container_operation"));
|
||||||
assertTrue(schema.contains("create table if not exists ll_receiving_sku_receipt"));
|
assertTrue(schema.contains("create table if not exists ll_receiving_sku_receipt"));
|
||||||
assertTrue(schema.contains("unique key uk_ll_receiving_sku_pallet (customer_id,line_id,pallet_id,sku_code)"));
|
assertTrue(schema.contains("unique key uk_ll_receiving_sku_pallet (customer_id,line_id,pallet_id,sku_code)"));
|
||||||
assertTrue(schema.contains("sign_photos json"));
|
String receivingSession = tableBlock(schema, "ll_receiving_container_session");
|
||||||
assertFalse(schema.contains("photo_file_ids json"));
|
assertTrue(receivingSession.contains("sign_photos json"));
|
||||||
|
assertFalse(receivingSession.contains("photo_file_ids json"));
|
||||||
assertTrue(unified.contains("create table if not exists ll_receiving_sku_receipt"));
|
assertTrue(unified.contains("create table if not exists ll_receiving_sku_receipt"));
|
||||||
assertTrue(unified.contains("column_name='sign_photos'"));
|
assertTrue(unified.contains("column_name='sign_photos'"));
|
||||||
assertTrue(schema.contains("wait_sign、signed、receiving、completed"));
|
assertTrue(schema.contains("wait_sign、signed、receiving、completed"));
|
||||||
@@ -93,7 +94,7 @@ class ReceivingContainerContractTest {
|
|||||||
assertTrue(successResponses.stream().allMatch(line ->
|
assertTrue(successResponses.stream().allMatch(line ->
|
||||||
line.contains("content: { application/json: { schema: { $ref: '#/components/schemas/Receiving")));
|
line.contains("content: { application/json: { schema: { $ref: '#/components/schemas/Receiving")));
|
||||||
assertTrue(receivingPaths.contains("返回 WAIT_SIGN、SIGNED 或 RECEIVING 当前柜"));
|
assertTrue(receivingPaths.contains("返回 WAIT_SIGN、SIGNED 或 RECEIVING 当前柜"));
|
||||||
assertTrue(receivingPaths.contains("LICENSE_PLATE, CONTAINER_SEAL, DOOR_OPEN"));
|
assertTrue(yaml.contains("enum: [LICENSE_PLATE, CONTAINER_SEAL, DOOR_OPEN]"));
|
||||||
assertFalse(receivingPaths.contains("photoFileIds"));
|
assertFalse(receivingPaths.contains("photoFileIds"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -134,7 +134,7 @@ class InboundStockReceiptServiceTest {
|
|||||||
ArgumentCaptor<InventoryCommandRequests.StockIn> requests = ArgumentCaptor.forClass(InventoryCommandRequests.StockIn.class);
|
ArgumentCaptor<InventoryCommandRequests.StockIn> requests = ArgumentCaptor.forClass(InventoryCommandRequests.StockIn.class);
|
||||||
verify(inventory, times(2)).stockIn(eq("100"), eq("operator"), requests.capture());
|
verify(inventory, times(2)).stockIn(eq("100"), eq("operator"), requests.capture());
|
||||||
assertEquals(java.util.Set.of("SKU-1:2001", "SKU-2:2002"), requests.getAllValues().stream()
|
assertEquals(java.util.Set.of("SKU-1:2001", "SKU-2:2002"), requests.getAllValues().stream()
|
||||||
.map(value -> value.skuCode() + ":" + value.warehousePalletId()).collect(java.util.stream.Collectors.toSet()));
|
.map(value -> value.skuCode() + ":" + value.palletId()).collect(java.util.stream.Collectors.toSet()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
+14
@@ -197,6 +197,7 @@ class ReceivingContainerServiceBehaviorTest {
|
|||||||
@Test
|
@Test
|
||||||
void localFailureAfterRemoteReservationTriggersReleaseCompensation() {
|
void localFailureAfterRemoteReservationTriggersReleaseCompensation() {
|
||||||
stubCurrent("FBA", "CONT-A");
|
stubCurrent("FBA", "CONT-A");
|
||||||
|
stubSku();
|
||||||
when(warehouse.resolvePallet("PAL-1")).thenReturn(resource(100L, "FBA-1"));
|
when(warehouse.resolvePallet("PAL-1")).thenReturn(resource(100L, "FBA-1"));
|
||||||
when(pallets.selectList(any())).thenReturn(List.of(planPallet()));
|
when(pallets.selectList(any())).thenReturn(List.of(planPallet()));
|
||||||
when(workflow.assignResolvedPallet(any(), any(), any(), any())).thenReturn(55L);
|
when(workflow.assignResolvedPallet(any(), any(), any(), any())).thenReturn(55L);
|
||||||
@@ -244,6 +245,19 @@ class ReceivingContainerServiceBehaviorTest {
|
|||||||
verifyNoInteractions(unloadPhotos);
|
verifyNoInteractions(unloadPhotos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void signRejectsDuplicateFileIdsBeforeFileValidation() {
|
||||||
|
when(sessions.lockActiveByOperator("100", "100:7")).thenReturn(session("CONT-A", "WAIT_SIGN"));
|
||||||
|
ReceivingContainerRequests.Sign request = new ReceivingContainerRequests.Sign(List.of(
|
||||||
|
new ReceivingContainerRequests.SignedPhoto(ReceivingPhotoRole.LICENSE_PLATE, 1L),
|
||||||
|
new ReceivingContainerRequests.SignedPhoto(ReceivingPhotoRole.CONTAINER_SEAL, 1L),
|
||||||
|
new ReceivingContainerRequests.SignedPhoto(ReceivingPhotoRole.DOOR_OPEN, 3L)), "invalid-files");
|
||||||
|
|
||||||
|
assertThatThrownBy(() -> service.sign("100", "7", "receiver", request))
|
||||||
|
.isInstanceOf(ResponseStatusException.class).hasMessageContaining("409");
|
||||||
|
verifyNoInteractions(unloadPhotos);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void bulkRejectsSkuOverReceiptBeforeWarehouseLookup() {
|
void bulkRejectsSkuOverReceiptBeforeWarehouseLookup() {
|
||||||
stubCurrent("FBA", "CONT-A");
|
stubCurrent("FBA", "CONT-A");
|
||||||
|
|||||||
Reference in New Issue
Block a user