From 20943f263c31beec3f25fcbeb09c73350248e74b Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 20 十一月 2023 16:37:05 +0800
Subject: [PATCH] # 1、图号从ERP获取 2、商品档案增加规格和图号搜索

---
 src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 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 f5fb2df..9f8ce99 100644
--- a/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
+++ b/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -116,10 +116,13 @@
 
                         // 鏇存柊璁㈠崟瀹屾垚鏁伴噺
                         OrderDetl orderDetl = orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
+                        if(orderDetl==null){
+                            orderDetl=orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), null);
+                        }
                         try {
                             if(!Cools.isEmpty(orderDetl)){
                                 if(!orderDetlService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), wrkDetl.getMatnr(),
-                                        wrkDetl.getBatch(),wrkDetl.getAnfme())){
+                                        orderDetl.getBatch(),wrkDetl.getAnfme())){
 //                                    exceptionHandle("鍏ㄦ澘鍏ュ簱 ===>> 鏇存柊璁㈠崟瀹屾垚鏁伴噺澶辫触锛沎workNo={0}],[locNo={1}]",
 //                                            wrkMast.getWrkNo(), wrkMast.getLocNo());
                                     TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -164,10 +167,13 @@
 
                         // 鏇存柊璁㈠崟瀹屾垚鏁伴噺
                         OrderDetl orderDetl = orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
+                        if(orderDetl==null){
+                            orderDetl=orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), null);
+                        }
                         try {
                             if(!Cools.isEmpty(orderDetl)){
                                 if(!orderDetlService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), wrkDetl.getMatnr(),
-                                        wrkDetl.getBatch(),wrkDetl.getAnfme())){
+                                        orderDetl.getBatch(),wrkDetl.getAnfme())){
 //                                    exceptionHandle("鎷f枡鍏ュ簱 ===>> 鏇存柊璁㈠崟瀹屾垚鏁伴噺澶辫触锛沎workNo={0}],[locNo={1}]",
 //                                            wrkMast.getWrkNo(), wrkMast.getLocNo());
                                     TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -344,10 +350,13 @@
                     for (WrkDetl wrkDetl : wrkDetls101) {
                         // 鏇存柊璁㈠崟瀹屾垚鏁伴噺
                         OrderDetl orderDetl = orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
+                        if(orderDetl==null){
+                            orderDetl=orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), null);
+                        }
                         try {
                             if(!Cools.isEmpty(orderDetl)){
                                 if(!orderDetlService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), wrkDetl.getMatnr(),
-                                        wrkDetl.getBatch(),wrkDetl.getAnfme())){
+                                        orderDetl.getBatch(),wrkDetl.getAnfme())){
 //                                    exceptionHandle("鍏ㄦ澘鍑哄簱 ===>> 鏇存柊璁㈠崟瀹屾垚鏁伴噺澶辫触锛沎workNo={0}],[locNo={1}]",
 //                                            wrkMast.getWrkNo(), wrkMast.getLocNo());
                                     TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();

--
Gitblit v1.9.1