From fe2a1e74780259605cd230e6f9c629c3dd7fdf15 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期五, 10 四月 2026 20:19:06 +0800
Subject: [PATCH] feat: 添加消防任务支持并修复堆垛机状态处理

---
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Common/CommonStackerCrane.cs |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Common/CommonStackerCrane.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Common/CommonStackerCrane.cs
index 76aff9c..d940fb7 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Common/CommonStackerCrane.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Common/CommonStackerCrane.cs
@@ -225,7 +225,7 @@
                 {
                     return DeviceStatus.Idle;
                 }
-                else if (StackerCraneWorkStatusValue == StackerCraneWorkStatus.Putting || StackerCraneWorkStatusValue == StackerCraneWorkStatus.PickUp || StackerCraneWorkStatusValue == StackerCraneWorkStatus.PickUpCompleted || StackerCraneWorkStatusValue == StackerCraneWorkStatus.PutCompleted)
+                else if (StackerCraneWorkStatusValue == StackerCraneWorkStatus.Putting || StackerCraneWorkStatusValue == StackerCraneWorkStatus.PickUp || StackerCraneWorkStatusValue == StackerCraneWorkStatus.PutMove || StackerCraneWorkStatusValue == StackerCraneWorkStatus.PutCompleted)
                 {
                     return DeviceStatus.Working;
                 }
@@ -236,7 +236,11 @@
         private int GetCurrentTaskNum()
         {
             DeviceProDTO? devicePro = _deviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == nameof(CurrentTaskNum));
-            return devicePro == null ? throw new Exception($"璇诲彇褰撳墠浠诲姟鍙烽敊璇�,鏈幏鍙栧埌鍗忚淇℃伅,璇锋鏌ラ厤缃弬鏁板悕绉版槸鍚﹂厤缃�,涓旈厤缃负涓簕nameof(CurrentTaskNum)}") : (int)Communicator.ReadAsObj(devicePro.DeviceProAddress, devicePro.DeviceDataType);
+            if (devicePro == null)
+                throw new Exception($"璇诲彇褰撳墠浠诲姟鍙烽敊璇�,鏈幏鍙栧埌鍗忚淇℃伅,璇锋鏌ラ厤缃弬鏁板悕绉版槸鍚﹂厤缃�,涓旈厤缃负{nameof(CurrentTaskNum)}");
+
+            object value = Communicator.ReadAsObj(devicePro.DeviceProAddress, devicePro.DeviceDataType);
+            return Convert.ToInt32(value);  // 缁熶竴杞崲涓� int
         }
 
         /// <summary>
@@ -311,10 +315,10 @@
                     {
                         return deviceProtocolDetail.ProtocolDetailType;
                     }
-                    return StackerCraneStatus.Unkonw.ToString();
+                    return StackerCraneStatus.Unknown.ToString();
                 }
             }
-            return StackerCraneStatus.Unkonw.ToString();
+            return StackerCraneStatus.Unknown.ToString();
         }
 
         private void CheckConnect()

--
Gitblit v1.9.3