From 8c8532db8fc7fa76b7fe4c254a36d67c6af24ace Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期三, 11 六月 2025 14:46:33 +0800
Subject: [PATCH] 添加物料编码字段并更新查询逻辑

---
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs |   34 +++++++---------------------------
 1 files changed, 7 insertions(+), 27 deletions(-)

diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs
index 0d172c9..df41df0 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs
@@ -6,8 +6,10 @@
 using WIDESEAWCS_Common.TaskEnum;
 using WIDESEAWCS_Core;
 using WIDESEAWCS_Core.Helper;
+using WIDESEAWCS_Core.LogHelper;
 using WIDESEAWCS_DTO.TaskInfo;
 using WIDESEAWCS_Model.Models;
+using WIDESEAWCS_QuartzJob;
 
 namespace WIDESEAWCS_TaskInfoService
 {
@@ -281,7 +283,7 @@
         // 妫�鏌ユ槸鍚﹀凡瀛樺湪鐩存帴鍑哄簱浠诲姟
         private async Task<bool> HasDirectOutboundTask(Dt_StationManager stationManager)
         {
-            var station = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 6 && x.productLine == stationManager.productLine && x.stationArea == stationManager.stationArea);
+            var station = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 6 && x.productLine == stationManager.productLine && x.stationArea == stationManager.stationArea && x.Roadway == stationManager.Roadway);
             var tasks = await BaseDal.QueryFirstAsync(x => x.TaskType == (int)TaskOutboundTypeEnum.InToOut && x.TargetAddress == stationManager.stationLocation && x.CurrentAddress == station.stationChildCode);
             return tasks != null;
         }
@@ -289,7 +291,7 @@
         // 澶勭悊 stationType 涓� 7 鐨勬儏鍐�
         private async Task<WebResponseContent> HandleStationType7(string palletCode, Dt_StationManager stationManager)
         {
-            var station = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 6 && x.productLine == stationManager.productLine && x.stationArea == stationManager.stationArea);
+            var station = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 6 && x.productLine == stationManager.productLine && x.stationArea == stationManager.stationArea && x.Roadway == stationManager.Roadway);
             var runTask = await BaseDal.QueryFirstAsync(x => x.CurrentAddress == station.stationChildCode && x.TaskState == (int)TaskInStatusEnum.Line_InFinish && x.TaskType == (int)TaskInboundTypeEnum.InTray);
 
             if (runTask != null)
@@ -326,7 +328,7 @@
         // 澶勭悊 stationType 涓� 6 鐨勬儏鍐�
         private async Task<WebResponseContent> HandleStationType6(string palletCode, Dt_StationManager stationManager)
         {
-            var emptyStation = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 7 && x.productLine == stationManager.productLine && x.stationArea == stationManager.stationArea);
+            var emptyStation = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 7 && x.productLine == stationManager.productLine && x.stationArea == stationManager.stationArea && x.Roadway==stationManager.Roadway);
             var runTask = await BaseDal.QueryFirstAsync(x => x.NextAddress == emptyStation.stationChildCode && x.TaskState == (int)TaskInStatusEnum.Line_InFinish && x.TaskType == (int)TaskInboundTypeEnum.InTray);
 
             if (runTask != null)
@@ -626,30 +628,6 @@
                 var task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
                 if (task == null) return WebResponseContent.Instance.Error($"鏈壘鍒拌浠诲姟淇℃伅,浠诲姟鍙�:銆恵taskNum}銆�");
 
-                //if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup && task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting)
-                //{
-                //    //todo
-
-                //}
-                //else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup && task.TaskState == (int)TaskInStatusEnum.SC_InExecuting)
-                //{
-                //    //todo 鍚屾鍒癢MS
-
-                //    BaseDal.DeleteData(task);
-
-                //}
-                //else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
-                //{
-                //    //todo 璋冪敤WMS绉诲簱瀹屾垚
-                //}
-                //else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OtherGroup)
-                //{
-                //}
-                //else
-                //{
-                //    throw new Exception($"浠诲姟绫诲瀷閿欒,鏈壘鍒拌浠诲姟绫诲瀷,浠诲姟鍙�:銆恵taskNum}銆�,浠诲姟绫诲瀷:銆恵task.TaskType}銆�");
-                //}
-
                 #region WMS鍚屾浠诲姟瀹屾垚
 
                 var keys = new Dictionary<string, object>()
@@ -698,7 +676,9 @@
             catch (Exception ex)
             {
                 content = WebResponseContent.Instance.Error($"浠诲姟瀹屾垚寮傚父,浠诲姟鍙�:銆恵taskNum}銆�");
+                QuartzLogger.WriteLogToFile($"Info_鍒嗗浠诲姟瀹屾垚", $"浠诲姟瀹屾垚寮傚父,浠诲姟鍙�:銆恵taskNum}銆戝紓甯镐俊鎭�恵ex.StackTrace}銆憑Environment.NewLine}{Environment.NewLine}");
             }
+            QuartzLogger.WriteLogToFile($"Info_鍒嗗浠诲姟瀹屾垚", $"浠诲姟瀹屾垚,浠诲姟鍙�:銆恵taskNum}銆戣繑鍥炲弬鏁般�恵JsonConvert.SerializeObject(content)}銆憑Environment.NewLine}{Environment.NewLine}");
             return content;
         }
     }

--
Gitblit v1.9.3