From 12f4a6839c831411be43819e4d6487af6933bbbb Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期三, 21 八月 2024 17:49:39 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 64 +++++++++++++++++++++++++++++---
1 files changed, 58 insertions(+), 6 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 8309d50..2089b32 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -112,6 +112,7 @@
for (DevpSlave.Sta inSta : devp.getInSta()) {
// 鑾峰彇鏉$爜鎵弿浠俊鎭�
BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode());
+ BarcodeThread barcodeThreadMat = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcodeMat());
LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed());
SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo());
@@ -124,7 +125,14 @@
if (barcodeThread == null) {
continue;
}
+
+ if (barcodeThreadMat == null) {
+ continue;
+ }
+
String barcode = barcodeThread.getBarcode();
+
+ String barcodeMat = barcodeThreadMat.getBarcode();
// 灏哄妫�娴嬪紓甯�
boolean back = false;
String errMsg = "";
@@ -154,7 +162,8 @@
}
if (!back && staProtocol.isBarcodeErr()) {
errMsg = "鎵爜澶辫触";
- back = true;
+ log.error("鐗╂枡鐮佹壂鐮佸け璐�");
+// back = true;
}
// 閫�鍥�
if (back) {
@@ -184,6 +193,18 @@
&& staProtocol.isPakMk()) {
if(Cools.isEmpty(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode) || "00000000".equals(barcode)) {
News.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", inSta.getBarcode(), barcode);
+
+ staProtocol.setWorkNo(wrkNo);
+ News.info("{}鍏ュ簱鍥為��锛歿}锛屼换鍔″彿锛歿}", inSta.getStaNo(), errMsg,wrkNo);
+ wrkNo++;
+ staProtocol.setStaNo(inSta.getBackSta().shortValue());
+ devpThread.setPakMk(staProtocol.getSiteId(), false);
+ MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
+ log.error("杈撻�佺嚎涓嬪彂1锛�"+wrkNo+","+inSta.getBackSta());
+ continue;
+ }
+ if(Cools.isEmpty(barcodeMat) || "NG".endsWith(barcodeMat) || "NoRead".equals(barcodeMat) || "00000000".equals(barcodeMat)) {
+ News.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", inSta.getBarcodeMat(), barcodeMat);
staProtocol.setWorkNo(wrkNo);
News.info("{}鍏ュ簱鍥為��锛歿}锛屼换鍔″彿锛歿}", inSta.getStaNo(), errMsg,wrkNo);
@@ -262,6 +283,30 @@
News.error(methodName + ":鏇存柊plc绔欑偣淇℃伅澶辫触");
throw new CoolException("鏇存柊plc绔欑偣淇℃伅澶辫触");
+ }
+ } else if (jsonObject.getInteger("code").equals(700)) {
+ SearchLocParam param2 = new SearchLocParam();
+ param2.setBarcode(barcode);
+ param2.setBarcodeMat(barcodeMat);
+ param2.setSourceStaNo(inSta.getStaNo());
+ param2.setLocType1(locTypeDto.getLocType1());
+ String response2 = new HttpHandler.Builder()
+ .setUri(wmsUrl)
+ .setPath("/rpc/pakin/yk/loc/v33")
+ .setJson(JSON.toJSONString(param2))
+ .build()
+ .doPost();
+ JSONObject jsonObject2 = JSON.parseObject(response2);
+ if (jsonObject2.getInteger("code").equals(200)) {
+ log.info("鑷姩缁勬墭鎴愬姛锛侊紒");
+ } else {
+ MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, "鑷姩缁勬墭澶辫触锛侊紒锛乥arcodeMat==>"+barcodeMat));
+ News.error(methodName + "==>缁勬墭澶辫触:璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + "/rpc/pakin/yk/loc/v33", JSON.toJSONString(param), response);
+ }
+ try{
+ Thread.sleep(500);
+ } catch (Exception e){
+
}
} else {
staProtocol.setWorkNo(wrkNo);
@@ -2586,18 +2631,25 @@
continue;
}
//鍒ゆ柇宸ヤ綔缁撴潫浣嶇疆鐘舵��
+ boolean signDev = false;
BasDevp devNo = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", wrkMastSta.getStaEnd()));
+ if (devNo.getDevNo()==113){
+ BasDevp devNo114 = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no", 114));
+ if (!Cools.isEmpty(devNo114)){
+ if (devNo114.getOutEnable().equals("Y")){
+ signDev = true;
+ }
+ }
+ }
if (!Cools.isEmpty(devNo)){
if (devNo.getAutoing().equals("Y") && !devNo.getWrkNo().equals(0) && !devNo.getLoading().equals("N")){
continue;
}
- if (!devNo.getAutoing().equals("Y") || !devNo.getWrkNo().equals(0) || !devNo.getLoading().equals("N")){
- if (devNo.getDevNo()==113){
+ if (!signDev && devNo.getDevNo()==113){
+ if (!devNo.getAutoing().equals("Y") || !devNo.getWrkNo().equals(0) || !devNo.getLoading().equals("N")){
wrkEnable = true;
+ continue;
}
- continue;
- }
- if (devNo.getDevNo()==113){
if (!devNo.getOutEnable().equals("Y")){
wrkEnable = true;
continue;
--
Gitblit v1.9.1