From a0194deab4b4f19183f7b596bf5f9e3bb8a15ec9 Mon Sep 17 00:00:00 2001
From: wankeda <Administrator@DESKTOP-HAU3ST3>
Date: 星期三, 05 三月 2025 17:28:06 +0800
Subject: [PATCH] 1

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs |   36 ++++++++++++++++++++++++++++++++++--
 1 files changed, 34 insertions(+), 2 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs"
index 5717f5c..808efce 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Completed.cs"
@@ -35,7 +35,7 @@
                 {
                     return OutboundTaskCompleted(taskNum);
                 }
-                else if (task.TaskType.GetTaskTypeGroup() != TaskTypeGroup.RelocationGroup)
+                else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
                 {
                     return RelocationTaskCompleted(task);
                 }
@@ -69,7 +69,13 @@
                 {
                     x.AGVArea = agvDescription;
                 });
-                string response = HttpHelper.Post("http://127.0.0.1:9291/api/Task/ReceiveTask", taskDTOs.Serialize());
+
+                string url = AppSettings.Get("WCS");
+                if (string.IsNullOrEmpty(url))
+                {
+                    throw new Exception($"鏈壘鍒癢CSAApi鍦板潃,璇锋鏌ラ厤缃枃浠�");
+                }
+                string response = HttpHelper.Post($"{url}/api/Task/ReceiveTask", taskDTOs.Serialize());
 
                 return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("杩斿洖閿欒");
             }
@@ -78,5 +84,31 @@
                 return WebResponseContent.Instance.Error(ex.Message);
             }
         }
+
+        /// <summary>
+        /// 淇敼浠诲姟鐘舵��
+        /// </summary>
+        /// <param name="task"></param>
+        /// <returns></returns>
+        public WebResponseContent UpdateTaskInfo(WCSTaskDTO task)
+        {
+            try
+            {
+                Dt_Task wmsTask = BaseDal.QueryFirst(x=>x.TaskNum == task.TaskNum);
+                if (wmsTask != null)
+                {
+                    wmsTask.TaskStatus = task.TaskState;
+                    wmsTask.CurrentAddress = task.CurrentAddress;
+                    wmsTask.NextAddress = task.NextAddress;
+                    wmsTask.Dispatchertime = task.Dispatchertime;
+                    BaseDal.UpdateData(wmsTask);
+                }
+                return WebResponseContent.Instance.OK();
+            }
+            catch(Exception ex)
+            {
+                return WebResponseContent.Instance.Error(ex.Message);
+            }
+        }
     }
 }

--
Gitblit v1.9.3