From 279077bf41bc726b474ca5d76cd2b8393d41d867 Mon Sep 17 00:00:00 2001
From: huanghongfeng <huanghongfeng@hnkhzn.com>
Date: 星期三, 05 十一月 2025 12:16:01 +0800
Subject: [PATCH] 1

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs                                    |   23 
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task.cs                                    |   32 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs                       |  493 ++++++++++
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/v17/HierarchyCache.v1.txt              |    0 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs                               |    4 
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Http/HttpHelperh.cs                                          |  198 ++++
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_IBasicService/IStationMangerService.cs               |   15 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_IBasicService/IDt_ApiInfoService.cs                  |   23 
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs                      |   34 
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs                                          |   62 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_StationManger.cs               |   77 +
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Common/StockEnum/StockStatusEmun.cs                  |    3 
 项目资料/接口清单/托盘库接口清单V1.6.xlsx                                                                                |    0 
 项目代码/WMS/WIDESEA_WMSClient/src/views/basic/locationInfo.vue                                               |    2 
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs                                                   |    2 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_DTO/ToMes/RelocationTaskMes.cs                       |  267 +++++
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_BasicService/Dt_ApiInfoService.cs                    |   30 
 项目代码/WMS/WIDESEA_WMSClient/config/buttons.js                                                              |   37 
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json                                             |   84 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfo.cs                   |   12 
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs                      |  176 +--
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_ApiInfo.cs                     |    8 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_RecordService/LocationStatusChangeRecordService.cs   |   17 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs        |  135 ++
 项目代码/WMS/WIDESEA_WMSClient/src/extension/stock/stockInfo.js                                               |  160 ---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_BasicService/StationMangerService.cs                 |   24 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Core/Const/ConfigConst.cs                            |   41 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs       |  135 ++
 项目代码/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/read.lock                               |    0 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs                      |  155 +--
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_IRecordService/ILocationStatusChangeRecordService.cs |    2 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskStatusEnum.cs                    |  143 +-
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs                     |   52 +
 /dev/null                                                                                                 |    1 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs                                 |    2 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs     |   75 +
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_LogService.cs                    |    1 
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs                                      |  189 ++-
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task.cs                     |   34 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json                           |    2 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock             |    0 
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs                                   |   25 
 42 files changed, 2,080 insertions(+), 695 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/DB/\345\210\235\345\247\213\345\214\226.txt" "b/\351\241\271\347\233\256\344\273\243\347\240\201/DB/\345\210\235\345\247\213\345\214\226.txt"
deleted file mode 100644
index 2b64487..0000000
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/DB/\345\210\235\345\247\213\345\214\226.txt"
+++ /dev/null
@@ -1 +0,0 @@
-鍒濆鍖�
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/read.lock" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/read.lock"
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/read.lock"
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Http/HttpHelperh.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Http/HttpHelperh.cs"
new file mode 100644
index 0000000..b0d69d4
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Http/HttpHelperh.cs"
@@ -0,0 +1,198 @@
+锘�
+using Newtonsoft.Json;
+using System.Net;
+using System.Text;
+using WIDESEA_Common.Log;
+
+namespace WIDESEA_Comm.Http
+{
+    public class HttpHelperh
+    {
+        private const int Timeout = 60 * 1000;
+
+        /// <summary>
+        /// post璇锋眰
+        /// </summary>
+        /// <param name="url"></param>
+        /// <param name="parm">鍙傛暟</param>
+        /// <param name="rquestName">鎺ュ彛鍚嶇О,鐢ㄤ簬鏃ュ織鍒嗙被</param>
+        /// <returns></returns>
+        public static string Post(string url, object parm, string rquestName = "")
+        {
+            HttpWebResponse response = null;
+            StreamReader resultReader = null;
+            string responseContent = string.Empty;
+            try
+            {
+                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
+                request.Timeout = Timeout;
+                request.Method = "POST";
+                request.ContentType = "application/json; charset=UTF-8";
+                parm = parm ?? "";
+                byte[] data = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(parm));
+                request.ContentLength = data.Length;
+                using (Stream newStream = request.GetRequestStream())
+                {
+                    newStream.Write(data, 0, data.Length);
+                };
+
+                response = (HttpWebResponse)request.GetResponse();
+                Stream webStream = response.GetResponseStream();
+                if (webStream == null)
+                {
+                    throw new Exception("Network error");
+                }
+
+                int statsCode = (int)response.StatusCode;
+                resultReader = new StreamReader(webStream, Encoding.UTF8);
+                responseContent = resultReader.ReadToEnd();
+
+                if (response != null)
+                    response.Close();
+                if (resultReader != null)
+                    resultReader.Close();
+
+                if (statsCode != 200)
+                {
+                    throw new Exception("寮傚父锛屽搷搴旂爜锛�" + statsCode.ToString());
+                }
+
+                //WriteLog.Write_Log("System/API璇锋眰", rquestName, "璇锋眰鎴愬姛", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent });
+                return responseContent;
+            }
+            catch (Exception ex)
+            {
+                WriteLog.Write_Log("System/API璇锋眰", rquestName, "璇锋眰寮傚父", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent, 閿欒 = ex.Message });
+                throw ex;
+            }
+        }
+
+        /// <summary>
+        /// post璇锋眰
+        /// </summary>
+        /// <param name="url"></param>
+        /// <param name="parm">鍙傛暟</param>
+        /// <param name="rquestName">鎺ュ彛鍚嶇О,鐢ㄤ簬鏃ュ織鍒嗙被</param>
+        /// <returns></returns>
+        public static T Post<T>(string url, object parm, string rquestName = "") where T : class
+        {
+            HttpWebResponse response = null;
+            StreamReader resultReader = null;
+            string responseContent = string.Empty;
+            try
+            {
+                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
+                request.Timeout = Timeout;
+                request.Method = "POST";
+                request.ContentType = "application/json; charset=UTF-8";
+                parm = parm ?? "";
+                byte[] data = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(parm));
+                request.ContentLength = data.Length;
+                using (Stream newStream = request.GetRequestStream())
+                {
+                    newStream.Write(data, 0, data.Length);
+                };
+
+                response = (HttpWebResponse)request.GetResponse();
+                Stream webStream = response.GetResponseStream();
+                if (webStream == null)
+                {
+                    throw new Exception("Network error");
+                }
+
+                int statsCode = (int)response.StatusCode;
+                resultReader = new StreamReader(webStream, Encoding.UTF8);
+                responseContent = resultReader.ReadToEnd();
+
+                if (response != null)
+                    response.Close();
+                if (resultReader != null)
+                    resultReader.Close();
+
+                if (statsCode != 200)
+                {
+                    throw new Exception("寮傚父锛屽搷搴旂爜锛�" + statsCode.ToString());
+                }
+
+                //WriteLog.Write_Log("System/API璇锋眰", rquestName, "璇锋眰鎴愬姛", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent });
+                return JsonConvert.DeserializeObject<T>(responseContent);
+            }
+            catch (Exception ex)
+            {
+                WriteLog.Write_Log("System/API璇锋眰", rquestName, "璇锋眰寮傚父", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent, 閿欒 = ex.Message });
+                throw ex;
+            }
+        }
+
+
+        /// <summary>
+        /// get璇锋眰
+        /// </summary>
+        /// <typeparam name="T"></typeparam>
+        /// <param name="url"></param>
+        /// <param name="parm">璇锋眰鍙傛暟锛屾坊鍔犲湪url</param>
+        /// <param name="rquestName"></param>
+        /// <returns></returns>
+        public static T Get<T>(string url, object parm = null, string rquestName = "") where T : class
+        {
+            HttpWebResponse response = null;
+            StreamReader resultReader = null;
+            string responseContent = string.Empty;
+            try
+            {
+                if (parm != null)
+                {
+                    var datas = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(parm));
+                    var keyList = datas.Keys;
+                    int index = 0;
+                    foreach (var key in datas.Keys)
+                    {
+                        if (index == 0)
+                        {
+                            url += $"?{key}={datas[key]}";
+                        }
+                        else
+                        {
+                            url += $"&{key}={datas[key]}";
+                        }
+                        index++;
+                    }
+                }
+                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
+                request.Timeout = Timeout;
+                request.Method = "GET";
+                request.ContentType = "application/json; charset=UTF-8";
+
+                response = (HttpWebResponse)request.GetResponse();
+                Stream webStream = response.GetResponseStream();
+                if (webStream == null)
+                {
+                    throw new Exception("Network error");
+                }
+
+                int statsCode = (int)response.StatusCode;
+                resultReader = new StreamReader(webStream, Encoding.UTF8);
+                responseContent = resultReader.ReadToEnd();
+
+                if (response != null)
+                    response.Close();
+                if (resultReader != null)
+                    resultReader.Close();
+
+                if (statsCode != 200)
+                {
+                    throw new Exception("寮傚父锛屽搷搴旂爜锛�" + statsCode.ToString());
+                }
+
+                WriteLog.Write_Log("System/API璇锋眰", rquestName, "璇锋眰鎴愬姛", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent });
+                return JsonConvert.DeserializeObject<T>(responseContent);
+            }
+            catch (Exception ex)
+            {
+                WriteLog.Write_Log("System/API璇锋眰", rquestName, "璇锋眰寮傚父", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent, 閿欒 = ex.Message });
+                throw ex;
+            }
+        }
+
+    }
+}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs"
index 94b7b8b..98cd6fa 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs"
@@ -138,12 +138,6 @@
     public enum TaskInStatusEnum
     {
         /// <summary>
-        /// 鏂板缓鍏ュ簱浠诲姟
-        /// </summary>
-        [Description("鏂板缓鍏ュ簱浠诲姟")]
-        InNew = 200,
-
-        /// <summary>
         /// 杈撻�佺嚎鍏ュ簱鎵ц涓�
         /// </summary>
         [Description("杈撻�佺嚎鍏ュ簱鎵ц涓�")]
@@ -154,12 +148,6 @@
         /// </summary>
         [Description("杈撻�佺嚎杈撻�佸畬鎴�")]
         Line_InFinish = 220,
-
-        /// <summary>
-        /// 鍫嗗灈鏈哄緟鎵ц
-        /// </summary>
-        [Description("鍫嗗灈鏈哄緟鎵ц")]
-        SC_Execute = 225,
 
         /// <summary>
         /// 鍫嗗灈鏈哄叆搴撴墽琛屼腑
@@ -230,18 +218,7 @@
         [Description("杈撻�佺嚎杈撻�佸畬鎴�")]
         Line_OutFinish = 125,
 
-        ///// <summary>
-        ///// AGV鍑哄簱鎵ц涓�
-        ///// </summary>
-        //[Description("AGV鍑哄簱鎵ц涓�")]
-        //AGV_OutExecuting = 130,
-
-        ///// <summary>
-        ///// AGV鍑哄簱瀹屾垚
-        ///// </summary>
-        //[Description("AGV鎼繍瀹屾垚")]
-        //AGV_OutFinish = 135,
-
+        
         /// <summary>
         /// 鍑哄簱浠诲姟瀹屾垚
         /// </summary>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs"
index 2aa064c..4918c95 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs"
@@ -8,10 +8,11 @@
 {
     public class WMSTaskDTO
     {
+        public int Id { get; set; }
         /// <summary>
         /// WMS浠诲姟涓婚敭
         /// </summary>
-        public int Id { get; set; }
+        public int TaskId { get; set; }
 
         /// <summary>
         /// 浠诲姟鍙�
@@ -34,14 +35,6 @@
         public int TaskType { get; set; }
 
         /// <summary>
-        /// 
-        /// </summary>
-        public string CurrentAddress { get; set; }
-        /// <summary>
-        /// 
-        /// </summary>
-        public string NextAddress { get; set; }
-        /// <summary>
         /// 浠诲姟鐘舵��
         /// </summary>
         public int TaskStatus { get; set; }
@@ -61,24 +54,53 @@
         /// </summary>
         public int Grade { get; set; }
 
+        /// <summary>
+        /// 
+        /// </summary>
         public int WarehouseId { get; set; }
 
         /// <summary>
-        /// 浠诲姟缁�
+        /// 
         /// </summary>
-        public string GroupId { get; set; }
-
-        /// <summary>
-        /// 浠诲姟鐗╂枡闀垮害
-        /// </summary>
-        public int TaskLength { get; set; }
-
         public string AGVArea { get; set; }
 
-        public int PalletType { get; set; }
         /// <summary>
-        /// AGV浠诲姟鍙�
+        /// 
         /// </summary>
-        public string AGVTaskNum { get; set; }
+        public int PalletType { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public string CurrentAddress { get; set; }
+        /// <summary>
+        /// 
+        /// </summary>
+        public string NextAddress { get; set; }
+        /// <summary>
+        /// 
+        /// </summary>
+        public int Depth { get; set; }
+        /// <summary>
+        /// 
+        /// </summary>
+        public string OrderNo { get; set; }
+        /// <summary>
+        /// 
+        /// </summary>
+        public int SourceKey { get; set; }
+        /// <summary>
+        /// 
+        /// </summary>
+        public DateTime Dispatchertime { get; set; }
+        /// <summary>
+        /// 
+        /// </summary>
+        public int MaterialType { get; set; }
+
+        public string MEStaskId { get; set; }
+        public string MESbusinessId { get; set; }
+        public string MESsubPalletCode { get; set; }
+
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
index 8ff3fa6..1781575 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
@@ -131,7 +131,7 @@
         /// <param name="deviceNo">璁惧缂栧彿</param>
         /// <param name="outStationCodes">褰撳墠鍦板潃</param>
         /// <returns>杩斿洖浠诲姟瀹炰綋瀵硅薄闆嗗悎锛屽彲鑳戒负null</returns>
-        List<Dt_Task> QueryStackerCraneOutTasks(string deviceNo, List<string> outStationCodes);
+        List<Dt_Task> QueryStackerCraneOutTasks(string deviceNo);
 
 
         /// <summary>
@@ -217,5 +217,26 @@
         /// <param name="taskNum">浠诲姟鍙�</param>
         /// <returns>杩斿洖澶勭悊缁撴灉</returns>
         WebResponseContent RollbackTaskStatusToLast(int taskNum);
+
+        //鏌ユ壘2妤煎叆搴撲换鍔�
+        Dt_Task GetTaskIninfo(string Pallat);
+
+        WebResponseContent UpdateTaskIninfo(string Pallat,int TaskNo);
+
+        /// <summary>
+        /// 鍒ゆ柇娴呰揣浣嶆槸鍚︽湁浠诲姟
+        /// </summary>
+        /// <param name="deviceNo"></param>
+        /// <param name="SourceAddress"></param>
+        /// <returns></returns>
+        Dt_Task QueryStationIsOccupiedOutTasks(string deviceNo, string LocaAddress);
+
+        /// <summary>
+        /// 鏍规嵁娣卞簱浣嶅悜wms鐢宠鍒ゆ柇娴呭簱浣嶆槸鍚︽湁璐э紝鏄惁闇�瑕佽繘琛岀Щ搴撴搷浣�
+        /// </summary>
+        /// <param name="palletCode">鎵樼洏鍙�</param>
+        /// <param name="sourceAddress">璧峰鍦板潃</param>
+        /// <returns></returns>
+        Dt_Task RequestWMSTaskMovelibrary(Dt_Task _Task);
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task.cs"
index f07b43c..b05bff1 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task.cs"
@@ -160,5 +160,37 @@
         [ExporterHeader(DisplayName = "澶囨敞")]
         [SugarColumn(IsNullable = true, Length = 255, ColumnDescription = "澶囨敞")]
         public string Remark { get; set; }
+
+        /// <summary>
+        /// 娣卞害
+        /// </summary>
+        [ImporterHeader(Name = "娣卞害")]
+        [ExporterHeader(DisplayName = "娣卞害")]
+        [SugarColumn(IsNullable = false, ColumnDescription = "娣卞害")]
+        public int Depth { get; set; }
+
+        /// <summary>
+        /// MES浠诲姟id
+        /// </summary>
+        [ImporterHeader(Name = "MES浠诲姟id")]
+        [ExporterHeader(DisplayName = "MES浠诲姟id")]
+        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "MES浠诲姟id")]
+        public string MEStaskId { get; set; }
+
+        /// <summary>
+        /// MES涓氬姟娴乮d
+        /// </summary>
+        [ImporterHeader(Name = "MES涓氬姟娴乮d")]
+        [ExporterHeader(DisplayName = "MES涓氬姟娴乮d")]
+        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "MES涓氬姟娴乮d")]
+        public string MESbusinessId { get; set; }
+
+        /// <summary>
+        /// 鎵樼洏缂栧彿瀛愭墭
+        /// </summary>
+        [ImporterHeader(Name = "鎵樼洏缂栧彿瀛愭墭")]
+        [ExporterHeader(DisplayName = "鎵樼洏缂栧彿瀛愭墭")]
+        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鎵樼洏缂栧彿瀛愭墭")]
+        public string MESsubPalletCode { get; set; }
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs"
index 00fbe9e..f878512 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs"
@@ -47,7 +47,7 @@
 builder.Services.AddAllOptionRegister();//读取配置文件
 builder.Services.AddMemoryCacheSetup();//缓存
 builder.Services.AddSqlsugarSetup();//SqlSugar 启动服务
-builder.Services.AddHostedService<SeedDataHostedService>();//初始化数据库
+//builder.Services.AddHostedService<SeedDataHostedService>();//初始化数据库
 
 builder.Services.AddDbSetup();//Db 启动服务
 
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json"
index 3859ef9..7df8dc4 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json"
@@ -1,42 +1,46 @@
 {
-    "urls": "http://*:9291", //web鏈嶅姟绔彛锛屽鏋滅敤IIS閮ㄧ讲锛屾妸杩欎釜鍘绘帀
-    "Logging": {
-        "LogLevel": {
-            "Default": "Information",
-            "Microsoft.AspNetCore": "Warning"
-        }
-    },
-    "dics": "deviceType,devicePlcType,jobAssembly,jobClassName,deviceStatus,taskType,taskState,inOutType",
-    "AllowedHosts": "*",
-    "ConnectionStringsEncryption": false,
-    "MainDB": "DB_WIDESEA", //褰撳墠椤圭洰鐨勪富搴擄紝鎵�瀵瑰簲鐨勮繛鎺ュ瓧绗︿覆鐨凟nabled蹇呴』涓簍rue 
-    //1.MySql
-    //2.SqlServer
-    //3.Sqlite
-    //4.Oracle
-    //5.PostgreSQL
-    "DBType": "SqlServer",
-    //杩炴帴瀛楃涓�
-    "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWCS_SYLK;User ID=sa;Password=sa123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
-    //璺ㄥ煙
-    "Cors": {
-        "PolicyName": "CorsIpAccess", //绛栫暐鍚嶇О
-        "EnableAllIPs": true, //褰撲负true鏃讹紝寮�鏀炬墍鏈塈P鍧囧彲璁块棶銆�
-        // 鏀寔澶氫釜鍩熷悕绔彛锛屾敞鎰忕鍙e彿鍚庝笉瑕佸甫/鏂滄潌锛氭瘮濡俵ocalhost:8000/锛屾槸閿欑殑
-        // 娉ㄦ剰锛宧ttp://127.0.0.1:1818 鍜� http://localhost:1818 鏄笉涓�鏍风殑
-        "IPs": "http://127.0.0.1:8080,http://localhost:8080"
-    },
-    "ApiLogIgnore": "", //璁板綍鏃ュ織鏃讹紝蹇界暐鐨凙PI鍚嶇О锛屽涓敤閫楀彿鍒嗛殧锛岄厤缃殑涓嶈褰曞埌鏁版嵁搴撲腑
-    "ApiName": "WIDESEAWCS",
-    "ExpMinutes": 120,
-    "QuartzJobAutoStart": false,
-    "DBSeedEnable": false,
-    "QuartzDBSeedEnable": false,
-    "LogDeubgEnable": false, //鏄惁璁板綍璋冭瘯鏃ュ織
-    "PrintSql": false, //鎵撳嵃SQL璇彞
-    "LogAOPEnable": false, //鏄惁璁板綍AOP鏃ュ織
-    "WebSocketEnable": true, //鏄惁寮�鍚疻ebSocket鏈嶅姟
-    "WebSocketPort": 9296, //WebSocket鏈嶅姟绔彛
-    "WMSApiAddress": "http://127.0.0.1:9290", //"http://127.0.0.1:9283",姝e紡鐜鍦板潃
-    "FeedBackWMSTaskCompleted": "http://127.0.0.1:9290/api/Task/InboundTaskCompleted"
+  "urls": "http://*:9291", //web鏈嶅姟绔彛锛屽鏋滅敤IIS閮ㄧ讲锛屾妸杩欎釜鍘绘帀
+  "Logging": {
+    "LogLevel": {
+      "Default": "Information",
+      "Microsoft.AspNetCore": "Warning"
+    }
+  },
+  "dics": "deviceType,devicePlcType,jobAssembly,jobClassName,deviceStatus,taskType,taskState,inOutType",
+
+  "urlWMSMovelibraryTask": "http://10.50.11.65:8098/api/Task/IsRelocations", //璇锋眰绉诲簱鎺ュ彛
+  "urlTaskCompleted": "http://10.50.11.65:8098/api/Task/TaskCompleted", //浠诲姟鍙嶉
+
+  "AllowedHosts": "*",
+  "ConnectionStringsEncryption": false,
+  "MainDB": "DB_WIDESEA", //褰撳墠椤圭洰鐨勪富搴擄紝鎵�瀵瑰簲鐨勮繛鎺ュ瓧绗︿覆鐨凟nabled蹇呴』涓簍rue 
+  //1.MySql
+  //2.SqlServer
+  //3.Sqlite
+  //4.Oracle
+  //5.PostgreSQL
+  "DBType": "SqlServer",
+  //杩炴帴瀛楃涓�
+  "ConnectionString": "Data Source=.;Initial Catalog=SY_WIDESEAWCS_SYLK;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
+  //璺ㄥ煙
+  "Cors": {
+    "PolicyName": "CorsIpAccess", //绛栫暐鍚嶇О
+    "EnableAllIPs": true, //褰撲负true鏃讹紝寮�鏀炬墍鏈塈P鍧囧彲璁块棶銆�
+    // 鏀寔澶氫釜鍩熷悕绔彛锛屾敞鎰忕鍙e彿鍚庝笉瑕佸甫/鏂滄潌锛氭瘮濡俵ocalhost:8000/锛屾槸閿欑殑
+    // 娉ㄦ剰锛宧ttp://127.0.0.1:1818 鍜� http://localhost:1818 鏄笉涓�鏍风殑
+    "IPs": "http://127.0.0.1:8080,http://localhost:8080"
+  },
+  "ApiLogIgnore": "", //璁板綍鏃ュ織鏃讹紝蹇界暐鐨凙PI鍚嶇О锛屽涓敤閫楀彿鍒嗛殧锛岄厤缃殑涓嶈褰曞埌鏁版嵁搴撲腑
+  "ApiName": "WIDESEAWCS",
+  "ExpMinutes": 120,
+  "QuartzJobAutoStart": false,
+  "DBSeedEnable": false,
+  "QuartzDBSeedEnable": false,
+  "LogDeubgEnable": false, //鏄惁璁板綍璋冭瘯鏃ュ織
+  "PrintSql": false, //鎵撳嵃SQL璇彞
+  "LogAOPEnable": false, //鏄惁璁板綍AOP鏃ュ織
+  "WebSocketEnable": true, //鏄惁寮�鍚疻ebSocket鏈嶅姟
+  "WebSocketPort": 9296, //WebSocket鏈嶅姟绔彛
+  "WMSApiAddress": "http://127.0.0.1:9290", //"http://127.0.0.1:9283",姝e紡鐜鍦板潃
+  "FeedBackWMSTaskCompleted": "http://127.0.0.1:9290/api/Task/InboundTaskCompleted"
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
index f7cdd93..ef564b2 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -20,6 +20,8 @@
 using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup;
 using SqlSugar;
 using System.Diagnostics.CodeAnalysis;
+using System.Threading.Tasks;
+using WIDESEA_Comm.Http;
 using WIDESEAWCS_Common.TaskEnum;
 using WIDESEAWCS_Core;
 using WIDESEAWCS_Core.BaseRepository;
@@ -44,6 +46,7 @@
         private readonly IRepository<Dt_Router> _routerRepository;
         private readonly IRepository<Dt_StationManger> _stationMangerRepository;
         private readonly IMapper _mapper;
+        
 
         private Dictionary<string, OrderByType> _taskOrderBy = new()
             {
@@ -56,6 +59,9 @@
         public List<int> TaskInboundTypes => typeof(TaskInboundTypeEnum).GetEnumIndexList();
 
         public List<int> TaskOutboundTypes => typeof(TaskOutboundTypeEnum).GetEnumIndexList();
+
+        public string urlWMSMovelibraryTask = WIDESEAWCS_Core.Helper.AppSettings.Configuration["urlWMSMovelibraryTask"];
+        public string urlTaskCompleted = WIDESEAWCS_Core.Helper.AppSettings.Configuration["urlTaskCompleted"];
 
         /// <summary>
         /// 浠撳偍灞�(鏁版嵁搴撹闂�)
@@ -96,33 +102,8 @@
                         continue;
                     }
                     Dt_Task task = _mapper.Map<Dt_Task>(item);
+                    task.TaskState = item.TaskStatus;
 
-
-                    Dt_Router? router;
-
-                    TaskTypeGroup taskTypeGroup = item.TaskType.GetTaskTypeGroup();
-                    Dt_StationManger? stationManger;
-                    if (taskTypeGroup == TaskTypeGroup.InboundGroup)
-                    {
-                        task.Creater = "WMS";
-                        task.TaskState = (int)TaskStatusEnum.New.ObjToInt();
-                        stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.CurrentAddress || x.StationDeviceCode == item.SourceAddress);
-                        task.DeviceCode = stationManger.StationDeviceCode;
-                    }
-                    else
-                    {
-                        stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.NextAddress || x.StationDeviceCode == item.NextAddress);
-                        task.DeviceCode = stationManger.StationDeviceCode;
-                        List<Dt_Router> routers = routersAll.Where(x => x.InOutType == RouterInOutType.Out && (item.NextAddress == x.StartPosi || item.RoadWay == x.StartPosi /*|| item.RoadWay == x.ChildPosiDeviceCode || item.RoadWay == x.ChildPosi*/)).ToList();
-                        router = routers.FirstOrDefault();
-                        if (router == null)
-                        {
-                            return WebResponseContent.Instance.Error($"鏈壘鍒拌矾鐢遍厤缃俊鎭�");
-                        }
-                        //task.NextAddress = stationManger.StackerCraneStationCode;
-                        task.TargetAddress = router.NextPosi;
-                        //鍑哄簱
-                    }
                     tasks.Add(task);
                 }
                 BaseDal.AddData(tasks);
@@ -215,7 +196,7 @@
         /// <returns></returns>
         public Dt_Task QueryConveyorLineTask(string deviceNo, string currentAddress)
         {
-            return BaseDal.QueryFirst(x => (TaskInboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskInStatusEnum.InNew || TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.SC_OutFinish) && x.CurrentAddress == currentAddress, TaskOrderBy);
+            return BaseDal.QueryFirst(x => (TaskInboundTypes.Contains(x.TaskType) &&  TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.SC_OutFinish) && x.CurrentAddress == currentAddress, TaskOrderBy);
         }
 
         /// <summary>
@@ -248,12 +229,10 @@
         /// <returns></returns>
         public Dt_Task? QuertStackerCraneTask(string deviceNo, TaskTypeGroup? taskTypeGroup = null)
         {
-            if (taskTypeGroup == null)
-                return BaseDal.QueryFirst(x => x.DeviceCode == deviceNo && x.TaskState == (int)TaskInStatusEnum.InNew, TaskOrderBy);
             if (taskTypeGroup.Value == TaskTypeGroup.InboundGroup)
-                return BaseDal.QueryFirst(x => x.DeviceCode == deviceNo && TaskInboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskInStatusEnum.SC_Execute, TaskOrderBy);
+                return BaseDal.QueryFirst(x => x.DeviceCode == deviceNo && TaskInboundTypes.Contains(x.TaskType), TaskOrderBy);
             if (taskTypeGroup.Value == TaskTypeGroup.OutbondGroup)
-                return BaseDal.QueryFirst(x => x.DeviceCode == deviceNo && TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskInStatusEnum.SC_Execute, TaskOrderBy);
+                return BaseDal.QueryFirst(x => x.DeviceCode == deviceNo && TaskOutboundTypes.Contains(x.TaskType) , TaskOrderBy);
             return null;
         }
         /// <summary>
@@ -313,10 +292,7 @@
         /// <returns>杩斿洖浠诲姟瀹炰綋瀵硅薄锛屽彲鑳戒负null</returns>
         public Dt_Task QueryStackerCraneInTask(string deviceNo, string currentAddress = "")
         {
-            if (string.IsNullOrEmpty(currentAddress))
-                return BaseDal.QueryFirst(x => x.DeviceCode == deviceNo && x.TaskState == (int)TaskStatusEnum.SC_Execute, TaskOrderBy);
-            else
-                return BaseDal.QueryFirst(x => x.DeviceCode == deviceNo && TaskInboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskStatusEnum.SC_Execute && x.CurrentAddress == currentAddress, TaskOrderBy);
+            return BaseDal.QueryFirst(x => x.Roadway == deviceNo && x.TaskType== (int)TaskInboundTypeEnum.Inbound && x.TaskState == (int)TaskInStatusEnum.Line_InFinish, TaskOrderBy);
         }
 
         /// <summary>
@@ -327,10 +303,7 @@
         /// <returns>杩斿洖浠诲姟瀹炰綋瀵硅薄锛屽彲鑳戒负null</returns>
         public Dt_Task QueryStackerCraneOutTask(string deviceNo, string currentAddress = "")
         {
-            if (string.IsNullOrEmpty(currentAddress))
-                return BaseDal.QueryFirst(x => x.Roadway == deviceNo && TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.OutNew, TaskOrderBy);
-            else
-                return BaseDal.QueryFirst(x => x.Roadway == deviceNo && TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.OutNew && x.CurrentAddress == currentAddress, TaskOrderBy);
+            return BaseDal.QueryFirst(x => x.Roadway == deviceNo && x.TaskType==(int)TaskOutboundTypeEnum.Outbound && x.TaskState == (int)TaskOutStatusEnum.OutNew, TaskOrderBy);
         }
 
         /// <summary>
@@ -339,9 +312,9 @@
         /// <param name="deviceNo">璁惧缂栧彿</param>
         /// <param name="currentAddress">褰撳墠鍦板潃</param>
         /// <returns>杩斿洖浠诲姟瀹炰綋瀵硅薄闆嗗悎锛屽彲鑳戒负null</returns>
-        public List<Dt_Task> QueryStackerCraneOutTasks(string deviceNo, List<string> outStationCodes)
+        public List<Dt_Task> QueryStackerCraneOutTasks(string deviceNo)
         {
-            return BaseDal.QueryData(x => x.Roadway == deviceNo && TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.OutNew && outStationCodes.Contains(x.CurrentAddress), TaskOrderBy);
+            return BaseDal.QueryData(x => x.Roadway == deviceNo && x.TaskType == (int)TaskOutboundTypeEnum.Outbound && x.TaskState == (int)TaskOutStatusEnum.OutNew, TaskOrderBy);
         }
 
         /// <summary>
@@ -528,51 +501,50 @@
                 Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
                 if (task == null) return WebResponseContent.Instance.Error($"鏈壘鍒拌浠诲姟淇℃伅,浠诲姟鍙�:銆恵taskNum}銆�");
 
-                if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup && task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting)
+                if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting)
                 {
-                    List<Dt_Router> routers = _routerService.QueryNextRoutes(task.NextAddress, task.TargetAddress);
-                    if (!routers.Any()) return WebResponseContent.Instance.Error($"鏈壘鍒拌澶囪矾鐢变俊鎭�");
-                    int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskOutStatusEnum>();
-                    task.TaskState = nextStatus;
-                    task.CurrentAddress = task.NextAddress;
-                    task.NextAddress = routers.FirstOrDefault().ChildPosi;
-                    task.ModifyDate = DateTime.Now;
-                    task.Modifier = "System";
+                    /*List<Dt_Router> routers = _routerService.QueryNextRoutes(task.NextAddress, task.TargetAddress);
+                    if (!routers.Any()) return WebResponseContent.Instance.Error($"鏈壘鍒拌澶囪矾鐢变俊鎭�");*/
+                    task.TaskState = (int)TaskOutStatusEnum.OutFinish;
                     BaseDal.UpdateData(task);
 
-                    _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍫嗗灈鏈哄嚭搴撳畬鎴�");
+
+                    content = HttpHelperh.Get<WebResponseContent>($"{urlTaskCompleted}?TaskNum={task.TaskNum}&HowWorks=2");
+
+                    task.ModifyDate = DateTime.Now;
+                    BaseDal.DeleteData(task);
+                    // _task_HtyService.AddTaskHty(task); 闇�瑕佹坊鍔犵Щ鍏ュ巻鍙�
+                    _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍑哄簱瀹屾垚");
                     //todo 鍚屾鍒癢MS
-                    WMSTaskDTO WMStask = _mapper.Map<WMSTaskDTO>(task);
-                    HttpHelper.PostAsync(WMSInterfaceAddress.UpdateTaskStatus, WMStask.ToJson(), headers: new Dictionary<string, string>());
+
                     //鏆備笉鑰冭檻澶氫釜鍑哄簱鍙�
                 }
-                else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup && task.TaskState == (int)TaskInStatusEnum.SC_InExecuting)
+                else if (task.TaskType == (int)TaskInboundTypeEnum.Inbound && task.TaskState == (int)TaskInStatusEnum.SC_InExecuting)
                 {
-                    //todo 
-                    int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskInStatusEnum>();
-                    task.TaskState = nextStatus;
+                    task.TaskState = (int)TaskInStatusEnum.InFinish;
+                    BaseDal.UpdateData(task);
+
+                    content = HttpHelperh.Get<WebResponseContent>($"{urlTaskCompleted}?TaskNum={task.TaskNum}&HowWorks=2");
+
                     task.ModifyDate = DateTime.Now;
                     task.Modifier = "System";
-                    BaseDal.UpdateData(task);
-                    _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍫嗗灈鏈哄叆搴撳畬鎴�");
+                    BaseDal.DeleteData(task);
+                    // _task_HtyService.AddTaskHty(task); 闇�瑕佹坊鍔犵Щ鍏ュ巻鍙�
+                    _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍏ュ簱瀹屾垚");
 
-                    WMSTaskDTO WMStask = _mapper.Map<WMSTaskDTO>(task);
-
-                    HttpHelper.PostAsync(WMSInterfaceAddress.UpdateTaskStatus, WMStask.ToJson(), headers: new Dictionary<string, string>());
                 }
-                else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup && task.TaskState == (int)TaskRelocationStatusEnum.SC_RelocationFinish)
+                else if (task.TaskType == (int)TaskRelocationTypeEnum.Relocation)
                 {
-                    int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskRelocationStatusEnum>();
-                    task.CurrentAddress = task.NextAddress;
-                    task.NextAddress = string.Empty;
-                    task.TaskState = nextStatus;
-                    task.ModifyDate = DateTime.Now;
-                    task.Modifier = "System";
+                    task.TaskState = (int)TaskRelocationStatusEnum.SC_RelocationFinish;
                     BaseDal.UpdateData(task);
-                    _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍫嗗灈鏈虹Щ搴撳畬鎴�");
-                    WMSTaskDTO WMStask = _mapper.Map<WMSTaskDTO>(task);
-                    //todo 璋冪敤WMS绉诲簱瀹屾垚
-                    HttpHelper.PostAsync(WMSInterfaceAddress.UpdateTaskStatus, WMStask.ToJson(), headers: new Dictionary<string, string>());
+
+                    content = HttpHelperh.Get<WebResponseContent>($"{urlTaskCompleted}?TaskNum={task.TaskNum}&HowWorks=2");
+
+                  
+                    task.ModifyDate = DateTime.Now;
+                    BaseDal.DeleteData(task);
+                   // _task_HtyService.AddTaskHty(task); 闇�瑕佹坊鍔犵Щ鍏ュ巻鍙�
+                    _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"绉诲簱瀹屾垚");
                 }
                 else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OtherGroup)
                 {
@@ -586,7 +558,7 @@
             }
             catch (Exception ex)
             {
-                content = WebResponseContent.Instance.Error($"浠诲姟瀹屾垚寮傚父,浠诲姟鍙�:銆恵taskNum}銆�");
+                content = WebResponseContent.Instance.Error($"浠诲姟瀹屾垚寮傚父,浠诲姟鍙�:銆恵taskNum}銆戯紝鍘熷洜锛歿ex.Message}");
             }
             return content;
         }
@@ -618,10 +590,6 @@
                     if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
                     {
                         task.TaskState = (int)TaskOutStatusEnum.OutNew;
-                    }
-                    else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
-                    {
-                        task.TaskState = (int)TaskInStatusEnum.InNew;
                     }
                     //todo
                 }
@@ -681,5 +649,70 @@
             }
             return content;
         }
+
+        public Dt_Task GetTaskIninfo(string Pallat)
+        {
+            return BaseDal.QueryFirst(x => x.PalletCode == Pallat);
+        }
+
+        public WebResponseContent UpdateTaskIninfo(string Pallat, int TaskNo)
+        {
+            try
+            {
+                Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == TaskNo && x.PalletCode == Pallat);
+                if (task != null)
+                {
+                    task.TaskState = (int)TaskInStatusEnum.Line_InFinish;
+                    BaseDal.UpdateData(task);
+                    return WebResponseContent.Instance.OK();
+                }
+
+                return WebResponseContent.Instance.Error();
+            }
+            catch (Exception ex)
+            {
+                return WebResponseContent.Instance.Error();
+                throw;
+            }
+        }
+
+
+        public Dt_Task QueryStationIsOccupiedOutTasks(string deviceNo, string LocaAddress)
+        {
+            return BaseDal.QueryFirst(x => x.Roadway == deviceNo && (x.SourceAddress == LocaAddress || x.TargetAddress == LocaAddress), TaskOrderBy);
+        }
+
+        /// <summary>
+        /// 鏍规嵁娣卞簱浣嶅悜wms鐢宠鍒ゆ柇娴呭簱浣嶆槸鍚︽湁璐э紝鏄惁闇�瑕佽繘琛岀Щ搴撴搷浣�
+        /// </summary>
+        /// <param name="palletCode">鎵樼洏鍙�</param>
+        /// <param name="sourceAddress">璧峰鍦板潃</param>
+        /// <returns></returns>
+        public Dt_Task RequestWMSTaskMovelibrary(Dt_Task _Task)
+        {
+            WebResponseContent content = new WebResponseContent();
+
+            content = HttpHelperh.Get<WebResponseContent>($"{urlWMSMovelibraryTask}?TaskNum={_Task.TaskNum}");
+            Dt_Task task = new Dt_Task();
+            if (content.Status)
+            {
+                if (content.Data != null)
+                {
+                    task = JsonConvert.DeserializeObject<Dt_Task>(content.Data.ToString());
+                    if (task.TaskNum != _Task.TaskNum)
+                    {
+                        task.Grade = 3;
+                        BaseDal.AddData(task);
+                        return task;
+                    }
+                    else
+                    {
+                        return _Task;
+                    }
+                }
+            }
+            return null;
+
+        }
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
index 197355c..040e69b 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
@@ -1,6 +1,7 @@
 锘縰sing Microsoft.AspNetCore.Routing;
 using Quartz;
 using SqlSugar;
+using System.Threading.Tasks;
 using WIDESEAWCS_Common;
 using WIDESEAWCS_Common.Helper;
 using WIDESEAWCS_Common.TaskEnum;
@@ -30,6 +31,7 @@
         private readonly IRouterService _routerService;
         private readonly IRepository<Dt_Task> _taskRepository;
         private readonly IRepository<Dt_StationManger> _stationMangerRepository;
+
 
         public CommonConveyorLineJob(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRepository<Dt_StationManger> stationMangerRepository, IRepository<Dt_Task> taskRepository, IRouterRepository routerRepository, IRouterService routerService)
         {
@@ -94,25 +96,17 @@
                                 }
                             }
                             //鍑哄叆搴撶珯鍙�
-                            if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt())
+                            else if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt())
                             {
                                 //鍏ュ簱鐢熸垚鍫嗗灈鏈哄叆搴撲换鍔�
                                 if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !ACK)
                                 {
-                                    if (conveyorLineInfoRead.TaskNo == 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))//閲囪喘鍏ュ簱
+                                    if (conveyorLineInfoRead.TaskNo != 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))//閲囪喘鍏ュ簱
                                     {
-                                        WebResponseContent content = _taskService.RequestWMSTaskSimple(conveyorLineInfoRead.Barcode, item.StationCode);
-                                        if (content.Status)
+                                        WebResponseContent contentweb = _taskService.UpdateTaskIninfo(conveyorLineInfoRead.Barcode, conveyorLineInfoRead.TaskNo);
+                                        if (contentweb.Status)
                                         {
-                                            Dt_Task task = _taskRepository.QueryFirst(x => x.PalletCode == conveyorLineInfoRead.Barcode && x.CurrentAddress == item.StationCode && x.DeviceCode == device.DeviceCode && x.TaskState == (int)TaskStatusEnum.New.ObjToInt());
-                                            if (task != null)
-                                            {
-                                                _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, deviceCode: item.StackerCraneCode, sourceAddress: item.StackerCraneStationCode);
-                                                device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
-                                                device.SetValue(W_ConveyorLineDB.TaskNo, 1111, item.StationCode);
-                                                //_taskService.UpdateTask(task, TaskStatusEnum.RGV_NEW);
-                                            }
-
+                                            device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
                                         }
                                     }
 
@@ -174,15 +168,19 @@
 
                             }
                             //鍏ュ簱绔欏彴
-                            if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt())
+                            else if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt())
                             {
                                 if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !ACK)
                                 {
                                     if (conveyorLineInfoRead.TaskNo == 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))//閲囪喘鍏ュ簱
                                     {
-                                        device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
-                                        device.SetValue(W_ConveyorLineDB.EndPos, 2020, item.StationCode);
-                                        device.SetValue(W_ConveyorLineDB.TaskNo, 1111, item.StationCode);
+                                        Dt_Task dt_Ta = _taskService.GetTaskIninfo(conveyorLineInfoRead.Barcode);
+                                        if(dt_Ta != null)
+                                        {
+                                            device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
+                                            device.SetValue(W_ConveyorLineDB.EndPos, dt_Ta.SourceAddress, item.StationCode);
+                                            device.SetValue(W_ConveyorLineDB.TaskNo, dt_Ta.TaskNum, item.StationCode);
+                                        }
                                     }
 
 
@@ -198,7 +196,7 @@
                     }
         
                 
-                catch (Exception)
+                catch (Exception ex)
                 {
                 }
 
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
index ca9c58d..88114f3 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
@@ -117,75 +117,13 @@
                 {
                     var TaskNum = speStackerCrane.GetValue<StackerCraneDBName, Int32>(StackerCraneDBName.CurrentTaskNum);
                     WriteInfo("鍫嗗灈鏈轰换鍔″畬鎴�", $"浠诲姟鍙�:{TaskNum}");
-                    StackerCraneTaskCompleted(e.TaskNum, speStackerCrane.DeviceCode);
+                    _taskService.StackCraneTaskCompleted(e.TaskNum);
                     WriteInfo("鍫嗗灈鏈轰换鍔″畬鎴愬弽棣堜换鍔″彿", $"浠诲姟淇℃伅,浠诲姟鍙�:{e.TaskNum}");
                     speStackerCrane.SetValue(StackerCraneDBName.WorkType, 5);
                 }
             }
         }
-        public WebResponseContent StackerCraneTaskCompleted(int taskNum, string deviceCode)
-        {
-            try
-            {
-                Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == taskNum);
-                if (task != null)
-                {
-                    if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
-                    {
-                        Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneStationCode == task.NextAddress && x.StackerCraneCode == deviceCode);
-                        if (stationManger == null)
-                        {
-                            //_taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"杈撻�佺嚎鍑哄簱绔欑偣鏈厤缃�,{task.NextAddress}");
-                            _taskService.UpdateTaskExceptionMessage(taskNum, $"杈撻�佺嚎鍑哄簱绔欑偣鏈厤缃�,{task.NextAddress}");
-                            WriteError(deviceCode, $"杈撻�佺嚎鍑哄簱绔欑偣鏈厤缃�,{task.NextAddress}");
-                            return WebResponseContent.Instance.Error($"杈撻�佺嚎鍑哄簱绔欑偣鏈厤缃�,{task.NextAddress}");
-                        }
-                        Dt_Router router = _routerRepository.QueryFirst(x => x.InOutType == task.TaskType && x.StartPosi == stationManger.StationCode);
-                        if (router == null)
-                        {
-                            router = _routerRepository.QueryFirst(x => x.ChildPosi == deviceCode && x.ChildPosiDeviceCode == stationManger.StationDeviceCode && x.NextPosi == stationManger.StationCode && x.InOutType == task.TaskType && x.IsEnd);
-                            if (router != null && router.IsEnd)
-                            {
-                                _taskService.TaskCompleted(taskNum);
-                            }
-                            else
-                            {
-                                _taskService.UpdateTaskExceptionMessage(taskNum, $"鏈壘鍒拌矾鐢变俊鎭�,{task.NextAddress}");
-                                WriteError(deviceCode, $"鏈壘鍒拌矾鐢变俊鎭�,{task.NextAddress}");
-                                return WebResponseContent.Instance.Error($"鏈壘鍒拌矾鐢变俊鎭�,{task.NextAddress}");
-                            }
-                        }
-                        if (task.TargetAddress.Contains("1030") || task.TargetAddress.Contains("1026")) //鑷姩涓�绾�
-                        {
-                            _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: router.NextPosi);
-                        }
-
-                    }
-                    else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup || task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
-                    {
-                        _taskService.TaskCompleted(taskNum);
-                    }
-                    else
-                    {
-                        WriteError(deviceCode, $"鏈壘鍒拌浠诲姟绫诲瀷鍥炶皟WMS浠诲姟瀹屾垚鎺ュ彛,{task.TaskType}");
-                        _taskService.UpdateTaskExceptionMessage(taskNum, $"鏈壘鍒拌浠诲姟绫诲瀷鍥炶皟WMS浠诲姟瀹屾垚鎺ュ彛,{task.TaskType}");
-                    }
-
-                }
-                else
-                {
-                    WriteError(deviceCode, $"鏈壘鍒颁换鍔′俊鎭�,浠诲姟鍙�:{taskNum}");
-                    return WebResponseContent.Instance.Error($"鏈壘鍒颁换鍔′俊鎭�,浠诲姟鍙�:{taskNum}");
-                }
-
-                return WebResponseContent.Instance.OK();
-            }
-            catch (Exception ex)
-            {
-                WriteError(deviceCode, $"浠诲姟瀹屾垚閿欒", ex);
-                return WebResponseContent.Instance.Error(ex.Message);
-            }
-        }
+        
         /// <summary>
         /// 鑾峰彇浠诲姟
         /// </summary>
@@ -195,51 +133,69 @@
         {
             Dt_Task? task;
 
+            //鍫嗗灈鏈烘墽琛屼腑
             if (_taskRepository.QueryFirst(x => x.DeviceCode == commonStackerCrane.DeviceCode && x.TaskState == TaskStatusEnum.SC_Executing.ObjToInt()) != null)
             {
                 return null;
             }
-            if (commonStackerCrane.LastTaskType.GetValueOrDefault().GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
+
+            task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);         //鑾峰彇鍏ュ簱浠诲姟
+            if(task != null)
             {
-                task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
-                if (task == null)
-                {
-                    task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode);
-                }
+                return task;    //濡傛灉鏈変换鍔″垯鐩存帴涓嬪彂缁欏爢鍨涙満
             }
             else
             {
-                task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode);
-                if (task == null)
+                //杩涜鑾峰彇鍫嗗灈鏈哄嚭搴撲换鍔�
+                List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode);
+                foreach (var item in tasks)
                 {
-                    task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
-                }
-            }
-
-
-            if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
-            {
-                if (OutTaskStationIsOccupied(task) != null || true)
-                {
-                    return task;
-                }
-                else
-                {
-                    List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress).Select(x => x.ChildPosi).ToList();
-                    List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes);
-                    foreach (var item in tasks)
+                    if (OutTaskStationIsOccupied(item) != null)
                     {
-                        if (OutTaskStationIsOccupied(task) != null)
+                        if(item.Roadway== "SC01")
                         {
-                            return task;
+                            if (item.Depth == 1) return item;
+                            //璋冨彇WMS鎺ュ彛杩涜鍒ゆ柇鏄惁闇�瑕佽繘琛岀Щ搴�
+                            Dt_Task dt_Task= OutTaskMovelibrary(item);
+                            if (dt_Task != null) return dt_Task;
+
+                        }
+                        else
+                        {
+                            return item;
                         }
                     }
-                    task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
                 }
             }
 
             return task;
         }
+
+        private Dt_Task? OutTaskMovelibrary([NotNull] Dt_Task task)
+        {
+            string[] targetCodes = task.SourceAddress.Split("-");
+            if (targetCodes[1] == "001")
+            {
+                targetCodes[1] = "002";
+
+            }
+            else if (targetCodes[1] == "004")
+            {
+                targetCodes[1] = "003";
+            }
+            targetCodes[4] = "01";
+            string SourceAddress = string.Join("-", targetCodes); //缁勮娴呭簱浣嶅湴鍧�
+            Dt_Task? tasks = _taskService.QueryStationIsOccupiedOutTasks(task.Roadway, SourceAddress); //鎵炬祬搴撲綅鏄惁鏈変换鍔�
+            if (tasks != null) return tasks;
+        //鍚憌ms鐢宠鍒ゆ柇娴呭簱浣嶆槸鍚︽湁璐э紝鏄惁闇�瑕佽繘琛岀Щ搴�
+            Dt_Task? taskst = _taskService.RequestWMSTaskMovelibrary(task);
+            if (taskst != null) return taskst;
+            return null;
+        }
+
+
+
+
         /// <summary>
         /// 鍑哄簱浠诲姟鍒ゆ柇鍑哄簱绔欏彴鏄惁琚崰鐢�
         /// </summary>
@@ -285,10 +241,13 @@
             stackerCraneTaskCommand.TaskNum = task.TaskNum;
             stackerCraneTaskCommand.WorkType = 1;
             stackerCraneTaskCommand.TrayType = 1;
-            if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//鍒ゆ柇鏄惁鏄叆搴撲换鍔�
+            if (task.TaskType==(int)TaskInboundTypeEnum.Inbound)//鍒ゆ柇鏄惁鏄叆搴撲换鍔�
             {
 
-                string[] startCodes = task.SourceAddress.Split("-");
+                Dt_StationManger dt_StationManger=_stationMangerRepository.QueryFirst(x=>x.StationCode==task.SourceAddress);
+
+
+                string[] startCodes = dt_StationManger.StackerCraneStationCode.Split("-");
                 if (startCodes.Length == 3)
                 {
                     stackerCraneTaskCommand.StartRow = Convert.ToInt16(startCodes[0]);
@@ -312,21 +271,22 @@
                 }
 
             }
-            else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
+            else if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound)
             {
+                Dt_StationManger dt_StationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.TargetAddress);
 
-                string[] targetCodes = task.TargetAddress.Split("-");
+                string[] targetCodes = dt_StationManger.StackerCraneStationCode.Split("-");
 
                 stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]);
                 stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]);
                 stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]);
 
                 string[] sourceCodes = task.SourceAddress.Split("-");
-                if (sourceCodes.Length == 3)
+                if (sourceCodes.Length == 5)
                 {
-                    stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]);
-                    stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]);
-                    stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]);
+                    stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[1]);
+                    stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[2]);
+                    stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[3]);
                 }
                 else
                 {
@@ -336,14 +296,14 @@
                 }
 
             }
-            else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
+            else if (task.TaskType == (int)TaskRelocationTypeEnum.Relocation)   //鍒ゆ柇绉诲簱浠诲姟
             {
                 string[] targetCodes = task.NextAddress.Split("-");
-                if (targetCodes.Length == 3)
+                if (targetCodes.Length == 5)
                 {
-                    stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]);
-                    stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]);
-                    stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]);
+                    stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[1]);
+                    stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[2]);
+                    stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[3]);
                 }
                 else
                 {
@@ -352,11 +312,11 @@
                     return null;
                 }
                 string[] sourceCodes = task.CurrentAddress.Split("-");
-                if (sourceCodes.Length == 3)
+                if (sourceCodes.Length == 5)
                 {
-                    stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]);
-                    stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]);
-                    stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]);
+                    stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[1]);
+                    stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[2]);
+                    stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[3]);
                 }
                 else
                 {
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/config/buttons.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/config/buttons.js"
index 3a1f49b..448e203 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/config/buttons.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/config/buttons.js"
@@ -101,45 +101,10 @@
     }
 },
 {
-    name: "鎴� 鍝�(绌烘墭) 鍑� 搴�",
+    name: "鎵� 鍔� 鍑� 搴�",
     icon: 'el-icon-plus',
     value: 'HandOutbound',
-    type: 'warning',
-    onClick: function () {
-
-    }
-},
-{
-    name: "鍘� 鏉� 鏂� 鍑� 搴�",
-    icon: 'el-icon-plus',
-    value: 'HandOutboundycl',
     type: 'success',
-    onClick: function () {
-
-    }
-},
-{
-    name: "鐗╂枡鐘舵�佹洿鏀�",
-    icon: 'el-icon-plus',
-    value: 'Materialstaticupdate',
-    type: 'success',
-    onClick: function () {
-
-    }
-},{
-    name: "鐢熶骇鏃堕棿鏇存敼",
-    icon: 'el-icon-plus',
-    value: 'HanGeneratetime',
-    type: 'success',
-    onClick: function () {
-
-    }
-},
-{
-    name: "浜� 宸� 鎵� 鍔� 鍑� 搴�",
-    icon: 'el-icon-plus',
-    value: 'HandOutboundt',
-    type: 'danger',
     onClick: function () {
 
     }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/stock/stockInfo.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/stock/stockInfo.js"
index 2632621..d674533 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/stock/stockInfo.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/stock/stockInfo.js"
@@ -1,14 +1,12 @@
 
 //姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
 import gridBody from "./extend/HandOutbound.vue"
-import modelBody from "./extend/HandMaterials.vue"
-import griForter from "./extend/HandGenerateti.vue"
 let extension = {
   components: {
     //鏌ヨ鐣岄潰鎵╁睍缁勪欢
-    gridHeader: modelBody,
+    gridHeader: '',
     gridBody: gridBody,
-    gridFooter: griForter,
+    gridFooter: '',
     //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
     modelHeader: '',
     modelBody: '',
@@ -26,161 +24,17 @@
           if (rows.length == 0) {
             return this.$error("璇烽�夋嫨鏁版嵁!");
           } else {
-            var ids = rows.map(x => {
-              return  x.palletCode
-            })
-            var param = {
-              DelKeys: ids, //taskNo
-              Extra: true
-            }
-            this.http
-            .post("api/Task/ManualOutbound", param, "鏁版嵁澶勭悊涓�...")
-            .then((x) => {
-              if (x.status) {
-                this.$Message.success('鎴愬姛.');
-                this.refresh();
-              } else {
-                return this.$error(x.message);
+            var data = rows.map(x => {
+              return {
+                palletCode: x.palletCode,
+                otherField: x.otherField // 鏇挎崲涓烘偍闇�瑕佺殑鍙︿竴涓瓧娈�
               }
-            });
-          }
-        }
-      }
-
-      var btnHandOutboundycl = this.buttons.find(x => x.value == "HandOutboundycl");
-      if (btnHandOutboundycl != null) {
-        btnHandOutboundycl.onClick = () => {
-          let rows = this.$refs.table.getSelected();
-          if (rows.length == 0) {
-            return this.$error("璇烽�夋嫨鏁版嵁!");
-          } else {
-            var ids = rows.map(x => {
-              return  x.palletCode
             })
-            this.$refs.gridBody.open(ids);
+            this.$refs.gridBody.open(data);
             this.refresh();
           }
         }
       }
-
-      var btnMaterialstaticupdate = this.buttons.find(x => x.value == "Materialstaticupdate");
-      if (btnMaterialstaticupdate != null) {
-        btnMaterialstaticupdate.onClick = () => {
-          let rows = this.$refs.table.getSelected();
-          if (rows.length == 0) {
-            return this.$error("璇烽�夋嫨鏁版嵁!");
-          } else {
-            var ids = rows.map(x => {
-              return  x.id
-            })
-            this.$refs.gridHeader.open(ids);
-            this.refresh();
-          }
-        }
-      }
-
-      var btnHanGeneratetime = this.buttons.find(x => x.value == "HanGeneratetime");
-      if (btnHanGeneratetime != null) {
-        btnHanGeneratetime.onClick = () => {
-          let rows = this.$refs.table.getSelected();
-          if (rows.length == 0) {
-            return this.$error("璇烽�夋嫨鏁版嵁!");
-          } else {
-            var ids = rows.map(x => {
-              return  x.id
-            })
-            this.$refs.gridFooter.open(ids);
-            this.refresh();
-          }
-        }
-      }
-
-
-      var btnHandOutbound2 = this.buttons.find(x => x.value == "HandOutboundt");
-      if (btnHandOutbound2 != null) {
-        btnHandOutbound2.onClick = () => {
-          let rows = this.$refs.table.getSelected();
-          if (rows.length == 0) {
-            return this.$error("璇烽�夋嫨鏁版嵁!");
-          } else {
-            var ids = rows.map(x => {
-              return  x.palletCode
-            })
-            var param = {
-              DelKeys: ids, //taskNo
-              Extra: true
-            }
-            this.http
-              .post("api/Task/ManualOutboundDeleteinventory", param, "鏁版嵁澶勭悊涓�...")
-              .then((x) => {
-                if (x.status) {
-                  this.$Message.success('鎴愬姛.');
-                  this.refresh();
-                } else {
-                  return this.$error(x.message);
-                }
-              });
-          }
-        }
-      }
-
-
-      this.columns.forEach(x => {
-        if (x.field == "wlstatus") {
-          //鏍规嵁涓嶅悓鐨勫�硷紝瀹氫箟涓嶅悓鐨勬牱寮�(濡傦細鏂囧瓧棰滆壊)
-          x.render = (h, { row, column, index }) => {
-            if(row.wlstatus=='1'){
-              return (
-                <span style="display:block;background-color:#67c23a;width:65px;text-align:center;color:white;border:1px solid #67c23a;border-radius:5px;">
-                  鍚堟牸
-                </span>
-              );
-            }else if(row.wlstatus=='0'){
-              return (
-                <tr style="display:block;background-color:#f4b400;width:65px;text-align:center;color:white;border:1px solid #f4b400;border-radius:5px;">
-                  寰呮
-                </tr>
-              );
-            }else if(row.wlstatus=='2'){
-              return (
-                <tr style="display:block;background-color:#f56c6c;width:65px;text-align:center;color:white;border:1px solid #f56c6c;border-radius:5px;">
-                  涓嶅悎鏍�
-                </tr>
-              );
-            }else if(row.wlstatus=='3'){
-              return (
-                <tr style="display:block;background-color:#909399;width:65px;text-align:center;color:white;border:1px solid #909399;border-radius:5px;">
-                  绌烘墭
-                </tr>
-              );
-            }else if(row.wlstatus=='4'){
-              return (
-                <tr style="display:block;background-color:#f87eb9;width:65px;text-align:center;color:white;border:1px solid #f87eb9;border-radius:5px;">
-                  閫�璐�
-                </tr>
-              );
-            }else if(row.wlstatus=='5'){
-              return (
-                <tr style="display:block;background-color:#409eff;width:65px;text-align:center;color:white;border:1px solid #409eff;border-radius:5px;">
-                  杩斿伐
-                </tr>
-              );
-            }else if(row.wlstatus=='6'){
-              return (
-                <tr style="display:block;background-color:#9b59b6;width:65px;text-align:center;color:white;border:1px solid #9b59b6;border-radius:5px;">
-                  鐗归噰
-                </tr>
-              );
-            }else{
-              return (
-                <span style="display:block;background-color:#909399;width:55px;text-align:center;color:white;border:1px solid #e9e9eb;border-radius:5px;">
-                  鏈煡
-                </span>
-              );
-            }
-          }
-        }
-      });
     },
     onInited() {
       //妗嗘灦鍒濆鍖栭厤缃悗
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/basic/locationInfo.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/basic/locationInfo.vue"
index b11abf1..b3148de 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/basic/locationInfo.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/basic/locationInfo.vue"
@@ -41,7 +41,7 @@
     const searchFormOptions = ref([
       [
         { title: "璐т綅缂栧彿", field: "locationCode" ,type: "like",},
-        { title: "宸烽亾缂栧彿", field: "roadwayNo" },
+        { title: "宸烽亾缂栧彿", field: "roadwayNo" ,type: "like",},
         { title: "璐т綅绫诲瀷", field: "locationType",type: "select",dataKey: "locationTypeEnum",data: []},
         { title: "绂佺敤鐘舵��", field: "enableStatus" ,type: "select",dataKey: "enableStatusEnum",data: []},
       ],
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock"
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock"
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/v17/HierarchyCache.v1.txt" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/v17/HierarchyCache.v1.txt"
index ceebc9e..3e622b0 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/v17/HierarchyCache.v1.txt"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/v17/HierarchyCache.v1.txt"
Binary files differ
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_BasicService/Dt_ApiInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_BasicService/Dt_ApiInfoService.cs"
new file mode 100644
index 0000000..9a69d30
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_BasicService/Dt_ApiInfoService.cs"
@@ -0,0 +1,30 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection.Emit;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_IBasicService;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_BasicService
+{
+    public partial class Dt_ApiInfoService : ServiceBase<Dt_ApiInfo, IRepository<Dt_ApiInfo>>, IDt_ApiInfoService
+    {
+
+        public Dt_ApiInfoService(IRepository<Dt_ApiInfo> BaseDal) : base(BaseDal)
+        {
+        }
+
+        public IRepository<Dt_ApiInfo> Repository => BaseDal;
+
+
+        public Dt_ApiInfo GetConfigsByAPIInfo(string ApiCode, string ApiInterfaceAddress)
+        {
+            return BaseDal.QueryFirst(x => x.ApiCode == ApiCode && x.ApiInterfaceAddress== ApiInterfaceAddress);
+        }
+    }
+}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_BasicService/StationMangerService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_BasicService/StationMangerService.cs"
new file mode 100644
index 0000000..8412926
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_BasicService/StationMangerService.cs"
@@ -0,0 +1,24 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_IBasicService;
+using WIDESEA_Model.Models;
+
+namespace WIDESEAWCS_BasicInfoService
+{
+    public class StationMangerService : ServiceBase<Dt_StationManger, IRepository<Dt_StationManger>>, IStationMangerService
+    {
+        public StationMangerService(IRepository<Dt_StationManger> BaseDal) : base(BaseDal)
+        {
+        }
+
+        public Dt_StationManger QueryPlatform(string StationCode)
+        {
+            return BaseDal.QueryFirst(x=>x.StationCode == StationCode);
+        }
+    }
+}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Common/StockEnum/StockStatusEmun.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Common/StockEnum/StockStatusEmun.cs"
index 65ea267..510dabe 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Common/StockEnum/StockStatusEmun.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Common/StockEnum/StockStatusEmun.cs"
@@ -29,6 +29,9 @@
         [Description("鍏ュ簱瀹屾垚")]
         鍏ュ簱瀹屾垚 = 6,
 
+        [Description("宸插叆搴�")]
+        宸插叆搴� = 6,
+
         [Description("鍑哄簱閿佸畾")]
         鍑哄簱閿佸畾 = 7,
 
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskStatusEnum.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskStatusEnum.cs"
index fdea881..39a1def 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskStatusEnum.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskStatusEnum.cs"
@@ -8,108 +8,141 @@
 namespace WIDESEA_Common.TaskEnum
 {
     /// <summary>
-    /// 浠诲姟鐘舵��
+    /// 鍑哄簱浠诲姟鐘舵��
     /// </summary>
-    public enum TaskStatusEnum
+    public enum TaskOutStatusEnum
     {
         /// <summary>
-        /// 鏂板缓浠诲姟
+        /// 鏂板缓鍑哄簱浠诲姟
         /// </summary>
-        [Description("鏂板缓")]
-        New = 100,
+        [Description("鏂板缓鍑哄簱浠诲姟")]
+        OutNew = 100,
 
         /// <summary>
-        /// 鍫嗗灈鏈哄緟鎵ц
+        /// 鍫嗗灈鏈哄嚭搴撴墽琛屼腑
         /// </summary>
-        [Description("鍫嗗灈鏈哄緟鎵ц")]
-        SC_Execute = 200,
+        [Description("鍫嗗灈鏈哄嚭搴撴墽琛屼腑")]
+        SC_OutExecuting = 110,
 
         /// <summary>
-        /// 鍫嗗灈鏈烘墽琛屼腑
+        /// 鍫嗗灈鏈哄嚭搴撳畬鎴�
         /// </summary>
-        [Description("鍫嗗灈鏈烘墽琛屼腑")]
-        SC_Executing = 210,
+        [Description("鍫嗗灈鏈哄嚭搴撳畬鎴�")]
+        SC_OutFinish = 115,
 
         /// <summary>
-        /// 鍫嗗灈鏈哄畬鎴�
+        /// 杈撻�佺嚎鍑哄簱鎵ц涓�
         /// </summary>
-        [Description("鍫嗗灈鏈哄畬鎴�")]
-        SC_Finish = 220,
+        [Description("杈撻�佺嚎鍑哄簱鎵ц涓�")]
+        Line_OutExecuting = 120,
 
         /// <summary>
-        /// 杈撻�佺嚎寰呮墽琛�
+        /// 杈撻�佺嚎鍑哄簱瀹屾垚
         /// </summary>
-        [Description("杈撻�佺嚎寰呮墽琛�")]
-        Line_Execute = 400,
+        [Description("杈撻�佺嚎杈撻�佸畬鎴�")]
+        Line_OutFinish = 125,
+
 
         /// <summary>
-        /// 杈撻�佺嚎鎵ц涓�
+        /// 鍑哄簱浠诲姟瀹屾垚
         /// </summary>
-        [Description("杈撻�佺嚎鎵ц涓�")]
-        Line_Executing = 410,
+        [Description("鍑哄簱浠诲姟瀹屾垚")]
+        OutFinish = 190,
 
         /// <summary>
-        /// 杈撻�佺嚎瀹屾垚
+        /// 鍑哄簱浠诲姟鎸傝捣
         /// </summary>
-        [Description("杈撻�佺嚎瀹屾垚")]
-        Line_Finish = 420,
+        [Description("鍑哄簱浠诲姟鎸傝捣")]
+        OutPending = 197,
 
         /// <summary>
-        /// AGV寰呮墽琛�
+        /// 鍑哄簱浠诲姟鍙栨秷
         /// </summary>
-        [Description("AGV寰呮墽琛�")]
-        AGV_Execute = 300,
+        [Description("鍑哄簱浠诲姟鍙栨秷")]
+        OutCancel = 198,
 
         /// <summary>
-        /// AGV鎵ц涓�
+        /// 鍑哄簱浠诲姟寮傚父
         /// </summary>
-        [Description("AGV鎵ц涓�")]
-        AGV_Executing = 310,
+        [Description("鍑哄簱浠诲姟寮傚父")]
+        OutException = 199,
+    }
+
+    public enum TaskInStatusEnum
+    {
+        /// <summary>
+        /// 杈撻�佺嚎鍏ュ簱鎵ц涓�
+        /// </summary>
+        [Description("杈撻�佺嚎鍏ュ簱鎵ц涓�")]
+        Line_InExecuting = 215,
 
         /// <summary>
-        /// AGV寰呯户缁墽琛�
+        /// 杈撻�佺嚎鍏ュ簱瀹屾垚
         /// </summary>
-        [Description("AGV寰呯户缁墽琛�")]
-        AGV_WaitToExecute = 320,
-        /// <summary>
-        /// AGV鏀捐揣涓�
-        /// </summary>
-        [Description("AGV鏀捐揣涓�")]
-        AGV_Puting = 325,
+        [Description("杈撻�佺嚎杈撻�佸畬鎴�")]
+        Line_InFinish = 220,
 
         /// <summary>
-        /// AGV瀹屾垚
+        /// 鍫嗗灈鏈哄叆搴撴墽琛屼腑
         /// </summary>
-        [Description("AGV瀹屾垚")]
-        AGV_Finish = 330,
+        [Description("鍫嗗灈鏈哄叆搴撴墽琛屼腑")]
+        SC_InExecuting = 230,
 
         /// <summary>
-        /// 浠诲姟瀹屾垚
+        /// 鍫嗗灈鏈哄叆搴撳畬鎴�
         /// </summary>
-        [Description("浠诲姟瀹屾垚")]
-        Finish = 900,
+        [Description("鍫嗗灈鏈哄叆搴撳畬鎴�")]
+        SC_InFinish = 235,
 
         /// <summary>
-        /// 浠诲姟鎸傝捣
+        /// 鍏ュ簱浠诲姟瀹屾垚
         /// </summary>
-        [Description("浠诲姟鎸傝捣")]
-        Pending = 970,
+        [Description("鍏ュ簱浠诲姟瀹屾垚")]
+        InFinish = 290,
 
         /// <summary>
-        /// 浠诲姟鍙栨秷
+        /// 鍏ュ簱浠诲姟鎸傝捣
         /// </summary>
-        [Description("浠诲姟鍙栨秷")]
-        Cancel = 980,
+        [Description("鍏ュ簱浠诲姟鎸傝捣")]
+        InPending = 297,
 
         /// <summary>
-        /// 浠诲姟寮傚父
+        /// 鍏ュ簱浠诲姟鍙栨秷
         /// </summary>
-        [Description("浠诲姟寮傚父")]
-        Exception = 990,
+        [Description("鍏ュ簱浠诲姟鍙栨秷")]
+        InCancel = 298,
+
         /// <summary>
-        /// 鎻愬崌鏈烘墽琛屼腑
+        /// 鍏ュ簱浠诲姟寮傚父
         /// </summary>
-        [Description("鎻愬崌鏈烘墽琛屼腑")]
-        HT_Executing = 110,
+        [Description("鍏ュ簱浠诲姟寮傚父")]
+        InException = 299,
+    }
+
+    public enum TaskRelocationStatusEnum
+    {
+        /// <summary>
+        /// 鏂板缓绉诲簱浠诲姟
+        /// </summary>
+        [Description("鏂板缓绉诲簱浠诲姟")]
+        RelocationNew = 400,
+
+        /// <summary>
+        /// 鍫嗗灈鏈虹Щ搴撴墽琛屼腑
+        /// </summary>
+        [Description("鍫嗗灈鏈虹Щ搴撴墽琛屼腑")]
+        SC_RelocationExecuting = 410,
+
+        /// <summary>
+        /// 鍫嗗灈鏈虹Щ搴撳畬鎴�
+        /// </summary>
+        [Description("鍫嗗灈鏈虹Щ搴撳畬鎴�")]
+        SC_RelocationFinish = 420,
+
+        /// <summary>
+        /// 绉诲簱瀹屾垚
+        /// </summary>
+        [Description("绉诲簱瀹屾垚")]
+        RelocationFinish = 430,
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs"
index 1013730..5f20279 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs"
@@ -7,100 +7,6 @@
 
 namespace WIDESEA_Common.TaskEnum
 {
-    public enum TaskTypeEnum
-    {
-        /// <summary>
-        /// 棰嗘枡鍑哄簱
-        /// </summary>
-        [Description("棰嗘枡鍑哄簱")]
-        Outbound = 100,
-        /// <summary>
-        /// 鐩樼偣鍑哄簱
-        /// </summary>
-        [Description("鐩樼偣鍑哄簱")]
-        OutInventory = 110,
-        /// <summary>
-        /// 鍒嗘嫞鍑哄簱
-        /// </summary>
-        [Description("鍒嗘嫞鍑哄簱")]
-        OutPick = 120,
-        /// <summary>
-        /// 璐ㄦ鍑哄簱
-        /// </summary>
-        [Description("璐ㄦ鍑哄簱")]
-        OutQuality = 130,
-
-        /// <summary>
-        /// 绌虹鍑哄簱
-        /// </summary>
-        [Description("绌虹鍑哄簱")]
-        OutEmpty = 140,
-
-        /// <summary>
-        /// MES鍑哄簱
-        /// </summary>
-        [Description("MES鍑哄簱")]
-        MesOutbound = 200,
-
-        /// <summary>
-        /// MES鎵嬪姩鍑哄簱
-        /// </summary>
-        [Description("MES鎵嬪姩鍑哄簱")]
-        MesHandOutbound = 210,
-
-        /// <summary>
-        /// MES鎵嬪姩鎷i�夊嚭搴�
-        /// </summary>
-        [Description("MES鎵嬪姩鎷i�夊嚭搴�")]
-        MesHandPickOutbound = 220,
-
-        /// <summary>
-        /// 閲囪喘鍏ュ簱
-        /// </summary>
-        [Description("閲囪喘鍏ュ簱")]
-        Inbound = 510,
-        /// <summary>
-        /// 鐩樼偣鍏ュ簱
-        /// </summary>
-        [Description("鐩樼偣鍏ュ簱")]
-        InInventory = 520,
-        /// <summary>
-        /// 鍒嗘嫞鍏ュ簱
-        /// </summary>
-        [Description("鍒嗘嫞鍏ュ簱")]
-        InPick = 530,
-        /// <summary>
-        /// 璐ㄦ鍏ュ簱
-        /// </summary>
-        [Description("璐ㄦ鍏ュ簱")]
-        InQuality = 540,
-
-        /// <summary>
-        /// 鐢熶骇閫�鏂�
-        /// </summary>
-        [Description("鐢熶骇閫�鏂�")]
-        ProductionReturn = 550,
-
-        /// <summary>
-        /// MES閫�鏂�
-        /// </summary>
-        [Description("MES閫�鏂�")]
-        MesMatReturn = 560,
-
-        /// <summary>
-        /// 绌虹鍏ュ簱
-        /// </summary>
-        [Description("绌虹鍏ュ簱")]
-        InEmpty = 600,
-
-        /// <summary>
-        /// 宸烽亾鍐呯Щ搴�
-        /// </summary>
-        [Description("宸烽亾鍐呯Щ搴�")]
-        Relocation = 900
-        
-    }
-
     public enum TaskTypeGroup
     {
         /// <summary>
@@ -123,4 +29,65 @@
         /// </summary>
         OtherGroup
     }
+
+
+
+
+    public enum TaskInboundTypeEnum
+    {
+        /// <summary>
+        /// 鍏ュ簱
+        /// </summary>
+        [Description("鍏ュ簱")]
+        Inbound = 200,
+        /// <summary>
+        /// 鐩樼偣鍏ュ簱
+        /// </summary>
+        [Description("鐩樼偣鍏ュ簱")]
+        InInventory = 201,
+        /// <summary>
+        /// 鍒嗘嫞鍏ュ簱
+        /// </summary>
+        [Description("鍒嗘嫞鍏ュ簱")]
+        InPick = 202,
+        /// <summary>
+        /// 璐ㄦ鍏ュ簱
+        /// </summary>
+        [Description("璐ㄦ鍏ュ簱")]
+        InQuality = 203
+    }
+
+    public enum TaskOutboundTypeEnum
+    {
+        /// <summary>
+        /// 鍑哄簱
+        /// </summary>
+        [Description("鍑哄簱")]
+        Outbound = 100,
+        /// <summary>
+        /// 鐩樼偣鍑哄簱
+        /// </summary>
+        [Description("鐩樼偣鍑哄簱")]
+        OutInventory = 101,
+        /// <summary>
+        /// 鍒嗘嫞鍑哄簱
+        /// </summary>
+        [Description("鍒嗘嫞鍑哄簱")]
+        OutPick = 102,
+        /// <summary>
+        /// 璐ㄦ鍑哄簱
+        /// </summary>
+        [Description("璐ㄦ鍑哄簱")]
+        OutQuality = 103,
+    }
+
+    public enum TaskRelocationTypeEnum
+    {
+        /// <summary>
+        /// 搴撳唴绉诲簱
+        /// </summary>
+        [Description("搴撳唴绉诲簱")]
+        Relocation = 300,
+    }
+
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Core/Const/ConfigConst.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Core/Const/ConfigConst.cs"
index e6c0f07..cdfd76e 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Core/Const/ConfigConst.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Core/Const/ConfigConst.cs"
@@ -12,14 +12,11 @@
     public class CateGoryConst
     {
         /// <summary>
-        /// 閭鍩虹
+        /// IP鎺ュ彛鍦板潃
         /// </summary>
-        public const string CONFIG_SYS_BaseExmail = "Sys_BaseExmail";
+        public const string CONFIG_WCS_IPAddress = "WCS_IPAddress";
 
-        /// <summary>
-        /// 閭閰嶇疆
-        /// </summary>
-        public const string CONFIG_SYS_RegExmail = "Sys_RegExmail";
+        public const string CONFIG_MES_IPAddress = "MES_IPAddress";
     }
 
     /// <summary>
@@ -28,37 +25,15 @@
     public class SysConfigConst
     {
         /// <summary>
-        ///  閭SMTP鍦板潃
+        /// 涓嬪彂WCS浠诲姟
         /// </summary>
-        public const string SMTP_Server = "smtpServer";
+        public const string WCSReceiveTask = "ReceiveTask";
 
         /// <summary>
-        ///  閭SMTP绔彛
+        /// 绉诲簱浠诲姟瀹屾垚
         /// </summary>
-        public const string SMTP_Port = "smtpPort";
+        public const string MESTransferCompletionFeedback = "MESTransferCompletionFeedback";
+        public const string MESTaskFeedback = "MESTaskFeedback";
 
-        /// <summary>
-        ///  閭SMTP璐﹀彿
-        /// </summary>
-        public const string SMTP_User = "smtpUser";
-
-        /// <summary>
-        ///  閭SMTP瀵嗙爜
-        /// </summary>
-        public const string SMTP_Pass = "smtpPass";
-
-        /// <summary>
-        ///  閭鏍囬
-        /// </summary>
-        public const string SMTP_Title = "smtpTitle";
-
-        /// <summary>
-        ///  閭鍐呭鏍囬
-        /// </summary>
-        public const string SMTP_ContentTitle = "smtpContentTitle";
-        /// <summary>
-        ///  閭鍐呭鏍囬
-        /// </summary>
-        public const string SMTP_RegUser = "smtpRegUser";
     }
 }
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs"
index c28210f..a1ba0a3 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_DTO/Task/WMSTaskDTO.cs"
@@ -100,5 +100,9 @@
         /// </summary>
         public int MaterialType { get; set; }
 
+        public string MEStaskId { get; set; }
+        public string MESbusinessId { get; set; }
+        public string MESsubPalletCode { get; set; }
+
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_DTO/ToMes/RelocationTaskMes.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_DTO/ToMes/RelocationTaskMes.cs"
new file mode 100644
index 0000000..5349f6b
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_DTO/ToMes/RelocationTaskMes.cs"
@@ -0,0 +1,267 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEA_DTO.ToMes
+{
+    /// <summary>
+    /// 绉诲簱绫讳笂浼燤ES閫氱煡
+    /// </summary>
+    public class TransferRequest
+    {
+        /// <summary>
+        /// 涓氬姟ID
+        /// </summary>
+        public string businessId { get; set; }
+
+        /// <summary>
+        /// 浠诲姟ID
+        /// </summary>
+        public string TaskId { get; set; }
+
+        /// <summary>
+        /// 鍘熻揣浣�
+        /// </summary>
+        public string SourceLocationCode { get; set; }
+
+        /// <summary>
+        /// 鐩爣璐т綅缂栫爜
+        /// </summary>
+        public string LocationCode { get; set; }
+
+        /// <summary>
+        /// 鎵樼洏缂栫爜
+        /// </summary>
+        public string PalletCode { get; set; }
+
+        /// <summary>
+        /// 鐘舵��: FINISH-宸插畬鎴�, TRANSFER-杞Щ涓�
+        /// </summary>
+        public string Status { get; set; }
+
+        /// <summary>
+        /// 寮傚父鐘舵��: NORMAL-姝e父锛孍RROR-寮傚父
+        /// </summary>
+        public string ErrorStatus { get; set; }
+
+        /// <summary>
+        /// 寮傚父淇℃伅
+        /// </summary>
+        public string ErrorInfo { get; set; }
+    }
+
+    /// <summary>
+    /// 鎺ユ敹鍙嶉鍙傛暟閫氱煡
+    /// </summary>
+    /// <typeparam name="T"></typeparam>
+    public class ApiResponse<T>
+    {
+        /// <summary>
+        /// 鐘舵�佺爜: 1-鎴愬姛, 鍏朵粬-澶辫触
+        /// </summary>
+        public int Code { get; set; }
+
+        /// <summary>
+        /// 娑堟伅
+        /// </summary>
+        public string Message { get; set; }
+
+        /// <summary>
+        /// 鏁版嵁
+        /// </summary>
+        public T Data { get; set; }
+
+        /// <summary>
+        /// 鏄惁鎴愬姛
+        /// </summary>
+        public bool Success { get; set; }
+
+        /// <summary>
+        /// 鎴愬姛鍝嶅簲
+        /// </summary>
+        public static ApiResponse<T> SuccessResponse(string message = "鎿嶄綔鎴愬姛锛�", T data = default)
+        {
+            return new ApiResponse<T>
+            {
+                Code = 1,
+                Message = message,
+                Data = data,
+                Success = true
+            };
+        }
+
+        /// <summary>
+        /// 澶辫触鍝嶅簲
+        /// </summary>
+        public static ApiResponse<T> ErrorResponse(string message = "鎿嶄綔澶辫触锛�", int code = 0)
+        {
+            return new ApiResponse<T>
+            {
+                Code = code,
+                Message = message,
+                Data = default,
+                Success = false
+            };
+        }
+    }
+
+    
+    public class TaskNotification
+    {
+        /// <summary>
+        /// 浠诲姟ID
+        /// </summary>
+        public string TaskId { get; set; }
+
+        /// <summary>
+        /// 涓氬姟ID
+        /// </summary>
+        public string BusinessId { get; set; }
+
+        /// <summary>
+        /// 鎵樼洏缂栫爜
+        /// </summary>
+        public string PalletCode { get; set; }
+
+        /// <summary>
+        /// 瀛愭墭鐩樼紪鐮�
+        /// </summary>
+        public string SubPalletCode { get; set; }
+
+        /// <summary>
+        /// 璐т綅缂栫爜
+        /// </summary>
+        public string LocationCode { get; set; }
+
+        /// <summary>
+        /// 寮傚父鐘舵�侊細NORMAL-姝e父锛孍RROR-寮傚父
+        /// </summary>
+        public string ErrorStatus { get; set; }
+
+        /// <summary>
+        /// 寮傚父淇℃伅
+        /// </summary>
+        public string ErrorInfo { get; set; }
+    }
+
+    
+    public class InOutboundTaskReceived
+    {
+        /// <summary>
+        /// 璇锋眰鏃堕棿
+        /// </summary>
+        public string ReqTime { get; set; }
+
+        /// <summary>
+        /// 浠诲姟ID
+        /// </summary>
+        public string TaskId { get; set; }
+
+        /// <summary>
+        /// 涓氬姟ID
+        /// </summary>
+        public string BusinessId { get; set; }
+
+        /// <summary>
+        /// 鑺傜偣缂栫爜
+        /// </summary>
+        public string NodeCode { get; set; }
+
+        /// <summary>
+        /// 鎵樼洏缂栫爜鍒楄〃
+        /// </summary>
+        public List<string> PalletCodeList { get; set; }
+
+        /// <summary>
+        /// 鎵樼洏淇℃伅鍒楄〃
+        /// </summary>
+        public List<PalletInfo> palletInfoList { get; set; }
+    }
+
+    /// <summary>
+    /// 鎵樼洏淇℃伅
+    /// </summary>
+    public class PalletInfo
+    {
+        /// <summary>
+        /// 璐т綅缂栫爜
+        /// </summary>
+        public string locationCode { get; set; }
+
+        /// <summary>
+        /// 鎵樼洏缂栫爜
+        /// </summary>
+        public string palletCode { get; set; }
+
+        /// <summary>
+        /// 瀛愭墭鐩樼紪鐮�
+        /// </summary>
+        public string subPalletCode { get; set; }
+    }
+
+    public class LocationInfoDto
+    {
+        /// <summary>
+        /// 鍖哄煙缂栫爜
+        /// </summary>
+        public string areaCode { get; set; }
+
+        /// <summary>
+        /// 璐т綅缂栫爜
+        /// </summary>
+        public string locationCode { get; set; }
+
+        /// <summary>
+        /// 璐т綅鍚嶇О
+        /// </summary>
+        public string locationName { get; set; }
+
+        /// <summary>
+        /// 宸烽亾缂栧彿
+        /// </summary>
+        public string roadwayNo { get; set; }
+
+        /// <summary>
+        /// 琛�
+        /// </summary>
+        public int row { get; set; }
+
+        /// <summary>
+        /// 鍒�
+        /// </summary>
+        public int column { get; set; }
+
+        /// <summary>
+        /// 灞�
+        /// </summary>
+        public int layer { get; set; }
+
+        /// <summary>
+        /// 娣卞害
+        /// </summary>
+        public double depth { get; set; }
+
+        /// <summary>
+        /// 璐т綅绫诲瀷
+        /// </summary>
+        public int locationType { get; set; }
+
+        /// <summary>
+        /// 璐т綅鐘舵��
+        /// </summary>
+        public int locationStatus { get; set; }
+
+        /// <summary>
+        /// 鍚敤鐘舵��
+        /// </summary>
+        public bool enableStatus { get; set; }
+
+        /// <summary>
+        /// 澶囨敞
+        /// </summary>
+        public string remark { get; set; }
+    }
+
+}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_IBasicService/IDt_ApiInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_IBasicService/IDt_ApiInfoService.cs"
new file mode 100644
index 0000000..4ec1b08
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_IBasicService/IDt_ApiInfoService.cs"
@@ -0,0 +1,23 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_DTO.Basic;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_IBasicService
+{
+    public interface IDt_ApiInfoService : IService<Dt_ApiInfo>
+    {
+        /// <summary>
+        /// 鏍规嵁绫诲埆,api閿幏鍙栧埌瀵瑰簲鐨勬帴鍙f暟鎹�
+        /// </summary>
+        /// <param name="category">绫诲埆</param>
+        /// <returns></returns>
+        Dt_ApiInfo GetConfigsByAPIInfo(string ApiCode, string ApiInterfaceAddress);
+    }
+}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_IBasicService/IStationMangerService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_IBasicService/IStationMangerService.cs"
new file mode 100644
index 0000000..bbfd08a
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_IBasicService/IStationMangerService.cs"
@@ -0,0 +1,15 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_IBasicService
+{
+    public interface IStationMangerService : IService<Dt_StationManger>
+    {
+        Dt_StationManger QueryPlatform(string StationCode);
+    }
+}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_IRecordService/ILocationStatusChangeRecordService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_IRecordService/ILocationStatusChangeRecordService.cs"
index ed24872..ce874f1 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_IRecordService/ILocationStatusChangeRecordService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_IRecordService/ILocationStatusChangeRecordService.cs"
@@ -14,5 +14,7 @@
     public interface ILocationStatusChangeRecordService : IService<Dt_LocationStatusChangeRecord>
     {
         IRepository<Dt_LocationStatusChangeRecord> Repository { get; }
+
+        void AddLocationStatusChangeRecord(Dt_LocationInfo locationInfo, int lastStatus, int changeType, string orderNo, int? taskNum);
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_LogService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_LogService.cs"
index 27dcb29..9838064 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_LogService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_ISystemService/ISys_LogService.cs"
@@ -10,5 +10,6 @@
 {
     public interface ISys_LogService : IService<Sys_Log>
     {
+
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
index 2b7d36d..441ca49 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
@@ -30,16 +30,66 @@
 using WIDESEA_DTO;
 using WIDESEA_DTO.Stock;
 using WIDESEA_DTO.Task;
+using WIDESEA_DTO.ToMes;
 using WIDESEA_Model.Models;
 
 namespace WIDESEA_ITaskInfoService
 {
     public interface ITaskService : IService<Dt_Task>
     {
+        int GetTaskNum(string sequenceName);
+
         IRepository<Dt_Task> Repository { get; }
 
         WebResponseContent DeviceRequestInboundTaskSimple(string stationCode, string palletCode);
 
-        WebResponseContent InboundTaskCompleted(int taskNum);
+        /// <summary>
+        /// 鍑哄簱
+        /// </summary>
+        /// <param name="outbound"></param>
+        /// <returns></returns>
+        ApiResponse<object> sendExTask(InOutboundTaskReceived outbound);
+
+        /// <summary>
+        /// 鍏ュ簱
+        /// </summary>
+        /// <param name="outbound"></param>
+        /// <returns></returns>
+        ApiResponse<object> sendEnTask(InOutboundTaskReceived outbound);
+
+
+        /// <summary>
+        /// 浠诲姟瀹屾垚鎺ュ彛
+        /// </summary>
+        /// <param name="taskNum"></param>
+        /// <returns></returns>
+        WebResponseContent TaskCompleted(int taskNum);
+
+        /// <summary>
+        /// 绉诲簱鐢宠鍒ゆ柇鎺ュ彛
+        /// </summary>
+        /// <param name="TaskNum"></param>
+        /// <returns></returns>
+        WebResponseContent IsRelocations(int TaskNum);
+
+
+
+
+        /// <summary>
+        /// 鍒涘缓璐т綅
+        /// </summary>
+        /// <param name="locationInfo"></param>
+        /// <returns></returns>
+        ApiResponse<object> createLocation(List<LocationInfoDto> locationInfo);
+        /// <summary>
+        /// 鍒犻櫎璐т綅
+        /// </summary>
+        ApiResponse<object> deleteLocation(List<string> locationCode);
+        /// <summary>
+        /// 淇敼璐т綅
+        /// </summary>
+        /// <param name="locationInfo"></param>
+        /// <returns></returns>
+        ApiResponse<object> updateLocation(LocationInfoDto locationInfo);
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_ApiInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_ApiInfo.cs"
index e0dc8f8..4cbdec7 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_ApiInfo.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_ApiInfo.cs"
@@ -20,7 +20,7 @@
         [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")]
         public int Id { get; set; }
         /// <summary>
-        /// 鎺ュ彛缂栧彿
+        /// 鎺ュ彛绫诲瀷
         /// </summary>
         [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鎺ュ彛缂栧彿")]
         public string ApiCode { get; set; }
@@ -29,6 +29,12 @@
         /// </summary>
         [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鎺ュ彛鍚嶇О")]
         public string ApiName { get; set; }
+
+        /// <summary>
+        /// 鎺ュ彛閿�
+        /// </summary>
+        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鎺ュ彛閿�")]
+        public string ApiInterfaceAddress { get; set; }
         /// <summary>
         /// 鎺ュ彛鍦板潃
         /// </summary>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_StationManger.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_StationManger.cs"
new file mode 100644
index 0000000..2e2b0fd
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_StationManger.cs"
@@ -0,0 +1,77 @@
+锘縰sing SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.DB.Models;
+
+namespace WIDESEA_Model.Models
+{
+    [SugarTable(nameof(Dt_StationManger), "绔欏彴琛�")]
+    public class Dt_StationManger : BaseEntity
+    {
+        /// <summary>
+        /// 涓婚敭
+        /// </summary>
+        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")]
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 绔欏彴缂栧彿
+        /// </summary>
+        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "绔欏彴缂栧彿")]
+        public string StationCode { get; set; }
+
+        /// <summary>
+        /// 绔欏彴鍚嶇О
+        /// </summary>
+        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "绔欏彴鍚嶇О")]
+        public string StationName { get; set; }
+
+        /// <summary>
+        /// 绔欏彴绫诲瀷 <br/>
+        /// 1锛氬彧鍏� <br/>
+        /// 2锛氬彧鍑� <br/>
+        /// 3锛氬彲鍏ュ彲鍑�
+        /// </summary>
+        [SugarColumn(IsNullable = false, ColumnDescription = "绔欏彴绫诲瀷")]
+        public int StationType {  get; set; }
+
+        /// <summary>
+        /// 瀵瑰簲鍫嗗灈鏈烘帓-鍒�-灞�
+        /// </summary>
+        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "瀵瑰簲鍫嗗灈鏈烘帓-鍒�-灞�")]
+        public string StackerCraneStationCode { get; set; }
+
+        /// <summary>
+        /// 绔欏彴璁惧缂栧彿
+        /// </summary>
+        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "绔欏彴璁惧缂栧彿")]
+        public string StationDeviceCode { get; set; }
+
+        /// <summary>
+        /// 鍫嗗灈鏈虹紪鍙�
+        /// </summary>
+        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鍫嗗灈鏈虹紪鍙�")]
+        public string StackerCraneCode { get; set; }
+
+        /// <summary>
+        /// AGV绔欏彴缂栧彿
+        /// </summary>
+        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "AGV绔欏彴缂栧彿")]
+        public string? AGVStationCode { get; set; }
+        /// <summary>
+        /// 绔欏彴鏄惁鍙敤 <br/>
+        /// 0锛氬彲鐢� <br/>
+        /// 1锛氬崰鐢� <br/>
+        /// </summary>
+        [SugarColumn(IsNullable = false, ColumnDescription = "绔欏彴鏄惁鍙敤")]
+        public int IsOccupied { get; set; }
+        /// <summary>
+        /// 澶囨敞
+        /// </summary>
+        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "澶囨敞")]
+        public string Remark { get; set; }
+    }
+}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfo.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfo.cs"
index 85fea92..07c998b 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfo.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfo.cs"
@@ -1,9 +1,11 @@
-锘縰sing SqlSugar;
+锘縰sing Magicodes.ExporterAndImporter.Core;
+using SqlSugar;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Xml.Linq;
 using WIDESEA_Core.DB.Models;
 
 namespace WIDESEA_Model.Models
@@ -57,6 +59,14 @@
         public string Remark { get; set; }
 
         /// <summary>
+        /// 鎵樼洏缂栧彿瀛愭墭
+        /// </summary>
+        [ImporterHeader(Name = "鎵樼洏缂栧彿瀛愭墭")]
+        [ExporterHeader(DisplayName = "鎵樼洏缂栧彿瀛愭墭")]
+        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鎵樼洏缂栧彿瀛愭墭")]
+        public string MESsubPalletCode { get; set; }
+
+        /// <summary>
         /// 搴撳瓨鏄庣粏
         /// </summary>
         [Navigate(NavigateType.OneToMany, nameof(Dt_StockInfoDetail.StockId), nameof(Id))]
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task.cs"
index 4744830..695d0af 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_Model/Models/TaskInfo/Dt_Task.cs"
@@ -142,5 +142,39 @@
         [ExporterHeader(DisplayName = "澶囨敞")]
         [SugarColumn(IsNullable = true, Length = 255, ColumnDescription = "澶囨敞")]
         public string Remark { get; set; }
+
+        /// <summary>
+        /// 娣卞害
+        /// </summary>
+        [ImporterHeader(Name = "娣卞害")]
+        [ExporterHeader(DisplayName = "娣卞害")]
+        [SugarColumn(IsNullable = false, ColumnDescription = "娣卞害")]
+        public int Depth { get; set; }
+
+
+
+        /// <summary>
+        /// MES浠诲姟id
+        /// </summary>
+        [ImporterHeader(Name = "MES浠诲姟id")]
+        [ExporterHeader(DisplayName = "MES浠诲姟id")]
+        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "MES浠诲姟id")]
+        public string MEStaskId { get; set; }
+
+        /// <summary>
+        /// MES涓氬姟娴乮d
+        /// </summary>
+        [ImporterHeader(Name = "MES涓氬姟娴乮d")]
+        [ExporterHeader(DisplayName = "MES涓氬姟娴乮d")]
+        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "MES涓氬姟娴乮d")]
+        public string MESbusinessId { get; set; }
+
+        /// <summary>
+        /// 鎵樼洏缂栧彿瀛愭墭
+        /// </summary>
+        [ImporterHeader(Name = "鎵樼洏缂栧彿瀛愭墭")]
+        [ExporterHeader(DisplayName = "鎵樼洏缂栧彿瀛愭墭")]
+        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鎵樼洏缂栧彿瀛愭墭")]
+        public string MESsubPalletCode { get; set; }
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_RecordService/LocationStatusChangeRecordService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_RecordService/LocationStatusChangeRecordService.cs"
index d159a29..f2555e5 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_RecordService/LocationStatusChangeRecordService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_RecordService/LocationStatusChangeRecordService.cs"
@@ -12,5 +12,22 @@
         }
 
         public IRepository<Dt_LocationStatusChangeRecord> Repository => BaseDal;
+
+        public void AddLocationStatusChangeRecord(Dt_LocationInfo locationInfo, int lastStatus, int changeType, string? orderNo, int? taskNum)
+        {
+            Dt_LocationStatusChangeRecord locationStatusChangeRecord = new Dt_LocationStatusChangeRecord()
+            {
+                AfterStatus = locationInfo.LocationStatus,
+                BeforeStatus = lastStatus,
+                ChangeType = changeType,
+                LocationCode = locationInfo.LocationCode,
+                LocationId = locationInfo.Id,
+                TaskNum = taskNum,
+                Creater = "WMS",
+                OrderNo = orderNo ?? ""
+            };
+
+            BaseDal.AddData(locationStatusChangeRecord);
+        }
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs"
index dc3ff0f..e82f7d9 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs"
@@ -18,6 +18,11 @@
 using WIDESEA_Common.TaskEnum;
 using WIDESEA_Common.StockEnum;
 using WIDESEA_Common.LocationEnum;
+using WIDESEA_Common.CommonEnum;
+using WIDESEA_DTO.ToMes;
+using System.Diagnostics;
+using WIDESEA_Common.OtherEnum;
+using WIDESEA_Core.Const;
 
 namespace WIDESEA_TaskInfoService
 {
@@ -40,10 +45,12 @@
                     PushTasksToWCS(new List<Dt_Task> { task });
                     return WebResponseContent.Instance.OK($"璇ユ墭鐩樺凡鐢熸垚浠诲姟", _mapper.Map<WMSTaskDTO>(task));
                 }
-                if (Repository.QueryFirst(x => x.SourceAddress == stationCode && x.TaskStatus == TaskStatusEnum.New.ObjToInt()) != null)
+               /* if (Repository.QueryFirst(x => x.SourceAddress == stationCode && x.TaskStatus == OutTaskStatusEnum.New.ObjToInt()) != null)
                 {
                     return WebResponseContent.Instance.Error($"璇ョ珯鐐瑰凡鏈夋湭鎵ц鐨勪换鍔�");
-                }
+                }*/
+
+
                 //Dt_StockInfo stockInfo = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode).Includes(x => x.Details).First();
 
                 //if (stockInfo == null)
@@ -63,7 +70,7 @@
                 Dt_Warehouse warehouse = _warehouseRepository.QueryFirst(x => x.WarehouseCode == roadwayInfo.RoadwayNo);
                 if (warehouse == null)
                 {
-                    return WebResponseContent.Instance.Error("鏈壘鍒版敼浠撳簱");
+                    return WebResponseContent.Instance.Error("鏈壘鍒拌浠撳簱");
                 }
                 Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(roadwayInfo.RoadwayNo, warehouse.WarehouseId, "");//
                 if (locationInfo == null)
@@ -90,8 +97,8 @@
                     Roadway = "1",
                     SourceAddress = "",
                     TargetAddress = locationInfo.LocationCode,
-                    TaskType = TaskTypeEnum.Inbound.ObjToInt(),
-                    TaskStatus = TaskStatusEnum.New.ObjToInt(),
+                    TaskType = TaskInboundTypeEnum.Inbound.ObjToInt(),
+                    TaskStatus = TaskInStatusEnum.Line_InExecuting.ObjToInt(),
                     WarehouseId = warehouse.WarehouseId,
                     //PalletType = GetPalletType(warehouse, palletCode),//GetPalletType(warehouse, palletCode)
                     Creater = "WCS",
@@ -118,5 +125,123 @@
             }
         }
 
+
+        /// <summary>
+        /// 鍒涘缓鍏ュ簱浠诲姟
+        /// </summary>
+        /// <param name="inboundTask"></param>
+        /// <returns></returns>
+        /// <exception cref="NotImplementedException"></exception>
+        public ApiResponse<object> sendEnTask(InOutboundTaskReceived inboundTask)
+        {
+            WebResponseContent webResponseContent = new WebResponseContent();
+
+            try
+            {
+                List<Dt_Task> AddtaskList = new List<Dt_Task>();
+                List<Dt_LocationInfo> Adddt_Locations = new List<Dt_LocationInfo>();
+                List<Dt_StockInfo> Adddtstockt = new List<Dt_StockInfo>();
+
+                if (inboundTask.palletInfoList.Count > 0)
+                {
+                    List<Dt_Task> taskData = BaseDal.QueryData();
+
+                    Dt_StationManger dt_Station = _stationMangerService.QueryPlatform(inboundTask.NodeCode);
+                    if (dt_Station == null) return MESresponse($"鏈壘鍒扮珯鍙颁俊鎭�,绔欏彴缂栧彿锛歿inboundTask.NodeCode}", false);
+
+                    foreach (PalletInfo palletInfo in inboundTask.palletInfoList)
+                    {
+                        Dt_LocationInfo location = null;
+                        if (palletInfo.locationCode == null || palletInfo.locationCode == "")
+                        {
+                            Dt_Warehouse warehouse = _warehouseRepository.QueryFirst(x => x.WarehouseCode == dt_Station.StackerCraneCode);
+
+                            location = _basicService.LocationInfoService.AssignLocation(dt_Station.StackerCraneCode, warehouse.WarehouseId, "");//鑾峰彇鍒版柊搴撲綅
+                        }
+                        else
+                        {
+                            location = _locationInfoRepository.QueryFirst(x => x.LocationCode == palletInfo.locationCode);
+                        }
+                        if (location == null) return MESresponse($"鏈壘鍒拌揣浣嶄俊鎭�,鏉$爜锛歿palletInfo.palletCode}", false);
+                        if (location.LocationStatus != (int)LocationStatusEnum.Free) return MESresponse($"鎵樼洏鏉$爜锛歿palletInfo.palletCode}锛屾煡鎵惧埌鐨勮揣浣嶏細{location.LocationCode},涓嶄负绌鸿揣浣嶏紒", false);
+
+
+                        //鍒涘缓缁勭洏淇℃伅
+                        var dt_Stock = new Dt_StockInfo
+                        {
+                            PalletCode = palletInfo.palletCode,
+                            PalletType = 1,
+                            LocationCode = location.LocationCode,
+                            StockStatus = (int)StockStatusEmun.缁勭洏鏆傚瓨,
+                            Creater = "WMS",
+                            CreateDate = DateTime.Now,
+                            MESsubPalletCode = palletInfo.palletCode,
+                        };
+                        location.LocationStatus = (int)LocationStatusEnum.InStockLock;
+
+                        //鐢熸垚绉诲姩浠诲姟
+                        Dt_Task dt_Task = new()
+                        {
+                            PalletCode = palletInfo.palletCode,
+                            TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
+                            Roadway = location.RoadwayNo,
+                            TaskType = TaskInboundTypeEnum.Inbound.ObjToInt(),
+                            TaskStatus = TaskInStatusEnum.Line_InExecuting.ObjToInt(),
+                            SourceAddress = dt_Station.StationCode,
+                            TargetAddress = location.LocationCode,
+                            CurrentAddress = dt_Station.StationCode,
+                            NextAddress = location.LocationCode,
+                            Grade = 1,
+                            Creater = "MES",
+                            Depth = location.Depth,
+                            CreateDate = DateTime.Now,
+                            MEStaskId = inboundTask.TaskId,
+                            MESbusinessId = inboundTask.BusinessId,
+                            MESsubPalletCode = palletInfo.subPalletCode
+                        };
+                        Adddtstockt.Add(dt_Stock);
+                        Adddt_Locations.Add(location);
+                        AddtaskList.Add(dt_Task);
+                    }
+                    if (Adddtstockt.Count > 0 && Adddt_Locations.Count > 0 && AddtaskList.Count > 0)
+                    {
+                        _unitOfWorkManage.BeginTran();
+
+
+                        _stockRepository.AddData(Adddtstockt);
+                        _locationInfoRepository.UpdateData(Adddt_Locations);
+                        BaseDal.AddData(AddtaskList);
+
+                        var respon = PushTasksToWCS(AddtaskList, "");
+                        if (respon.Status)
+                        {
+                            _unitOfWorkManage.CommitTran();  //鎻愪氦浜嬪姟
+                            return MESresponse("", true);
+                        }
+                        else
+                        {
+                            _unitOfWorkManage.RollbackTran();  //鍥炴粴浜嬪姟
+                            return MESresponse($"涓嬪彂鍑哄簱澶辫触锛屽師鍥狅細{respon.Message}锛�", false);
+                        }
+
+                    }
+                    else
+                    {
+                        return MESresponse("浠诲姟鐢熸垚澶辫触锛�", false);
+                    }
+
+                }
+                else
+                {
+                    return MESresponse("鎺ユ敹鍒癕ES鎵樼洏缂栫爜鍒楄〃鏃犳暟鎹紒", false);
+                }
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();  //鍥炴粴浜嬪姟
+                return MESresponse($"涓嬪彂鍑哄簱澶辫触锛屽師鍥狅細{ex.Message}锛�", false);
+                throw;
+            }
+        }
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs"
new file mode 100644
index 0000000..10af9a3
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs"
@@ -0,0 +1,135 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.Enums;
+using WIDESEA_Core;
+using WIDESEA_Model.Models;
+using WIDESEA_Core.Helper;
+using Microsoft.Extensions.Logging;
+using MailKit.Search;
+using System.Reflection.Metadata;
+using static WIDESEA_ITaskInfoService.ITaskService;
+using WIDESEA_Common;
+using WIDESEA_Core.LogHelper;
+using WIDESEA_DTO.Task;
+using WIDESEA_Common.TaskEnum;
+using WIDESEA_Common.StockEnum;
+using WIDESEA_Common.LocationEnum;
+using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
+using WIDESEA_Common.OtherEnum;
+using WIDESEA_Core.Const;
+using WIDESEA_DTO.ToMes;
+using System.DirectoryServices.Protocols;
+using System.Net;
+
+namespace WIDESEA_TaskInfoService
+{
+    public partial class TaskService
+    {
+        
+        /// <summary>
+        /// 涓嬪彂鍑哄簱鎺ュ彛
+        /// </summary>
+        /// <param name="outbound"></param>
+        /// <returns></returns>
+        public ApiResponse<object> sendExTask(InOutboundTaskReceived outbound)
+        {
+
+            List<Dt_StockInfo> Adddtstockt = new List<Dt_StockInfo>();
+            List<Dt_LocationInfo> Addlocations = new List<Dt_LocationInfo>();
+            List<Dt_Task> Addtaskdt = new List<Dt_Task>();
+
+            if ( outbound != null )
+            {
+                if (outbound.PalletCodeList.Count > 0)
+                {
+                    List<Dt_StockInfo> StockData = _stockRepository.QueryData();
+                    List<Dt_LocationInfo> LocationData=_locationInfoRepository.QueryData(x=>x.LocationStatus== (int)LocationStatusEnum.InStock);
+                    List<Dt_Task> taskData = BaseDal.QueryData();
+
+                    foreach (string Pallet in outbound.PalletCodeList)
+                    {
+                        //鏌ユ壘搴撳瓨淇℃伅
+                        Dt_StockInfo dt_StockInfo = StockData.Find(x => x.PalletCode == Pallet);
+                        if(dt_StockInfo==null) return MESresponse($"鎺ユ敹鍒扮殑鎵樼洏鏉$爜锛歿Pallet},鏈湪绯荤粺涓壘鍒板簱瀛樹俊鎭紒", false);
+                        //鏌ユ壘搴撲綅淇℃伅
+                        Dt_LocationInfo locationInfo = LocationData.Find(x => x.LocationCode == dt_StockInfo.LocationCode);
+                        if (locationInfo == null) return MESresponse($"鎺ユ敹鍒扮殑鎵樼洏鏉$爜锛歿Pallet},鏈湪绯荤粺涓壘鍒板簱浣嶄俊鎭紒", false);
+
+                        //鍒ゆ柇褰撳墠璐т綅鏄惁鏈変换鍔�
+                        Dt_Task _Task = taskData.Find(x => x.SourceAddress == locationInfo.LocationCode || x.TargetAddress == locationInfo.LocationCode);
+                        if (_Task != null) return MESresponse($"鎺ユ敹鍒扮殑鎵樼洏鏉$爜锛歿Pallet},褰撳墠鎵樼洏瀵瑰簲鐨勫簱浣嶄俊鎭凡鏈変换鍔★紝涓嶅彲鍑哄簱锛�", false);
+
+                        dt_StockInfo.StockStatus = (int)StockStatusEmun.鍑哄簱閿佸畾;
+                        locationInfo.LocationStatus = (int)LocationStatusEnum.InStockLock;
+
+                        //鐢熸垚绉诲姩浠诲姟
+                        Dt_Task dt_Task = new()
+                        {
+                            PalletCode = dt_StockInfo.PalletCode,
+                            TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
+                            Roadway = locationInfo.RoadwayNo,
+                            TaskType = TaskOutboundTypeEnum.Outbound.ObjToInt(),
+                            TaskStatus = TaskOutStatusEnum.OutNew.ObjToInt(),
+                            SourceAddress = locationInfo.LocationCode,
+                            TargetAddress = outbound.NodeCode,
+                            CurrentAddress = locationInfo.LocationCode,
+                            NextAddress = outbound.NodeCode,
+                            Grade = 1,
+                            Creater = "MES",
+                            Depth = locationInfo.Depth,
+                            CreateDate = DateTime.Now,
+                            MEStaskId= outbound.TaskId,
+                            MESbusinessId= outbound.BusinessId,
+                            MESsubPalletCode= dt_StockInfo.MESsubPalletCode
+                        };
+                        Adddtstockt.Add(dt_StockInfo);
+                        Addlocations.Add(locationInfo);
+                        Addtaskdt.Add(dt_Task);
+                    }
+                    if (Adddtstockt.Count > 0 && Addlocations.Count > 0 && Addtaskdt.Count > 0)
+                    {
+                        _unitOfWorkManage.BeginTran();
+
+
+                        _stockRepository.AddData(Adddtstockt);
+                        _locationInfoRepository.AddData(Addlocations);
+                        BaseDal.AddData(Addtaskdt);
+
+                        var respon = PushTasksToWCS(Addtaskdt,"");
+                        if (respon.Status)
+                        {
+                            _unitOfWorkManage.CommitTran();  //鎻愪氦浜嬪姟
+                            return MESresponse("", true);
+                        }
+                        else
+                        {
+                            _unitOfWorkManage.RollbackTran();  //鍥炴粴浜嬪姟
+                            return MESresponse($"涓嬪彂鍑哄簱澶辫触锛屽師鍥狅細{respon.Message}锛�", false);
+                        }
+
+                    }
+                    else
+                    {
+                        return MESresponse("浠诲姟鐢熸垚澶辫触锛�", false);
+                    }
+
+                }
+                else
+                {
+                    return MESresponse("鎺ユ敹鍒癕ES鎵樼洏缂栫爜鍒楄〃鏃犳暟鎹紒", false);
+                }
+            }
+            else
+            {
+                return MESresponse("鎺ユ敹鍒癕ES涓嬪彂鐨勪换鍔′负绌猴紒", false);
+            }
+        }
+
+        
+    }
+}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
index 9d91261..fecb1ee 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
@@ -21,15 +21,22 @@
 using Microsoft.AspNetCore.Mvc;
 using Newtonsoft.Json;
 using SqlSugar;
+using System.DirectoryServices.Protocols;
+using System.Net;
+using System.Reflection.Emit;
+using System.Threading.Tasks;
 using WIDESEA_Common.LocationEnum;
+using WIDESEA_Common.OtherEnum;
 using WIDESEA_Common.StockEnum;
 using WIDESEA_Common.TaskEnum;
 using WIDESEA_Core;
 using WIDESEA_Core.BaseRepository;
 using WIDESEA_Core.BaseServices;
+using WIDESEA_Core.Const;
 using WIDESEA_Core.Enums;
 using WIDESEA_Core.Helper;
 using WIDESEA_DTO.Task;
+using WIDESEA_DTO.ToMes;
 using WIDESEA_IBasicService;
 using WIDESEA_IInboundService;
 using WIDESEA_IOutboundService;
@@ -49,6 +56,9 @@
         private readonly IRepository<Dt_LocationInfo> _locationInfoRepository;
         private readonly IRepository<Dt_RoadwayInfo> _roadwayInforepository;
         private readonly IBasicService _basicService;
+        private readonly IDt_ApiInfoService _dt_ApiInfoService;
+        private readonly ILocationStatusChangeRecordService _locationStatusChangeRecordService;
+        private readonly IStationMangerService _stationMangerService;
 
         public IRepository<Dt_Task> Repository => BaseDal;
 
@@ -58,11 +68,7 @@
                 {nameof(Dt_Task.CreateDate),OrderByType.Asc},
             };
 
-        public List<int> TaskTypes => typeof(TaskTypeEnum).GetEnumIndexList();
-
-        public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList();
-
-        public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, IBasicService basicService, IRepository<Dt_Warehouse> warehouseRepository, IRepository<Dt_LocationInfo> locationInfoRepository, IRepository<Dt_RoadwayInfo> roadwayInforepository) : base(BaseDal)
+        public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, IBasicService basicService, IRepository<Dt_Warehouse> warehouseRepository, IRepository<Dt_LocationInfo> locationInfoRepository, IRepository<Dt_RoadwayInfo> roadwayInforepository, IDt_ApiInfoService dt_ApiInfoService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IStationMangerService stationMangerService) : base(BaseDal)
         {
             _mapper = mapper;
             _unitOfWorkManage = unitOfWorkManage;
@@ -71,7 +77,15 @@
             _warehouseRepository = warehouseRepository;
             _locationInfoRepository = locationInfoRepository;
             _roadwayInforepository = roadwayInforepository;
+            _dt_ApiInfoService = dt_ApiInfoService;
+            _locationStatusChangeRecordService = locationStatusChangeRecordService;
+            _stationMangerService=stationMangerService;
         }
+        public int GetTaskNum(string sequenceName)
+        {
+            return Db.Ado.GetScalar($"SELECT NEXT VALUE FOR {sequenceName}").ObjToInt();
+        }
+
         /// <summary>
         /// 浠诲姟淇℃伅鎺ㄩ�佽嚦WCS
         /// </summary>
@@ -85,34 +99,204 @@
                 {
                     x.AGVArea = agvDescription;
                 });
-                string url = AppSettings.Get("WCSApiAddress");
-                if (string.IsNullOrEmpty(url))
-                {
-                    return WebResponseContent.Instance.Error($"鏈壘鍒癢CSApi鍦板潃,璇锋鏌ラ厤缃枃浠�");
-                }
-                string response = HttpHelper.Post($"{url}/api/Task/ReceiveTask", taskDTOs.Serialize());
 
-                return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("杩斿洖閿欒");
+                var ConfigsAPIInfo = _dt_ApiInfoService.GetConfigsByAPIInfo(CateGoryConst.CONFIG_WCS_IPAddress, SysConfigConst.WCSReceiveTask);      //鑾峰彇鍒皐cs鍏ㄩ儴绫诲瀷鐨勬帴鍙�
+                string WCSReceiveTaskAPI = ConfigsAPIInfo.ApiAddress + ConfigsAPIInfo.ApiName;
+
+                var respon = HttpHelper.Post(WCSReceiveTaskAPI, JsonConvert.SerializeObject(taskDTOs));
+                if (respon != null)
+                {
+                    WebResponseContent respone = JsonConvert.DeserializeObject<WebResponseContent>(respon.ToString());
+                    if (respone.Status)
+                    {
+                        return WebResponseContent.Instance.OK();
+                    }
+                    else
+                    {
+                        return WebResponseContent.Instance.Error($"涓嬪彂鍑哄簱澶辫触锛屽師鍥狅細{respone.Message}锛�");
+                    }
+                }
+                else
+                {
+                    return WebResponseContent.Instance.Error("浠诲姟涓嬪彂澶辫触锛�");
+                }
             }
             catch (Exception ex)
             {
                 return WebResponseContent.Instance.Error(ex.Message);
             }
         }
+        
+
+
+        /// <summary>
+        /// 鍒ゆ柇宸烽亾鍐呯Щ搴�
+        /// </summary>
+        /// <param name="TaskNum"></param>
+        /// <param name="SourceAddress"></param>
+        /// <returns></returns>
+        public WebResponseContent IsRelocations(int TaskNum)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                List<Dt_LocationInfo> loca = new List<Dt_LocationInfo>();
+
+                Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == TaskNum);
+                if (task == null) return content.Error($"鏈壘鍒拌浠诲姟淇℃伅锛屼换鍔″彿锛歿TaskNum}");
+                string Locatask = task.SourceAddress;
+
+                //鑾峰彇鍒版繁搴撲綅缂栧彿
+                Dt_LocationInfo DeepLocation = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == Locatask);
+                if(DeepLocation == null) return content.Error($"鏈壘鍒拌璐т綅淇℃伅,璐т綅缂栧彿:{Locatask}");
+
+                //杩涜鑾峰彇娴呭簱浣嶇紪鍙�
+                int locrow = DeepLocation.Row == 1 ? 2 : 3;
+                Dt_LocationInfo ShallowLocation = _basicService.LocationInfoService.Repository.QueryFirst(x =>x.Row== locrow && x.Layer== DeepLocation.Layer && x.Column== DeepLocation.Column && x.RoadwayNo== DeepLocation.RoadwayNo);
+                if (ShallowLocation == null) return content.Error($"鏈壘鍒拌揣浣嶇紪鍙�:{Locatask}鐨勬祬璐т綅");
+
+                if (ShallowLocation.LocationStatus == (int)LocationStatusEnum.Free)
+                {
+                    return content.OK(data: task);  //鐩存帴杩斿洖褰撳墠鏌ヨ鐨勪换鍔�
+                }
+
+
+                //濡傛灉鏈夎揣锛屽垯鐢熸垚绉诲簱浠诲姟
+                if (ShallowLocation.LocationStatus == (int)LocationStatusEnum.InStock)
+                {
+                    Dt_StockInfo dt_Stock = _stockRepository.QueryFirst(x => x.LocationCode == ShallowLocation.LocationCode);
+                    if (dt_Stock == null) return content.Error($"璐т綅缂栧彿:{Locatask}鐨勬祬璐т綅搴撳瓨寮傚父锛岃妫�鏌ワ紒锛侊紒");
+
+                    Dt_Task _Task = BaseDal.QueryFirst(x => x.SourceAddress == ShallowLocation.LocationCode || x.TargetAddress == ShallowLocation.LocationCode);
+                    if (_Task != null) return content.Error($"璐т綅缂栧彿:{Locatask}鐨勬祬璐т綅搴撳凡鏈変换鍔★紝涓嶅彲杩涜绉诲簱");
+
+                    //杩涜鑾峰彇鏂扮殑搴撲綅
+                    Dt_LocationInfo? Nextlocation = _basicService.LocationInfoService.AssignLocation(DeepLocation.RoadwayNo, 0, "");//鑾峰彇鍒版柊搴撲綅
+                    if (Nextlocation == null)
+                    {
+                        return content.Error($"璐т綅鍒嗛厤澶辫触,鏈壘鍒板彲鍒嗛厤璐т綅");
+                    }
+                    ShallowLocation.LocationStatus = (int)LocationStatusEnum.Lock;
+                    Nextlocation.LocationStatus = (int)LocationStatusEnum.Lock;
+                    loca.Add(ShallowLocation);
+                    loca.Add(Nextlocation);
+
+                    _unitOfWorkManage.BeginTran();
+                    //鐢熸垚绉诲姩浠诲姟
+                    Dt_Task dt_Task = new()
+                    {
+                        PalletCode = dt_Stock.PalletCode,
+                        TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)),
+                        Roadway = Nextlocation.RoadwayNo,
+                        TaskType = TaskRelocationTypeEnum.Relocation.ObjToInt(),
+                        TaskStatus = TaskRelocationStatusEnum.RelocationNew.ObjToInt(),
+                        SourceAddress = ShallowLocation.LocationCode,
+                        TargetAddress = Nextlocation.LocationCode,
+                        CurrentAddress = ShallowLocation.LocationCode,
+                        NextAddress = Nextlocation.LocationCode,
+                        Grade = 1,
+                        Creater = "WMS",
+                        Depth = ShallowLocation.Depth,
+                        CreateDate = DateTime.Now,
+                    };
+
+                    _locationInfoRepository.AddData(loca);
+                    BaseDal.AddData(dt_Task);   //鏂板浠诲姟
+                    _unitOfWorkManage.CommitTran();
+
+                    return content.OK(data: dt_Task);
+                }
+                else
+                {
+                    return content.Error($"璐т綅缂栧彿:{Locatask}鐨勬祬璐т綅鐘舵�佸紓甯革紝娴呰揣浣嶇紪鍙凤細{ShallowLocation.LocationCode}");
+                }
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                throw;
+            }
+        }
+
+        /// <summary>
+        /// 浠诲姟瀹屾垚
+        /// </summary>
+        /// <param name="taskNum">浠诲姟缂栧彿</param>
+        /// <param name="HowWorks">妯″紡锛�1锛氳嚜鍔紝2锛氭墜鍔級</param>
+        /// <returns></returns>
+        public WebResponseContent TaskCompleted(int taskNum)
+        {
+            WebResponseContent content = new WebResponseContent();
+
+            Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
+            if (task == null) return WebResponseContent.Instance.Error("鏈壘鍒颁换鍔′俊鎭�");
+            switch (task.TaskType)
+            {
+                case (int)TaskRelocationTypeEnum.Relocation:
+                    return RelocationInTaskCompleted(task);
+                case (int)TaskInboundTypeEnum.Inbound:
+                    return InboundTaskCompleted(task);
+                case (int)TaskOutboundTypeEnum.Outbound:
+                    return OutboundTaskCompleted(task);
+                default: return content.Error($"浠诲姟绫诲瀷閿欒锛屼换鍔″彿锛歿task.TaskNum}");
+            }
+        }
+
+        /// <summary>
+        /// 绉诲簱瀹屾垚鏂规硶
+        /// </summary>
+        /// <param name="task"></param>
+        /// <returns></returns>
+        public WebResponseContent RelocationInTaskCompleted(Dt_Task task)
+        {
+            WebResponseContent webResponse = new WebResponseContent();
+            try
+            {
+                Dt_StockInfo stockInfo = _stockRepository.QueryFirst(x => x.PalletCode == task.PalletCode);
+                Dt_LocationInfo locationpoint = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress);
+                Dt_LocationInfo locationEnd = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
+                List<Dt_LocationInfo> loca = new List<Dt_LocationInfo>();
+                stockInfo.LocationCode = locationEnd.LocationCode;
+                stockInfo.StockStatus = StockStatusEmun.宸插叆搴�.ObjToInt();
+                locationpoint.LocationStatus = LocationStatusEnum.Free.ObjToInt();
+                locationEnd.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
+                loca.Add(locationpoint);
+                loca.Add(locationEnd);
+
+                _unitOfWorkManage.BeginTran();
+                _stockRepository.UpdateData(stockInfo);
+                _basicService.LocationInfoService.Repository.UpdateData(loca);
+                BaseDal.DeleteData(task);
+                BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
+
+                WebResponseContent content=MES_TransferCompletionFeedback(task);
+                if (!content.Status)
+                {
+                    _unitOfWorkManage.RollbackTran();
+                    return content;
+                }
+                    
+                _unitOfWorkManage.CommitTran();
+                return webResponse.OK();
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                return webResponse.Error($"绉诲簱浠诲姟瀹屾垚澶辫触锛屼换鍔d锛歿task.TaskNum}");
+                throw;
+            }
+            
+        }
+
         /// <summary>
         /// 鍏ュ簱浠诲姟瀹屾垚
         /// </summary>
         /// <param name="tasknum"></param>
         /// <returns></returns>
-        public WebResponseContent InboundTaskCompleted(int taskNum)
+        public WebResponseContent InboundTaskCompleted(Dt_Task task)
         {
             try
             {
-                Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
-                if (task == null)
-                {
-                    return WebResponseContent.Instance.Error($"鏈壘鍒拌浠诲姟淇℃伅");
-                }
                 Dt_Warehouse warehouse = _warehouseRepository.QueryFirst(x => x.WarehouseId == task.WarehouseId);
                 Dt_StockInfo stockInfo = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == task.PalletCode && x.WarehouseId == task.WarehouseId).First();
                 if (stockInfo == null)
@@ -130,6 +314,7 @@
                 }
                 dt_LocationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
                 stockInfo.StockStatus = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt();
+
                 _unitOfWorkManage.BeginTran();
                 //淇敼璐т綅鐘舵�佷负鏈夎揣
                 _locationInfoRepository.UpdateData(dt_LocationInfo);
@@ -137,6 +322,14 @@
                 _stockRepository.UpdateData(stockInfo);
                 //鍒犻櫎浠诲姟娣诲姞鍘嗗彶
                 BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.浜哄伐瀹屾垚 : OperateTypeEnum.鑷姩瀹屾垚);
+
+                WebResponseContent content = TaskCompletionFeedback(task);
+                if (!content.Status)
+                {
+                    _unitOfWorkManage.RollbackTran();
+                    return content;
+                }
+
                 _unitOfWorkManage.CommitTran();
             }
             catch (Exception)
@@ -146,5 +339,269 @@
             }
             return WebResponseContent.Instance.OK();
         }
+
+        /// <summary>
+        /// 鍑哄簱浠诲姟瀹屾垚
+        /// </summary>
+        /// <param name="task"></param>
+        /// <returns></returns>
+        public WebResponseContent OutboundTaskCompleted(Dt_Task task)
+        {
+            WebResponseContent webResponse = new WebResponseContent();
+            try
+            {
+                Dt_StockInfo stockInfo = _stockRepository.QueryFirst(x => x.PalletCode == task.PalletCode);
+                if (stockInfo == null) return webResponse.Error($"浠诲姟缂栧彿锛歿task.TaskNum},鏈壘鍒版墭鐩橈細{stockInfo.PalletCode}鐨勫簱瀛樹俊鎭�");
+                Dt_LocationInfo locationInfo = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.SourceAddress);
+                if (locationInfo == null) return webResponse.Error($"浠诲姟缂栧彿锛歿task.TaskNum},鏈壘鍒版墭鐩橈細{stockInfo.PalletCode}鐨勮揣浣嶄俊鎭�");
+
+
+                stockInfo.StockStatus = StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt();
+                
+                int beforeStatus = locationInfo.LocationStatus;
+                locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
+                task.TaskStatus = TaskOutStatusEnum.OutFinish.ObjToInt();
+
+                _unitOfWorkManage.BeginTran();
+                _stockRepository.DeleteData(stockInfo);
+                _locationInfoRepository.UpdateData(locationInfo);   //淇敼鎴愮┖璐т綅
+                BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
+                _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum);
+                WebResponseContent content = TaskCompletionFeedback(task);
+                if (!content.Status)
+                {
+                    _unitOfWorkManage.RollbackTran();
+                    return content;
+                }
+
+                _unitOfWorkManage.CommitTran();
+                return webResponse.OK();
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                return webResponse.Error($"绉诲簱浠诲姟瀹屾垚澶辫触锛屼换鍔d锛歿task.TaskNum},閿欒鍘熷洜锛歿ex.Message}");
+                throw;
+            }
+            
+        }
+
+
+
+
+
+
+
+        //==============================================绉诲簱瀹屾垚鍙嶉鎺ュ彛====================================================
+        /// <summary>
+        /// 涓婁紶绉诲簱浠诲姟瀹屾垚缁橫ES
+        /// </summary>
+        /// <param name="dt_Task"></param>
+        /// <returns></returns>
+        public WebResponseContent MES_TransferCompletionFeedback(Dt_Task dt_Task)
+        {
+            WebResponseContent webResponse = new WebResponseContent();
+
+            try
+            {
+                TransferRequest transferRequest = new TransferRequest()
+                {
+                    //涓氬姟id锛屼换鍔d鍚庣画杩涜鏇存敼
+                    businessId = "1",
+                    TaskId = "1",
+                    SourceLocationCode = dt_Task.SourceAddress,
+                    LocationCode = dt_Task.TargetAddress,
+                    PalletCode = dt_Task.PalletCode,
+                    Status = "FINISH",
+                    ErrorStatus = "NORMAL",
+                    ErrorInfo = "",
+                };
+
+                //鑾峰彇鎺ュ彛杩涜璋冨彇
+                var ConfigsAPIInfo = _dt_ApiInfoService.GetConfigsByAPIInfo(CateGoryConst.CONFIG_MES_IPAddress, SysConfigConst.MESTransferCompletionFeedback);      //鑾峰彇鍒皐cs鍏ㄩ儴绫诲瀷鐨勬帴鍙�
+                string WCSReceiveTaskAPI = ConfigsAPIInfo.ApiAddress + ConfigsAPIInfo.ApiName;
+                if (WCSReceiveTaskAPI == null)
+                {
+                    return webResponse.Error($"鍑哄簱澶辫触锛屾湭閰嶇疆MES绉诲簱瀹屾垚鍙嶉鎺ュ彛");
+                }
+                var respon = HttpHelper.Post(WCSReceiveTaskAPI, JsonConvert.SerializeObject(transferRequest));
+                if (respon != null)
+                {
+                    var response = JsonConvert.DeserializeObject<ApiResponse<object>>(respon);
+                    if (response.Success)
+                    {
+                        return webResponse.OK();
+                    }
+                    else
+                    {
+                        return webResponse.Error($"璋冨彇鎺ュ彛澶辫触锛屽弽棣堝弬鏁板師鍥狅細{response.Message}");
+                    }
+                }
+                else
+                {
+                    return webResponse.Error($"璋冨彇鎺ュ彛澶辫触锛屽弽棣堝弬鏁颁负绌�");
+                }
+            }
+            catch (Exception ex)
+            {
+                return webResponse.Error($"绉诲簱浠诲姟涓婁紶澶辫触锛佸師鍥狅細{ex.Message}");
+                throw;
+            }
+        }
+
+
+        /// <summary>
+        /// 涓婁紶鍑哄叆搴撲换鍔″畬鎴愮粰MES
+        /// </summary>
+        /// <param name="dt_Task"></param>
+        /// <returns></returns>
+        public WebResponseContent TaskCompletionFeedback(Dt_Task dt_Task)
+        {
+            WebResponseContent webResponse = new WebResponseContent();
+
+            try
+            {
+                TaskNotification transferRequest = new TaskNotification()
+                {
+                    //涓氬姟id锛屼换鍔d鍚庣画杩涜鏇存敼
+                    TaskId = "1",   //浠诲姟id
+                    BusinessId = "1",   //涓氬姟id
+                    PalletCode = dt_Task.PalletCode,
+                    SubPalletCode = "",//瀛愭墭鐩樼紪鐮�
+                    LocationCode = dt_Task.SourceAddress,
+                    ErrorStatus = "NORMAL",
+                    ErrorInfo = "",
+                };
+
+                //鑾峰彇鎺ュ彛杩涜璋冨彇
+                var ConfigsAPIInfo = _dt_ApiInfoService.GetConfigsByAPIInfo(CateGoryConst.CONFIG_MES_IPAddress, SysConfigConst.MESTaskFeedback);      //鑾峰彇鍒皐cs鍏ㄩ儴绫诲瀷鐨勬帴鍙�
+                string WCSReceiveTaskAPI = ConfigsAPIInfo.ApiAddress + ConfigsAPIInfo.ApiName;
+                if (WCSReceiveTaskAPI == null)
+                {
+                    return webResponse.Error($"浠诲姟鍙嶉MES澶辫触锛屾湭閰嶇疆MES浠诲姟瀹屾垚鍙嶉鎺ュ彛");
+                }
+                var respon = HttpHelper.Post(WCSReceiveTaskAPI, JsonConvert.SerializeObject(transferRequest));
+                if (respon != null)
+                {
+                    var response = JsonConvert.DeserializeObject<ApiResponse<object>>(respon);
+                    if (response.Success)
+                    {
+                        return webResponse.OK();
+                    }
+                    else
+                    {
+                        return webResponse.Error($"璋冨彇鎺ュ彛澶辫触锛屽弽棣堝弬鏁板師鍥狅細{response.Message}");
+                    }
+                }
+                else
+                {
+                    return webResponse.Error($"璋冨彇鎺ュ彛澶辫触锛屽弽棣堝弬鏁颁负绌�");
+                }
+            }
+            catch (Exception ex)
+            {
+                return webResponse.Error($"浠诲姟浠诲姟涓婁紶澶辫触锛佸師鍥狅細{ex.Message}");
+                throw;
+            }
+        }
+
+        public ApiResponse<object> MESresponse(string Message, bool Success)
+        {
+            ApiResponse<object> apiResponse = new ApiResponse<object>();
+            apiResponse.Message = Message;
+            apiResponse.Success = Success;
+            apiResponse.Code = 1;
+            return apiResponse;
+        }
+
+
+
+
+        /// <summary>
+        /// 鍒涘缓璐т綅
+        /// </summary>
+        /// <param name="locationInfo"></param>
+        /// <returns></returns>
+        /// <exception cref="NotImplementedException"></exception>
+        public ApiResponse<object> createLocation(List<LocationInfoDto> locationInfo)
+        {
+            List<Dt_LocationInfo> dt_LocationInfoList = new List<Dt_LocationInfo>();
+            foreach (var item in locationInfo)
+            {
+                Dt_LocationInfo dt_LocationInfo = new Dt_LocationInfo()
+                {
+                    LocationCode = item.locationCode,
+                    LocationName = item.locationName,
+                    RoadwayNo = item.roadwayNo,
+                    Row = item.row,
+                    Column = item.column,
+                    Layer = item.layer,
+                    Depth = (int)item.depth,
+                    LocationType = item.locationType,
+                    LocationStatus = item.locationStatus,
+                    EnableStatus = item.enableStatus == true ? 1 : 0,
+                    Remark = item.remark,
+                    CreateDate = DateTime.Now,
+                    Creater = App.User.UserName,
+                };
+                dt_LocationInfoList.Add(dt_LocationInfo);
+            }
+            int res = _locationInfoRepository.AddData(dt_LocationInfoList);
+            if (res <= 0)
+            {
+                return MESresponse($"鍒涘缓璐т綅澶辫触",false);
+            }
+            return MESresponse($"", true);
+        }
+
+        /// <summary>
+        /// 淇敼璐т綅
+        /// </summary>
+        /// <param name="locationInfo"></param>
+        /// <returns></returns>
+        /// <exception cref="NotImplementedException"></exception>
+        public ApiResponse<object> updateLocation(LocationInfoDto locationInfo)
+        {
+            Dt_LocationInfo dt_LocationInfo = new Dt_LocationInfo()
+            {
+                LocationCode = locationInfo.locationCode,
+                LocationName = locationInfo.locationName,
+                RoadwayNo = locationInfo.roadwayNo,
+                Row = locationInfo.row,
+                Column = locationInfo.column,
+                Layer = locationInfo.layer,
+                Depth = (int)locationInfo.depth,
+                LocationType = locationInfo.locationType,
+                LocationStatus = locationInfo.locationStatus,
+                EnableStatus = locationInfo.enableStatus == true ? 1 : 0,
+                Remark = locationInfo.remark,
+                CreateDate = DateTime.Now,
+            };
+            bool res = _locationInfoRepository.Db.Updateable(dt_LocationInfo)
+    .Where(x => x.LocationCode == dt_LocationInfo.LocationCode)
+    .ExecuteCommand() > 0;
+            if (!res)
+            {
+                return MESresponse($"淇敼璐т綅澶辫触",false);
+            }
+            return MESresponse($"", true);
+        }
+
+        /// <summary>
+        /// 鍒犻櫎璐т綅
+        /// </summary>
+        /// <param name="locationCode"></param>
+        /// <returns></returns>
+        /// <exception cref="NotImplementedException"></exception>
+        public ApiResponse<object> deleteLocation(List<string> locationCode)
+        {
+            WebResponseContent webResponseContent = new WebResponseContent();
+            int res = _locationInfoRepository.Db.Deleteable<Dt_LocationInfo>().Where(x => locationCode.Contains(x.LocationCode)).ExecuteCommand();
+            if (res <= 0)
+            {
+                return MESresponse($"鍒犻櫎璐т綅澶辫触",false);
+            }
+            return MESresponse($"", true);
+        }
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
index 4cead0c..fa1cc4c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
@@ -6,6 +6,7 @@
 using WIDESEA_Core.BaseController;
 using WIDESEA_DTO.Stock;
 using WIDESEA_DTO.Task;
+using WIDESEA_DTO.ToMes;
 using WIDESEA_ITaskInfoService;
 using WIDESEA_Model.Models;
 
@@ -21,6 +22,33 @@
         public TaskController(ITaskService service) : base(service)
         {
         }
+
+
+        /// <summary>
+        /// 浠诲姟瀹屾垚鎺ュ彛
+        /// </summary>
+        /// <param name="taskNum"></param>
+        /// <returns></returns>
+        [HttpGet, Route("TaskCompleted"), AllowAnonymous]
+        public WebResponseContent TaskCompleted(int taskNum)
+        {
+            return Service.TaskCompleted(taskNum);
+        }
+
+
+        /// <summary>
+        /// 绉诲簱鐢宠鍒ゆ柇鎺ュ彛
+        /// </summary>
+        /// <param name="taskNum"></param>
+        /// <returns></returns>
+        [HttpGet, Route("IsRelocations"), AllowAnonymous]
+        public WebResponseContent IsRelocations(int taskNum)
+        {
+            return Service.IsRelocations(taskNum);
+        }
+
+
+
         /// <summary>
         /// WCS鐢宠鍏ュ簱浠诲姟(涓嶅垎閰嶈揣浣�)
         /// </summary>
@@ -34,14 +62,53 @@
         }
 
         /// <summary>
-        /// 鍏ュ簱浠诲姟瀹屾垚
+        /// MES涓嬪彂鍑哄簱浠诲姟
         /// </summary>
         /// <param name="taskNum"></param>
         /// <returns></returns>
-        [HttpPost, HttpGet, Route("InboundTaskCompleted"), AllowAnonymous]
-        public WebResponseContent InboundTaskCompleted(int taskNum)
+        [HttpPost, HttpGet, Route("sendExTask"), AllowAnonymous]
+        public ApiResponse<object> sendExTask([FromBody] InOutboundTaskReceived outbound)
         {
-            return Service.InboundTaskCompleted(taskNum);
+            return Service.sendExTask(outbound);
+        }
+
+        /// <summary>
+        /// MES涓嬪彂鍏ュ簱浠诲姟
+        /// </summary>
+        /// <param name="taskNum"></param>
+        /// <returns></returns>
+        [HttpPost, HttpGet, Route("sendEnTask"), AllowAnonymous]
+        public ApiResponse<object> sendEnTask([FromBody] InOutboundTaskReceived outbound)
+        {
+            return Service.sendEnTask(outbound);
+        }
+
+
+        /// <summary>
+        /// 鏂板缓璐т綅
+        /// </summary>
+        [HttpPost, HttpGet, Route("createLocation"), AllowAnonymous]
+        public ApiResponse<object> createLocation([FromBody] List<LocationInfoDto> locationInfo)
+        {
+            return Service.createLocation(locationInfo);
+        }
+
+        /// <summary>
+        /// 淇敼璐т綅
+        /// </summary>
+        [HttpPost, HttpGet, Route("updateLocation"), AllowAnonymous]
+        public ApiResponse<object> updateLocation([FromBody] LocationInfoDto locationInfo)
+        {
+            return Service.updateLocation(locationInfo);
+        }
+
+        /// <summary>
+        /// 鍒犻櫎璐т綅
+        /// </summary>
+        [HttpPost, HttpGet, Route("deleteLocation"), AllowAnonymous]
+        public ApiResponse<object> deleteLocation([FromBody] List<string> locationCode)
+        {
+            return Service.deleteLocation(locationCode);
         }
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs"
index 1b0c26a..e65beab 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs"
@@ -45,7 +45,7 @@
 builder.Services.AddWebSocketSetup();
 builder.Services.AddSqlsugarSetup();//SqlSugar 启动服务
 builder.Services.AddDbSetup();//Db 启动服务
-builder.Services.AddInitializationHostServiceSetup();//应用初始化服务注入
+//builder.Services.AddInitializationHostServiceSetup();//应用初始化服务注入
 //builder.Services.AddHostedService<PermissionDataHostService>();//数据权限
 builder.Services.AddAutoMapperSetup();
 
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json"
index 392057b..ada4d93 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json"
@@ -12,7 +12,7 @@
     "MainDB": "DB_WIDESEA", //褰撳墠椤圭洰鐨勪富搴擄紝鎵�瀵瑰簲鐨勮繛鎺ュ瓧绗︿覆鐨凟nabled蹇呴』涓簍rue
     //杩炴帴瀛楃涓�
     //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=",
-    "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_SYLK;User ID=sa;Password=sa123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
+    "ConnectionString": "Data Source=.;Initial Catalog=SY_WIDESEAWMS_SYLK;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
     //"ConnectionString": "Data Source=10.30.4.92;Initial Catalog=WMS_TC;User ID=sa;Password=duo123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
     //鏃MS鏁版嵁搴撹繛鎺�
     //"TeConnectionString": "Data Source=10.30.4.92;Initial Catalog=TeChuang;User ID=sa;Password=duo123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
diff --git "a/\351\241\271\347\233\256\350\265\204\346\226\231/\346\216\245\345\217\243\346\270\205\345\215\225/\346\211\230\347\233\230\345\272\223\346\216\245\345\217\243\346\270\205\345\215\225V1.6.xlsx" "b/\351\241\271\347\233\256\350\265\204\346\226\231/\346\216\245\345\217\243\346\270\205\345\215\225/\346\211\230\347\233\230\345\272\223\346\216\245\345\217\243\346\270\205\345\215\225V1.6.xlsx"
new file mode 100644
index 0000000..ce16be1
--- /dev/null
+++ "b/\351\241\271\347\233\256\350\265\204\346\226\231/\346\216\245\345\217\243\346\270\205\345\215\225/\346\211\230\347\233\230\345\272\223\346\216\245\345\217\243\346\270\205\345\215\225V1.6.xlsx"
Binary files differ

--
Gitblit v1.9.3