From c7208d3c3e7edbbeca257dce42e661ec6a85cf36 Mon Sep 17 00:00:00 2001 From: Junjie <xjj@123> Date: 星期一, 16 六月 2025 09:21:53 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 112 ++++++++++++++++++++++++++++++------------------------- 1 files changed, 61 insertions(+), 51 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 45033ce..08ac542 100644 --- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java @@ -235,21 +235,21 @@ throw new CoolException("鏇存柊plc绔欑偣淇℃伅澶辫触"); } - // led 鍏ュ簱淇℃伅鏄剧ず - if (ledThread != null) { - // 鍛戒护闆嗗悎 - List<LedCommand> commands = new ArrayList<>(); - // 缁勮鍛戒护 - LedCommand ledCommand = new LedCommand(); - ledCommand.setWorkNo(dto.getWorkNo()); - ledCommand.setIoType(1); - ledCommand.setTitle("鍏ㄦ澘鍏ュ簱"); - ledCommand.setLocNo(dto.getLocNo()); - ledCommand.setStaNo(dto.getStaNo()); - commands.add(ledCommand); - MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, commands)); -// ledThread.errorReset(); - } +// // led 鍏ュ簱淇℃伅鏄剧ず +// if (ledThread != null) { +// // 鍛戒护闆嗗悎 +// List<LedCommand> commands = new ArrayList<>(); +// // 缁勮鍛戒护 +// LedCommand ledCommand = new LedCommand(); +// ledCommand.setWorkNo(dto.getWorkNo()); +// ledCommand.setIoType(1); +// ledCommand.setTitle("鍏ㄦ澘鍏ュ簱"); +// ledCommand.setLocNo(dto.getLocNo()); +// ledCommand.setStaNo(dto.getStaNo()); +// commands.add(ledCommand); +// MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, commands)); +//// ledThread.errorReset(); +// } } else { News.error(""+mark+" - 5"+" - 璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); // staProtocol.setWorkNo((short)9992); @@ -364,26 +364,30 @@ staProtocol = staProtocol.clone(); } - if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() && staProtocol.isPakMk()) { + if (staProtocol.isAutoing() + && staProtocol.isLoading() + && staProtocol.isInEnable() + && staProtocol.getWorkNo() > 0 + && staProtocol.isPakMk()) { News.warnNoLog(""+mark+" - 0"+" - 寮�濮嬫墽琛�"); - // 鑾峰彇鏉$爜鎵弿浠俊鎭� - BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode()); - if (barcodeThread == null) { - continue; - } - String barcode = barcodeThread.getBarcode(); - if(!Cools.isEmpty(barcode)) { - News.info(""+mark+" - 1"+" - {}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", pickSta.getBarcode(), barcode); - if("NG".endsWith(barcode) || "NoRead".equals(barcode)) { - continue; - } - } else { - continue; - } +// // 鑾峰彇鏉$爜鎵弿浠俊鎭� +// BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode()); +// if (barcodeThread == null) { +// continue; +// } +// String barcode = barcodeThread.getBarcode(); +// if(!Cools.isEmpty(barcode)) { +// News.info(""+mark+" - 1"+" - {}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", pickSta.getBarcode(), barcode); +// if("NG".endsWith(barcode) || "NoRead".equals(barcode)) { +// continue; +// } +// } else { +// continue; +// } - WrkMast wrkMast = wrkMastMapper.selectPickStep(barcode); -// WrkMast wrkMast = wrkMastMapper.selectPakInStep3(staProtocol.getWorkNo().intValue()); +// WrkMast wrkMast = wrkMastMapper.selectPickStep(barcode); + WrkMast wrkMast = wrkMastMapper.selectPakInStep3(staProtocol.getWorkNo().intValue()); if (wrkMast == null) { // 鏃犳嫞鏂欐暟鎹� continue; @@ -409,11 +413,11 @@ .eq("crn_no", wrkMast.getCrnNo()); // 鍫嗗灈鏈哄彿 StaDesc staDesc = staDescService.selectOne(wrapper); if (Cools.isEmpty(staDesc)) { - News.error(""+mark+" - 2"+" - 鍏ュ簱璺緞涓嶅瓨鍦紒type_no={},stn_no={},crn_no={}", wrkMast.getIoType(), pickSta.getStaNo(), wrkMast.getCrnNo()); - staProtocol.setWorkNo((short) 9989); - staProtocol.setStaNo((short) (pickSta.getStaNo().shortValue()-(short)1)); - devpThread.setPakMk(staProtocol.getSiteId(), false); - MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); +// News.error(""+mark+" - 2"+" - 鍏ュ簱璺緞涓嶅瓨鍦紒type_no={},stn_no={},crn_no={}", wrkMast.getIoType(), pickSta.getStaNo(), wrkMast.getCrnNo()); +// staProtocol.setWorkNo((short) 9989); +// staProtocol.setStaNo((short) (pickSta.getStaNo().shortValue()-(short)1)); +// devpThread.setPakMk(staProtocol.getSiteId(), false); +// MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); //LED LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, pickSta.getLed()); // led 寮傚父鏄剧ず @@ -1650,20 +1654,20 @@ // ledCommand.setSourceStaNo(wrkMast.getSourceStaNo()); if (wrkMast.getIoType() != 110 && wrkMast.getIoType() != 10) { List<WrkDetl> wrkDetls = wrkDetlService.findByWorkNo(wrkMast.getWrkNo()); - try{ - if (wrkMast.getIoType()>100){ - for (WrkDetl wrkDetl : wrkDetls){ - LocDetl locDetl = locDetlService.selectMatnrSpecs(wrkDetl.getMatnr(), wrkDetl.getSpecs(), wrkMast.getSourceLocNo()); - wrkDetl.setWeight(locDetl.getAnfme()); - } - }else { - for (WrkDetl wrkDetl : wrkDetls){ - wrkDetl.setWeight(wrkDetl.getAnfme()); - } - } - }catch (Exception e){ - log.error("宸ヤ綔妗f鏄庣粏杈撳叆鐢佃鏈哄け璐�1锛氬紓甯镐俊鎭�==銆�"+e); - } +// try{ +// if (wrkMast.getIoType()>100){ +// for (WrkDetl wrkDetl : wrkDetls){ +// LocDetl locDetl = locDetlService.selectMatnrSpecs(wrkDetl.getMatnr(), wrkDetl.getSpecs(), wrkMast.getSourceLocNo()); +// wrkDetl.setWeight(locDetl.getAnfme()); +// } +// }else { +// for (WrkDetl wrkDetl : wrkDetls){ +// wrkDetl.setWeight(wrkDetl.getAnfme()); +// } +// } +// }catch (Exception e){ +// log.error("宸ヤ綔妗f鏄庣粏杈撳叆鐢佃鏈哄け璐�1锛氬紓甯镐俊鎭�==銆�"+e); +// } wrkDetls.forEach(wrkDetl -> ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getAnfme(),wrkDetl.getWeight(),wrkDetl.getSpecs(),wrkDetl.getSku()))); } commands.add(ledCommand); @@ -2013,6 +2017,11 @@ continue; } + Integer ctnType = 1; + if (ctnType.equals(loc.getCtnType())) { + continue; + } + String sourceLocNo = sourceLoc.getLocNo(); String locNo = loc.getLocNo(); @@ -2067,6 +2076,7 @@ // 淇敼鐩爣搴撲綅鐘舵�� if (loc.getLocSts().equals("O")) { loc.setLocSts("S"); // S.鍏ュ簱棰勭害 + loc.setCtnType(1); loc.setModiTime(new Date()); if (!locMastService.updateById(loc)) { throw new CoolException("鏇存柊鐩爣搴撲綅鐘舵�佸け璐�"); -- Gitblit v1.9.1