From fe77f3c9d11e3087c1efa56fd6205ffc10e39991 Mon Sep 17 00:00:00 2001
From: helongyang <647556386@qq.com>
Date: 星期四, 05 六月 2025 18:45:23 +0800
Subject: [PATCH] 更新

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs |   66 ++++++++++++++++++--------------
 1 files changed, 37 insertions(+), 29 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
index d2a4a74..5a885e6 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -386,7 +386,7 @@
         /// <param name="palletCode">鎵樼洏鍙�</param>
         /// <param name="sourceAddress">璧峰鍦板潃</param>
         /// <returns></returns>
-        public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress)
+        public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string materielBoxCode = "")
         {
             WebResponseContent content = new WebResponseContent();
             try
@@ -401,7 +401,15 @@
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒癢MSApi鍦板潃");
                 }
-                string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}");
+                string responseStr = "";
+                if (!string.IsNullOrEmpty(materielBoxCode))
+                {
+                    responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}&materielBoxCode={materielBoxCode}");
+                }
+                else
+                {
+                    responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={stationManger.StackerCraneCode}&palletCode={palletCode}");
+                }
                 WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr);
                 if (responseContent != null && responseContent.Status && responseContent.Data != null)
                 {
@@ -462,34 +470,34 @@
         /// <param name="sourceAddress"></param>
         /// <param name="roadway"></param>
         /// <returns></returns>
-        public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway)
-        {
-            WebResponseContent content = new WebResponseContent();
-            try
-            {
-                string address = AppSettings.Get("WMSApiAddress");
-                if (string.IsNullOrEmpty(address))
-                {
-                    return WebResponseContent.Instance.Error($"鏈壘鍒癢MSApi鍦板潃");
-                }
-                string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={roadway}&palletCode={palletCode}");
-                WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr);
-                if (responseContent != null && responseContent.Status && responseContent.Data != null)
-                {
-                    WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.ToString());
-                    if (taskDTO != null)
-                    {
-                        content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO });
-                    }
-                }
+        //public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway)
+        //{
+        //    WebResponseContent content = new WebResponseContent();
+        //    try
+        //    {
+        //        string address = AppSettings.Get("WMSApiAddress");
+        //        if (string.IsNullOrEmpty(address))
+        //        {
+        //            return WebResponseContent.Instance.Error($"鏈壘鍒癢MSApi鍦板潃");
+        //        }
+        //        string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTask?stationCode={sourceAddress}&roadwayNo={roadway}&palletCode={palletCode}");
+        //        WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr);
+        //        if (responseContent != null && responseContent.Status && responseContent.Data != null)
+        //        {
+        //            WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.ToString());
+        //            if (taskDTO != null)
+        //            {
+        //                content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO });
+        //            }
+        //        }
 
-            }
-            catch (Exception ex)
-            {
-                content = WebResponseContent.Instance.Error(ex.Message);
-            }
-            return content;
-        }
+        //    }
+        //    catch (Exception ex)
+        //    {
+        //        content = WebResponseContent.Instance.Error(ex.Message);
+        //    }
+        //    return content;
+        //}
 
         /// <summary>
         /// 

--
Gitblit v1.9.3