From 84026ccb613df98417ab3063a6e7ac2a9151487f Mon Sep 17 00:00:00 2001
From: DELL <DELL@qq.com>
Date: 星期五, 28 十一月 2025 15:16:58 +0800
Subject: [PATCH] #

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

diff --git a/src/main/java/com/zy/core/thread/impl/ZyStationThread.java b/src/main/java/com/zy/core/thread/impl/ZyStationThread.java
index d54012a..ea8e40f 100644
--- a/src/main/java/com/zy/core/thread/impl/ZyStationThread.java
+++ b/src/main/java/com/zy/core/thread/impl/ZyStationThread.java
@@ -11,6 +11,8 @@
 import com.core.common.SpringUtils;
 import com.zy.asrs.entity.DeviceConfig;
 import com.zy.asrs.entity.DeviceDataLog;
+import com.zy.asrs.entity.BasStationOpt;
+import com.zy.asrs.service.BasStationOptService;
 import com.zy.common.utils.RedisUtil;
 import com.zy.core.network.ZyStationConnectDriver;
 import com.zy.core.cache.MessageQueue;
@@ -176,8 +178,41 @@
 
     @Override
     public CommandResponse sendCommand(StationCommand command) {
-       CommandResponse commandResponse = zyStationConnectDriver.sendCommand(command);
-       return commandResponse;
+       CommandResponse commandResponse = null;
+       try {
+           commandResponse = zyStationConnectDriver.sendCommand(command);
+           return commandResponse;
+       } finally {
+           BasStationOptService optService = SpringUtils.getBean(BasStationOptService.class);
+           List<ZyStationStatusEntity> statusListEntity = zyStationConnectDriver.getStatus();
+           ZyStationStatusEntity matched = null;
+           if (statusListEntity != null) {
+               for (ZyStationStatusEntity e : statusListEntity) {
+                   if (e.getStationId() != null && e.getStationId().equals(command.getStationId())) {
+                       matched = e;
+                       break;
+                   }
+               }
+           }
+           BasStationOpt basStationOpt = new BasStationOpt(
+                   command.getTaskNo(),
+                   command.getStationId(),
+                   new Date(),
+                   "MOVE",
+                   command.getStationId(),
+                   command.getTargetStaNo(),
+                   null,
+                   null,
+                   null,
+                   JSON.toJSONString(command),
+                   JSON.toJSONString(matched),
+                   1,
+                   JSON.toJSONString(commandResponse)
+           );
+           if (optService != null) {
+               optService.insert(basStationOpt);
+           }
+       }
     }
 
     @Override

--
Gitblit v1.9.1