From b69671d75ba283f8d47c31ae989b5dd346b62967 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期四, 24 四月 2025 15:17:54 +0800
Subject: [PATCH] #出库任务预调度提升机

---
 src/main/java/com/zy/core/thread/impl/LfdZyForkLiftSlaveThread.java |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/impl/LfdZyForkLiftSlaveThread.java b/src/main/java/com/zy/core/thread/impl/LfdZyForkLiftSlaveThread.java
index 3ee487a..7075597 100644
--- a/src/main/java/com/zy/core/thread/impl/LfdZyForkLiftSlaveThread.java
+++ b/src/main/java/com/zy/core/thread/impl/LfdZyForkLiftSlaveThread.java
@@ -159,6 +159,8 @@
                 forkLiftProtocol.setIOMode((int) siemensS7Net.getByteTransform().TransInt16(result1.Content, 12));
                 //鏁呴殰鐮�
                 forkLiftProtocol.setErrorCode((int) siemensS7Net.getByteTransform().TransInt16(result1.Content, 14));
+                //褰撳墠灞�
+                forkLiftProtocol.setLev((int) siemensS7Net.getByteTransform().TransInt16(result1.Content, 16));
 
                 //************琛ュ厖鎵╁睍瀛楁*************
                 InnerForkLiftExtend forkLiftExtend = (InnerForkLiftExtend) forkLiftProtocol.getExtend();
@@ -304,6 +306,25 @@
     }
 
     @Override
+    public CommandResponse move(ForkLiftCommand command) {
+        CommandResponse response = new CommandResponse(false);
+
+        short[] array = new short[4];
+        array[0] = command.getTaskNo();//浠诲姟鍙�
+        array[1] = command.getMode();//浠诲姟妯″紡
+        array[2] = command.getPick();//鍙栬揣鏁版嵁
+        array[3] = command.getPut();//鏀捐揣鏁版嵁
+        OperateResult result = this.masterThread.write(this.slave.getId(), "write", array);
+        if (result.IsSuccess) {
+            OperateResult result2 = this.masterThread.write(this.slave.getId(), "writeConfirm", command.getConfirm());
+            if (result2.IsSuccess) {
+                response.setResult(true);
+            }
+        }
+        return response;
+    }
+
+    @Override
     public CommandResponse reset() {
         CommandResponse response = new CommandResponse(false);
         OperateResult result = this.masterThread.write(this.slave.getId(), "confirm", (short) 1);
@@ -424,6 +445,24 @@
         return commands;
     }
 
+    @Override
+    public List<ForkLiftCommand> getMoveCommand(Integer taskNo, Integer pick, Integer put) {
+        Integer realPick = pick % 1000;
+        Integer realPut = put % 1000;
+
+        List<ForkLiftCommand> commands = new ArrayList<>();
+        ForkLiftCommand command = new ForkLiftCommand();
+        command.setLiftNo(slave.getId());
+        command.setTaskNo(taskNo.shortValue());
+        command.setMode(ForkLiftTaskModeType.MOVE.id.shortValue());
+        command.setPick(realPick.shortValue());
+        command.setPut(realPut.shortValue());
+        command.setConfirm((short) 1);
+
+        commands.add(command);
+        return commands;
+    }
+
     /**
      * 鎵╁睍瀛楁
      */

--
Gitblit v1.9.1