From 0d9fb6555efa42e27de4d57d3fb7b8d82a78ef45 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期四, 27 三月 2025 14:10:43 +0800
Subject: [PATCH] 优化任务处理逻辑并清理代码

---
 CodeManagement/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_After/CommonConveyorLine_AfterJob.cs |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 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 c291afa..4ace90d 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
@@ -38,6 +38,7 @@
 using WIDESEAWCS_ITaskInfoService;
 using WIDESEAWCS_Model.Models;
 using WIDESEAWCS_QuartzJob;
+using WIDESEAWCS_QuartzJob.DeviceBase;
 using WIDESEAWCS_QuartzJob.DTO;
 using WIDESEAWCS_QuartzJob.Service;
 using WIDESEAWCS_SignalR;
@@ -182,17 +183,19 @@
         {
             if (stationInfo.stationType != 7) return;
 
-            var taskNew = _taskRepository.QueryData(x => x.TargetAddress == stationInfo.stationChildCode && x.TaskType == (int)TaskOutboundTypeEnum.OutTray);
-            var cache = command.Reserved5;
-            if (taskNew.Count < cache)   //涓嶅瓨鍦ㄧ┖妗嗗嚭搴撲换鍔� 鍒欒姹俉MS鍑虹┖搴�
+            var taskNew = _taskRepository.QueryData(x => x.TaskType == (int)TaskOutboundTypeEnum.OutTray);
+            //var need = _needBarcodeRepository.QueryFirst(x => x.toArea == stationInfo.stationChildCode && x.productLine == stationInfo.productLine);
+            //var cache = command.Reserved5;
+            //var proAddress = conveyorLine.DeviceProDTOs.Where(x => x.DeviceChildCode == stationInfo.stationChildCode).Where(x => x.DeviceProParamName == ConveyorLineDBName_After.Reserve5.ToString()).FirstOrDefault().DeviceProAddress;
+            var cache = Convert.ToInt16(conveyorLine.ReadValue(ConveyorLineDBName_After.Reserve5, stationInfo.stationChildCode));
+            ConsoleHelper.WriteColorLine($"宸茬粡鏈墈taskNew.Count}涓换鍔�,鍙互鏀緖cache}涓┖鎵樼洏", ConsoleColor.DarkCyan);
+            if (taskNew.Count + 1 < cache)   //涓嶅瓨鍦ㄧ┖妗嗗嚭搴撲换鍔� 鍒欒姹俉MS鍑虹┖搴�
             {
-                ConsoleHelper.WriteWarningLine("璇锋眰绌烘墭鐩�");
+                //ConsoleHelper.WriteWarningLine("璇锋眰绌烘墭鐩�");
                 if (_taskService.RequestTask(command.ConveyorLineBarcode, stationInfo).Result.Status)
                 {
-                    Dt_Task task = _taskService.QueryTaskByPalletCode(command.ConveyorLineBarcode, stationInfo.Roadway);
-                    if (task != null)
-                    {
-                    }
+                    //need.inLineNum += 1;
+                    //_needBarcodeRepository.UpdateData(need);
                 }
             }
         }

--
Gitblit v1.9.3