From 190bec9d5950a76e62b3bb1663f979a644695279 Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期六, 09 八月 2025 15:22:27 +0800
Subject: [PATCH] 完善wcs'主控图地图显示
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 74 ++++++++++++++++++++++++++++++++++---
1 files changed, 68 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 68bbb31..8684907 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -38,6 +38,7 @@
import com.zy.core.properties.SlaveProperties;
import com.zy.core.thread.BarcodeThread;
import com.zy.core.thread.LedThread;
+import com.zy.core.thread.ScaleThread;
import com.zy.core.thread.SiemensDevpThread;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
@@ -306,6 +307,8 @@
}
Short workNo = staProtocol.getWorkNo();
Short stano = staProtocol.getStaNo();
+ //led
+ LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed());
// 灏哄妫�娴嬪紓甯�
boolean back = false;
@@ -338,6 +341,7 @@
errMsg = "鎵爜澶辫触";
back = true;
}
+
// 鍒ゆ柇鏄惁婊¤冻鍏ュ簱鏉′欢
if (staProtocol.isAutoing() && staProtocol.isLoading()
&& staProtocol.isInEnable()
@@ -364,15 +368,31 @@
if (back) {
storageEscalationParam.setWCSStatus(1);
storageEscalationParam.setWCSErrorMessage(storageEscalationParam.getWCSErrorMessage() + errMsg);
+ // led 寮傚父鏄剧ず
+ if (ledThread != null) {
+ String errorMsg = errMsg;
+ MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errorMsg));
+ }
}
}
+ ScaleThread scaleThread = (ScaleThread) SlaveConnection.get(SlaveType.Scale, inSta.getBarcode());
+ if(scaleThread != null) {
+ storageEscalationParam.setWeight(scaleThread.getScale());
+ }
storageEscalationParam.setBoxNo(BoxNo);
//鏄惁婊℃澘 1婊℃澘 0绌烘澘
storageEscalationParam.setStaType(staProtocol.isEmptyMk() ? 0 : 1);
- //搴撲綅绫诲瀷 1楂樺簱浣� 0浣庡簱浣�
- storageEscalationParam.setLocType(staProtocol.isHigh() ? 1 : 0);
+ //搴撲綅绫诲瀷 2涓簱浣� 1楂樺簱浣� 0浣庡簱浣�
+ if(staProtocol.isHigh()){
+ storageEscalationParam.setLocType(1);
+ }else if(staProtocol.isLow()){
+ storageEscalationParam.setLocType(0);
+ }else if (staProtocol.isCentre()){
+ storageEscalationParam.setLocType(2);
+ }
+
storageEscalationParam.setTerminalNo(staProtocol.getSiteId());
log.info("缁勬墭鍏ュ簱={}", storageEscalationParam);
String response = "";
@@ -436,6 +456,11 @@
}
}
} else {
+ // led 寮傚父鏄剧ず
+ if (ledThread != null) {
+ String errorMsg = "宸叉湁鍏ュ簱浠诲姟锛侊紒锛�";
+ MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errorMsg));
+ }
staProtocol.setWorkNo((short) 9991);
staProtocol.setStaNo(inSta.getBackSta().shortValue());
devpThread.setPakMk(staProtocol.getSiteId(), false);
@@ -443,6 +468,13 @@
}
} else {
+
+ // led 寮傚父鏄剧ず
+ if (ledThread != null) {
+ String errorMsg = jsonObject.getString("ErrorMessage");
+ MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errorMsg));
+ }
+
staProtocol.setWorkNo((short) 9991);
staProtocol.setStaNo(inSta.getBackSta().shortValue());
devpThread.setPakMk(staProtocol.getSiteId(), false);
@@ -502,6 +534,9 @@
staProtocol = staProtocol.clone();
}
Short workNo = staProtocol.getWorkNo();
+ //led
+ LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed());
+
// 鍒ゆ柇鏄惁婊¤冻鍏ュ簱鏉′欢
if (staProtocol.isAutoing() && staProtocol.isLoading()
&& staProtocol.isInEnable()
@@ -590,6 +625,11 @@
}
}
} else {
+ // led 寮傚父鏄剧ず
+ if (ledThread != null) {
+ String errorMsg = "浠诲姟宸插瓨鍦紒锛侊紒锛�";
+ MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errorMsg));
+ }
staProtocol.setWorkNo((short) 9991);
staProtocol.setStaNo(inSta.getBackSta().shortValue());
devpThread.setPakMk(staProtocol.getSiteId(), false);
@@ -597,6 +637,11 @@
}
} else {
+ // led 寮傚父鏄剧ず
+ if (ledThread != null) {
+ String errorMsg = jsonObject.getString("ErrorMessage");
+ MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errorMsg));
+ }
staProtocol.setWorkNo((short) 9991);
staProtocol.setStaNo(inSta.getBackSta().shortValue());
devpThread.setPakMk(staProtocol.getSiteId(), false);
@@ -1129,9 +1174,19 @@
LocMast locMast = locMastService.selectByLocNo(taskWrk.getStartPoint());
//鍒ゆ柇鍏跺簱浣嶆槸鍚︿负娣卞簱浣嶏紝濡傛灉涓烘繁搴撲綅鎵惧叾娴呭簱浣嶆槸閮芥湁璐�
- if (locMast.getRow1() == 8 || locMast.getRow1() == 5) {
+ if (locMast.getRow1() == 5) {
LocMast locMast1 = locMastService.selectOne(new EntityWrapper<LocMast>()
.eq("row1", (locMast.getRow1() + 1))
+ .eq("bay1", locMast.getBay1())
+ .eq("lev1", locMast.getLev1()).eq("loc_sts", "F"));
+ if (!Cools.isEmpty(locMast1)) {
+ log.info(locMast.getLocNo() + "鍑烘繁搴撲綅锛屾祬搴撲綅鏈夎揣");
+ continue;
+ }
+ }
+ if (locMast.getRow1() == 8) {
+ LocMast locMast1 = locMastService.selectOne(new EntityWrapper<LocMast>()
+ .eq("row1", (locMast.getRow1() - 1 ))
.eq("bay1", locMast.getBay1())
.eq("lev1", locMast.getLev1()).eq("loc_sts", "F"));
if (!Cools.isEmpty(locMast1)) {
@@ -1790,7 +1845,7 @@
taskWrk.setStatus(TaskStatusType.RECEIVE.id);//浠诲姟鐘舵�侊細鎺ユ敹
taskWrk.setCreateTime(now);
taskWrk.setIoType(1);//浠诲姟绫诲瀷 鍏ュ簱
- taskWrk.setIoPri(13);//浼樺厛绾�
+ taskWrk.setIoPri(10);//浼樺厛绾�
taskWrk.setBarcode(barcode);//鏉$爜
taskWrk.setTargetPoint(locNo);
taskWrk.setStartPoint(staNo+"");
@@ -1874,14 +1929,21 @@
// 鑾峰彇led绾跨▼
LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId());
// led鏄剧ず榛樿鍐呭
- if (reset && !ledThread.isLedMk()) {
+ if (reset) {
ledThread.setLedMk(true);
- if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(4, new ArrayList<>()))) {
+ if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(2, new ArrayList<>()))) {
log.error(""+mark+" - 1"+" - {}鍙稬ED鍛戒护涓嬪彂澶辫触锛侊紒锛乕ip锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort());
} else {
}
}
+// if (reset) {
+// if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(2, new ArrayList<>()))) {
+// log.error(""+mark+" - 1"+" - {}鍙稬ED鍛戒护涓嬪彂澶辫触锛侊紒锛乕ip锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort());
+// } else {
+//
+// }
+// }
}
// log.info(""+mark+" - 0"+" - 鎵ц瀹屾垚锛氬叾浠� ===>> LED鏄剧ず鍣ㄥ浣嶏紝鏄剧ず榛樿淇℃伅");
}
--
Gitblit v1.9.1