From c3ed42924f19d383dd643814b754d60b392496d3 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期三, 16 七月 2025 19:22:07 +0800
Subject: [PATCH] 添加常温直接出库功能,增加实框入库存在任务发往异常口

---
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs |   26 +++++++++++++++++++-------
 1 files changed, 19 insertions(+), 7 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 df41df0..f93798d 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs
@@ -443,12 +443,24 @@
 
                 if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
                 {
-                    var stationinfo = _stationManagerRepository.QueryFirst(x => x.stationLocation == taskDTO.TargetAddress && x.Roadway == taskDTO.RoadWay);
-                    task.TaskState = (int)TaskOutStatusEnum.OutNew;
-                    task.CurrentAddress = taskDTO.RoadWay;
-                    task.NextAddress = stationinfo.stationChildCode;
-                    task.SourceAddress = taskDTO.SourceAddress;
-                    task.TargetAddress = taskDTO.TargetAddress;
+                    if (task.TaskType == (int)TaskOutboundTypeEnum.InToOut)
+                    {
+                        var stationinfo = _stationManagerRepository.QueryFirst(x => x.stationPLC == "1017" && x.stationType == 10&&x.Roadway==taskDTO.RoadWay);
+                        task.TaskState = (int)TaskOutStatusEnum.OutNew;
+                        task.CurrentAddress = taskDTO.SourceAddress;
+                        task.NextAddress = stationinfo.stationChildCode;
+                        task.SourceAddress = taskDTO.SourceAddress;
+                        task.TargetAddress = taskDTO.TargetAddress;
+                    }
+                    else
+                    {
+                        var stationinfo = _stationManagerRepository.QueryFirst(x => x.stationLocation == taskDTO.TargetAddress && x.Roadway == taskDTO.RoadWay);
+                        task.TaskState = (int)TaskOutStatusEnum.OutNew;
+                        task.CurrentAddress = taskDTO.RoadWay;
+                        task.NextAddress = stationinfo.stationChildCode;
+                        task.SourceAddress = taskDTO.SourceAddress;
+                        task.TargetAddress = taskDTO.TargetAddress;
+                    }   
                 }
                 else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
                 {
@@ -676,7 +688,7 @@
             catch (Exception ex)
             {
                 content = WebResponseContent.Instance.Error($"浠诲姟瀹屾垚寮傚父,浠诲姟鍙�:銆恵taskNum}銆�");
-                QuartzLogger.WriteLogToFile($"Info_鍒嗗浠诲姟瀹屾垚", $"浠诲姟瀹屾垚寮傚父,浠诲姟鍙�:銆恵taskNum}銆戝紓甯镐俊鎭�恵ex.StackTrace}銆憑Environment.NewLine}{Environment.NewLine}");
+                QuartzLogger.WriteLogToFile($"Info_鍒嗗浠诲姟瀹屾垚", $"浠诲姟瀹屾垚寮傚父,浠诲姟鍙�:銆恵taskNum}銆戝紓甯镐俊鎭�恵ex.Message}銆憑Environment.NewLine}寮傚父淇℃伅銆恵ex.StackTrace}銆憑Environment.NewLine}");
             }
             QuartzLogger.WriteLogToFile($"Info_鍒嗗浠诲姟瀹屾垚", $"浠诲姟瀹屾垚,浠诲姟鍙�:銆恵taskNum}銆戣繑鍥炲弬鏁般�恵JsonConvert.SerializeObject(content)}銆憑Environment.NewLine}{Environment.NewLine}");
             return content;

--
Gitblit v1.9.3