From 059757507aa6e37c4dc65823bb24e953b08e7d0e Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Mon, 14 Sep 2026 15:33:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../renderer/DropshipPalletA4Renderer.java | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/print/src/main/java/com/baiyue/print/renderer/DropshipPalletA4Renderer.java b/print/src/main/java/com/baiyue/print/renderer/DropshipPalletA4Renderer.java index af9f18a0e..1ff6f3f64 100644 --- a/print/src/main/java/com/baiyue/print/renderer/DropshipPalletA4Renderer.java +++ b/print/src/main/java/com/baiyue/print/renderer/DropshipPalletA4Renderer.java @@ -16,10 +16,9 @@ import org.springframework.stereotype.Component; /** 每个托盘一页 A4:托盘码、目的仓、入仓码汇总和 SKU 汇总。 */ @Component public class DropshipPalletA4Renderer { - private static final Color BLUE = new Color(20, 89, 156); - private static final Color LIGHT_BLUE = new Color(225, 239, 251); - private static final Color TABLE_HEADER = new Color(238, 242, 247); - private static final Color RED = new Color(180, 43, 36); + private static final Color INK = Color.BLACK; + private static final Color LIGHT_GRAY = new Color(242, 242, 242); + private static final Color TABLE_HEADER = new Color(232, 232, 232); private static final float[] INBOUND_COLS = {18, 27, 79, 146, 169, 192}; private static final String[] INBOUND_HEADERS = {"#", "入仓码", "客户", "箱数", "件数"}; private static final float[] SKU_COLS = {18, 132, 154, 176, 192}; @@ -35,7 +34,7 @@ public class DropshipPalletA4Renderer { try (PDPageContentStream stream = new PDPageContentStream(pdf, page)) { stream.setLineWidth(PdfUnits.mmToPt(.25)); border(stream, units); - colorText(stream, units, font, "一件代发备货托", 14, 18, 22, BLUE); + colorText(stream, units, font, "一件代发备货托", 14, 18, 22, INK); rightText(stream, units, font, "第 " + data.palletSequence() + " 托 / 共 " + data.totalPallets() + " 托", 10, 192, 22, new Color(75, 75, 75)); @@ -44,9 +43,9 @@ public class DropshipPalletA4Renderer { PdfUnits.mmToPt(80), PdfUnits.mmToPt(22)); fittedText(stream, units, font, data.palletNo(), 25, 105, 44, 87, Color.BLACK); - fill(stream, units, LIGHT_BLUE, 10, 57, 200, 82); - colorText(stream, units, font, "目的仓", 7.5f, 18, 66, BLUE); - fittedText(stream, units, font, data.destinationWarehouse(), 20, 18, 77, 174, BLUE); + fill(stream, units, LIGHT_GRAY, 10, 57, 200, 82); + colorText(stream, units, font, "目的仓", 7.5f, 18, 66, INK); + fittedText(stream, units, font, data.destinationWarehouse(), 20, 18, 77, 174, INK); int rowCount = data.inboundRows().size() + 1 + Math.max(1, data.skuRows().size()); double rowHeight = rowCount > 36 ? 2.9 : rowCount > 24 ? 3.6 : 6.0; @@ -56,7 +55,7 @@ public class DropshipPalletA4Renderer { int inboundItems = data.inboundRows().stream().mapToInt(DropshipPalletA4PdfDtos.InboundRow::itemQuantity).sum(); colorText(stream, units, font, "入仓码信息 · 共 " + data.inboundRows().size() + " 票", - 9, 18, 92, BLUE); + 9, 18, 92, INK); double inboundBottom = inboundTable(stream, units, font, data.inboundRows(), inboundCartons, inboundItems, 97, rowHeight, rowFont); @@ -65,7 +64,7 @@ public class DropshipPalletA4Renderer { skuTable(stream, units, font, data.skuRows(), skuTitleY + 5, rowHeight, rowFont); line(stream, units, 10, 280, 200, 280); - colorText(stream, units, font, "拆托 / 合托后此标作废,须重打", 8.5f, 18, 288, RED); + colorText(stream, units, font, "拆托 / 合托后此标作废,须重打", 8.5f, 18, 288, INK); } } @@ -142,7 +141,7 @@ public class DropshipPalletA4Renderer { } private void border(PDPageContentStream s, PdfUnits u) throws IOException { - s.setStrokingColor(BLUE); + s.setStrokingColor(INK); s.setLineWidth(PdfUnits.mmToPt(.55)); s.addRect(PdfUnits.mmToPt(10), u.topDownMmToPdfY(290), PdfUnits.mmToPt(190), PdfUnits.mmToPt(280)); s.stroke();