From 1cc361ec5fca7550ba01f0a6ecf058e84a5a20ad Mon Sep 17 00:00:00 2001
From: dubin <bindu_bean@163.com>
Date: 星期六, 18 十月 2025 16:25:18 +0800
Subject: [PATCH] 联调

---
 src/main/java/com/zy/asrs/service/impl/MatBarcodeServiceImpl.java |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/MatBarcodeServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MatBarcodeServiceImpl.java
index 8de630f..8040092 100644
--- a/src/main/java/com/zy/asrs/service/impl/MatBarcodeServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MatBarcodeServiceImpl.java
@@ -44,6 +44,9 @@
         if (matBarcode != null){
             throw new CoolException("璇ョ墿鏂欏凡缁忕粦瀹氭墭鐩橈紝璇峰嬁閲嶅缁戝畾");
         }
+        if (mat.getColor().equals("鎶ュ簾")){
+            throw new CoolException("璇ョ墿鏂欏凡鎶ュ簾锛岃鍕跨粦瀹�");
+        }
         MatBarcode mb=new MatBarcode();
         mb.setZpallet(waitPakin.getBarcode());
         mb.setMatnr(mat.getMatnr());
@@ -54,4 +57,28 @@
             throw new CoolException("鐗╂枡鎵樼洏缁戝畾澶辫触");
         }
     }
+
+    @Override
+    public void addBarcodeMatnrTwo(Mat mat) {
+        Mat m = matService.selectById(mat);
+        if (m == null){
+            throw new CoolException("鐗╂枡涓嶅瓨鍦紝璇峰厛娣诲姞鐗╂枡鏁版嵁");
+        }
+        MatBarcode matBarcode = matBarcodeMapper.selectByMatnr(mat.getMatnr());
+        if (matBarcode != null){
+            throw new CoolException("璇ョ墿鏂欏凡缁忕粦瀹氭墭鐩橈紝璇峰嬁閲嶅缁戝畾");
+        }
+        if (mat.getColor().equals("鎶ュ簾")){
+            throw new CoolException("璇ョ墿鏂欏凡鎶ュ簾锛岃鍕跨粦瀹�");
+        }
+        MatBarcode mb=new MatBarcode();
+        mb.setZpallet(mat.getUnit());
+        mb.setMatnr(mat.getMatnr());
+        mb.setMaktx(mat.getMaktx());
+        mb.setSpecs(mat.getSpecs());
+        mb.setModel(mat.getModel());
+        if (!matBarcodeService.insert(mb)){
+            throw new CoolException("鐗╂枡鎵樼洏缁戝畾澶辫触");
+        }
+    }
 }

--
Gitblit v1.9.1