From 5e851678cc02257bbbd179446de36082430ca5bc Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期一, 13 四月 2026 15:12:04 +0800
Subject: [PATCH] feat(MES): 添加Mes_Log扩展逻辑

---
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/RobotTaskService.cs |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/RobotTaskService.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/RobotTaskService.cs
index 00291e7..f1c12ab 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/RobotTaskService.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/RobotTaskService.cs
@@ -82,14 +82,15 @@
                     RobotSourceAddressLineCode = stockDTO.SourceLineNo,
                     RobotTargetAddressLineCode = stockDTO.TargetLineNo,
                     RobotRoadway = stockDTO.Roadway,
-                    RobotSourceAddress = stockDTO.SourceLineNo,
-                    RobotTargetAddress = stockDTO.TargetLineNo,
+                    RobotSourceAddress = taskDTO.SourceAddress,
+                    RobotTargetAddress = taskDTO.TargetAddress,
                     RobotSourceAddressPalletCode = stockDTO.SourcePalletNo,
                     RobotTargetAddressPalletCode = stockDTO.TargetPalletNo,
                     RobotTaskType = taskDTO.TaskType,
-                    RobotTaskState = taskDTO.TaskState,
+                    RobotTaskState = taskDTO.TaskStatus,
                     RobotGrade = taskDTO.Grade,
-                    Creater = "WMS"
+                    Creater = "WMS",
+                    RobotTaskTotalNum = 0,
                 };
 
                 BaseDal.AddData(task);
@@ -108,6 +109,11 @@
         public Dt_RobotTask? QueryRobotCraneTask(string deviceCode)
         {
             return BaseDal.QueryFirst(x => x.RobotRoadway == deviceCode && x.RobotTaskState != (int)TaskRobotStatusEnum.RobotExecuting, TaskOrderBy);
+        }
+
+        public Dt_RobotTask? QueryRobotCraneExecutingTask(string deviceCode)
+        {
+            return BaseDal.QueryFirst(x => x.RobotRoadway == deviceCode && x.RobotTaskState == (int)TaskRobotStatusEnum.RobotExecuting, TaskOrderBy);
         }
 
         public async Task<bool> UpdateRobotTaskAsync(Dt_RobotTask robotTask)
@@ -174,7 +180,7 @@
         /// 灏嗛厤缃换鍔$被鍨嬭浆鎹负鎺ュ彛閰嶇疆閿��
         /// 鏀寔鍊硷細Split/Group/Change锛堝ぇ灏忓啓涓嶆晱鎰燂級
         /// </summary>
-        private string MapRobotTaskTypeToConfigKey(string? taskType)
+        public string MapRobotTaskTypeToConfigKey(string? taskType)
         {
             string type = (taskType ?? string.Empty).Trim().ToLowerInvariant();
             return type switch
@@ -188,7 +194,7 @@
         /// <summary>
         /// 鏍规嵁鎺ュ彛绫诲瀷鏋勫缓鏈烘鎵嬩换鍔″叆鍙傘��
         /// </summary>
-        private StockDTO BuildRobotTaskStock(Dt_Task task, string configKey)
+        public StockDTO BuildRobotTaskStock(Dt_Task task, string configKey)
         {
             string targetAddress = task.TargetAddress ?? string.Empty;
             string roadway = ResolveRobotRuleValue(targetAddress, "AddressRoadwayMap", task.Roadway);
@@ -231,7 +237,7 @@
         /// <summary>
         /// 鏍规嵁鐩爣鍦板潃鎸夈�岀簿纭� > 鍥為��鍊笺�嶈В鏋愯鍒欏�笺��
         /// </summary>
-        private string ResolveRobotRuleValue(string? targetAddress, string addressSectionName, string? fallback)
+        public string ResolveRobotRuleValue(string? targetAddress, string addressSectionName, string? fallback)
         {
             string address = (targetAddress ?? string.Empty).Trim();
             string defaultValue = fallback ?? string.Empty;

--
Gitblit v1.9.3