From 441b6f8d257a01b2998253ef0515a201777d7e68 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期五, 04 七月 2025 14:06:49 +0800
Subject: [PATCH] 修改入库、移库、出库逻辑

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneExtend/SignalInteraction.cs |   86 +++++++++++++++++++++++++++++++-----------
 1 files changed, 63 insertions(+), 23 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneExtend/SignalInteraction.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneExtend/SignalInteraction.cs"
index 9ef6f79..dfef3d8 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneExtend/SignalInteraction.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneExtend/SignalInteraction.cs"
@@ -64,44 +64,83 @@
                     }
                     else
                     {
-                        Dt_ShuttleCar? shuttleCar1 = _shuttleCarService.QueryCode(task.ShuttleCarCode);
-                        if (task.TaskType == TaskRelocationTypeEnum.Relocation.ObjToInt() && task.Remark == "")
+                        if (task.TaskType == TaskRelocationTypeEnum.Relocation.ObjToInt())
                         {
-                            shuttleCar1 = _shuttleCarService.QueryNoCode(task.ShuttleCarCode);
-                            task.Remark = shuttleCar1.ShuttleCarCode;
-                            _taskService.UpdateData(task);
+                            var shuttleCar2 = _shuttleCarService.QueryNoCode(task.ShuttleCarCode);
+                            ShuttleCar shuttleCarA = Storage.Devices.FirstOrDefault(x => x.DeviceCode == shuttleCar2.ShuttleCarCode) as ShuttleCar;
+                            ShuttleCar shuttleCarB = Storage.Devices.FirstOrDefault(x => x.DeviceCode == task.ShuttleCarCode) as ShuttleCar;
+
+                            #region 鍙栬揣
+                            if (ASRSRqtGetGoods)
+                            {
+                                shuttleCarA.SetValue(ShuttleCarDBName.ASRSRqtGetGoods, ASRSRqtGetGoods, shuttleCarA.DeviceCode);
+
+                                var AGVAlwASRSGetGoods = shuttleCarA.GetValue<ShuttleCarDBName, bool>(ShuttleCarDBName.AGVAlwASRSGetGoods, shuttleCarA.DeviceCode);//鍏佽鍙栬揣
+                                if (AGVAlwASRSGetGoods)
+                                    commonStackerCrane.SetValue(StackerCraneDBName.AGVAlwASRSGetGoods, AGVAlwASRSGetGoods);
+
+                                WriteDebug($"{commonStackerCrane.DeviceName}璇锋眰鍙栬揣", $"銆恵shuttleCarA.DeviceName}銆憑(AGVAlwASRSGetGoods ? "鍏佽" : "涓嶅厑璁�")}鍙栬揣,浠诲姟鍙枫�恵task.TaskNum}銆�");
+                            }
+                            #endregion
+
+                            #region 鍙栬揣瀹屾垚
+                            if (ASRSGetGoodsDone)
+                            {
+                                shuttleCarA.SetValue(ShuttleCarDBName.ASRSGetGoodsDone, ASRSGetGoodsDone, shuttleCarA.DeviceCode);
+                                WriteDebug($"{commonStackerCrane.DeviceName}鍙栬揣瀹屾垚", $"銆恵shuttleCarA.DeviceName}銆�,浠诲姟鍙枫�恵task.TaskNum}銆�");
+                            }
+                            #endregion
+
+                            #region 鏀捐揣
+                            if (ASRSRqtPutGoods)
+                            {
+                                shuttleCarB.SetValue(ShuttleCarDBName.ASRSRqtPutGoods, ASRSRqtPutGoods, shuttleCarB.DeviceCode);
+
+                                var AGVAlwASRSPuttGoods = shuttleCarB.GetValue<ShuttleCarDBName, bool>(ShuttleCarDBName.AGVAlwASRSPuttGoods, shuttleCarB.DeviceCode);//鍏佽鏀捐揣
+                                if (AGVAlwASRSPuttGoods)
+                                    commonStackerCrane.SetValue(StackerCraneDBName.AGVAlwASRSPuttGoods, AGVAlwASRSPuttGoods);
+
+                                WriteDebug($"{commonStackerCrane.DeviceName}璇锋眰鏀捐揣", $"銆恵shuttleCarB.DeviceName}銆憑(AGVAlwASRSPuttGoods ? "鍏佽" : "涓嶅厑璁�")}鏀捐揣,浠诲姟鍙枫�恵task.TaskNum}銆�");
+                            }
+                            #endregion
+
+                            #region 鏀捐揣瀹屾垚
+                            if (ASRSPutAGoodsDone)
+                            {
+                                shuttleCarB.SetValue(ShuttleCarDBName.ASRSPutAGoodsDone, ASRSPutAGoodsDone, shuttleCarB.DeviceCode);
+                                WriteDebug($"{commonStackerCrane.DeviceName}鏀捐揣瀹屾垚", $"銆恵shuttleCarA.DeviceName}銆�,浠诲姟鍙枫�恵task.TaskNum}銆�");
+                            }
+                            #endregion
+
                         }
-                        if (shuttleCar1 != null)
+                        else
                         {
-                            ShuttleCar shuttleCar = Storage.Devices.FirstOrDefault(x => x.DeviceName == shuttleCar1.ShuttleCarName) as ShuttleCar;
+                            ShuttleCar shuttleCar = Storage.Devices.FirstOrDefault(x => x.DeviceCode == task.ShuttleCarCode) as ShuttleCar;
                             if (shuttleCar != null)
                             {
                                 shuttleCar.SetValue(ShuttleCarDBName.ASRSRqtGetAGV, ASRSRqtGetAGV, shuttleCar.DeviceCode);
-                                if (ASRSRqtGetAGV)
-                                    WriteDebug($"{commonStackerCrane.DeviceName}璇锋眰鍙栬溅", $"浠诲姟鍙枫�恵task.TaskNum}銆�");
 
                                 shuttleCar.SetValue(ShuttleCarDBName.ASRSRqtGetGoods, ASRSRqtGetGoods, shuttleCar.DeviceCode);
-                                if (ASRSRqtGetGoods)
-                                    WriteDebug($"{commonStackerCrane.DeviceName}璇锋眰鍙栬揣", $"浠诲姟鍙枫�恵task.TaskNum}銆�");
 
                                 shuttleCar.SetValue(ShuttleCarDBName.ASRSRqtPutGoods, ASRSRqtPutGoods, shuttleCar.DeviceCode);
-                                if (ASRSRqtPutGoods)
-                                    WriteDebug($"{commonStackerCrane.DeviceName}璇锋眰鏀捐揣", $"浠诲姟鍙枫�恵task.TaskNum}銆�");
 
                                 var AGVAlwASRSGetAGV = shuttleCar.GetValue<ShuttleCarDBName, bool>(ShuttleCarDBName.AGVAlwASRSGetAGV, shuttleCar.DeviceCode);//鍏佽鍙栬溅
                                 commonStackerCrane.SetValue(StackerCraneDBName.AGVAlwASRSGetAGV, AGVAlwASRSGetAGV);
-                                if (AGVAlwASRSGetAGV)
-                                    WriteDebug($"{shuttleCar.DeviceName}鍏佽鍙栬溅", $"浠诲姟鍙枫�恵task.TaskNum}銆�");
+
+                                if (ASRSRqtGetAGV)
+                                    WriteDebug($"{commonStackerCrane.DeviceName}璇锋眰鍙栬溅", $"銆恵shuttleCar.DeviceName}銆憑(AGVAlwASRSGetAGV ? "鍏佽" : "涓嶅厑璁�")}鍙栬溅,浠诲姟鍙枫�恵task.TaskNum}銆�");
 
                                 var AGVAlwASRSGetGoods = shuttleCar.GetValue<ShuttleCarDBName, bool>(ShuttleCarDBName.AGVAlwASRSGetGoods, shuttleCar.DeviceCode);//鍏佽鍙栬揣
                                 commonStackerCrane.SetValue(StackerCraneDBName.AGVAlwASRSGetGoods, AGVAlwASRSGetGoods);
-                                if (AGVAlwASRSGetGoods)
-                                    WriteDebug($"{shuttleCar.DeviceName}鍏佽鍙栬揣", $"浠诲姟鍙枫�恵task.TaskNum}銆�");
+
+                                if (ASRSRqtGetGoods)
+                                    WriteDebug($"{commonStackerCrane.DeviceName}璇锋眰鍙栬揣", $"銆恵shuttleCar.DeviceName}銆憑(AGVAlwASRSGetGoods ? "鍏佽" : "涓嶅厑璁�")}鍙栬揣,浠诲姟鍙枫�恵task.TaskNum}銆�");
 
                                 var AGVAlwASRSPuttGoods = shuttleCar.GetValue<ShuttleCarDBName, bool>(ShuttleCarDBName.AGVAlwASRSPuttGoods, shuttleCar.DeviceCode);//鍏佽鏀捐揣
                                 commonStackerCrane.SetValue(StackerCraneDBName.AGVAlwASRSPuttGoods, AGVAlwASRSPuttGoods);
-                                if (AGVAlwASRSPuttGoods)
-                                    WriteDebug($"{shuttleCar.DeviceName}鍏佽鏀捐揣", $"浠诲姟鍙枫�恵task.TaskNum}銆�");
+
+                                if (ASRSRqtPutGoods)
+                                    WriteDebug($"{commonStackerCrane.DeviceName}璇锋眰鏀捐揣", $"銆恵shuttleCar.DeviceName}銆憑(AGVAlwASRSPuttGoods ? "鍏佽" : "涓嶅厑璁�")}鏀捐揣,浠诲姟鍙枫�恵task.TaskNum}銆�");
 
                                 commonStackerCrane.SetValue(StackerCraneDBName.AGVAlwASRSPutAGV, ASRSRqtPutAGV);
                                 if (ASRSRqtPutAGV)
@@ -109,14 +148,15 @@
 
                                 shuttleCar.SetValue(ShuttleCarDBName.ASRSGetAGVDone, ASRSGetAGVDone, shuttleCar.DeviceCode);
                                 if (ASRSGetAGVDone)
-                                    WriteDebug($"{commonStackerCrane.DeviceName}鍙栬溅瀹屾垚", $"浠诲姟鍙枫�恵task.TaskNum}銆�");
+                                    WriteDebug($"{commonStackerCrane.DeviceName}鍙栬溅瀹屾垚", $"銆恵shuttleCar.DeviceName}銆�,浠诲姟鍙枫�恵task.TaskNum}銆�");
+
                                 shuttleCar.SetValue(ShuttleCarDBName.ASRSGetGoodsDone, ASRSGetGoodsDone, shuttleCar.DeviceCode);
                                 if (ASRSGetGoodsDone)
-                                    WriteDebug($"{commonStackerCrane.DeviceName}鍙栬揣瀹屾垚", $"浠诲姟鍙枫�恵task.TaskNum}銆�");
+                                    WriteDebug($"{commonStackerCrane.DeviceName}鍙栬揣瀹屾垚", $"銆恵shuttleCar.DeviceName}銆�,浠诲姟鍙枫�恵task.TaskNum}銆�");
+
                                 shuttleCar.SetValue(ShuttleCarDBName.ASRSPutAGoodsDone, ASRSPutAGoodsDone, shuttleCar.DeviceCode);
                                 if (ASRSPutAGoodsDone)
-                                    WriteDebug($"{commonStackerCrane.DeviceName}鏀捐揣瀹屾垚", $"浠诲姟鍙枫�恵task.TaskNum}銆�");
-                                //shuttleCar.SetValue(ShuttleCarDBName.ASRSPutAGVDone, ASRSPutAGVDone, shuttleCar.DeviceCode);
+                                    WriteDebug($"{commonStackerCrane.DeviceName}鏀捐揣瀹屾垚", $"銆恵shuttleCar.DeviceName}銆�,浠诲姟鍙枫�恵task.TaskNum}銆�");
                             }
                         }
                     }

--
Gitblit v1.9.3