From 1a07e9d429a7e72cab581cfda10265a0d5f1f071 Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期五, 17 三月 2023 15:56:48 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 105 ++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 76 insertions(+), 29 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 4169bfe..a6f0fe9 100644 --- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java @@ -229,8 +229,8 @@ .build() .doPost(); JSONObject jsonObject = JSON.parseObject(response); - LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); - Integer code = jsonObject.getInteger("code"); +// LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); +// Integer code = jsonObject.getInteger("code"); if (jsonObject.getInteger("code").equals(200)) { StartupDto dto = jsonObject.getObject("data", StartupDto.class); @@ -238,33 +238,47 @@ staProtocol.setWorkNo(dto.getWorkNo().shortValue()); staProtocol.setStaNo(dto.getStaNo().shortValue()); devpThread.setPakMk(staProtocol.getSiteId(), false); - - ledThread.errorReset(); - boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); if (!result) { throw new CoolException("鏇存柊plc绔欑偣淇℃伅澶辫触"); } - } else if(code == 500){ - if (ledThread != null) { - String errorMsg = jsonObject.getString("msg"); - if (!Cools.isEmpty(errorMsg)) { - MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); - } - } + } else { log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); - } else if (code == 700) { - staProtocol.setWorkNo((short) 9995); - staProtocol.setStaNo(inSta.getBackSta().shortValue()); - devpThread.setPakMk(staProtocol.getSiteId(), false); - MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); - - // led 寮傚父鏄剧ず - if (ledThread != null) { - String errorMsg = barcode + "鎵樼洏璇嗗埆寮傚父锛岃鍏堣繘琛岀粍鎵橈紒"; - MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); - } } +// if (jsonObject.getInteger("code").equals(200)) { +// StartupDto dto = jsonObject.getObject("data", StartupDto.class); +// +// barcodeThread.setBarcode(""); +// staProtocol.setWorkNo(dto.getWorkNo().shortValue()); +// staProtocol.setStaNo(dto.getStaNo().shortValue()); +// devpThread.setPakMk(staProtocol.getSiteId(), false); +// +// ledThread.errorReset(); +// +// boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); +// if (!result) { +// throw new CoolException("鏇存柊plc绔欑偣淇℃伅澶辫触"); +// } +// } else if(code == 500){ +// if (ledThread != null) { +// String errorMsg = jsonObject.getString("msg"); +// if (!Cools.isEmpty(errorMsg)) { +// MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); +// } +// } +// log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); +// } else if (code == 700) { +// staProtocol.setWorkNo((short) 9995); +// staProtocol.setStaNo(inSta.getBackSta().shortValue()); +// devpThread.setPakMk(staProtocol.getSiteId(), false); +// MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); +// +// // led 寮傚父鏄剧ず +// if (ledThread != null) { +// String errorMsg = barcode + "鎵樼洏璇嗗埆寮傚父锛岃鍏堣繘琛岀粍鎵橈紒"; +// MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg)); +// } +// } // // 妫�绱㈠簱浣� @@ -449,7 +463,7 @@ } } - if (!Cools.isEmpty(barcode) && "NoRead".equals(barcode)) { + if (!Cools.isEmpty(barcode)) { log.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", pickSta.getBarcode(), barcode); // if ("NG".endsWith(barcode) || "NoRead".equals(barcode)) { // continue; @@ -518,7 +532,37 @@ wrkMast.setIoTime(now); wrkMast.setIoType(wrkMast.getIoType() - 50); // 鍏ュ嚭搴撶被鍨�: 103->53,104->54,107->57 wrkMast.setWrkSts(2L); // 宸ヤ綔鐘舵��: 2.璁惧涓婅蛋 - wrkMast.setSourceStaNo(wrkMast.getStaNo()); // 婧愮珯 + + Integer sourceStaNo = 0; + switch (wrkMast.getStaNo()){ + case 100: + sourceStaNo = 101; + break; + case 103: + sourceStaNo = 104; + break; + case 110: + sourceStaNo = 111; + break; + case 113: + sourceStaNo = 114; + break; + case 200: + sourceStaNo = 201; + break; + case 203: + sourceStaNo = 204; + break; + case 300: + sourceStaNo = 301; + break; + case 303: + sourceStaNo = 304; + break; + } + + wrkMast.setSourceStaNo(sourceStaNo); // 婧愮珯 +// wrkMast.setSourceStaNo(wrkMast.getStaNo()); // 婧愮珯 wrkMast.setStaNo(staNo); // 鐩爣绔� wrkMast.setLocNo(wrkMast.getSourceLocNo()); // 鐩爣搴撲綅 = 鍑哄簱鏃剁殑婧愬簱浣� wrkMast.setSourceLocNo(""); // 婧愬簱浣嶆竻绌� @@ -874,7 +918,7 @@ List<WrkMast> wrkMasts = wrkMastMapper.selectPakOutStep11(slave.getId(), crnStn.getStaNo()); // 鑾峰彇宸ヤ綔鐘舵�佷负14鐨勫伐浣滄。 WrkMast wrkMast1 = wrkMastMapper.selectPakOutStep14(slave.getId(), crnStn.getStaNo()); - if (wrkMast1.getIoType().equals(103) || wrkMast1.getIoType().equals(107) ) { + if ( wrkMast1 !=null) { continue; } for (WrkMast wrkMast : wrkMasts) { @@ -984,7 +1028,7 @@ continue; } else if (shallowLoc.getLocSts().equals("Q") || shallowLoc.getLocSts().equals("S")) { WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo); - if (null != waitWrkMast && waitWrkMast.getWrkSts() == 4) { + if (null != waitWrkMast && (waitWrkMast.getWrkSts() == 4 || waitWrkMast.getWrkSts() == 5)) { continue; } } @@ -1844,8 +1888,11 @@ } LocMast sourceLoc = locMastService.queryDemoSourceLoc(crn.getId()); - LocMast loc = locMastService.queryDemoLoc(crn.getId()); - if (null == sourceLoc || null == loc) { + if (null == sourceLoc ) { + continue; + } + LocMast loc = locMastService.queryDemoLoc0(crn.getId(),sourceLoc.getLocType1()); + if ( null == loc) { continue; } -- Gitblit v1.9.1