From d7e71e9eaf18c27fc328b06204ba4bec152608b6 Mon Sep 17 00:00:00 2001
From: 野心家 <1051256694@qq.com>
Date: 星期二, 13 六月 2023 09:11:30 +0800
Subject: [PATCH] 孚能

---
 src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java |   35 ++++++++++++++++++++++++++++-------
 1 files changed, 28 insertions(+), 7 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 30cbf19..17691fb 100644
--- a/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
+++ b/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -334,7 +334,6 @@
                         sourceLoc.setLocSts("O");
                         sourceLoc.setModiTime(now);
                         sourceLoc.setIoTime(now);
-                        sourceLoc.setFireStatus(0);
                         sourceLoc.setPackStatus(0);
                         if (!locMastService.updateById(sourceLoc)) {
 //                            exceptionHandle("搴撲綅绉昏浆 ===>> 淇敼婧愬簱浣嶇姸鎬佸け璐ワ紱[workNo={0}],[sourceLoc={1}]", wrkMast.getWrkNo(), wrkMast.getSourceLocNo());
@@ -347,31 +346,55 @@
                     locMast.setBarcode(wrkMast.getBarcode());
                     locMast.setIoTime(now);
                     locMast.setModiTime(now);
-                    locMast.setFireStatus(0);
                     LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo()));
 
 
                     boolean sign =false;
                     if (locMast.getLocType1().equals(sourceLoc.getLocType1())){
                         locMast.setPackStatus(packStatus);
+
+                        //寰呮祴搴撲綅杞祴璇曞簱浣�
                     }else if (locMast.getLocType1().equals((short)1) && sourceLoc.getLocType1().equals((short)3)){
                         locMast.setPackStatus(1);
+                        TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>()
+                                .eq("loc_no",sourceLoc.getLocNo())
+                                .eq("user_id",locMast.getBarcode())
+                                .eq("barcode",locDetl.getMatnr())
+                        );
+                        if(!Cools.isEmpty(testMast)){
+                            testMast.setChannel(locMast.getChannel());
+                            testMast.setLocNo(wrkMast.getLocNo());
+                            testMast.setModiTime(new Date());
+                            if (!testMastService.update(testMast,new EntityWrapper<TestMast>()
+                                    .eq("loc_no",sourceLoc.getLocNo())
+                                    .eq("user_id",locMast.getBarcode())
+                                    .eq("barcode",locDetl.getMatnr()))){
+                                throw new CoolException("鏇存敼娴嬭瘯鐘舵�佸け璐�");
+                            }
+                        }else {
+                            throw new CoolException("寰呮祴搴撲綅鏃犵墿");
+                        }
+
                     }else {
+                        //娴嬭瘯搴撲綅杞潤缃簱浣�
                         if (locMast.getLocType1().equals((short)4)){
                             locMast.setPackStatus(4); //4:NG
                         }else {
                             locMast.setPackStatus(5); //5:闈欑疆涓�
                         }
                         sign=true;
-                        if (locMast.getLocType1()==1 && sourceLoc.getLocType1()==2){
+                        if (locMast.getLocType1()==2 && sourceLoc.getLocType1()==1){
                             TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>()
                                     .eq("loc_no",sourceLoc.getLocNo())
-                                    .eq("barcode",locMast.getBarcode())
+                                    .eq("barcode",locDetl.getMatnr())
                                     .eq("status",4)
                             );
                             testMast.setStatus(5);
                             testMast.setModiTime(new Date());
-                            if (!testMastService.update(testMast,new EntityWrapper<TestMast>().eq("loc_no",sourceLoc.getLocNo()).eq("barcode",locMast.getBarcode()).eq("status",4))){
+                            if (!testMastService.update(testMast,new EntityWrapper<TestMast>()
+                                    .eq("loc_no",sourceLoc.getLocNo())
+                                    .eq("barcode",locDetl.getMatnr())
+                                    .eq("status",4))){
                                 throw new CoolException("鏇存敼娴嬭瘯鐘舵�佸け璐�");
                             }
                         }
@@ -470,7 +493,6 @@
                         locMast.setBarcode("");
                         locMast.setModiTime(now);
                         locMast.setIoTime(now);
-                        locMast.setFireStatus(0);
                         locMast.setPackStatus(0);
                         if (!locMastService.updateById(locMast)) {
 //                            exceptionHandle("鍏ㄦ澘鍑哄簱 ===>> 淇敼婧愬簱浣嶇姸鎬佸け璐ワ紱[workNo={0}],[sourceLocNo={1}]", wrkMast.getWrkNo(), wrkMast.getSourceLocNo());
@@ -506,7 +528,6 @@
                         locMast.setBarcode("");
                         locMast.setModiTime(now);
                         locMast.setIoTime(now);
-                        locMast.setFireStatus(0);
                         locMast.setPackStatus(0);
                         if (!locMastService.updateById(locMast)) {
 //                            exceptionHandle("绌烘澘鍑哄簱 ===>> 淇敼婧愬簱浣嶇姸鎬佸け璐ワ紱[workNo={0}],[sourceLocNo={1}]", wrkMast.getWrkNo(), wrkMast.getSourceLocNo());

--
Gitblit v1.9.1