From 3ecd03b3a0a30a57153468beaed3199bfe906772 Mon Sep 17 00:00:00 2001
From: huanghongfeng <huanghongfeng@hnkhzn.com>
Date: 星期一, 11 十一月 2024 16:58:37 +0800
Subject: [PATCH] 1

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 54 insertions(+), 5 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 2d0468e..0fc8907 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"
@@ -85,6 +85,7 @@
         public string urlWMSMovelibraryTask = WIDESEAWCS_Core.Helper.AppSettings.Configuration["urlWMSMovelibraryTask"];
         public string urlRelocationTaskCompleted = WIDESEAWCS_Core.Helper.AppSettings.Configuration["urlRelocationTaskCompleted"];
         public string urlQueryinventory = WIDESEAWCS_Core.Helper.AppSettings.Configuration["urlQueryinventory"];
+        public string urlEmptyOutbound = WIDESEAWCS_Core.Helper.AppSettings.Configuration["urlEmptyOutbound"];
         /// <summary>
         /// 鎺ユ敹WMS浠诲姟淇℃伅
         /// </summary>
@@ -128,13 +129,22 @@
         /// <param name="palletCode">鎵樼洏鍙�</param>
         /// <param name="sourceAddress">璧峰鍦板潃</param>
         /// <returns></returns>
+        public class GenerateInv
+        {
+            public string SourceAddress { get; set; }
+            public string PalletCode { get; set; }
+        }
         public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress)
         {
             WebResponseContent content = new WebResponseContent();
             try
             {
-                palletCode = "6431-jdsda-jjal333-300";
-                content = HttpHelper.Get<WebResponseContent>($"{urlWMSTask}?sourceAddress={sourceAddress}&palletCode={palletCode}");
+                GenerateInv generate = new GenerateInv()
+                {
+                    SourceAddress=sourceAddress,
+                    PalletCode = palletCode
+                };
+                content = HttpHelper.Post<WebResponseContent>($"{urlWMSTask}", generate);
                 Dt_Task task = new Dt_Task();
                 if (content != null)
                 {
@@ -164,7 +174,7 @@
             return content;
         }
         /// <summary>
-        /// 鏌ヨ搴撲綅
+        /// 杩涜缁勭洏
         /// </summary>
         /// <param name="palletCode"></param>
         /// <returns></returns>
@@ -174,7 +184,46 @@
             return  content = HttpHelper.Get<WebResponseContent>($"{urlQueryinventory}?palletCode={palletCode}");
         }
 
+        /// <summary>
+        /// 鏍规嵁鎵樼洏鍙枫�佽捣濮嬪湴鍧�鍚慦MS璇锋眰浠诲姟
+        /// </summary>
+        /// <param name="palletCode">鎵樼洏鍙�</param>
+        /// <param name="sourceAddress">璧峰鍦板潃</param>
+        /// <returns></returns>
+        public WebResponseContent RequestWMSTask2(string sourceAddress)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                content = HttpHelper.Get<WebResponseContent>($"{urlEmptyOutbound}?sourceAddress={sourceAddress}");
+                Dt_Task task = new Dt_Task();
+                if (content != null)
+                {
+                    if (content.Status)
+                    {
+                        task = JsonConvert.DeserializeObject<Dt_Task>(content.Data.ToString());
+                        task.TaskState = (int)TaskInStatusEnum.Line_InFinish;
+                        task.Roadway = task.Roadway == "1" ? task.Roadway = "SC01" : task.Roadway = "SC02";
+                        BaseDal.AddData(task);
+                        return content = WebResponseContent.Instance.OK();
+                    }
+                    else
+                    {
 
+                        return content = WebResponseContent.Instance.Error();
+                    }
+                }
+                else
+                {
+                    return content = WebResponseContent.Instance.Error();
+                }
+
+            }
+            catch (Exception ex)
+            {
+                return content = WebResponseContent.Instance.Error(ex.Message);
+            }
+        }
         /// <summary>
         /// 鏍规嵁娣卞簱浣嶅悜wms鐢宠鍒ゆ柇娴呭簱浣嶆槸鍚︽湁璐э紝鏄惁闇�瑕佽繘琛岀Щ搴撴搷浣�
         /// </summary>
@@ -271,8 +320,8 @@
         }
         public Dt_Task IngStackerCraneTask(string deviceNo)
         {
-            string deviceNot = deviceNo == "SC01" ? "1" : "2";
-            return BaseDal.QueryFirst(x => x.Roadway == deviceNot && x.TaskState == (int)TaskInStatusEnum.SC_InExecuting);
+            //string deviceNot = deviceNo == "SC01" ? "1" : "2";
+            return BaseDal.QueryFirst(x => x.Roadway == deviceNo && x.TaskState == (int)TaskInStatusEnum.SC_InExecuting);
         }
 
         /// <summary>

--
Gitblit v1.9.3