This commit is contained in:
2026-09-14 15:51:52 +08:00
parent 13d2fe8e3a
commit f9fa859391
7 changed files with 19 additions and 11 deletions
@@ -273,7 +273,7 @@ class InternalPdfControllerTest {
"downloadFileName": "DP-260911-0034-A4托盘信息单.pdf",
"documents": [{
"palletNo": "DP-260911-0034",
"destinationWarehouse": "纽约 N.JDF",
"destinationWarehouse": "纽约 NJDF",
"palletSequence": 1,
"totalPallets": 3,
"barcodeContent": "DP-260911-0034",
@@ -27,7 +27,7 @@ class DropshipPalletA4PdfServiceGenerationTest {
@Test
void generatesOneA4PageWithPalletBarcodeAndSkuDetails() throws Exception {
DropshipPalletA4PdfDtos.Document document = new DropshipPalletA4PdfDtos.Document(
"DP-260911-0034", "纽约 N.JDF", 1, 3, "DP-260911-0034",
"DP-260911-0034", "纽约 NJDF", 1, 3, "DP-260911-0034",
List.of(new DropshipPalletA4PdfDtos.InboundRow(
"NYEXX2609110249", "小虫科技", 3, 90)),
List.of(
@@ -44,7 +44,7 @@ class DropshipPalletA4PdfServiceGenerationTest {
assertThat(pdf.getPage(0).getMediaBox().getWidth()).isCloseTo(PdfUnits.mmToPt(210), org.assertj.core.data.Offset.offset(.002f));
assertThat(pdf.getPage(0).getMediaBox().getHeight()).isCloseTo(PdfUnits.mmToPt(297), org.assertj.core.data.Offset.offset(.002f));
assertThat(new PDFTextStripper().getText(pdf))
.contains("DP-260911-0034", "N.JDF", "NYEXX2609110249",
.contains("DP-260911-0034", "NJDF", "NYEXX2609110249",
"SKU-001", "SKU-002", "40", "50")
.containsOnlyOnce("DP-260911-0034")
.doesNotContain("状态", "待封托", "已封托", "重量", "体积");
@@ -64,7 +64,7 @@ class DropshipPalletA4PdfServiceGenerationTest {
"SKU-" + String.format("%03d", index), 2, index * 5, "5-10"));
}
DropshipPalletA4PdfDtos.Document document = new DropshipPalletA4PdfDtos.Document(
"DP-260911-0034", "纽约 N.JDF", 1, 1,
"DP-260911-0034", "纽约 NJDF", 1, 1,
"DP-260911-0034", inboundRows, rows);
var generated = service.generate(new DropshipPalletA4PdfDtos.Request(
DropshipPalletA4PdfDtos.TEMPLATE,
@@ -85,7 +85,7 @@ class DropshipPalletA4PdfServiceGenerationTest {
rows.add(new DropshipPalletA4PdfDtos.SkuRow("SKU-" + index, 1, 1, "1"));
}
DropshipPalletA4PdfDtos.Document document = new DropshipPalletA4PdfDtos.Document(
"DP-260911-0034", "纽约 N.JDF", 1, 1, "DP-260911-0034",
"DP-260911-0034", "纽约 NJDF", 1, 1, "DP-260911-0034",
List.of(new DropshipPalletA4PdfDtos.InboundRow("INBOUND", "客户", 35, 35)), rows);
assertThatThrownBy(() -> service.generate(new DropshipPalletA4PdfDtos.Request(