From 8fb65b05c4e7abf048ef9b2f615d647226b06f1a Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期二, 01 十一月 2022 14:04:50 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 52 insertions(+), 0 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 410b59f..2994db2 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -2726,6 +2726,7 @@
wrkCharge.setWrkSts(41L); // 41.灏忚溅鍑嗗澶嶄綅
wrkCharge.setCrnNo(2); // 鍥哄畾2鍙峰爢鍨涙満
wrkCharge.setIoPri((double) 10);
+ wrkCharge.setSourceLocNo(value.locNo);
wrkCharge.setLocNo(basSte.getIdleLoc());
wrkCharge.setMemo("reset");
if (!wrkChargeService.insert(wrkCharge)) {
@@ -2733,6 +2734,57 @@
continue;
}
+ // 1.鎼繍鑷冲浐瀹氶�氶亾
+ if (wrkCharge.getWrkSts() == 41L) {
+ // 鎼皬杞﹁嚦灏忚溅璧板悜閫氶亾
+ List<String> channel = slaveProperties.getChannel();
+ for (String channelLocNo : channel) {
+ Integer otherSte = existOtherSte(channelLocNo, wrkCharge.getSteNo());
+ if (null != otherSte) {
+ log.warn("{}鍙峰皬杞︾Щ鍏}搴撲綅缁勫け璐ワ紝鍘熷洜锛氬瓨鍦▄}鍙风┛姊溅锛�", wrkCharge.getSteNo(), channelLocNo, otherSte);
+ } else {
+ // 鍥哄畾鍫嗗灈鏈�
+ int crnNo = 1;
+ LocMast channelLoc = locMastService.selectById(channelLocNo);
+
+ CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crnNo);
+ CrnProtocol crnProtocol = crnThread.getCrnProtocol();
+ if (crnProtocol == null) { continue; }
+ // 鍙湁褰撳爢鍨涙満绌洪棽 骞朵笖 鏃犱换鍔℃椂鎵嶇户缁墽琛�
+ if (crnProtocol.getStatusType() == CrnStatusType.IDLE && crnProtocol.getTaskNo() == 0 && crnProtocol.getModeType() == CrnModeType.AUTO) {
+ // 鍫嗗灈鏈哄懡浠や笅鍙戝尯 --------------------------------------------------------------------------
+ CrnCommand crnCommand = new CrnCommand();
+ crnCommand.setCrnNo(crnNo); // 鍫嗗灈鏈虹紪鍙�
+ crnCommand.setTaskNo(wrkCharge.getWrkNo().shortValue()); // 宸ヤ綔鍙�
+ crnCommand.setAckFinish((short) 0); // 浠诲姟瀹屾垚纭浣�
+ crnCommand.setTaskMode(CrnTaskModeType.STE_MOVE); // 浠诲姟妯″紡: 搴撲綅绉昏浆
+ crnCommand.setSourcePosX(Utils.getGroupRow(steProtocol.getRow().intValue(), true).shortValue()); // 婧愬簱浣嶆帓
+ crnCommand.setSourcePosY(steProtocol.getBay()); // 婧愬簱浣嶅垪
+ crnCommand.setSourcePosZ(steProtocol.getLev()); // 婧愬簱浣嶅眰
+ crnCommand.setDestinationPosX(Utils.getGroupRow(channelLoc.getLocNo(), false).shortValue()); // 鐩爣搴撲綅鎺�
+ crnCommand.setDestinationPosY(channelLoc.getBay1().shortValue()); // 鐩爣搴撲綅鍒�
+ crnCommand.setDestinationPosZ(channelLoc.getLev1().shortValue()); // 鐩爣搴撲綅灞�
+ if (!MessageQueue.offer(SlaveType.Crn, wrkCharge.getCrnNo(), new Task(2, crnCommand))) {
+ log.error("鍫嗗灈鏈哄懡浠や笅鍙戝け璐ワ紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", wrkCharge.getCrnNo(), JSON.toJSON(crnCommand));
+ } else {
+ // 淇敼绌挎杞﹁繍琛屼腑鎺掑垪灞�
+ steThread.modifyPos(Utils.getGroupRow(channelLoc.getLocNo(), true), channelLoc.getBay1(), channelLoc.getLev1());
+ // 淇敼宸ヤ綔妗g姸鎬� 41.灏忚溅鍑嗗澶嶄綅 => 42.鍚婅溅鎼繍
+ Date now = new Date();
+ wrkCharge.setWrkSts(42L);
+ wrkCharge.setCrnStrTime(now);
+ wrkCharge.setModiTime(now);
+ if (!wrkChargeService.updateById(wrkCharge)) {
+ log.error("淇敼宸ヤ綔妗g姸鎬� 41.灏忚溅鍑嗗澶嶄綅 => 42.鍚婅溅鎼繍 澶辫触锛侊紒锛屽伐浣滃彿={}", wrkCharge.getWrkNo());
+ }
+ }
+ break;
+ }
+
+ }
+ }
+
+ }
}
}
}
--
Gitblit v1.9.1