From 67348f250a1b7970059698002949a5e0a5f3c52f Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期四, 14 八月 2025 08:51:04 +0800
Subject: [PATCH] 上传最新代码

---
 项目代码/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs |   68 ++++++++++++++++++++++++++++++----
 1 files changed, 60 insertions(+), 8 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs"
index c3c168d..c4a7efe 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -251,6 +251,22 @@
                                 task.NextAddress = router.NextPosi;
                             }
                         }
+                        else
+                        {
+                            if (taskTypeGroup == TaskTypeGroup.InboundGroup && !task.Roadway.Contains("YL"))
+                            {
+                                task.CurrentAddress = router.StartPosi;
+                                task.NextAddress = "";
+                                task.DeviceCode = router.ChildPosiDeviceCode;
+                            }
+                            else
+                            {
+                                router = routers.FirstOrDefault(x=>x.ChildPosiDeviceCode==task.Roadway);
+                                task.CurrentAddress = router.StartPosi;
+                                task.NextAddress = router.NextPosi;
+                                task.DeviceCode = router.ChildPosi;
+                            }
+                        }
                     }
                     tasks.Add(task);
                 }
@@ -314,14 +330,49 @@
             }
             return content;
         }
-
-        /// <summary>
-        /// 
+        // <summary>
+        /// 璇锋眰鍏ュ簱浠诲姟
         /// </summary>
-        /// <param name="palletCode"></param>
-        /// <param name="sourceAddress"></param>
+        /// <param name="palletCode">鎵樼洏鍙�</param>
+        /// <param name="sourceAddress">璧峰鍦板潃</param>
+        /// /// <param name="roadWay">宸烽亾</param>
         /// <returns></returns>
-        public WebResponseContent RequestWMSTaskSimple(string palletCode, string sourceAddress, int taskType=630)
+        public WebResponseContent RequestYLWMSTaskSimple(string palletCode, string sourceAddress)
+        {
+            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/RequestYLWMSTaskSimple?stationCode={sourceAddress}&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;
+        }
+        // <summary>
+        /// 璇锋眰鍏ュ簱浠诲姟
+        /// </summary>
+        /// <param name="palletCode">鎵樼洏鍙�</param>
+        /// <param name="sourceAddress">璧峰鍦板潃</param>
+        /// /// <param name="roadWay">宸烽亾</param>
+        /// <returns></returns>
+        public WebResponseContent RequestWMSTaskSimple(string palletCode, string sourceAddress, string roadWay="", int taskType=630)
         {
             WebResponseContent content = new WebResponseContent();
             try
@@ -342,8 +393,8 @@
                 {
                     Id = 1,
                     TaskNum = DateTime.Now.ToString("mmss").ObjToInt(),
-                    PalletCode="",
-                    RoadWay="",
+                    PalletCode= palletCode,
+                    RoadWay= roadWay ?? "",
                     TaskType= taskType,
                     PalletType=1,
                     TaskStatus=TaskStatusEnum.New.ObjToInt(),
@@ -631,6 +682,7 @@
         /// <returns>杩斿洖浠诲姟瀹炰綋瀵硅薄锛屽彲鑳戒负null</returns>
         public Dt_Task QueryStackerCraneTask(string deviceNo, string currentAddress = "")
         {
+            //鍒ゆ柇鏄惁涓虹┖
             if (string.IsNullOrEmpty(currentAddress))
                 return BaseDal.QueryFirst(x => x.DeviceCode == deviceNo && x.TaskState == (int)TaskStatusEnum.SC_Execute, TaskOrderBy);
             else

--
Gitblit v1.9.3