From 43efe016c156158b9fc3a8b647810f612fb126e6 Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期二, 02 九月 2025 11:39:52 +0800
Subject: [PATCH] 自动补货单新增 1.订单中只能生成两笔自动补货单 2.CTU库是否有足够的空库位,空库位数需要大于100才会生成自动补货单 3.在补货时加上订单明细的数量进行判断

---
 src/main/java/com/zy/common/utils/QrCode.java |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/zy/common/utils/QrCode.java b/src/main/java/com/zy/common/utils/QrCode.java
index 174d713..ee63247 100644
--- a/src/main/java/com/zy/common/utils/QrCode.java
+++ b/src/main/java/com/zy/common/utils/QrCode.java
@@ -20,15 +20,18 @@
     private static final String CHARSET = "utf-8";
     private static final String FORMAT_NAME = "JPG";
     // 浜岀淮鐮佸昂瀵�
-    private static final int QRCODE_SIZE = 60;
-
+    private static final int QRCODE_SIZE = 150;
 
     public static BufferedImage createImg(String content) throws WriterException {
-        ConcurrentHashMap hints = new ConcurrentHashMap();
+        return createImg(content, QRCODE_SIZE, QRCODE_SIZE);
+    }
+
+    public static BufferedImage createImg(String content, Integer wid, Integer hei) throws WriterException {
+        ConcurrentHashMap<EncodeHintType, Object> hints = new ConcurrentHashMap<>();
         hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
         hints.put(EncodeHintType.CHARACTER_SET, CHARSET);
         hints.put(EncodeHintType.MARGIN, 1);
-        BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, QRCODE_SIZE, QRCODE_SIZE, hints);
+        BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, wid, hei, hints);
         int width = bitMatrix.getWidth();
         int height = bitMatrix.getHeight();
         BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);

--
Gitblit v1.9.1