From 7ca9651f81d7b84f054194d3d46fdbd1d9c8b922 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期三, 09 七月 2025 22:55:27 +0800
Subject: [PATCH] 增加质检出入库逻辑

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneExtend/SignalInteraction.cs |   85 ++++++++++++++++++++++++++++++++++++++----
 1 files changed, 77 insertions(+), 8 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 6754049..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"
@@ -53,41 +53,110 @@
                        && task.TargetIsPickPlace && ASRSRqtPutGoods)//璇锋眰鏀捐揣
                     {
                         commonStackerCrane.SetValue(StackerCraneDBName.AGVAlwASRSPuttGoods, ASRSRqtPutGoods);
+                        WriteDebug($"{commonStackerCrane.DeviceName}璇锋眰鏀捐揣", $"WCS鍏佽鏀捐揣,浠诲姟鍙枫�恵task.TaskNum}銆�");
                     }
                     else if ((_taskService.TaskOutboundTypes.Contains(task.TaskType)
                         || task.TaskType == TaskRelocationTypeEnum.Relocation.ObjToInt())
                         && ASRSRqtGetGoods && task.SourceIsPickPlace)//璇锋眰鍙栬揣
                     {
                         commonStackerCrane.SetValue(StackerCraneDBName.AGVAlwASRSGetGoods, ASRSRqtGetGoods);
-                    }
-                    else if (_taskService.TaskOutboundTypes.Contains(task.TaskType) && ASRSPutAGoodsDone)
-                    {
-
+                        WriteDebug($"{commonStackerCrane.DeviceName}璇锋眰鍙栬揣", $"WCS鍏佽鍙栬揣,浠诲姟鍙枫�恵task.TaskNum}銆�");
                     }
                     else
                     {
-                        Dt_ShuttleCar? shuttleCar1 = _shuttleCarService.QueryCode(task.ShuttleCarCode);
-                        if (shuttleCar1 != null)
+                        if (task.TaskType == TaskRelocationTypeEnum.Relocation.ObjToInt())
                         {
-                            ShuttleCar shuttleCar = Storage.Devices.FirstOrDefault(x => x.DeviceName == shuttleCar1.ShuttleCarName) as ShuttleCar;
+                            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
+
+                        }
+                        else
+                        {
+                            ShuttleCar shuttleCar = Storage.Devices.FirstOrDefault(x => x.DeviceCode == task.ShuttleCarCode) as ShuttleCar;
                             if (shuttleCar != null)
                             {
                                 shuttleCar.SetValue(ShuttleCarDBName.ASRSRqtGetAGV, ASRSRqtGetAGV, shuttleCar.DeviceCode);
+
                                 shuttleCar.SetValue(ShuttleCarDBName.ASRSRqtGetGoods, ASRSRqtGetGoods, shuttleCar.DeviceCode);
+
                                 shuttleCar.SetValue(ShuttleCarDBName.ASRSRqtPutGoods, ASRSRqtPutGoods, shuttleCar.DeviceCode);
 
                                 var AGVAlwASRSGetAGV = shuttleCar.GetValue<ShuttleCarDBName, bool>(ShuttleCarDBName.AGVAlwASRSGetAGV, shuttleCar.DeviceCode);//鍏佽鍙栬溅
                                 commonStackerCrane.SetValue(StackerCraneDBName.AGVAlwASRSGetAGV, AGVAlwASRSGetAGV);
+
+                                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 (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 (ASRSRqtPutGoods)
+                                    WriteDebug($"{commonStackerCrane.DeviceName}璇锋眰鏀捐揣", $"銆恵shuttleCar.DeviceName}銆憑(AGVAlwASRSPuttGoods ? "鍏佽" : "涓嶅厑璁�")}鏀捐揣,浠诲姟鍙枫�恵task.TaskNum}銆�");
+
                                 commonStackerCrane.SetValue(StackerCraneDBName.AGVAlwASRSPutAGV, ASRSRqtPutAGV);
+                                if (ASRSRqtPutAGV)
+                                    WriteDebug($"{commonStackerCrane.DeviceName}璇锋眰鏀捐溅", $"WCS鍏佽鏀捐溅,浠诲姟鍙枫�恵task.TaskNum}銆�");
 
                                 shuttleCar.SetValue(ShuttleCarDBName.ASRSGetAGVDone, ASRSGetAGVDone, shuttleCar.DeviceCode);
+                                if (ASRSGetAGVDone)
+                                    WriteDebug($"{commonStackerCrane.DeviceName}鍙栬溅瀹屾垚", $"銆恵shuttleCar.DeviceName}銆�,浠诲姟鍙枫�恵task.TaskNum}銆�");
+
                                 shuttleCar.SetValue(ShuttleCarDBName.ASRSGetGoodsDone, ASRSGetGoodsDone, shuttleCar.DeviceCode);
+                                if (ASRSGetGoodsDone)
+                                    WriteDebug($"{commonStackerCrane.DeviceName}鍙栬揣瀹屾垚", $"銆恵shuttleCar.DeviceName}銆�,浠诲姟鍙枫�恵task.TaskNum}銆�");
+
                                 shuttleCar.SetValue(ShuttleCarDBName.ASRSPutAGoodsDone, ASRSPutAGoodsDone, shuttleCar.DeviceCode);
-                                //shuttleCar.SetValue(ShuttleCarDBName.ASRSPutAGVDone, ASRSPutAGVDone, shuttleCar.DeviceCode);
+                                if (ASRSPutAGoodsDone)
+                                    WriteDebug($"{commonStackerCrane.DeviceName}鏀捐揣瀹屾垚", $"銆恵shuttleCar.DeviceName}銆�,浠诲姟鍙枫�恵task.TaskNum}銆�");
                             }
                         }
                     }

--
Gitblit v1.9.3