From ca301e64c071ecbdf9e7442070fa7b9b80ca56e4 Mon Sep 17 00:00:00 2001 From: 野心家 <1051256694@qq.com> Date: 星期五, 01 九月 2023 08:50:42 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java | 81 ++++++++++++++++++++++++++++++++++------ 1 files changed, 69 insertions(+), 12 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 3741792..5b242eb 100644 --- a/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java +++ b/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java @@ -161,21 +161,23 @@ locMast.setPackStatus(0); } }else { + WrkDetl wrkDetl1 = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>().eq("zpallet",locMast.getBarcode())); locMast.setPackStatus(5); TestMast testMast = testMastService.selectOne(new EntityWrapper<TestMast>() - .eq("barcode",locMast.getBarcode()) + .eq("barcode",wrkDetl1.getMatnr()) .eq("status",4) ); testMast.setStatus(5); testMast.setModiTime(new Date()); - if (!testMastService.update(testMast,new EntityWrapper<TestMast>().eq("barcode",locMast.getBarcode()).eq("status",4))){ + if (!testMastService.update(testMast,new EntityWrapper<TestMast>().eq("barcode",wrkDetl1.getMatnr()).eq("status",4))){ throw new CoolException("鏇存敼娴嬭瘯鐘舵�佸け璐�"); } } //2.鍏ュ簱瀹屾垚涓婃姤 CombParam combParam = new CombParam(); - combParam.setPackNo(wrkMast.getBarcode()); + combParam.setPackNo(wrkDetls.get(0).getMatnr()); combParam.setLocNo(wrkMast.getLocNo()); + combParam.setBarcode(wrkMast.getBarcode()); if (locMast.getCrnNo()==1){ combParam.setPackSts(0); combParam.setStepSts(2); @@ -332,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()); @@ -345,42 +346,70 @@ 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()); + testMast.setBarcode(locDetl.getMatnr()); + 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 { + //娴嬭瘯搴撲綅杞潤缃簱浣嶅拰NG搴撲綅 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){ 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.setLocNo(locMast.getLocNo()); 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("鏇存敼娴嬭瘯鐘舵�佸け璐�"); } - } + } if (!locMastService.updateById(locMast)) { // exceptionHandle("搴撲綅绉昏浆 ===>> 淇敼鐩爣搴撲綅鐘舵�佸け璐ワ紱[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); return FAIL.setMsg("搴撲綅绉昏浆 ===>> 淇敼鐩爣搴撲綅鐘舵�佸け璐�; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getLocNo() + "]"); } + if (locMast.getCrnNo()==1 && sign){ //5.闈欑疆搴撲綅鍏ュ簱瀹屾垚涓婃姤 CombParam combParam = new CombParam(); - combParam.setPackNo(wrkMast.getBarcode()); + combParam.setPackNo(locDetl.getMatnr()); combParam.setLocNo(wrkMast.getLocNo()); if (locMast.getPackStatus()==4){ combParam.setPackSts(2); @@ -465,12 +494,41 @@ 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()); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); return FAIL.setMsg("鍏ㄦ澘鍑哄簱 ===>> 淇敼婧愬簱浣嶇姸鎬佸け璐�; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getSourceLocNo() + "]"); + }else{ + //2.鍑哄簱瀹屾垚涓婃姤 + CombParam combParam = new CombParam(); + combParam.setPackNo(wrkDetls101.get(0).getMatnr()); + combParam.setLocNo(wrkMast.getLocNo()); + combParam.setBarcode(wrkMast.getBarcode()); + //鐩爣绔�206鍑哄簱 + if(wrkMast.getStaNo()==206){ + combParam.setPackSts(1);//OK + combParam.setStepSts(7);//娴嬭瘯搴撳嚭搴撳畬鎴� + }else if(wrkMast.getStaNo()==204){//NG 鍑哄簱 + //NG鍑哄簱淇敼娴嬭瘯妗g殑鐘舵�佷负5.宸茬Щ搴� + TestMast testMast=testMastService.selectOne(new EntityWrapper<TestMast>() + .eq("user_id",wrkMast.getBarcode()) + .eq("barcode",wrkDetls101.get(0).getMatnr())); + combParam.setPackSts(2);//NG + combParam.setStepSts(8);//NG鍑哄簱瀹屾垚 + testMast.setStatus(5); + if(!testMastService.update(testMast,new EntityWrapper<TestMast>() + .eq("user_id",wrkMast.getBarcode()) + .eq("barcode",wrkDetls101.get(0).getMatnr()))){ + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return FAIL.setMsg("鍏ㄦ澘鍑哄簱 ===>> 淇敼娴嬭瘯琛ㄧ姸鎬佷负5澶辫触; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getSourceLocNo() + "]"); + } + }else if(wrkMast.getStaNo()==103){//鐩爣绔�103鍑哄簱 + combParam.setPackSts(1);//OK + combParam.setStepSts(6);//闈欑疆搴撳嚭搴撳畬鎴� + } + combParam.setRequestTime(DateUtils.convert(now)); + new PostMesDataUtils().postMesData("MES绯荤粺",mesUrl,inpath,combParam); } } break; @@ -482,7 +540,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