From 111e559e11137ba87db3ff978db933170b7cb158 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期六, 05 七月 2025 15:58:06 +0800
Subject: [PATCH] no message

---
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/ZpalletBarcodeController.java |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/ZpalletBarcodeController.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/ZpalletBarcodeController.java
index 9f8d543..5838111 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/ZpalletBarcodeController.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/ZpalletBarcodeController.java
@@ -120,16 +120,18 @@
                 pakinType = "ctu";
             }
         }
-        ZpalletBarcode one = zpalletBarcodeService.getOne(new LambdaQueryWrapper<ZpalletBarcode>().eq(ZpalletBarcode::getBarcode, barcode));
-        if (one != null) {
-            return R.error("鏉$爜璧峰鍊煎凡瀛樺湪");
-        }
+
         if (pakinType.equals("flat")) {
             int barcodeInt = Integer.parseInt(String.valueOf(barcode));
             for (int i = 0; i < Integer.parseInt(String.valueOf(num)); i++) {
                 ZpalletBarcode zpalletBarcode = new ZpalletBarcode();
                 String strBarcode = String.format("%08d", barcodeInt);
                 zpalletBarcode.setBarcode("PK" + strBarcode);
+                ZpalletBarcode one = zpalletBarcodeService.getOne(new LambdaQueryWrapper<ZpalletBarcode>()
+                        .eq(ZpalletBarcode::getBarcode, strBarcode));
+                if (one != null) {
+                    continue;
+                }
                 zpalletBarcodeService.save(zpalletBarcode);
                 barcodeInt += 1;
             }
@@ -139,6 +141,11 @@
                 ZpalletBarcode zpalletBarcode = new ZpalletBarcode();
                 String strBarcode = String.format("%08d", barcodeInt);
                 zpalletBarcode.setBarcode(strBarcode);
+                ZpalletBarcode one = zpalletBarcodeService.getOne(new LambdaQueryWrapper<ZpalletBarcode>()
+                        .eq(ZpalletBarcode::getBarcode, strBarcode));
+                if (one != null) {
+                    continue;
+                }
                 zpalletBarcodeService.save(zpalletBarcode);
                 barcodeInt += 1;
             }

--
Gitblit v1.9.1