From ef776e9fd5e4f64e4ad09a3faa12fb7bb646c79c Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期二, 31 三月 2026 08:15:36 +0800
Subject: [PATCH] Merge branch 'stationChange'

---
 src/main/java/com/zy/core/plugin/FakeProcess.java |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/main/java/com/zy/core/plugin/FakeProcess.java b/src/main/java/com/zy/core/plugin/FakeProcess.java
index 99a25f7..9fcc809 100644
--- a/src/main/java/com/zy/core/plugin/FakeProcess.java
+++ b/src/main/java/com/zy/core/plugin/FakeProcess.java
@@ -16,6 +16,7 @@
 import com.zy.core.News;
 import com.zy.core.cache.MessageQueue;
 import com.zy.core.cache.SlaveConnection;
+import com.zy.core.dispatch.StationCommandDispatcher;
 import com.zy.core.enums.*;
 import com.zy.core.model.StationObjModel;
 import com.zy.core.model.Task;
@@ -93,6 +94,8 @@
     private DualCrnOperateProcessUtils dualCrnOperateProcessUtils;
     @Autowired
     private StoreInTaskGenerationService storeInTaskGenerationService;
+    @Autowired
+    private StationCommandDispatcher stationCommandDispatcher;
 
     /**
      * 甯﹁秴鏃朵繚鎶ゆ墽琛屾柟娉�
@@ -254,7 +257,7 @@
                     StationCommand command = stationThread.getCommand(StationCommandType.MOVE,
                             commonService.getWorkNo(WrkIoType.FAKE_TASK_NO.id), stationId,
                             entity.getBarcodeStation().getStationId(), 0);
-                    MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command));
+                    stationCommandDispatcher.dispatch(basDevp.getDevpNo(), command, "fake-process", "fake-enable-in");
                     redisUtil.set(RedisKeyType.GENERATE_FAKE_IN_STATION_DATA_LIMIT.key + stationId, "lock", 5);
                 }
             }
@@ -349,7 +352,7 @@
                         News.taskInfo(wrkMast.getWrkNo(), "鑾峰彇杈撻�佺嚎鍛戒护澶辫触");
                         continue;
                     }
-                    MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command));
+                    stationCommandDispatcher.dispatch(basDevp.getDevpNo(), command, "fake-process", "fake-in-task");
                     redisUtil.set(RedisKeyType.GENERATE_FAKE_IN_TASK_LIMIT.key + stationId, "lock", 5);
                 }
             }
@@ -459,7 +462,7 @@
             News.taskInfo(wrkMast.getWrkNo(), "鑾峰彇杈撻�佺嚎鍛戒护澶辫触");
             return;
         }
-        MessageQueue.offer(SlaveType.Devp, context.getBasDevp().getDevpNo(), new Task(2, command));
+        stationCommandDispatcher.dispatch(context.getBasDevp().getDevpNo(), command, "fake-process", "write-info");
     }
 
     // 璁$畻鎵�鏈夌珯鐐瑰仠鐣欐椂闂�
@@ -521,7 +524,7 @@
                         continue;
                     }
 
-                    MessageQueue.offer(SlaveType.Devp, stationObjModel.getDeviceNo(), new Task(2, command));
+                    stationCommandDispatcher.dispatch(stationObjModel.getDeviceNo(), command, "fake-process", "out-station-reset");
                     redisUtil.set(
                             RedisKeyType.CHECK_OUT_STATION_STAY_TIME_OUT_LIMIT.key + stationObjModel.getStationId(),
                             "lock", 10);
@@ -584,7 +587,7 @@
 
                 WrkMast wrkMast = wrkMastService.selectByWorkNo(stationProtocol.getTaskNo());
                 if (wrkMast == null) {
-                    MessageQueue.offer(SlaveType.Devp, stationObjModel.getDeviceNo(), new Task(2, command));
+                    stationCommandDispatcher.dispatch(stationObjModel.getDeviceNo(), command, "fake-process", "in-station-reset-task-over");
                     redisUtil.set(
                             RedisKeyType.CHECK_IN_STATION_STAY_TIME_OUT_LIMIT.key + stationObjModel.getStationId(),
                             "lock", 10);
@@ -605,7 +608,7 @@
                                 continue;
                             }
 
-                            MessageQueue.offer(SlaveType.Devp, stationObjModel.getDeviceNo(), new Task(2, command));
+                            stationCommandDispatcher.dispatch(stationObjModel.getDeviceNo(), command, "fake-process", "in-station-reset-crn-fetch");
                             redisUtil.set(RedisKeyType.CHECK_IN_STATION_STAY_TIME_OUT_LIMIT.key
                                     + stationObjModel.getStationId(), "lock", 10);
                             News.info("杈撻�佺珯鐐归噸缃懡浠や笅鍙戞垚鍔�(crn_fetch)锛岀珯鐐瑰彿={}锛屽懡浠ゆ暟鎹�={}", stationObjModel.getStationId(),
@@ -632,7 +635,7 @@
                                 continue;
                             }
 
-                            MessageQueue.offer(SlaveType.Devp, stationObjModel.getDeviceNo(), new Task(2, command));
+                            stationCommandDispatcher.dispatch(stationObjModel.getDeviceNo(), command, "fake-process", "in-station-reset-dual-crn-fetch");
                             redisUtil.set(RedisKeyType.CHECK_IN_STATION_STAY_TIME_OUT_LIMIT.key
                                     + stationObjModel.getStationId(), "lock", 10);
                             News.info("杈撻�佺珯鐐归噸缃懡浠や笅鍙戞垚鍔�(crn_fetch)锛岀珯鐐瑰彿={}锛屽懡浠ゆ暟鎹�={}", stationObjModel.getStationId(),
@@ -699,7 +702,7 @@
                         // 鐢熸垚浠跨湡绔欑偣鏁版嵁
                         StationCommand command = stationThread.getCommand(StationCommandType.WRITE_INFO, 9998,
                                 wrkMast.getSourceStaNo(), 0, 0);
-                        MessageQueue.offer(SlaveType.Devp, stationObjModel.getDeviceNo(), new Task(2, command));
+                        stationCommandDispatcher.dispatch(stationObjModel.getDeviceNo(), command, "fake-process", "crn-out-complete-write-info");
                         redisUtil.set(RedisKeyType.CRN_OUT_TASK_COMPLETE_STATION_INFO.key + wrkMast.getWrkNo(), JSON.toJSONString(stationObjModel, SerializerFeature.DisableCircularReferenceDetect), 60 * 60 * 24);
                     }
                 } else if (wrkMast.getWrkSts() == WrkStsType.LOC_MOVE_RUN.sts) {

--
Gitblit v1.9.1