From ae91523e49af02438f58a9fd5f590a483a297417 Mon Sep 17 00:00:00 2001 From: Junjie <540245094@qq.com> Date: 星期五, 01 十二月 2023 13:37:44 +0800 Subject: [PATCH] #盘点逻辑 --- src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 47 ++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 44 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java index a8d5c32..4b44e70 100644 --- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java @@ -417,10 +417,29 @@ if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() - && (staProtocol.getWorkNo() > 0) +// && (staProtocol.getWorkNo() > 0) && staProtocol.isPakMk()){ - WrkMast wrkMast = wrkMastMapper.selectByWorkNo(staProtocol.getWorkNo().intValue()); + WrkMast wrkMast = null; + if (staProtocol.getWorkNo() > 0) {//瀛樺湪宸ヤ綔鍙凤紝鍒╃敤宸ヤ綔鍙锋悳绱换鍔� + wrkMast = wrkMastMapper.selectByWorkNo(staProtocol.getWorkNo().intValue()); + }else { + //涓嶅瓨鍦ㄥ伐浣滃彿锛屼緷闈犳墭鐩樻潯鐮佹悳绱� + // 鑾峰彇鏉$爜鎵弿浠俊鎭� + BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode()); + if (barcodeThread == null) { + continue; + } + String barcode = barcodeThread.getBarcode(); + if(Cools.isEmpty(barcode)) { + continue; + } + if("NG".endsWith(barcode) || "NoRead".equals(barcode) || "empty".equals(barcode)) { + continue; + } + wrkMast = wrkMastMapper.selectPickStepByBarcode(barcode); + } + if (wrkMast == null) {//鎵句笉鍒板伐浣滄。 continue; } @@ -442,7 +461,7 @@ if (!locMast.getLocSts().equals("F")) { flag = true; - th = loc + "搴撲綅瀛樺湪闈炵┖娴呭簱浣�"; + th = loc + "搴撲綅瀛樺湪鏈洖搴撲换鍔�"; break; } } @@ -1287,6 +1306,28 @@ return false;//绔欑偣涓嶅彲鍏� } + Integer barcodeId = Utils.getBarcodeIdByStaNo(wrkMast.getSourceStaNo()); + if (barcodeId == null) { + News.info("{}浠诲姟锛寋}婧愮珯锛屾壘涓嶅埌鍙敤鏉$爜鍣↖D", wrkMast.getWrkNo(), sourceBasDevp.getDevNo()); + return false;//绔欑偣涓嶅彲鍏� + } + + BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, barcodeId); + if (barcodeThread == null) { + News.info("{}浠诲姟锛寋}婧愮珯锛屾潯鐮佸櫒{}绾跨▼涓虹┖", wrkMast.getWrkNo(), sourceBasDevp.getDevNo(), barcodeId); + return false;//绔欑偣涓嶅彲鍏� + } + String barcode = barcodeThread.getBarcode(); + if(!Cools.isEmpty(barcode)) { + if(!("NG".endsWith(barcode) || "NoRead".equals(barcode) || "empty".equals(barcode))) { + //瀛樺湪鏉$爜鍊硷紝鍒ゆ柇鏄惁鍜屽綋鍓嶅伐浣滄。涓�鑷� + if (!barcode.equals(wrkMast.getBarcode())) { + News.info("{}浠诲姟锛屾潯鐮佸櫒{}鍊納}涓庡伐浣滄。鏉$爜鍊间笉涓�鑷达紝绯荤粺璺宠繃鎵ц", wrkMast.getWrkNo(), sourceBasDevp.getDevNo(), barcodeId, barcode); + return false;//绔欑偣涓嶅彲鍏� + } + } + } + //鍒ゆ柇鎻愬崌鏈烘暣涓笁妤兼槸鍚﹂兘澶勪簬鍏ュ簱妯″紡 Integer outInModel1 = Utils.getOutInModelByLift(sourceBasDevp.getLiftNo(), 1); Integer outInModel2 = Utils.getOutInModelByLift(sourceBasDevp.getLiftNo(), 5); -- Gitblit v1.9.1