From 047e8be481b2b626a5dbcc613b5f2e77323239be Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期四, 20 三月 2025 14:27:36 +0800
Subject: [PATCH] 更新配置和任务处理逻辑

---
 CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_After/CommonConveyorLine_AfterJob.cs |   51 ++++++++-------------------------------------------
 1 files changed, 8 insertions(+), 43 deletions(-)

diff --git a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_After/CommonConveyorLine_AfterJob.cs b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_After/CommonConveyorLine_AfterJob.cs
index 324f8e2..c291afa 100644
--- a/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_After/CommonConveyorLine_AfterJob.cs
+++ b/CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_After/CommonConveyorLine_AfterJob.cs
@@ -97,10 +97,10 @@
                                 method.Invoke(this, new object[] { conveyorLine, command, station });
                             }
                         }
-                        if (station.stationType == 6 && station.stationArea == "3")
-                        {
-                            await GetEmptyTrayAsync(station, conveyorLine, command);
-                        }
+                        //if (station.stationType == 6 && station.stationArea == "3")
+                        //{
+                        //    await GetEmptyTrayAsync(station, conveyorLine, command);
+                        //}
 
                         #region 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
 
@@ -181,8 +181,10 @@
         public void RequestEmptyOutbound(CommonConveyorLine_After conveyorLine, ConveyorLineTaskCommand_After command, Dt_StationManager stationInfo)
         {
             if (stationInfo.stationType != 7) return;
-            var taskNew = _taskRepository.QueryFirst(x => x.Roadway == stationInfo.Roadway && x.TaskType == (int)TaskOutboundTypeEnum.OutTray);
-            if (taskNew == null)   //涓嶅瓨鍦ㄧ┖妗嗗嚭搴撲换鍔� 鍒欒姹俉MS鍑虹┖搴�
+
+            var taskNew = _taskRepository.QueryData(x => x.TargetAddress == stationInfo.stationChildCode && x.TaskType == (int)TaskOutboundTypeEnum.OutTray);
+            var cache = command.Reserved5;
+            if (taskNew.Count < cache)   //涓嶅瓨鍦ㄧ┖妗嗗嚭搴撲换鍔� 鍒欒姹俉MS鍑虹┖搴�
             {
                 ConsoleHelper.WriteWarningLine("璇锋眰绌烘墭鐩�");
                 if (_taskService.RequestTask(command.ConveyorLineBarcode, stationInfo).Result.Status)
@@ -194,43 +196,6 @@
                 }
             }
         }
-
-        /// <summary>
-        /// 杈撻�佺嚎璇锋眰鍏ュ簱
-        /// </summary>
-        /// <param name="conveyorLine">杈撻�佺嚎瀹炰緥瀵硅薄</param>
-        /// <param name="command">璇诲彇鐨勮姹備俊鎭�</param>
-        /// <param name="childDeviceCode">瀛愯澶囩紪鍙�</param>
-        //public void RequestInbound(CommonConveyorLine_After conveyorLine, ConveyorLineTaskCommand_After command, string childDeviceCode)
-        //{
-        //    var stationInfo = _stationManagerService.GetStationInfoByChildCode(childDeviceCode);
-        //    if (stationInfo != null)
-        //    {
-        //        //_taskService.r
-        //    }
-        //    var taskNew = _taskService.QueryCraneConveyorLineTask(command.ConveyorLineTaskNum.ObjToInt(), childDeviceCode);
-        //    if (taskNew == null)
-        //    {
-        //        string barcode = command.ConveyorLineBarcode.TrimEnd();
-        //        if (_taskService.RequestWMSTask(command.ConveyorLineBarcode, childDeviceCode).Result.Status)
-        //        {
-        //            Dt_Task task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode);
-        //            if (task != null)
-        //            {
-        //                ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
-        //                //taskCommand.InteractiveSignal = command.InteractiveSignal;
-        //                taskCommand.ResponState = 1;
-        //                taskCommand.ConveyorLineTaskNum = task.TaskNum;
-        //                taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(task.NextAddress);
-        //                conveyorLine.SendCommand(taskCommand, childDeviceCode);
-
-        //                //ConveyorLineSendFinish(conveyorLine, childDeviceCode, ProtocalDetailValue, true);
-
-        //                _taskService.UpdateTaskStatusToNext(task);
-        //            }
-        //        }
-        //    }
-        //}
 
         private async Task GetEmptyTrayAsync(Dt_StationManager stationManager, CommonConveyorLine_After commonConveyor, ConveyorLineTaskCommand_After conveyorLine)
         {

--
Gitblit v1.9.3