From ac09ee9c9f39cb9d452b57504e5c79321e0371eb Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期四, 03 四月 2025 15:34:34 +0800
Subject: [PATCH] #

---
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyLiftThread.java |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyLiftThread.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyLiftThread.java
index c03eb2c..0be1c20 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyLiftThread.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyLiftThread.java
@@ -286,20 +286,16 @@
         }
 
         LiftDispatcher liftDispatcher = SpringUtils.getBean(LiftDispatcher.class);
-        Integer lev = liftDispatcher.getLiftLevOffset(this.device.getId().intValue(), liftProtocol.getLev());
-        if (null == lev){
-            News.error("鎻愬崌鏈鸿幏鍙栧綋鍓嶅眰涓虹┖");
-            response.setMessage("鎻愬崌鏈鸿幏鍙栧綋鍓嶅眰涓虹┖");
-            return response;
+
+        Integer origin = command.getOriginLev();
+        Integer target = command.getTargetLev();
+        if (command.getMode() == 2) {
+            origin = liftDispatcher.getLiftLevOffset(this.device.getId().intValue(), liftProtocol.getLev());
+            target = liftDispatcher.getLiftLevOffset(this.device.getId().intValue(), command.getTargetLev());
         }
-        array[1] = lev.shortValue();
-        Integer targetLev = liftDispatcher.getLiftLevOffset(this.device.getId().intValue(), command.getTargetLev());
-        if (null == targetLev){
-            News.error("鎻愬崌鏈鸿幏鍙栫洰鏍囧眰涓虹┖");
-            response.setMessage("鎻愬崌鏈鸿幏鍙栫洰鏍囧眰涓虹┖");
-            return response;
-        }
-        array[2] = targetLev.shortValue();
+
+        array[1] = origin.shortValue();
+        array[2] = target.shortValue();
 
         OperateResult result = siemensS7Net.Write("DB83.0", array);
         if (result != null && result.IsSuccess) {
@@ -413,12 +409,16 @@
     public List<LiftCommand> getMoveCommand(Integer taskNo, Integer sourceLev, Integer targetLev, LiftCommandModeType mode) {
         /**
          * 浠诲姟绫诲瀷
-         * 1=绉绘墭鐩橈紱鍗囬檷鏈哄皢婧愮珯鍙版墭鐩樼Щ鍒扮洰鏍囩珯鍙�
-         * 2=绉诲皬杞︼紝鍗囬檷鏈虹Щ鍒扮洰鏍囧眰锛岀瓑寰�
+         1=绉绘墭鐩橈紱鍗囬檷鏈哄皢婧愮珯鍙版墭鐩樼Щ鍒扮洰鏍囩珯鍙�
+         2=鎹㈠眰锛屽崌闄嶆満绉诲埌鐩爣灞傦紝绛夊緟
+         3=鍏ュ簱鎵樼洏,鍗囬檷鏈哄皢婧愮珯鍙版墭鐩樼Щ鍒扮洰鏍囧眰鏁帮紱
+         4=鍑哄簱鎵樼洏锛屽崌闄嶆満灏嗘簮绔欏彴鎵樼洏绉诲埌鐩爣绔欏彴
          */
         short taskMode = 2;
-        if (mode.equals(LiftCommandModeType.PALLET_INOUT)) {
-            taskMode = 1;
+        if (mode.equals(LiftCommandModeType.PALLET_IN)) {
+            taskMode = 3;
+        } else if (mode.equals(LiftCommandModeType.PALLET_OUT)) {
+            taskMode = 4;
         }
 
         // 寮�濮嬩换鍔�
@@ -435,7 +435,7 @@
         LiftCommand command = new LiftCommand();
         command.setLiftNo(Integer.valueOf(this.device.getDeviceNo()));
         command.setBody(JSON.toJSONString(array));
-        command.setMode(LiftCommandModeType.MOVE.id);
+        command.setMode(mode.id);
         command.setOriginLev(sourceLev);
         command.setTargetLev(targetLev);
 

--
Gitblit v1.9.1