From 164bdd039c4f5c5fe0572b7f1f090b9346cd735f Mon Sep 17 00:00:00 2001 From: LSH Date: 星期日, 29 一月 2023 13:23:06 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 30 +++++++++++++++++++++--------- 1 files changed, 21 insertions(+), 9 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 baaa901..ae35f93 100644 --- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java @@ -21,6 +21,7 @@ import com.zy.common.service.CommonService; import com.zy.common.utils.CollectionUtils; import com.zy.common.utils.HttpHandler; +import com.zy.common.utils.News; import com.zy.core.CrnThread; import com.zy.core.DevpThread; import com.zy.core.cache.MessageQueue; @@ -126,18 +127,22 @@ if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() && !staProtocol.isEmptyMk() && (staProtocol.getWorkNo() == 0 || staProtocol.getWorkNo() > 9990) - && staProtocol.isPakMk()) {// && !Cools.isEmpty(barcode)) { + && staProtocol.isPakMk() && staProtocol.getStamp()>=2) {// && !Cools.isEmpty(barcode)) { + +// try { +// Thread.sleep(300); +// }catch (Exception e){} String barcode = barcodeThread.getBarcode(); if(!Cools.isEmpty(barcode)) { - log.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", inSta.getBarcode(), barcode); + News.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", inSta.getBarcode(), barcode); if("NG".endsWith(barcode) || "NoRead".equals(barcode) || "empty".equals(barcode)) { staProtocol.setWorkNo((short) 9999); staProtocol.setStaNo(inSta.getBackSta().shortValue()); devpThread.setPakMk(staProtocol.getSiteId(), false); MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); - log.info("鎵爜澶辫触1 ===>> {}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{},绔欑偣:{}", inSta.getBarcode(), barcode, inSta.getStaNo()); + News.info("鎵爜澶辫触1 ===>> {}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{},绔欑偣:{}", inSta.getBarcode(), barcode, inSta.getStaNo()); // led 寮傚父鏄剧ず if (ledThread != null) { String errorMsg = "鎵爜澶辫触锛岃閲嶈瘯"; @@ -151,7 +156,7 @@ devpThread.setPakMk(staProtocol.getSiteId(), false); MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); - log.info("鎵爜澶辫触2 ===>> {}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{},绔欑偣:{}", inSta.getBarcode(), barcode, inSta.getStaNo()); + News.info("鎵爜澶辫触2 ===>> {}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{},绔欑偣:{}", inSta.getBarcode(), barcode, inSta.getStaNo()); // led 寮傚父鏄剧ず if (ledThread != null) { String errorMsg = "鎵爜澶辫触锛岃閲嶈瘯"; @@ -162,7 +167,13 @@ // 鍒ゆ柇閲嶅宸ヤ綔妗� WrkMast wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode); - + //杩囨护鍒ゆ柇锛岄槻姝㈡嫞鏂欏啀鍏ュ簱璐х墿锛岀粡杩囧叆搴撶珯鍐嶅叆搴撴椂锛岃閫�鍥炲埌閫�搴撶珯 + WrkMast wrkMast1 = wrkMastMapper.selectPakInStepBarcode(barcode); + if (wrkMast1 !=null){ + if (wrkMast1.getIoType()==103 || wrkMast1.getIoType()==107 || wrkMast1.getIoType()==104){ + continue; + } + } if (wrkMast != null) { log.error("宸ヤ綔妗d腑宸插瓨鍦ㄨ绔欑姸鎬佷负锛� 2.璁惧涓婅蛋 锛夌殑鏁版嵁,宸ヤ綔鍙�={}", wrkMast.getWrkNo()); staProtocol.setWorkNo((short)9999); @@ -221,6 +232,7 @@ ledCommand.setStaNo(dto.getStaNo()); commands.add(ledCommand); MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, commands)); +// ledThread.errorReset(); } } else { log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); @@ -324,7 +336,7 @@ } String barcode = barcodeThread.getBarcode(); if(!Cools.isEmpty(barcode)) { - log.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", pickSta.getBarcode(), barcode); + News.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", pickSta.getBarcode(), barcode); if("NG".endsWith(barcode) || "NoRead".equals(barcode)) { continue; } @@ -583,7 +595,7 @@ if (wrkMastMapper.selectDevWorking(crnProtocol.getCrnNo()) == null) { return; } - log.info("鍫嗗灈鏈哄彫鍥炲師鐐�==>>" + crnProtocol.getCrnNo() + "鍙峰爢鍨涙満鏈夊叆搴撲换鍔�,鍙洖鍘熺偣"); + News.info("鍫嗗灈鏈哄彫鍥炲師鐐�==>>" + crnProtocol.getCrnNo() + "鍙峰爢鍨涙満鏈夊叆搴撲换鍔�,鍙洖鍘熺偣"); // 鍛戒护涓嬪彂鍖� -------------------------------------------------------------------------- CrnCommand crnCommand = new CrnCommand(); crnCommand.setCrnNo(crnProtocol.getCrnNo()); // 鍫嗗灈鏈虹紪鍙� @@ -1920,7 +1932,7 @@ JSONObject jsonObject = JSON.parseObject(response); if (jsonObject.getInteger("code").equals(200)) { JSONObject data = (JSONObject) jsonObject.get("data"); - log.info((String) data.get("msg")); + News.info((String) data.get("msg")); } else { log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + "/rpc/auto/emptyOut/v1","", response); } @@ -1958,7 +1970,7 @@ .doPost(); JSONObject jsonObject = JSON.parseObject(response); if (jsonObject.getInteger("code").equals(200)) { - log.info((String) jsonObject.get("msg")); + News.info((String) jsonObject.get("msg")); } else { log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + "/rpc/auto/emptyIn/v1", JSON.toJSONString(locTypeDto), response); } -- Gitblit v1.9.1