From 6d99081f3f6e0363b0bd28053e545a8e4589b979 Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期五, 09 一月 2026 08:50:11 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/plugin/NormalProcess.java |   34 +++++++++++++++++++++++-----------
 1 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/src/main/java/com/zy/core/plugin/NormalProcess.java b/src/main/java/com/zy/core/plugin/NormalProcess.java
index 3792035..b58d1dd 100644
--- a/src/main/java/com/zy/core/plugin/NormalProcess.java
+++ b/src/main/java/com/zy/core/plugin/NormalProcess.java
@@ -56,10 +56,10 @@
 
     @Override
     public void run() {
-        //璇锋眰鐢熸垚鍏ュ簱浠诲姟
-        generateStoreWrkFile();
         //妫�娴嬪叆搴撶珯鏄惁鏈変换鍔$敓鎴愶紝骞跺惎鍔ㄥ叆搴�
         checkInStationHasTask();
+        //璇锋眰鐢熸垚鍏ュ簱浠诲姟
+        generateStoreWrkFile();
 
         //鎵ц鍫嗗灈鏈轰换鍔�
         crnOperateUtils.crnIoExecute();
@@ -71,6 +71,9 @@
         stationOperateProcessUtils.stationOutExecute();
         //妫�娴嬭緭閫佺珯鐐瑰嚭搴撲换鍔℃墽琛屽畬鎴�
         stationOperateProcessUtils.stationOutExecuteFinish();
+
+        //妫�娴嬭緭閫佺珯鐐规槸鍚﹁繍琛屽牭濉�
+        stationOperateProcessUtils.checkStationRunBlock();
     }
 
     /**
@@ -102,8 +105,23 @@
                 //婊¤冻鑷姩銆佹湁鐗┿�佹湁宸ヤ綔鍙凤紝鐢熸垚鍏ュ簱鏁版嵁
                 if (stationProtocol.isAutoing()
                         && stationProtocol.isLoading()
+                        && stationProtocol.isInEnable()
                         && stationProtocol.getTaskNo() > 0
                 ) {
+                    if (stationProtocol.getError() > 0) {
+                        Object backLock = redisUtil.get(RedisKeyType.GENERATE_STATION_BACK_LIMIT.key + stationId);
+                        if (backLock != null) {
+                            continue;
+                        }
+
+                        //鎶ヨ鍥為��
+                        StationCommand command = stationThread.getCommand(StationCommandType.MOVE, commonService.getWorkNo(WrkIoType.STATION_BACK.id), stationId, entity.getBackStation().getStationId(), 0);
+                        MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command));
+                        redisUtil.set(RedisKeyType.GENERATE_STATION_BACK_LIMIT.key + stationId, "lock", 15);
+                        News.info("{}绔欑偣鎶ヨ鍥為��鎴愬姛锛屾暟鎹寘:{}", stationId, JSON.toJSONString(command));
+                        continue;
+                    }
+
                     if (Cools.isEmpty(stationProtocol.getBarcode())) {
                         continue;
                     }
@@ -135,13 +153,6 @@
                         taskParam.setTaskPri(dto.getTaskPri());
                         taskParam.setBarcode(stationProtocol.getBarcode());
                         WrkMast wrkMast = commonService.createInTask(taskParam);
-
-                        StationCommand command = stationThread.getCommand(StationCommandType.WRITE_INFO, wrkMast.getWrkNo(), stationId, stationId, 0);
-                        if(command == null){
-                            News.taskInfo(wrkMast.getWrkNo(), "鑾峰彇杈撻�佺嚎鍛戒护澶辫触");
-                            continue;
-                        }
-                        MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command));
                     }
                 }
             }
@@ -182,9 +193,10 @@
                         && stationProtocol.getTaskNo() == 0
                         && stationProtocol.isEnableIn()
                 ) {
-                    StationCommand command = stationThread.getCommand(StationCommandType.MOVE, commonService.getWorkNo(WrkIoType.FAKE_TASK_NO.id), stationId, entity.getBarcodeStation().getStationId(), 0);
+                    StationCommand command = stationThread.getCommand(StationCommandType.MOVE, commonService.getWorkNo(WrkIoType.ENABLE_IN.id), stationId, entity.getBarcodeStation().getStationId(), 0);
                     MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command));
-                    redisUtil.set(RedisKeyType.GENERATE_ENABLE_IN_STATION_DATA_LIMIT.key + stationId, "lock", 10);
+                    redisUtil.set(RedisKeyType.GENERATE_ENABLE_IN_STATION_DATA_LIMIT.key + stationId, "lock", 15);
+                    News.info("{}绔欑偣鍚姩鍏ュ簱鎴愬姛锛屾暟鎹寘:{}", stationId, JSON.toJSONString(command));
                 }
             }
         }

--
Gitblit v1.9.1