From db9a7f9c1b61af84be764a399b3f1f85e0ff03ee Mon Sep 17 00:00:00 2001
From: dubin <bindu_bean@163.com>
Date: 星期四, 27 十一月 2025 09:37:36 +0800
Subject: [PATCH] #1

---
 src/main/java/com/zy/asrs/utils/MatExcelListener.java |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/zy/asrs/utils/MatExcelListener.java b/src/main/java/com/zy/asrs/utils/MatExcelListener.java
index 2793abc..cf5fd80 100644
--- a/src/main/java/com/zy/asrs/utils/MatExcelListener.java
+++ b/src/main/java/com/zy/asrs/utils/MatExcelListener.java
@@ -2,6 +2,7 @@
 
 import com.alibaba.excel.context.AnalysisContext;
 import com.alibaba.excel.event.AnalysisEventListener;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.core.common.Cools;
 import com.core.common.SpringUtils;
 import com.core.exception.CoolException;
@@ -10,13 +11,11 @@
 import com.zy.asrs.entity.MatBarcode;
 import com.zy.asrs.entity.Tag;
 import com.zy.asrs.mapper.TagMapper;
-import com.zy.asrs.service.InOutService;
-import com.zy.asrs.service.MatBarcodeService;
-import com.zy.asrs.service.MatService;
-import com.zy.asrs.service.TagService;
+import com.zy.asrs.service.*;
 import com.zy.common.entity.MatExcel;
 import com.zy.common.utils.NodeUtils;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 
 import java.util.ArrayList;
 import java.util.Date;
@@ -63,6 +62,9 @@
         MatService matService = SpringUtils.getBean(MatService.class);
         InOutService inOutService = SpringUtils.getBean(InOutService.class);
         MatBarcodeService matBarcodeService = SpringUtils.getBean(MatBarcodeService.class);
+        WrkDetlService wrkDetlService = SpringUtils.getBean(WrkDetlService.class);
+        LocDetlService locDetlService = SpringUtils.getBean(LocDetlService.class);
+        WaitPakinService waitPakinService = SpringUtils.getBean(WaitPakinService.class);
         Date now = new Date();
         Long tagId;
         // 鍒嗙被
@@ -163,7 +165,13 @@
 
             }
             //妯″叿淇℃伅鏇存柊
-            matService
+            matService.delete(new EntityWrapper<Mat>().eq("matnr",mat.getMatnr()));
+            mat = excel;
+            mat.setTagId(tagId);
+            mat.setMatnr(excel.getMatnr() + "__" + excel.getName());
+            if (!matService.insert(mat)) {
+                throw new CoolException("淇濆瓨鍟嗗搧妗f澶辫触锛屽晢鍝佺紪鐮侊細" + excel.getMatnr());
+            }
         }
     }
 

--
Gitblit v1.9.1