From a8756c3526832332db4ef5685348d9b188c2bf2b Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期六, 13 九月 2025 08:36:44 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/阻焊仓/GroundStationJob_ZH.cs |   52 +++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 49 insertions(+), 3 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\351\230\273\347\204\212\344\273\223/GroundStationJob_ZH.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\351\230\273\347\204\212\344\273\223/GroundStationJob_ZH.cs"
index b7570c9..d70a8aa 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\351\230\273\347\204\212\344\273\223/GroundStationJob_ZH.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\351\230\273\347\204\212\344\273\223/GroundStationJob_ZH.cs"
@@ -7,6 +7,7 @@
 using System.Threading.Tasks;
 using WIDESEAWCS_Common;
 using WIDESEAWCS_Common.TaskEnum;
+using WIDESEAWCS_Common.WareHouseEnum;
 using WIDESEAWCS_Core.Helper;
 using WIDESEAWCS_IBasicInfoRepository;
 using WIDESEAWCS_ITaskInfoRepository;
@@ -14,6 +15,7 @@
 using WIDESEAWCS_Model.Models;
 using WIDESEAWCS_QuartzJob;
 using WIDESEAWCS_Tasks.HoisterJob;
+using WIDESEAWCS_Tasks.闃荤剨浠�;
 
 namespace WIDESEAWCS_Tasks
 {
@@ -70,10 +72,11 @@
                             ////鍒ゆ柇AGV浠诲姟瀹屾垚锛屽悗鍐欑粰鍦伴潰绔欏彇璐у畬鎴�
                             //device.SetValue(GroundStationDBName.W_TakeRequest, false, item.StationCode);
                             //device.SetValue(GroundStationDBName.W_TakeFinish, false, item.StationCode);
-                            Dt_Task task = _taskRepository.QueryFirst(x => x.DeviceCode == item.StackerCraneCode && x.TaskState == TaskStatusEnum.SC_Execute.ObjToInt() && string.IsNullOrEmpty(x.NextAddress));
-                            if (task != null && isCanPut && !isCanTake && !putRequest && !putFinish && !takeRequest && !takeFinish)
+                            Dt_Task task = _taskRepository.QueryFirst(x => x.DeviceCode == item.StackerCraneCode && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && x.TaskState == TaskStatusEnum.New.ObjToInt() && x.NextAddress==item.StationCode);
+                            Dt_Task? taskOther = _taskRepository.QueryFirst(x => x.Roadway == item.StackerCraneCode && x.TaskType < TaskTypeEnum.Inbound.ObjToInt() && (x.TaskState == TaskStatusEnum.SC_Executing.ObjToInt() || x.TaskState == TaskStatusEnum.SC_Execute.ObjToInt() || x.TaskState == TaskStatusEnum.AGV_Executing.ObjToInt() || x.TaskState == TaskStatusEnum.AGV_WaitToExecute.ObjToInt() || x.TaskState == TaskStatusEnum.Exception.ObjToInt()));
+                            if (task != null && isCanPut && !isCanTake && !putRequest && !putFinish && !takeRequest && !takeFinish && taskOther == null)
                             {
-                                _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, nextAddress: item.StationCode);
+                                _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, nextAddress: item.StackerCraneStationCode);
                             }
                         }
                         if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt())
@@ -98,6 +101,49 @@
                                 _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: stationManger.StackerCraneStationCode, targetAddress: locationCode, nextAddress: locationCode, deviceCode: stationManger.StackerCraneCode);
                             }
                         }
+                        if (item.StationCode == "301")
+                        {
+                            StackerCraneJob_ZH.zHReadData.R_ZH_TakePalletType1= device.GetValue<GroundStationDBName, short>(GroundStationDBName.R_TakePalletType, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.R_ZH_IsCanPut1 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.R_ZH_IsCanTake1 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.W_ZH_PutPalletType1 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.W_PutPalletType, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.W_ZH_PutRequest1 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.W_ZH_PutFinish1 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutFinish, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.W_ZH_TakeRequest1 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeRequest, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.W_ZH_TakeFinish1 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeFinish, item.StationCode);
+                        }else if(item.StationCode == "302")
+                        {
+                            StackerCraneJob_ZH.zHReadData.R_ZH_TakePalletType2 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.R_TakePalletType, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.R_ZH_IsCanPut2 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.R_ZH_IsCanTake2 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.W_ZH_PutPalletType2 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.W_PutPalletType, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.W_ZH_PutRequest2 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.W_ZH_PutFinish2 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutFinish, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.W_ZH_TakeRequest2 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeRequest, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.W_ZH_TakeFinish2 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeFinish, item.StationCode);
+                        }
+                        else if (item.StationCode == "303")
+                        {
+                            StackerCraneJob_ZH.zHReadData.R_ZH_TakePalletType3 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.R_TakePalletType, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.R_ZH_IsCanPut3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.R_ZH_IsCanTake3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.W_ZH_PutPalletType3 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.W_PutPalletType, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.W_ZH_PutRequest3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.W_ZH_PutFinish3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutFinish, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.W_ZH_TakeRequest3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeRequest, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.W_ZH_TakeFinish3 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeFinish, item.StationCode);
+                        }
+                        else if (item.StationCode == "304")
+                        {
+                            StackerCraneJob_ZH.zHReadData.R_ZH_TakePalletType4 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.R_TakePalletType, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.R_ZH_IsCanPut4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.R_ZH_IsCanTake4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.W_ZH_PutPalletType4 = device.GetValue<GroundStationDBName, short>(GroundStationDBName.W_PutPalletType, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.W_ZH_PutRequest4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutRequest, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.W_ZH_PutFinish4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_PutFinish, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.W_ZH_TakeRequest4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeRequest, item.StationCode);
+                            StackerCraneJob_ZH.zHReadData.W_ZH_TakeFinish4 = device.GetValue<GroundStationDBName, bool>(GroundStationDBName.W_TakeFinish, item.StationCode);
+                        }
                     }
                     catch (Exception ex)
                     {

--
Gitblit v1.9.3