feat: precreate dropship pallet codes after measurement

This commit is contained in:
2026-09-11 12:12:41 +08:00
parent 69076ea712
commit e61050c490
13 changed files with 108 additions and 198 deletions
@@ -38,21 +38,16 @@ class InboundCartonLabelPrintServiceTest {
}
@Test
void dropshipPalletLabelIsAvailableOnlyAfterSeal() {
void dropshipPalletLabelIsAvailableBeforeSeal() {
Pallet open = dropshipPallet("OPEN");
assertThatThrownBy(() -> service.generateDropshipPallet(open, "request-open"))
.isInstanceOf(BizException.class)
.hasMessageContaining("已完成");
verifyNoInteractions(print);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_PDF);
when(print.generateInboundMarks(org.mockito.ArgumentMatchers.anyString(),
org.mockito.ArgumentMatchers.eq("request-sealed"), org.mockito.ArgumentMatchers.any()))
org.mockito.ArgumentMatchers.eq("request-open"), org.mockito.ArgumentMatchers.any()))
.thenReturn(new ResponseEntity<>(new byte[] {7, 8, 9}, headers,
org.springframework.http.HttpStatus.OK));
ResponseEntity<byte[]> response = service.generateDropshipPallet(dropshipPallet("SEALED"), "request-sealed");
ResponseEntity<byte[]> response = service.generateDropshipPallet(open, "PCHK2608040174", "request-open");
assertThat(response.getBody()).containsExactly(7, 8, 9);
}