From 83425ecab7ea13a6f5cbe877b1313f3e7a42b8b1 Mon Sep 17 00:00:00 2001
From: pang.jiabao <pang_jiabao@163.com>
Date: 星期四, 15 八月 2024 14:13:18 +0800
Subject: [PATCH] 成品入库修改

---
 src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java b/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
index 4ca6f44..3e18817 100644
--- a/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
+++ b/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -107,6 +107,7 @@
                             locDetl.setZpallet(wrkDetl.getZpallet()); // 鎵樼洏鏉$爜
                             locDetl.setModiTime(now);
                             locDetl.setAppeTime(now);
+                            locDetl.setBatch("");
                             if (!locDetlService.insert(locDetl)) {
 //                                exceptionHandle("鍏ㄦ澘鍏ュ簱 ===>> 娣诲姞搴撳瓨鏄庣粏澶辫触锛沎workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo());
                                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -157,9 +158,14 @@
                     }
                     for (WrkDetl wrkDetl : wrkDetls53) {
 
-                        LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
+//                        LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
+                        // 绠卞彿+鍗峰彿
+                        LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("batch",wrkDetl.getBatch())
+                                .eq("model",wrkDetl.getModel()));
                         if (null != locDetl) {
-                            if (!locDetlService.updateAnfme(locDetl.getAnfme() - wrkDetl.getAnfme(), locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch())) {
+
+//                            if (!locDetlService.updateAnfme(locDetl.getAnfme() - wrkDetl.getAnfme(), locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch())) {
+                            if (!locDetlService.updateAnfme2(locDetl.getAnfme() - wrkDetl.getAnfme(), locMast.getLocNo(), wrkDetl.getModel(), wrkDetl.getBatch())) {
 //                                exceptionHandle("鎷f枡鍏ュ簱 ===>> 淇敼搴撳瓨鏄庣粏鏁伴噺澶辫触锛沎workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo());
                                 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                                 return FAIL.setMsg("鎷f枡鍏ュ簱 ===>> 淇敼搴撳瓨鏄庣粏鏁伴噺澶辫触; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getLocNo() + "]");

--
Gitblit v1.9.1