From 39b95ef917ac3a01d8e1d315d25b4645b9df9692 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期四, 16 四月 2026 10:54:27 +0800
Subject: [PATCH] #检查是否为出库模式增加提示信息

---
 src/main/java/com/zy/core/utils/CrnOperateProcessUtils.java |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/core/utils/CrnOperateProcessUtils.java b/src/main/java/com/zy/core/utils/CrnOperateProcessUtils.java
index 5c813e1..19a9b51 100644
--- a/src/main/java/com/zy/core/utils/CrnOperateProcessUtils.java
+++ b/src/main/java/com/zy/core/utils/CrnOperateProcessUtils.java
@@ -391,6 +391,12 @@
             return false;
         }
 
+        //妫�鏌ユ槸鍚︿负鍑哄簱妯″紡
+        if(!checkOutTargetStationIoMode(wrkMast)) {
+            News.taskInfo(wrkMast.getWrkNo(), "鍫嗗灈鏈�:{} 浠诲姟:{}绂佹鎵ц锛屽嚭搴撶珯:{} 涓嶅浜庡嚭搴撴ā寮�", basCrnp.getCrnNo(), wrkMast.getWrkNo(), wrkMast.getStaNo());
+            return false;
+        }
+
         for (StationObjModel stationObjModel : outStationList) {
             StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, stationObjModel.getDeviceNo());
             if (stationThread == null) {
@@ -622,6 +628,36 @@
         return false;
     }
 
+    //妫�鏌ユ槸鍚︿负鍑哄簱妯″紡
+    private boolean checkOutTargetStationIoMode(WrkMast wrkMast) {
+        if (wrkMast == null || wrkMast.getStaNo() == null) {
+            return false;
+        }
+        BasStation basStation = basStationService.getById(wrkMast.getStaNo());
+        if (basStation == null) {
+            return false;
+        }
+
+        StationThread targetStationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basStation.getDeviceNo());
+        if (targetStationThread == null) {
+            return false;
+        }
+
+        StationProtocol targetStationProtocol = targetStationThread.getStatusMap().get(wrkMast.getStaNo());
+        if (targetStationProtocol == null) {
+            return false;
+        }
+
+        if (targetStationProtocol.getIoMode() == null) {
+            return false;
+        }
+
+        if (targetStationProtocol.getIoMode() == 2) {
+            return true;//鍑哄簱妯″紡
+        }
+        return false;
+    }
+
     private int getSystemConfigInt(String code, int defaultValue) {
         Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key);
         if (systemConfigMapObj == null) {

--
Gitblit v1.9.1