From f947d43adfe6a204b6afe920ce88a30d78015f1d Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期五, 28 二月 2025 10:44:44 +0800
Subject: [PATCH] 板料优化,成品流程,测试架...

---
 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/5ba3c6c3-45c6-476a-ba4d-7e36c7c7a528.vsidx |    0 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPProInboundModel.cs                                      |  127 ++++
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPMaterialSaleReturnModel.cs                              |   26 
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs                                       |    4 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPProOutOrderModel.cs                                     |   85 +++
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpProductWarehousingOrderDTO.cs                                  |  107 +++
 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/959c0d1d-18db-48d3-9271-1d227e7b7a7a.vsidx |    0 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpProductSpecifyVerDTO.cs                                        |   71 ++
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs                                         |    7 
 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/cf4c8fbf-fed0-45af-ba6f-76a403b97252.vsidx |    0 
 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/f0ca51ef-0959-4f1b-a1f1-0807e03664dc.vsidx |    0 
 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/336a7528-2578-4f8c-8fc8-17a205348f74.vsidx |    0 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs                                    |    8 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs                                   |    8 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPMaintainIssueModel.cs                                   |   92 +++
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpProOutOrderDTO.cs                                              |  107 +++
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs             |   38 +
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/PalletCodeInfoService.cs                                     |    4 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationStatusEnum.cs                                 |    2 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs                                          |    2 
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs                                         |   16 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesResponseContent.cs                                             |   12 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs                           |   31 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPStockCheckModel.cs                                      |  128 ++++
 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e78f7dca-bb67-4a49-94e2-a0a1a362cc32.vsidx |    0 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs                        |   13 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPScrapSheetModel.cs                                      |  101 +++
 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/read.lock                                  |    0 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/StockEnum/StockStatusEmun.cs                                       |    3 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPProductCheckModel.cs                                    |  187 ++++++
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs                                           |    6 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs                                            |   12 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs                          |    4 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpProductScrappedOrderDTO.cs                                     |   90 +++
 /dev/null                                                                                                    |    0 
 代码管理/WMS/WIDESEA_WMSClient/src/views/outbound/mesOutboundOrder.vue                                           |   12 
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs                                      |   12 
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/ConveyorLineJob_BC.cs                                        |   92 +++
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/StackerCraneJob_BC.cs                                        |   25 
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs                                        |    6 
 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock                                  |    0 
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/测试架仓/StackerCraneJob_CSJ.cs                                      |   62 ++
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpProductTransferOrderDTO.cs                                     |   96 +++
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesOutboundOrderService.cs                                |    1 
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/RGVJob_BC.cs                                                 |    5 
 45 files changed, 1,543 insertions(+), 59 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/336a7528-2578-4f8c-8fc8-17a205348f74.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/336a7528-2578-4f8c-8fc8-17a205348f74.vsidx"
new file mode 100644
index 0000000..353c3df
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/336a7528-2578-4f8c-8fc8-17a205348f74.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/5ba3c6c3-45c6-476a-ba4d-7e36c7c7a528.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/5ba3c6c3-45c6-476a-ba4d-7e36c7c7a528.vsidx"
new file mode 100644
index 0000000..9fc7b75
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/5ba3c6c3-45c6-476a-ba4d-7e36c7c7a528.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/9db99863-dd5d-4ea4-9436-cf86369c513c.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/9db99863-dd5d-4ea4-9436-cf86369c513c.vsidx"
deleted file mode 100644
index fbb4364..0000000
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/9db99863-dd5d-4ea4-9436-cf86369c513c.vsidx"
+++ /dev/null
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/read.lock" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/read.lock"
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/read.lock"
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs"
index 43f74db..f414325 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskStatusEnum.cs"
@@ -19,6 +19,12 @@
         New = 100,
 
         /// <summary>
+        /// 鎻愬崌鏈烘墽琛屼腑
+        /// </summary>
+        [Description("鎻愬崌鏈烘墽琛屼腑")]
+        HT_Executing = 110,
+
+        /// <summary>
         /// 鍫嗗灈鏈哄緟鎵ц
         /// </summary>
         [Description("鍫嗗灈鏈哄緟鎵ц")]
@@ -106,10 +112,6 @@
         /// </summary>
         [Description("浠诲姟寮傚父")]
         Exception = 990,
-        /// <summary>
-        /// 鎻愬崌鏈烘墽琛屼腑
-        /// </summary>
-        [Description("鎻愬崌鏈烘墽琛屼腑")]
-        HT_Executing = 110,
+        
     }
 }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs"
index 0e971ec..10bd4e9 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs"
@@ -91,6 +91,12 @@
         MesMatReturn = 560,
 
         /// <summary>
+        /// MES绌烘墭閫�鏂�
+        /// </summary>
+        [Description("MES绌烘墭閫�鏂�")]
+        MesPalletReturn = 580,
+
+        /// <summary>
         /// 璋冩嫧鍏ュ簱
         /// </summary>
         [Description("璋冩嫧鍏ュ簱")]
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
index b501222..9112aad 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
@@ -260,5 +260,9 @@
         /// <param name="PodBerthAndMat"></param>
         /// <returns></returns>
         WebResponseContent AgvPodBerthAndMat(AgvPodBerthAndMatDTO agvPodModel, APIEnum PodBerthAndMat = APIEnum.Agv_CSJPodBerthAndMat);
+        /// <summary>
+        /// //鍒ゆ柇绉诲簱璐т綅浠诲姟鏄惁宸插瓨鍦紝濡傚瓨鍦ㄥ厛鎵ц
+        /// </summary>
+        Dt_Task QueryStackerExistTask(string PalletCode,string locationCode);
     }
 }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
index ebdb88a..6a74dc6 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -16,6 +16,7 @@
 #endregion << 鐗� 鏈� 娉� 閲� >>
 
 using AutoMapper;
+using HslCommunication.Enthernet;
 using Newtonsoft.Json;
 using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
 using SqlSugar;
@@ -65,6 +66,7 @@
         private Dictionary<string, OrderByType> _taskOrderBy = new()
             {
                 {nameof(Dt_Task.Grade),OrderByType.Desc },
+                {nameof(Dt_Task.TaskNum),OrderByType.Asc},
                 {nameof(Dt_Task.CreateDate),OrderByType.Asc},
             };
 
@@ -198,7 +200,12 @@
                                 task.NextAddress = router.NextPosi;
                                 task.DeviceCode = router.ChildPosi;
                             }
-                            else if (item.TaskType == TaskTypeEnum.MesOutbound.ObjToInt() || item.TaskType == TaskTypeEnum.MesHandOutbound.ObjToInt() || item.TaskType == TaskTypeEnum.MesHandPickOutbound.ObjToInt())
+                            else if (item.TaskType == TaskTypeEnum.MesPalletReturn.ObjToInt() && router.IsEnd)
+                            {
+                                task.NextAddress = router.NextPosi;
+                                task.DeviceCode = router.ChildPosi;
+                            }
+                            else if (item.TaskType == TaskTypeEnum.MesOutbound.ObjToInt() || item.TaskType == TaskTypeEnum.MesHandOutbound.ObjToInt() || item.TaskType == TaskTypeEnum.MesHandPickOutbound.ObjToInt() || (item.TaskType == TaskTypeEnum.OutAllocate.ObjToInt() && item.RoadWay.Contains("BC")))
                             {
                                 task.NextAddress = router.NextPosi;
                                 task.DeviceCode = stationManger.StackerCraneCode;
@@ -813,5 +820,12 @@
                 return WebResponseContent.Instance.Error(ex.Message);
             }
         }
+        /// <summary>
+        /// //鍒ゆ柇绉诲簱璐т綅浠诲姟鏄惁宸插瓨鍦紝濡傚瓨鍦ㄥ厛鎵ц
+        /// </summary>
+        public Dt_Task QueryStackerExistTask(string PalletCode, string locationCode)
+        {
+            return BaseDal.QueryFirst(x => x.PalletCode == PalletCode && x.SourceAddress == locationCode && x.TaskState == (int)TaskStatusEnum.SC_Execute);
+        }
     }
 }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs"
index 0c5db6a..787946b 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs"
@@ -106,13 +106,16 @@
                                 Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) /*&& x.DeviceCode == item.StationDeviceCode*/ && (x.TaskState == TaskStatusEnum.New.ObjToInt()) && x.WarehouseId == warehouseDevice.WarehouseId);
                                 if (task != null && conveyorLineInfoWrite.Spare2 == 0 && conveyorLineStatus.Goods)
                                 {
-                                    List<string> stations = _routerExtension.GetEndPoint(item.StationCode, TaskTypeEnum.Inbound.ObjToInt()).Select(x => x.NextPosi).ToList();
-                                    WebResponseContent responseContent = _taskService.RequestWMSAssignRoadway(stations, task.TaskNum, conveyorLineInfoRead.Spare2);
-                                    if (responseContent.Status)
-                                    {
-                                        device.SetValue(W_ConveyorLineDB.Spare2, 1, item.StationCode);
-                                        _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: item.StationDeviceCode, roadwayNo: responseContent.Data.ToString() ?? "");
-                                    }
+                                    //List<string> stations = _routerExtension.GetEndPoint(item.StationCode, TaskTypeEnum.Inbound.ObjToInt()).Select(x => x.NextPosi).ToList();
+                                    ////鍒嗛厤宸烽亾
+                                    //WebResponseContent responseContent = _taskService.RequestWMSAssignRoadway(stations, task.TaskNum, conveyorLineInfoRead.Spare2);
+                                    //if (responseContent.Status)
+                                    //{
+                                    //    device.SetValue(W_ConveyorLineDB.Spare2, 1, item.StationCode);
+                                    //    _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: item.StationDeviceCode, roadwayNo: responseContent.Data.ToString() ?? "");
+                                    //}
+                                    device.SetValue(W_ConveyorLineDB.Spare2, 1, item.StationCode);
+                                    _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: item.StationDeviceCode);
                                 }
                                 else
                                 {
@@ -132,6 +135,17 @@
                                     Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.DeviceCode == item.StationDeviceCode && (x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt()) && x.PalletCode == conveyorLineInfoRead.Barcode && x.WarehouseId == warehouseDevice.WarehouseId);
                                     if (task != null)
                                     {
+                                        List<string> stations = _routerExtension.GetEndPoint(item.StationCode, TaskTypeEnum.Inbound.ObjToInt()).Select(x => x.NextPosi).ToList();
+                                        //鍒嗛厤宸烽亾
+                                        if (stations.Count>1)
+                                        {
+                                            WebResponseContent responseContent = _taskService.RequestWMSAssignRoadway(stations, task.TaskNum, conveyorLineInfoRead.Spare2);
+                                            if (responseContent.Status)
+                                            {
+                                                _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, roadwayNo: responseContent.Data.ToString() ?? "");
+                                            }
+                                        }
+
                                         device.SetValue(W_ConveyorLineDB.Spare2, 0, item.StationCode);
 
                                         string currentAddress = task.CurrentAddress;
@@ -173,13 +187,22 @@
                                         else
                                         {
                                             //task.NextAddress鍙兘鏄痳outer.NextPosi
-                                            device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode);
+                                            nextAddress = router.NextPosi;
+                                            device.SetValue(W_ConveyorLineDB.EndPos, router.NextPosi, item.StationCode);
                                         }
                                         device.SetValue(W_ConveyorLineDB.TaskNum, task.TaskNum, item.StationCode);
                                         device.SetValue(W_ConveyorLineDB.StartPos, task.CurrentAddress, item.StationCode);
                                         device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode);
                                         device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
-                                        _taskService.UpdateTask(task, taskState, currentAddress: currentAddress, nextAddress: nextAddress, targetAddress: targetAddress, deviceCode: deviceCode);
+                                        if (router.IsEnd)
+                                        {
+                                            _taskService.UpdateTask(task, taskState, currentAddress: currentAddress, nextAddress: nextAddress, targetAddress: targetAddress, deviceCode: deviceCode);
+                                        }
+                                        else
+                                        {
+                                            _taskService.UpdateTask(task, taskState, nextAddress: nextAddress);
+                                        }
+                                            
                                     }
                                     else
                                     {
@@ -187,10 +210,11 @@
                                     }
                                     #endregion
                                 }
-                                else//鐢熶骇閫�搴�
+                                else//鐢熶骇閫�搴� //鎹㈠贩閬撳叆搴�
                                 {
                                     #region 鐢熶骇閫�搴�,甯︿换鍔″彿鏌ヨ浠诲姟
                                     Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.WarehouseId == warehouseDevice.WarehouseId); // 甯︿换鍔″彿鏌ヨ浠诲姟
+                                    Dt_Task taskIn = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNum && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.DeviceCode == item.StationDeviceCode && x.NextAddress == item.StationCode && x.WarehouseId == warehouseDevice.WarehouseId && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt()); // 甯︿换鍔″彿鏌ヨ浠诲姟
                                     if (task != null)
                                     {
                                         List<string> stations = _routerExtension.GetEndPoint(item.StationCode, TaskTypeEnum.Inbound.ObjToInt()).Select(x => x.NextPosi).ToList();
@@ -252,6 +276,50 @@
                                         }
                                        
                                     }
+                                    if (taskIn!=null)
+                                    {
+                                        string currentAddress = taskIn.CurrentAddress;
+                                        string nextAddress = taskIn.NextAddress;
+                                        string targetAddress = taskIn.TargetAddress;
+                                        string deviceCode = taskIn.DeviceCode;
+                                        TaskStatusEnum taskState = (TaskStatusEnum)taskIn.TaskState;
+                                        List<Dt_Router> routers = _routerService.QueryNextRoutes(item.StationCode, taskIn.Roadway, taskIn.TaskType);
+                                        Dt_Router? router = routers.FirstOrDefault();
+                                        if (routers == null || routers.Count == 0 || router == null)
+                                        {
+                                            WriteError(item.StationName, $"鏈壘鍒板搴旇矾鐢变俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{taskIn.TaskNum}");
+                                            continue;
+                                        }
+                                        if (routers.Count > 1)
+                                        {
+                                            WriteError(item.StationName, $"璺敱淇℃伅閰嶇疆閿欒,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{taskIn.TaskNum}");
+                                            continue;
+                                        }
+
+                                        if (router.IsEnd)
+                                        {
+                                            string? targetLoca = _taskService.RequestAssignLocationByHeight(taskIn.TaskNum, taskIn.Roadway, conveyorLineInfoRead.Spare2);
+                                            if (!string.IsNullOrEmpty(targetLoca))
+                                            {
+                                                currentAddress = item.StackerCraneStationCode;
+                                                targetAddress = targetLoca;
+                                                nextAddress = targetLoca;
+                                                taskState = TaskStatusEnum.SC_Execute;
+                                                deviceCode = item.StackerCraneCode;
+                                                device.SetValue(W_ConveyorLineDB.EndPos, taskIn.CurrentAddress, item.StationCode);
+                                            }
+                                            else
+                                            {
+                                                WriteError(item.StationName, $"璇锋眰鍒嗛厤璐т綅澶辫触,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}");
+                                                continue;
+                                            }
+                                        }
+                                        device.SetValue(W_ConveyorLineDB.TaskNum, taskIn.TaskNum, item.StationCode);
+                                        device.SetValue(W_ConveyorLineDB.StartPos, taskIn.CurrentAddress, item.StationCode);
+                                        device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode);
+                                        device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
+                                        _taskService.UpdateTask(taskIn, taskState, currentAddress: currentAddress, nextAddress: nextAddress, targetAddress: targetAddress, deviceCode: deviceCode);
+                                    }
                                     #endregion
                                 }
                             }
@@ -272,6 +340,10 @@
                                     device.SetValue(W_ConveyorLineDB.Spare1, ConveyorWorkTypeEnum.Outbound.ObjToInt(), item.StationCode);
                                     device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode);
                                 }
+                                else //璋冩嫧浣跨敤
+                                {
+                                    device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode);
+                                }
                                 //{
                                 //    task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && string.IsNullOrEmpty(x.DeviceCode) && x.TaskState == TaskStatusEnum.New.ObjToInt() && x.WarehouseId == warehouseDevice.WarehouseId);
                                 //    if (task != null)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/RGVJob_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/RGVJob_BC.cs"
index d314d45..834a6de 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/RGVJob_BC.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/RGVJob_BC.cs"
@@ -145,6 +145,11 @@
                             }
                             else if (!conveyorLineSignalRead.STB && conveyorLineSignalWrite.ACK && !conveyorLineStatus.Alarm)
                             {
+                                Dt_Task task = _taskRepository.QueryFirst(x => x.PalletCode == conveyorLineInfoRead.Barcode);
+                                if (task!=null && task.TaskType==TaskTypeEnum.MesPalletReturn.ObjToInt())
+                                {
+                                    _taskService.TaskCompleted(task.TaskNum);
+                                }
                                 device.SetValue(W_ConveyorLineDB.ACK, false, item.StationCode);
                             }
                         }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs"
index 397c4a8..8fb228b 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs"
@@ -200,7 +200,7 @@
                         }
                         else
                         {
-                            _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: router.NextPosi, targetAddress: "1102");
+                            _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: "1102", targetAddress: "1102");
                         }
                         
                     }
@@ -336,13 +336,22 @@
                 else
                 {
                     Dt_Task reloTask = _mapper.Map<Dt_Task>(taskDTO);
-                    reloTask.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
-                    reloTask.CurrentAddress = taskDTO.SourceAddress;
-                    reloTask.NextAddress = taskDTO.TargetAddress;
-                    reloTask.DeviceCode = task.DeviceCode;
-                    reloTask.TaskType = TaskTypeEnum.Relocation.ObjToInt();
-                    int taskId = _taskRepository.AddData(reloTask);
-                    reloTask.TaskId = taskId;
+                    //鍒ゆ柇绉诲簱璐т綅浠诲姟鏄惁宸插瓨鍦紝濡傚瓨鍦ㄥ厛鎵ц
+                    Dt_Task existTask = _taskService.QueryStackerExistTask(reloTask.PalletCode, reloTask.SourceAddress);
+                    if (existTask != null)
+                    {
+                        return existTask;
+                    }
+                    else
+                    {
+                        reloTask.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
+                        reloTask.CurrentAddress = taskDTO.SourceAddress;
+                        reloTask.NextAddress = taskDTO.TargetAddress;
+                        reloTask.DeviceCode = task.DeviceCode;
+                        reloTask.TaskType = TaskTypeEnum.Relocation.ObjToInt();
+                        int taskId = _taskRepository.AddData(reloTask);
+                        reloTask.TaskId = taskId;
+                    }
                     return reloTask;
 
                 }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/StackerCraneJob_CSJ.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/StackerCraneJob_CSJ.cs"
index e9a0996..8f364d1 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/StackerCraneJob_CSJ.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\265\213\350\257\225\346\236\266\344\273\223/StackerCraneJob_CSJ.cs"
@@ -1,4 +1,5 @@
-锘縰sing Microsoft.AspNetCore.Components.Routing;
+锘縰sing AutoMapper;
+using Microsoft.AspNetCore.Components.Routing;
 using Newtonsoft.Json;
 using Quartz;
 using System;
@@ -14,6 +15,7 @@
 using WIDESEAWCS_Core.Caches;
 using WIDESEAWCS_Core.Enums;
 using WIDESEAWCS_Core.Helper;
+using WIDESEAWCS_DTO.TaskInfo;
 using WIDESEAWCS_IBasicInfoRepository;
 using WIDESEAWCS_ITaskInfoRepository;
 using WIDESEAWCS_ITaskInfoService;
@@ -31,6 +33,7 @@
     [DisallowConcurrentExecution]
     public class StackerCraneJob_CSJ : JobBase, IJob
     {
+        private readonly IMapper _mapper;
         private readonly ICacheService _cacheService;
         private readonly ITaskService _taskService;
         private readonly ITaskExecuteDetailService _taskExecuteDetailService;
@@ -39,7 +42,7 @@
         private readonly IStationMangerRepository _stationMangerRepository;
         private List<Dt_ApiInfo> apiInfos;
 
-        public StackerCraneJob_CSJ(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository)
+        public StackerCraneJob_CSJ(ITaskService taskService, ICacheService cacheService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IStationMangerRepository stationMangerRepository, IMapper mapper)
         {
             _taskService = taskService;
             _taskExecuteDetailService = taskExecuteDetailService;
@@ -47,6 +50,7 @@
             _routerService = routerService;
             _stationMangerRepository = stationMangerRepository;
             _cacheService = cacheService;
+            _mapper = mapper;
 
             string? apiInfoStr = _cacheService.Get("apiInfos");
             if (!string.IsNullOrEmpty(apiInfoStr))
@@ -231,7 +235,57 @@
                     _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒癢MS绉诲簱鍒ゆ柇鎺ュ彛");
                     return null;
                 }
-                HttpHelper.Post($"{url}?taskNum={task.TaskNum}&locationCode={task.NextAddress}", "");//todo 璋冪敤WMS浠诲姟瀹屾垚鏂规硶
+                string response = HttpHelper.Post($"{url}?taskNum={task.TaskNum}&locationCode={task.CurrentAddress}", "");//todo 璋冪敤WMS浠诲姟瀹屾垚鏂规硶
+                if (string.IsNullOrEmpty(response))
+                {
+                    _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+                    WriteError(commonStackerCrane.DeviceCode, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+                    return null;
+                }
+                WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(response);
+                if (responseContent == null || !responseContent.Status)
+                {
+                    _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+                    WriteError(commonStackerCrane.DeviceCode, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+                    return null;
+                }
+                WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.Serialize());
+                if (taskDTO == null)
+                {
+                    _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskNum, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+                    WriteError(commonStackerCrane.DeviceCode, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"绉诲簱鎺ュ彛璋冪敤閿欒");
+                    return null;
+
+                }
+                if (task.TaskNum == taskDTO.TaskNum)
+                {
+                    return task;
+                }
+                else
+                {
+                    Dt_Task reloTask = _mapper.Map<Dt_Task>(taskDTO);
+                    //鍒ゆ柇绉诲簱璐т綅浠诲姟鏄惁宸插瓨鍦紝濡傚瓨鍦ㄥ厛鎵ц
+                    Dt_Task existTask = _taskService.QueryStackerExistTask(reloTask.PalletCode, reloTask.SourceAddress);
+                    if (existTask != null)
+                    {
+                        return existTask;
+                    }
+                    else
+                    {
+                        reloTask.TaskState = TaskStatusEnum.SC_Execute.ObjToInt();
+                        reloTask.CurrentAddress = taskDTO.SourceAddress;
+                        reloTask.NextAddress = taskDTO.TargetAddress;
+                        reloTask.DeviceCode = task.DeviceCode;
+                        reloTask.TaskType = TaskTypeEnum.Relocation.ObjToInt();
+                        int taskId = _taskRepository.AddData(reloTask);
+                        reloTask.TaskId = taskId;
+                    }
+                    return reloTask;
+
+                }
             }
 
             return task;
@@ -244,7 +298,7 @@
         /// <returns>濡傛灉鏈鍗犵敤锛岃繑鍥炰紶鍏ョ殑浠诲姟淇℃伅锛屽惁鍒欙紝杩斿洖null</returns>
         private Dt_Task? OutTaskStationIsOccupied([NotNull] Dt_Task task)
         {
-            Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.NextAddress && x.StackerCraneCode == task.DeviceCode);
+            Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x => (x.StationCode == task.NextAddress || x.StackerCraneStationCode == task.NextAddress) && x.StackerCraneCode == task.DeviceCode);
             if (stationManger != null)
             {
                 IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode);
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/outbound/mesOutboundOrder.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/outbound/mesOutboundOrder.vue"
index e5c696c..c34330c 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/outbound/mesOutboundOrder.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/outbound/mesOutboundOrder.vue"
@@ -34,12 +34,14 @@
       ]);
       const searchFormFields = ref({
         orderNo: "",
+        taskNo:"",
         materialCode: "",
         batchNo: "",
       });
       const searchFormOptions = ref([
         [
           { title: "鍗曟嵁缂栧彿", field: "orderNo", type:"like" },
+          { title: "MES浠诲姟鍗曞彿", field: "taskNo", type:"like" },
           { title: "鐗╂枡缂栧彿", field: "materialCode" ,type:"like"},
           { title: "鎵规鍙�", field: "batchNo" ,type:"like"},
         ],
@@ -71,7 +73,7 @@
         },
         {
           field: "taskNo",
-          title: "浠诲姟鍗曞彿",
+          title: "MES浠诲姟鍗曞彿",
           type: "string",
           width: 150,
           align: "left",
@@ -154,6 +156,14 @@
           type: "string",
           width: 100,
           align: "left",
+          hidden: true
+        },
+        {
+          field: "createDate",
+          title: "鍒涘缓鏃堕棿",
+          type: "datetime",
+          width: 160,
+          align: "left",
         },
         {
           field: "width",
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/1835396e-ee0b-4003-b5af-b6427288d0f6.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/1835396e-ee0b-4003-b5af-b6427288d0f6.vsidx"
deleted file mode 100644
index 9adb7a0..0000000
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/1835396e-ee0b-4003-b5af-b6427288d0f6.vsidx"
+++ /dev/null
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/2a6737f2-ed15-4243-99f4-32f56eae41df.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/2a6737f2-ed15-4243-99f4-32f56eae41df.vsidx"
deleted file mode 100644
index 666656d..0000000
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/2a6737f2-ed15-4243-99f4-32f56eae41df.vsidx"
+++ /dev/null
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/736d9a07-7f63-4075-b18a-3910cc852c4c.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/736d9a07-7f63-4075-b18a-3910cc852c4c.vsidx"
deleted file mode 100644
index fae6d33..0000000
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/736d9a07-7f63-4075-b18a-3910cc852c4c.vsidx"
+++ /dev/null
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/959c0d1d-18db-48d3-9271-1d227e7b7a7a.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/959c0d1d-18db-48d3-9271-1d227e7b7a7a.vsidx"
new file mode 100644
index 0000000..d976082
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/959c0d1d-18db-48d3-9271-1d227e7b7a7a.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b0f7d90e-1d2b-41fa-bdc4-6751c11f6ed9.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b0f7d90e-1d2b-41fa-bdc4-6751c11f6ed9.vsidx"
deleted file mode 100644
index 9d609ad..0000000
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/b0f7d90e-1d2b-41fa-bdc4-6751c11f6ed9.vsidx"
+++ /dev/null
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/cf4c8fbf-fed0-45af-ba6f-76a403b97252.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/cf4c8fbf-fed0-45af-ba6f-76a403b97252.vsidx"
new file mode 100644
index 0000000..21838e7
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/cf4c8fbf-fed0-45af-ba6f-76a403b97252.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e78f7dca-bb67-4a49-94e2-a0a1a362cc32.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e78f7dca-bb67-4a49-94e2-a0a1a362cc32.vsidx"
new file mode 100644
index 0000000..ddc6364
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e78f7dca-bb67-4a49-94e2-a0a1a362cc32.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/f0ca51ef-0959-4f1b-a1f1-0807e03664dc.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/f0ca51ef-0959-4f1b-a1f1-0807e03664dc.vsidx"
new file mode 100644
index 0000000..b720304
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/f0ca51ef-0959-4f1b-a1f1-0807e03664dc.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock"
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/read.lock"
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/PalletCodeInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/PalletCodeInfoService.cs"
index 6163330..affe4dd 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/PalletCodeInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/PalletCodeInfoService.cs"
@@ -104,7 +104,7 @@
                     List<Dt_PalletCodeInfo> palletCodeInfos = new List<Dt_PalletCodeInfo>();
                     int serialNo = 0;
                     DateTime now = DateTime.Now;
-                    Dt_PalletCodeInfo palletCodeInfo = BaseDal.QueryFirst(x => x.WarehouseId == warehouseId, new Dictionary<string, OrderByType> { { nameof(Dt_PalletCodeInfo.SerialNo), OrderByType.Desc } });
+                    Dt_PalletCodeInfo palletCodeInfo = BaseDal.QueryFirst(x => x.WarehouseId == warehouseId && x.PalletTypeId==palletTypeId, new Dictionary<string, OrderByType> { { nameof(Dt_PalletCodeInfo.SerialNo), OrderByType.Desc } });
                     if (palletCodeInfo != null && palletCodeInfo.CreateDate.Year == now.Year && palletCodeInfo.CreateDate.Month == now.Month && palletCodeInfo.CreateDate.Day == now.Day)
                     {
                         serialNo = palletCodeInfo.SerialNo + 1;
@@ -123,7 +123,7 @@
                             SerialNo = serialNo,
                             PalletCode = palletTypeInfo.CodeStartStr + now.ToString("yyyyMMdd") + serialNo.ToString().PadLeft(3, '0'),
                             PalletType = 1,
-                            PalletTypeId = 0,
+                            PalletTypeId = palletTypeId,
                             WarehouseId = warehouseId,
                             Status = 0,
                             Size = 0
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs"
index 2021323..5c615e9 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs"
@@ -108,6 +108,15 @@
                     {
                         Dt_LocationInfo definedTypeEmptyLocation = definedTypeEmptyLocations[i];
                         Dt_LocationInfo? locationInfo = GetUsableLocation_BC(locationInfos, definedTypeEmptyLocation, palletType, palletTypeInfo);
+                        //鍒ゆ柇璐т綅涓ゆ繁鍙婁互涓婃槸鍚﹀瓨鍦ㄥ嚭搴撻攣瀹氳揣浣�
+                        if (locationInfo?.Depth == 1)
+                        {
+                            Dt_LocationInfo? IsBebusyLocation = locationInfos.Where(x => x.Row == (locationInfo?.Row == 2 ? locationInfo?.Row - 1 : locationInfo?.Row + 1) && x.Column==locationInfo?.Column && x.Layer== locationInfo?.Layer).FirstOrDefault();
+                            if (IsBebusyLocation!=null && (IsBebusyLocation.LocationStatus<LocationStatusEnum.InStock.ObjToInt()))
+                            {
+                                continue;
+                            }
+                        }
                         if (locationInfo != null)
                         {
                             locationCaches_BC.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
@@ -123,18 +132,29 @@
                             undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Column % 2 == 1).ToList();
                         else
                             undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Column % 2 == 0).ToList();
-                    }
-                    for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++)
-                    {
-                        Dt_LocationInfo undefinedTypeEmptyLocation = undefinedTypeEmptyLocations[i];
-                        Dt_LocationInfo? locationInfo = GetUsableLocation_BC(locationInfos, undefinedTypeEmptyLocation, palletType, palletTypeInfo);
-                        if (locationInfo != null)
+
+                        for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++)
                         {
-                            //UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, locationInfo.WarehouseId);
-                            locationCaches_BC.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
-                            return locationInfo;
+                            Dt_LocationInfo undefinedTypeEmptyLocation = undefinedTypeEmptyLocations[i];
+                            Dt_LocationInfo? locationInfo = GetUsableLocation_BC(locationInfos, undefinedTypeEmptyLocation, palletType, palletTypeInfo);
+                            //鍒ゆ柇璐т綅涓ゆ繁鍙婁互涓婃槸鍚﹀瓨鍦ㄥ嚭搴撻攣瀹氳揣浣�
+                            if (locationInfo?.Depth == 1)
+                            {
+                                Dt_LocationInfo? IsBebusyLocation = locationInfos.Where(x => x.Row == (locationInfo?.Row == 2 ? locationInfo?.Row - 1 : locationInfo?.Row + 1) && x.Column == locationInfo?.Column && x.Layer == locationInfo?.Layer).FirstOrDefault();
+                                if (IsBebusyLocation != null && (IsBebusyLocation.LocationStatus < LocationStatusEnum.InStock.ObjToInt()))
+                                {
+                                    continue;
+                                }
+                            }
+                            if (locationInfo != null)
+                            {
+                                //UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, locationInfo.WarehouseId);
+                                locationCaches_BC.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
+                                return locationInfo;
+                            }
                         }
                     }
+                    
                 }
                 return null;
             }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs"
index adec44a..3e875b8 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs"
@@ -341,9 +341,20 @@
                         nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column - 1);
                     }
 
-                    if (location.RoadwayNo == "SC01_BC")
+                    if (nearLocation!=null && location.RoadwayNo.Contains("BC"))
+                    {
+                        if (nearLocation?.LocationType == LocationTypeEnum.SmallPallet.ObjToInt())
+                        {
+                            nearLocation = null;
+                        }
+                    }
+                    if (location.RoadwayNo == "SC01_BC" && palletType != PalletTypeEnum.SmallPallet.ObjToInt())
                     {
                         nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column - 1);
+                        if (nearLocation?.LocationType == LocationTypeEnum.SmallPallet.ObjToInt())
+                        {
+                            nearLocation = null;
+                        }
                     }
 
                     if (nearLocation != null)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationStatusEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationStatusEnum.cs"
index dd54520..87a5df4 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationStatusEnum.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationStatusEnum.cs"
@@ -30,7 +30,7 @@
         InStockLock = 10,
 
         /// <summary>
-        /// 
+        /// 鏈夎揣閿佸畾
         /// </summary>
         [Description("绌洪棽閿佸畾")]
         FreeLock = 20,
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/StockEnum/StockStatusEmun.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/StockEnum/StockStatusEmun.cs"
index 65ea267..993b657 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/StockEnum/StockStatusEmun.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/StockEnum/StockStatusEmun.cs"
@@ -56,6 +56,9 @@
         [Description("閫�搴�")]
         MES閫�搴� = 21,
 
+        [Description("MES绌烘墭閫�搴�")]
+        MES绌烘墭閫�搴� = 22,
+
         [Description("缁勭洏鎾ら攢")]
         缁勭洏鎾ら攢 = 99,
 
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs"
index bd83eec..596b29e 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs"
@@ -100,6 +100,12 @@
         InAllocate = 570,
 
         /// <summary>
+        /// MES绌烘墭閫�鏂�
+        /// </summary>
+        [Description("MES绌烘墭閫�鏂�")]
+        MesPalletReturn = 580,
+
+        /// <summary>
         /// 绌虹鍏ュ簱
         /// </summary>
         [Description("绌虹鍏ュ簱")]
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpProOutOrderDTO.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpProOutOrderDTO.cs"
new file mode 100644
index 0000000..94acb66
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpProOutOrderDTO.cs"
@@ -0,0 +1,107 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.Attributes;
+
+namespace WIDESEA_DTO.ERP
+{
+    /// <summary>
+    /// 鎴愬搧璁㈠崟鍑哄簱
+    /// </summary>
+    public class ErpProOutOrderDTO
+    {
+        /// <summary>
+        /// 鎿嶄綔绫诲瀷<br/>
+        /// 1锛氭柊澧�<br/>
+        /// 2锛氫慨鏀�<br/>
+        /// 3锛氬垹闄�(鍒犻櫎鍙鏄庣粏琛屽彿鍜岄鏂欏崟鍙�)
+        /// </summary>
+        [PropertyValidate("鎿嶄綔绫诲瀷", NotNullAndEmpty = true, Check = new object[] { 1, 2, 3 })]
+        public int Way { get; set; }
+        /// <summary>
+        /// 鍑哄簱璁㈠崟鍙�
+        /// </summary>
+        [PropertyValidate("鍑哄簱璁㈠崟鍙�", NotNullAndEmpty = true)]
+        public string OrderNo { get; set; }
+        /// <summary>
+        /// 璁㈠崟绫诲瀷<br/>
+        /// 1锛氬嚭搴撳崟<br/>
+        /// 2锛氬瘎鍞鍗曡浆浠�<br/>
+        /// </summary>
+        [PropertyValidate("璁㈠崟绫诲瀷", NotNullAndEmpty = true, Check = new object[] { 1, 2})]
+        public int OType { get; set; }
+        /// <summary>
+        /// 璁″垝鍑鸿揣鏃堕棿
+        /// </summary>
+        public string PlantShipDate { get; set; }
+        /// <summary>
+        /// 澶囨敞
+        /// </summary>
+        public string Note { get; set; }
+        /// <summary>
+        /// 璇︽儏
+        /// </summary>
+        public List<ErpProOutOrderDetailds> OrderDetails { get; set; }
+    }
+    /// <summary>
+    /// 璇︾粏
+    /// </summary>
+    public class ErpProOutOrderDetailds 
+    {
+        /// <summary>
+        /// 琛屽彿
+        /// </summary>
+        public int RowId { get; set; }
+        /// <summary>
+        /// 閿�鍞鍗曞彿
+        /// </summary>
+        public string SaleOrder { get; set; }
+        /// <summary>
+        /// 瀹㈡埛
+        /// </summary>
+        public string Customer { get; set; }
+        /// <summary>
+        /// 宸ュ巶
+        /// </summary>
+        public string FactoryCode { get; set; } = "HA02";
+        /// <summary>
+        /// 浜у搧缂栫爜
+        /// </summary>
+        public string PCode { get; set; }
+        /// <summary>
+        /// 浜у搧鐗堟湰
+        /// </summary>
+        public string PVer { get; set; }
+        /// <summary>
+        /// 浜у搧鎵规
+        /// </summary>
+        public string PLot { get; set; }
+        /// <summary>
+        /// 浜у搧鍛ㄦ湡
+        /// </summary>
+        public int DateCode { get; set; }
+        /// <summary>
+        /// 鍚堟牸PCS鏁�
+        /// </summary>
+        public float QtyPcs { get; set; }
+        /// <summary>
+        /// X鏉挎暟
+        /// </summary>
+        public float XQty { get; set; }
+        /// <summary>
+        /// X鏉夸綅
+        /// </summary>
+        public string XSite { get; set; }
+        /// <summary>
+        /// 鍗曚綅
+        /// </summary>
+        public string Unit { get; set; }
+        /// <summary>
+        /// 澶囧搧鏁�
+        /// </summary>
+        public float SpareQty { get; set; }
+    }
+
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpProductScrappedOrderDTO.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpProductScrappedOrderDTO.cs"
new file mode 100644
index 0000000..de02fa4
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpProductScrappedOrderDTO.cs"
@@ -0,0 +1,90 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.Attributes;
+
+namespace WIDESEA_DTO.ERP
+{
+    /// <summary>
+    /// 鎴愬搧浠撴鎶ュ簾鍗�
+    /// </summary>
+    [ModelValidate]
+    public class ErpProductScrappedOrderDTO
+    {
+        /// <summary>
+        /// 璁㈠崟鍙�
+        /// </summary>
+        [PropertyValidate("璁㈠崟鍙�", NotNullAndEmpty = true)]
+        public string OrderNo { get; set; }
+
+        /// <summary>
+        /// 浜у搧缂栫爜
+        /// </summary>
+        [PropertyValidate("浜у搧缂栫爜", NotNullAndEmpty = true)]
+        public string PCode { get; set; }
+
+        /// <summary>
+        /// 浜у搧鐗堟湰
+        /// </summary>
+        [PropertyValidate("浜у搧鐗堟湰", NotNullAndEmpty = true)]
+        public string PVer { get; set; }
+
+        /// <summary>
+        /// 浜у搧鎵规
+        /// </summary>
+        [PropertyValidate("浜у搧鎵规", NotNullAndEmpty = true)]
+        public string PLot { get; set; }
+
+        /// <summary>
+        /// 浜у搧鍛ㄦ湡
+        /// </summary>
+        [PropertyValidate("浜у搧鍛ㄦ湡")]
+        public int DateCode { get; set; }
+
+        /// <summary>
+        /// 浠撳簱绫诲瀷
+        /// HA72=灏炬暟浠撱�丠A71=鎴愬搧浠撱�丠A73=鐮斿彂浠�
+        /// </summary>
+        [PropertyValidate("浠撳簱绫诲瀷", NotNullAndEmpty = true)]
+        public string WaType { get; set; }
+
+        /// <summary>
+        /// 鍚堟牸PCS鏁�
+        /// </summary>
+        [PropertyValidate("鍚堟牸PCS鏁�", NotNullAndEmpty = true)]
+        public float QtyPcs { get; set; }
+
+        /// <summary>
+        /// X鏉挎暟
+        /// </summary>
+        [PropertyValidate("X鏉挎暟")]
+        public float XQty { get; set; }
+
+        /// <summary>
+        /// X鏉夸綅
+        /// </summary>
+        [PropertyValidate("X鏉夸綅")]
+        public string XSite { get; set; }
+
+        /// <summary>
+        /// 鍗曚綅
+        /// </summary>
+        [PropertyValidate("鍗曚綅", NotNullAndEmpty = true)]
+        public string Unit { get; set; }
+
+        /// <summary>
+        /// 寤哄崟鏃ユ湡
+        /// yyyy-MM-dd
+        /// </summary>
+        [PropertyValidate("寤哄崟鏃ユ湡", NotNullAndEmpty = true)]
+        public string OrderDate { get; set; }
+
+        /// <summary>
+        /// 澶囨敞
+        /// </summary>
+        [PropertyValidate("澶囨敞")]
+        public string Note { get; set; }
+    }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpProductSpecifyVerDTO.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpProductSpecifyVerDTO.cs"
new file mode 100644
index 0000000..a7f780c
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpProductSpecifyVerDTO.cs"
@@ -0,0 +1,71 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.Attributes;
+
+namespace WIDESEA_DTO.ERP
+{
+    /// <summary>
+    /// 鎴愬搧閿�鍞寚娲捐〃
+    /// </summary>
+    [ModelValidate]
+    public class ErpProductSpecifyVerDTO
+    {
+        /// <summary>
+        /// 璁㈠崟鍙�
+        /// </summary>
+        [PropertyValidate("璁㈠崟鍙�", NotNullAndEmpty = true)]
+        public string OrderNo { get; set; }
+
+        /// <summary>
+        /// 鏄庣粏琛屽彿
+        /// </summary>
+        [PropertyValidate("鏄庣粏琛屽彿", NotNullAndEmpty = true)]
+        public int RowId { get; set; }
+
+        /// <summary>
+        /// 浜у搧缂栫爜
+        /// </summary>
+        [PropertyValidate("浜у搧缂栫爜", NotNullAndEmpty = true)]
+        public string PCode { get; set; }
+
+        /// <summary>
+        /// 浜у搧鐗堟湰
+        /// </summary>
+        [PropertyValidate("浜у搧鐗堟湰", NotNullAndEmpty = true)]
+        public string PVer { get; set; }
+
+        /// <summary>
+        /// 浜у搧鎵规
+        /// </summary>
+        [PropertyValidate("浜у搧鎵规", NotNullAndEmpty = true)]
+        public string PLot { get; set; }
+
+        /// <summary>
+        /// 浜у搧鍛ㄦ湡
+        /// </summary>
+        [PropertyValidate("浜у搧鍛ㄦ湡")]
+        public int DateCode { get; set; }
+
+        /// <summary>
+        /// 浠撳簱绫诲瀷
+        /// HA72=灏炬暟浠撱�丠A71=鎴愬搧浠撱�丠A73=鐮斿彂浠�
+        /// </summary>
+        [PropertyValidate("浠撳簱绫诲瀷", NotNullAndEmpty = true)]
+        public string WaType { get; set; }
+
+        /// <summary>
+        /// 鍚堟牸PCS鏁�
+        /// </summary>
+        [PropertyValidate("鍚堟牸PCS鏁�", NotNullAndEmpty = true)]
+        public float QtyPcs { get; set; }
+
+        /// <summary>
+        /// 鎸囨淳鐗堟湰鍙�
+        /// </summary>
+        [PropertyValidate("鎸囨淳鐗堟湰鍙�",NotNullAndEmpty =true)]
+        public string Ver { get; set; }
+    }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpProductTransferOrderDTO.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpProductTransferOrderDTO.cs"
new file mode 100644
index 0000000..e50805a
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpProductTransferOrderDTO.cs"
@@ -0,0 +1,96 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.Attributes;
+
+namespace WIDESEA_DTO.ERP
+{
+    /// <summary>
+    /// 鐮斿彂鎴愬搧璋冨叆鎴愬搧浠撹〃
+    /// </summary>
+    [ModelValidate]
+    
+    public class ErpProductTransferOrder
+    {
+        /// <summary>
+        /// 璋冩嫧鍗曞彿
+        /// </summary>
+        [PropertyValidate("璋冩嫧鍗曞彿",NotNullAndEmpty =true)]
+        public string TransferNo { get; set; }
+
+        /// <summary>
+        /// 浜у搧缂栫爜
+        /// </summary>
+        [PropertyValidate("浜у搧缂栫爜", NotNullAndEmpty = true)]
+        public string PCode  { get; set; }
+
+        /// <summary>
+        /// 浜у搧鐗堟湰
+        /// </summary>
+        [PropertyValidate("浜у搧鐗堟湰", NotNullAndEmpty = true)]
+        public string PVer { get; set; }
+
+        /// <summary>
+        /// 浜у搧鍛ㄦ湡
+        /// </summary>
+        [PropertyValidate("浜у搧鍛ㄦ湡")]
+        public int DateCode { get; set; }
+
+        /// <summary>
+        /// 鍚堟牸PCS鏁�
+        /// </summary>
+        [PropertyValidate("鍚堟牸PCS鏁�", NotNullAndEmpty = true)]
+        public float QtyPcs { get; set; }
+
+        /// <summary>
+        /// X鏉挎暟
+        /// </summary>
+        [PropertyValidate("X鏉挎暟")]
+        public float XQty { get; set; }
+
+        /// <summary>
+        /// X鏉夸綅
+        /// </summary>
+        [PropertyValidate("X鏉夸綅")]
+        public int XSite { get; set; }
+
+        /// <summary>
+        /// 鍗曚綅
+        /// </summary>
+        [PropertyValidate("鍗曚綅",NotNullAndEmpty =true)]
+        public string Unit { get; set; }
+
+        /// <summary>
+        /// 寤哄崟鏃ユ湡
+        /// yyyy-MM-dd
+        /// </summary>
+        [PropertyValidate("寤哄崟鏃ユ湡",NotNullAndEmpty =true)]
+        public string OrderDate { get; set; }
+
+        /// <summary>
+        /// 澶囨敞
+        /// </summary>
+        [PropertyValidate("澶囨敞")]
+        public string Note { get; set; }
+
+        /// <summary>
+        /// 閿�鍞鍗曞彿
+        /// </summary>
+        [PropertyValidate("閿�鍞鍗曞彿",NotNullAndEmpty =true)]
+        public string SaleOrder { get; set; }
+
+        /// <summary>
+        /// 瀹㈡埛
+        /// </summary>
+        [PropertyValidate("瀹㈡埛", NotNullAndEmpty =true)]
+        public string Customer { get; set; }
+
+        /// <summary>
+        /// 宸ュ巶
+        /// </summary>
+        [PropertyValidate("宸ュ巶", NotNullAndEmpty =true)]
+        public string FactoryCode { get; set; }
+    }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpProductWarehousingOrderDTO.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpProductWarehousingOrderDTO.cs"
new file mode 100644
index 0000000..bb9aa8c
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/ErpProductWarehousingOrderDTO.cs"
@@ -0,0 +1,107 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.Attributes;
+
+namespace WIDESEA_DTO.ERP
+{
+    /// <summary>
+    /// 鎴愬搧璋冨叆寰呭彂璐т粨琛�
+    /// </summary>
+    [ModelValidate]
+    public class ErpProductWarehousingOrderDTO
+    {
+        /// <summary>
+        /// 璋冩嫧鍗曞彿
+        /// </summary>
+        [PropertyValidate("璋冩嫧鍗曞彿", NotNullAndEmpty = true)]
+        public string TransferNo { get; set; }
+
+        /// <summary>
+        /// 浜у搧缂栫爜
+        /// </summary>
+        [PropertyValidate("浜у搧缂栫爜", NotNullAndEmpty = true)]
+        public string PCode { get; set; }
+
+        /// <summary>
+        /// 浜у搧鐗堟湰
+        /// </summary>
+        [PropertyValidate("浜у搧鐗堟湰", NotNullAndEmpty = true)]
+        public string PVer { get; set; }
+
+        /// <summary>
+        /// 浜у搧鎵规
+        /// </summary>
+        [PropertyValidate("浜у搧鎵规", NotNullAndEmpty = true)]
+        public string PLot { get; set; }
+
+        /// <summary>
+        /// 浜у搧鍛ㄦ湡
+        /// </summary>
+        [PropertyValidate("浜у搧鍛ㄦ湡")]
+        public int DateCode { get; set; }
+
+        /// <summary>
+        /// 鍚堟牸PCS鏁�
+        /// </summary>
+        [PropertyValidate("鍚堟牸PCS鏁�", NotNullAndEmpty = true)]
+        public float QtyPcs { get; set; }
+
+        /// <summary>
+        /// 鍖呰Set鏁�
+        /// </summary>
+        [PropertyValidate("鍖呰Set鏁�", NotNullAndEmpty = true)]
+        public float QtySet { get; set; }
+
+        /// <summary>
+        /// X鏉挎暟
+        /// </summary>
+        [PropertyValidate("X鏉挎暟")]
+        public float XQty { get; set; }
+
+        /// <summary>
+        /// X鏉夸綅
+        /// </summary>
+        [PropertyValidate("X鏉夸綅")]
+        public string XSite { get; set; }
+
+        /// <summary>
+        /// 鍗曚綅
+        /// </summary>
+        [PropertyValidate("鍗曚綅",NotNullAndEmpty =true)]
+        public string Unit { get; set; }
+
+        /// <summary>
+        /// 寤哄崟鏃ユ湡
+        /// yyyy-MM-dd
+        /// </summary>
+        [PropertyValidate("寤哄崟鏃ユ湡",NotNullAndEmpty =true)]
+        public string OrderDate { get; set; }
+
+        /// <summary>
+        /// 澶囨敞
+        /// </summary>
+        [PropertyValidate("澶囨敞")]
+        public string Note { get; set; }
+
+        /// <summary>
+        /// 閿�鍞鍗曞彿
+        /// </summary>
+        [PropertyValidate("閿�鍞鍗曞彿", NotNullAndEmpty = true)]
+        public string SaleOrder { get; set; }
+
+        /// <summary>
+        /// 瀹㈡埛
+        /// </summary>
+        [PropertyValidate("瀹㈡埛", NotNullAndEmpty = true)]
+        public string Customer { get; set; }
+
+        /// <summary>
+        /// 宸ュ巶
+        /// </summary>
+        [PropertyValidate("宸ュ巶", NotNullAndEmpty = true)]
+        public string FactoryCode { get; set; }
+    }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesResponseContent.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesResponseContent.cs"
index 65e68ef..0a3d51b 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesResponseContent.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_DTO/MES/MesResponseContent.cs"
@@ -28,26 +28,32 @@
         /// <summary>
         /// 
         /// </summary>
-        public DateTime DataTime { get; set; }
+        public string DataTime { get; set; }
 
         public static MesResponseContent Instance
         {
             get { return new MesResponseContent(); }
         }
-
+        /// <summary>
+        /// 杩斿洖
+        /// </summary>
         public MesResponseContent OK(string message = null)
         {
             BSucc = true;
             StrCode = "0000";
             StrMsg = message == null ? "鎵ц鎴愬姛" : message;
+            DataTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             return this;
         }
-
+        /// <summary>
+        /// 杩斿洖
+        /// </summary>
         public MesResponseContent Error(string message = null)
         {
             BSucc = false;
             StrCode = "404";
             StrMsg = message == null ? "鎵ц澶辫触" : message;
+            DataTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             return this;
         }
         public ContentMes Content { get; set; }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPMaintainIssueModel.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPMaintainIssueModel.cs"
new file mode 100644
index 0000000..ffd5c23
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPMaintainIssueModel.cs"
@@ -0,0 +1,92 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEA_External.Model
+{
+    /// <summary>
+    /// 缁翠慨鍙戞枡鍑哄簱鍗�
+    /// </summary>
+    public class ERPMaintainIssueModel
+    {
+        /// <summary>
+        /// 鎿嶄綔绫诲瀷
+        /// </summary>
+        public int Way { get; set; }
+
+        /// <summary>
+        /// 涓诲仴鍊�
+        /// </summary>
+        public int UniqueTag { get; set; }
+
+        /// <summary>
+        /// 鍙戞枡鍗曞彿
+        /// </summary>
+        public string Code { get; set; }
+
+        /// <summary>
+        /// 鍙戞枡鏃堕棿
+        /// </summary>
+        public string Createtime { get; set; }
+
+        /// <summary>
+        /// 鍙戞枡浜哄憳
+        /// </summary>
+        public string Createuser { get; set; }
+
+        /// <summary>
+        /// 浠撳簱缂栫爜
+        /// </summary>
+        public string WarehouseCode { get; set; }
+
+        /// <summary>
+        /// 澶囨敞
+        /// </summary>
+        public string Remark { get; set; } 
+        /// <summary>
+        /// 
+        /// </summary>
+        public List<ERPItemlist> Itemlist { get; set; }
+    }
+    public class ERPItemlist
+    {
+        /// <summary>
+        /// 鍙戞枡鏄庣粏琛屽彿
+        /// </summary>
+        public int RowNo { get; set; }
+
+        /// <summary>
+        /// 鐗╂枡缂栫爜
+        /// </summary>
+        public string Material { get; set; }
+        /// <summary>
+        /// 缁翠慨鍗曞彿
+        /// </summary>
+        public string Pickno { get; set; }
+
+        /// <summary>
+        /// 鍙戞枡鏁伴噺
+        /// </summary>
+        public string Issueqty { get; set; }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public List<ERPBatchlist> Batchlist { get; set; }
+    }
+    public class ERPBatchlist {
+        /// <summary>
+        /// 鎵规鍙�
+        /// </summary>
+        public string Lotno { get; set; }
+
+        /// <summary>
+        /// 鏁伴噺
+        /// </summary>
+        public string Qty { get; set; }
+
+        
+    }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPMaterialSaleReturnModel.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPMaterialSaleReturnModel.cs"
new file mode 100644
index 0000000..6ae3e74
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPMaterialSaleReturnModel.cs"
@@ -0,0 +1,26 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEA_External.Model
+{
+    /// <summary>
+    /// 鐗╂枡閿�鍞��璐у叆搴�
+    /// </summary>
+    public class ERPMaterialSaleReturnModel
+    {
+        /// <summary>
+        /// 绫诲瀷
+        /// </summary>
+        public string Way { get; set; }
+
+        /// <summary>
+        /// 鍗曞彿
+        /// </summary>
+        public string Code { get; set; }
+
+    }
+  
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPProInboundModel.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPProInboundModel.cs"
new file mode 100644
index 0000000..1ac50e1
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPProInboundModel.cs"
@@ -0,0 +1,127 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEA_External.Model
+{
+    /// <summary>
+    /// 鎴愬搧鍏ュ簱瀹屾垚涓婃姤ERP
+    /// </summary>
+    public class ERPProInboundModel
+    {
+        /// <summary>
+        /// 鎿嶄綔绫诲瀷
+        /// </summary>
+        public int Way { get; set; }
+        /// <summary>
+        /// 鍏ュ簱鍗曞彿
+        /// </summary>
+        public string Code { get; set; }
+        /// <summary>
+        /// 鍒涘缓浜轰唬鐮�
+        /// </summary>
+        public string CreatorCode { get; set; }
+        /// <summary>
+        /// 鍏徃浠g爜
+        /// </summary>
+        public string CompanyCode { get; set; } = "HATC";
+        /// <summary>
+        /// 宸ュ巶浠e彿
+        /// </summary>
+        public string FactoryCode { get; set; } = "HA02";
+        /// <summary>
+        /// 浠撳簱浠g爜
+        /// </summary>
+        public string WarehouseCode { get; set; }
+        /// <summary>
+        /// 鍌ㄤ綅浠g爜
+        /// </summary>
+        public string LocationCode { get; set; }
+        /// <summary>
+        /// 鍏ュ簱鏃ユ湡
+        /// </summary>
+        public string StockDate { get; set; }
+        /// <summary>
+        /// 鍏ュ簱鏃ユ湡
+        /// </summary>
+        public string Remark { get; set; }
+        /// <summary>
+        /// 鍏ュ簱绫诲瀷
+        /// </summary>
+        public string StockFormType { get; set; } = "Production";
+        /// <summary>
+        /// 鍏ュ簱鏄庣粏
+        /// </summary>
+        public List<ERPProItemsItem> StockFormItems { get; set; }
+    }
+    /// <summary>
+    /// 鍏ュ簱涓婃姤鏄庣粏
+    /// </summary>
+    public class ERPProItemsItem
+    {
+        /// <summary>
+        /// 浜у搧缂栫爜
+        /// </summary>
+        public string PartNum { get; set; }
+        /// <summary>
+        /// 浜у搧鐗堟湰
+        /// </summary>
+        public string Rev { get; set; }
+        /// <summary>
+        /// 鍛ㄦ湡鐮�
+        /// </summary>
+        public string DateCode { get; set; }
+        /// <summary>
+        /// 鎵规(鍏ュ簱鍗曞彿+鎴愬搧缂栫爜+澶у皬鐗堟湰)mes鐢熸垚
+        /// </summary>
+        public string BatchNumber { get; set; }
+        /// <summary>
+        /// 鍙夋澘浣嶇疆
+        /// </summary>
+        public string XLocation { get; set; }
+        /// <summary>
+        /// 鍙夋澘鏁�
+        /// </summary>
+        public float Xqty { get; set; }
+        /// <summary>
+        /// Pnl鏁伴噺
+        /// </summary>
+        public float QtyPnl { get; set; }
+        /// <summary>
+        /// Set鏁伴噺
+        /// </summary>
+        public float QtySet { get; set; }
+        /// <summary>
+        /// Pcs鏁伴噺
+        /// </summary>
+        public float QtyPcs { get; set; }
+        /// <summary>
+        /// 宸ュ崟鏄庣粏
+        /// </summary>
+        public List<ERPProListItem> WoList { get; set; }
+    }
+    /// <summary>
+    /// 鍏ュ簱宸ュ崟鏄庣粏
+    /// </summary>
+    public class ERPProListItem
+    {
+        /// <summary>
+        /// 鍒堕�犺鍗�
+        /// </summary>
+        public string moNumber { get; set; }
+        /// <summary>
+        /// 宸ュ崟
+        /// </summary>
+        public string WoNumber { get; set; }
+        /// <summary>
+        /// Pcs鏁伴噺
+        /// </summary>
+        public float QtyPcs { get; set; }
+        /// <summary>
+        /// Set鏁伴噺
+        /// </summary>
+        public float QtySet { get; set; }
+    }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPProOutOrderModel.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPProOutOrderModel.cs"
new file mode 100644
index 0000000..028250c
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPProOutOrderModel.cs"
@@ -0,0 +1,85 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEA_External.Model
+{
+    /// <summary>
+    /// 鎴愬搧鍑哄簱鍥炰紶ERP
+    /// </summary>
+    public class ERPProOutOrderModel
+    {
+        /// <summary>
+        /// 鎿嶄綔绫诲瀷
+        /// </summary>
+        public int Way { get; set; }
+        /// <summary>
+        /// 鍙戞枡鍗曞彿
+        /// </summary>
+        public string StockOutCode { get; set; }
+        /// <summary>
+        ///搴撳瓨鎸囨淳鍛樹唬鐮�
+        /// </summary>
+        public string ConfirmedUserNo { get; set; }
+        /// <summary>
+        /// 鍑哄簱浜轰唬鐮�
+        /// </summary>
+        public string AssignUserNo { get; set; }
+        /// <summary>
+        /// 閫佽揣鏃ユ湡
+        /// </summary>
+        public string ShipDate { get; set; }
+        /// <summary>
+        /// 浠撳簱浠g爜
+        /// </summary>
+        public string WarehouseCode { get; set; }
+        /// <summary>
+        /// 璁″垝鍑鸿揣鍗曞彿
+        /// </summary>
+        public string DeliverplanCode { get; set; }
+        /// <summary>
+        /// 澶囨敞
+        /// </summary>
+        public string Remark { get; set; }
+        /// <summary>
+        /// 鏄庣粏璇︽儏
+        /// </summary>
+        public List<StockOutItemsItem> StockOutItems { get; set; }
+    }
+    /// <summary>
+    /// 鍑哄簱鏄庣粏
+    /// </summary>
+    public class StockOutItemsItem
+    {
+        /// <summary>
+        /// 浜у搧缂栫爜
+        /// </summary>
+        public string PartNum { get; set; }
+        /// <summary>
+        /// 鐗堟湰
+        /// </summary>
+        public string Rev { get; set; }
+        /// <summary>
+        /// 閿�鍞鍗曞彿
+        /// </summary>
+        public string SoNumber { get; set; }
+        /// <summary>
+        /// 鎵规鍙�
+        /// </summary>
+        public string BatchNumber { get; set; }
+        /// <summary>
+        /// 澶囧搧鏁伴噺
+        /// </summary>
+        public float QtyFree { get; set; }
+        /// <summary>
+        /// PCS鏁伴噺
+        /// </summary>
+        public float QtyPcs { get; set; }
+        /// <summary>
+        /// 鍖呰SET鏁伴噺
+        /// </summary>
+        public float QtySet { get; set; }
+    }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPProductCheckModel.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPProductCheckModel.cs"
new file mode 100644
index 0000000..ee516d1
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPProductCheckModel.cs"
@@ -0,0 +1,187 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEA_External.Model
+{
+    /// <summary>
+    /// 鎴愬搧閫佹
+    /// </summary>
+    public class ERPProductCheckModel
+    {
+        /// <summary>
+        /// 鎿嶄綔绫诲瀷
+        /// 1 鏂板 
+        /// </summary>
+        public int Way { get; set; }
+
+        /// <summary>
+        /// WMES涓诲仴鍊�
+        /// </summary>
+        public string UniqueTag { get; set; }
+
+        /// <summary>
+        /// 妫�楠屽崟鍙�
+        /// </summary>
+        public string Code { get; set; }
+
+        /// <summary>
+        /// 宸ュ巶浠e彿
+        /// </summary>
+        public string PlantsCode { get; set; } = "HA02";
+
+        /// <summary>
+        /// 閫佹鍗曞彿
+        /// </summary>
+        public string RecheckCode { get; set; }
+
+        /// <summary>
+        /// 鐢熶骇鍨嬪彿
+        /// </summary>
+        public string PartNum { get; set; }
+
+        /// <summary>
+        /// 鐗堟湰鍙�
+        /// </summary>
+        public string PartRev { get; set; }
+
+        /// <summary>
+        /// 浠撳簱浠e彿
+        /// "HA72灏炬暟浠撱�� HA71鎴愬搧浠撱�丠A73鐮斿彂浠�"
+        /// </summary>
+        public string WarehouseCode { get; set; }
+
+        /// <summary>
+        /// 鍌ㄤ綅浠e彿
+        ///"HA72灏炬暟浠撱�� HA71鎴愬搧浠撱�丠A73鐮斿彂浠�"
+        /// </summary>
+        public string Location { get; set; }
+
+        /// <summary>
+        /// 鎵规鍙�
+        /// </summary>
+        public string LotNo { get; set; }
+
+        /// <summary>
+        /// 澶囨敞
+        /// </summary>
+        public string Node { get; set; }
+
+        /// <summary>
+        /// 鍚堟牸PCS鏁伴噺
+        /// </summary>
+        public int QtyPcs { get; set; }
+
+        /// <summary>
+        /// 鍚堟牸Set鏁伴噺
+        /// </summary>
+        public int QtyArray { get; set; }
+
+        /// <summary>
+        /// 鍚堟牸PNL鏁伴噺
+        /// </summary>
+        public int QtyPanel { get; set; }
+
+        /// <summary>
+        /// 閫佹PCS鏁伴噺
+        /// </summary>
+        public int QtyPcsRecieved { get; set; }
+
+        /// <summary>
+        /// 閫佹Set鏁伴噺
+        /// </summary>
+        public int QtyArrayRecieved { get; set; }
+
+        /// <summary>
+        /// 閫佹PNL鏁伴噺
+        /// </summary>
+        public int QtyPanelRecieved { get; set; }
+
+        /// <summary>
+        ///鎶ュ簾Pcs鏁伴噺
+        /// </summary>
+        public int QtyPcsScrapped { get; set; }
+
+        /// <summary>
+        /// 鎶ュ簾Set鏁伴噺
+        /// </summary>
+        public int QtyArrayScrapped { get; set; }
+
+        /// <summary>
+        /// 鎶ュ簾PNL鏁伴噺
+        /// </summary>
+        public int QtyPanelScrapped { get; set; }
+
+        /// <summary>
+        ///鎶芥Pcs鏁伴噺
+        ///濡傛棤榛樿涓�0
+        /// </summary>
+        public int QtySample { get; set; }
+
+
+        /// <summary>
+        /// 鎺ユ敹鏃ユ湡
+        /// 鏍煎紡锛歽yyy-MM-dd
+        /// </summary>
+        public string ReceiveDate { get; set; }
+
+
+        /// <summary>
+        /// 鍒涘缓浜轰唬鍙�
+        /// </summary>
+        public string CreatorCode { get; set; }
+
+
+        /// <summary>
+        /// 妫�楠屾棩鏈�
+        /// 鏍煎紡锛歽yyy-MM-dd
+        /// </summary>
+        public string TestDate { get; set; }
+
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public List<ERPIqcItem> IqcItem { get; set; }
+
+    }
+    public class ERPIqcItem
+    {
+        /// <summary>
+        /// 缂洪櫡浠g爜
+        /// </summary>
+        public string DefectCode { get; set; }
+
+        /// <summary>
+        /// 缁撴灉
+        /// </summary>
+        public string Result{ get; set; }
+
+        /// <summary>
+        /// 妫�楠屾棩鏈�
+        /// </summary>
+        public string TestDate { get; set; }
+
+        /// <summary>
+        /// PCS鏁伴噺
+        /// </summary>
+        public string QtyPcs { get; set; }
+
+        /// <summary>
+        /// Set鏁伴噺
+        /// </summary>
+        public string QtyArray { get; set; }
+
+        /// <summary>
+        /// PNL鏁伴噺
+        /// </summary>
+        public string QtyPanel { get; set; }
+
+        /// <summary>
+        /// 澶囨敞
+        /// </summary>
+        public string Node { get; set; }
+    }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPScrapSheetModel.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPScrapSheetModel.cs"
new file mode 100644
index 0000000..0c52432
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPScrapSheetModel.cs"
@@ -0,0 +1,101 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEA_External.Model
+{
+    /// <summary>
+    /// 鎴愬搧鎶ュ簾
+    /// </summary>
+    public class ERPScrapSheetModel
+    {
+        /// <summary>
+        /// 鎿嶄綔绫诲瀷
+        /// 1 鏂板 
+        /// </summary>
+        public int Way { get; set; }
+
+        /// <summary>
+        /// 涓诲仴鍊�
+        /// </summary>
+        public string UniqueTag { get; set; }
+
+        /// <summary>
+        /// 鎶ュ簾鍗曞彿
+        /// </summary>
+        public string Code { get; set; }
+
+        /// <summary>
+        /// 鎶ュ簾鐘舵��
+        /// Valid 宸叉牳鍑� 锛堥粯璁わ級TOChecked 寰呮牳鍑�
+        /// </summary>
+        public string Status { get; set; }
+
+        /// <summary>
+        /// 鍒涘缓鏃ユ湡
+        /// </summary>
+        public string Createtime { get; set; }
+
+        /// <summary>
+        /// 鍒涘缓浜�
+        /// </summary>
+        public string Createuser { get; set; }
+
+        /// <summary>
+        /// 浠撳簱
+        /// "HA72灏炬暟浠撱�� HA71鎴愬搧浠撱�丠A73鐮斿彂浠�"
+        /// </summary>
+        public string WarehouseCode { get; set; }
+
+        /// <summary>
+        /// 澶囨敞
+        /// </summary>
+        public string Remark { get; set; }
+
+        public List<ERPDataItem> DataItem { get; set; }
+    }
+    public class ERPDataItemSheet
+    {
+        /// <summary>
+        /// 鐢熶骇缂栫爜
+        /// </summary>
+        public string PartNum { get; set; }
+
+        /// <summary>
+        /// 鐗堟湰
+        /// </summary>
+        public string PartRev { get; set; }
+
+        /// <summary>
+        /// 澶囨敞
+        /// </summary>
+        public string Remark { get; set; }
+
+        /// <summary>
+        /// 鎵规鍙�
+        /// </summary>
+        public string Lotno { get; set; }
+
+        /// <summary>
+        /// 鎶ュ簾Set鏁�
+        /// </summary>
+        public int QtyOfArray { get; set; }
+
+        /// <summary>
+        /// 鎶ュ簾PCS鏁�
+        /// </summary>
+        public int QtyOfUnit { get; set; }
+
+        /// <summary>
+        /// 鎶ュ簾鍙夋澘SET鏁�
+        /// </summary>
+        public int QtyOfArray_Alloc { get; set; }
+
+        /// <summary>
+        /// 鎶ュ簾鍙夋澘PCS鏁�
+        /// </summary>
+        public int QtyOfUnit_Alloc { get; set; }
+    }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPStockCheckModel.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPStockCheckModel.cs"
new file mode 100644
index 0000000..feec85c
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_External/Model/ERPStockCheckModel.cs"
@@ -0,0 +1,128 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEA_External.Model
+{
+    /// <summary>
+    /// 鎴愬搧鐩樼偣
+    /// </summary>
+    public class ERPStockCheckModel
+    {
+        /// <summary>
+        /// 鎿嶄綔绫诲瀷
+        /// 1 鏂板 
+        /// </summary>
+        public int Way { get; set; }
+
+        /// <summary>
+        /// 涓诲仴鍊�
+        /// </summary>
+        public string UniqueTag { get; set; }
+
+        /// <summary>
+        /// 鍗曟嵁鍙�
+        /// </summary>
+        public string Code { get; set; }
+
+        /// <summary>
+        /// 鐩樼偣鍚嶇О
+        /// </summary>
+        public string Name { get; set; }
+
+        /// <summary>
+        /// 璐︽湡寮�濮嬫椂闂�
+        /// 2023-01-01 鏍煎紡
+        /// </summary>
+        public string FiscalPeriotime { get; set; }
+
+        /// <summary>
+        /// 鍒涘缓鏃ユ湡
+        /// </summary>
+        public string Createtime { get; set; }
+
+        /// <summary>
+        /// 鍒涘缓浜�
+        /// </summary>
+        public string Createuser { get; set; }
+
+        /// <summary>
+        /// 浠撳簱
+        /// "HA72灏炬暟浠撱�� HA71鎴愬搧浠撱�丠A73鐮斿彂浠�"
+        /// </summary>
+        public string WarehouseCode { get; set; }
+
+        /// <summary>
+        /// 澶囨敞
+        /// </summary>
+        public string Remark { get; set; }
+        /// <summary>
+        /// 
+        /// </summary>
+        public List<ERPDataItem> DataItem { get; set; }
+    }
+    public class ERPDataItem {
+        /// <summary>
+        /// 鍌ㄤ綅浠e彿
+        /// </summary>
+        public string Location { get; set; }
+
+        /// <summary>
+        /// 鐢熶骇缂栫爜
+        /// </summary>
+        public string PartNum { get; set; }
+
+        /// <summary>
+        /// 鐗堟湰
+        /// </summary>
+        public string PartRev { get; set; }
+
+        /// <summary>
+        /// 澶囨敞
+        /// </summary>
+        public string Remark { get; set; }
+
+        /// <summary>
+        /// 鎵规
+        /// </summary>
+        public string Lotno { get; set; }
+
+        /// <summary>
+        /// 鐩樼偣鍙夋澘鍗曞厓鏁�
+        /// 鍙夋澘pcs鏁�
+        /// </summary>
+        public int QtyOfUnit_Alloc { get; set; }
+
+        /// <summary>
+        /// 鐩樼偣浜よ揣鏉挎暟
+        /// 濂芥澘Set鏁�
+        /// </summary>
+        public int QtyOfArray { get; set; }
+
+        /// <summary>
+        /// 鐩樼偣鍗曞厓鏁�
+        /// 濂芥澘pcs鏁�
+        /// </summary>
+        public int QtyOfUnit { get; set; }
+
+        /// <summary>
+        /// 绯荤粺搴撳瓨鍗曞厓鏁�
+        /// 濂芥澘pcs鏁� 
+        /// </summary>
+        public int SysQtyOfUnit { get; set; }
+
+        /// <summary>
+        /// 绯荤粺搴撳瓨鏉挎暟
+        ///濂芥澘Set鏁�
+        /// </summary>
+        public int SysQtyOfArray { get; set; }
+
+        /// <summary>
+        /// 绯荤粺鍙夋澘搴撳瓨鍗曞厓鏁�
+        /// 鍙夋澘pcs鏁�
+        /// </summary>
+        public int SysQtyOfUnit_Alloc { get; set; }
+    }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
index 67606c7..fbdafca 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
@@ -248,7 +248,7 @@
         /// <param name="taskNum"></param>
         /// <param name="roadwayNos"></param>
         /// <returns></returns>
-        WebResponseContent AssignRoadway(int taskNum, List<string> roadwayNos);
+        WebResponseContent AssignRoadway(int taskNum, List<string> roadwayNos, int heightType);
 
         /// <summary>
         /// 
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesOutboundOrderService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesOutboundOrderService.cs"
index d1a47ae..2f7bfe9 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesOutboundOrderService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesOutboundOrderService.cs"
@@ -68,6 +68,7 @@
             }
             List<Dt_StockInfo> autoAssignStocks = _stockService.StockInfoService.GetOutboundStocks(stockInfos, mesOutboundOrder.MaterialCode, needQuantity, out float residueQuantity);
             mesOutboundOrder.LockQuantity += needQuantity - residueQuantity;
+            autoAssignStocks.OrderBy(x => x.Details.FirstOrDefault()?.StockQuantity).ToList();
             outStocks.AddRange(autoAssignStocks);
             float assignQuantity = needQuantity - residueQuantity;
 
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs"
index aca5552..6b87fac 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs"
@@ -4,6 +4,7 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using WIDESEA_Common.CommonEnum;
 using WIDESEA_Common.LocationEnum;
 using WIDESEA_Common.OrderEnum;
 using WIDESEA_Common.StockEnum;
@@ -192,7 +193,7 @@
         /// <param name="taskNum">浠诲姟鍙�</param>
         /// <param name="roadwayNos">宸烽亾鍙�</param>
         /// <returns></returns>
-        public WebResponseContent AssignRoadway(int taskNum, List<string> roadwayNos)
+        public WebResponseContent AssignRoadway(int taskNum, List<string> roadwayNos, int heightType)
         {
             try
             {
@@ -206,11 +207,29 @@
                 {
                     return WebResponseContent.Instance.OK(data: task.TargetAddress);
                 }
-
-                List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => (x.LocationType == task.PalletType || x.LocationType == LocationTypeEnum.Undefined.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && roadwayNos.Contains(x.RoadwayNo)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList();
-
-                string roadwayNo = locationCounts.OrderBy(x => x.Count).FirstOrDefault()?.RoadwayNo ?? "";
-
+                bool IsBCS = task.PalletType == PalletTypeEnum.SmallPallet.ObjToInt();
+                //鑾峰彇姣忎釜宸烽亾1-3灞傦紝4灞傦紝5灞傜殑璐т綅
+                List<LocationCount> locationCounts = new List<LocationCount>();
+                if (heightType == 1)
+                {
+                    locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => (x.LocationType == task.PalletType || (IsBCS ? false : x.LocationType == LocationTypeEnum.Undefined.ObjToInt())) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && (IsBCS ? !IsBCS : ("SC01_BC".Contains(x.RoadwayNo) ? x.Column % 2 == 0 : x.Column % 2 == 1)) && x.Layer <= 3 && roadwayNos.Contains(x.RoadwayNo)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList();
+                }
+                else if(heightType == 2)
+                {
+                    locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => (x.LocationType == task.PalletType || (IsBCS ? false : x.LocationType == LocationTypeEnum.Undefined.ObjToInt())) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && (IsBCS ? !IsBCS : ("SC01_BC".Contains(x.RoadwayNo) ? x.Column % 2 == 0 : x.Column % 2 == 1)) && x.Layer == 4 && roadwayNos.Contains(x.RoadwayNo)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList();
+                }
+                else if(heightType == 3)
+                {
+                    locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => (x.LocationType == task.PalletType || (IsBCS ? false : x.LocationType == LocationTypeEnum.Undefined.ObjToInt())) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && (IsBCS ? !IsBCS : ("SC01_BC".Contains(x.RoadwayNo) ? x.Column % 2 == 0 : x.Column % 2 == 1)) && x.Layer == 5 && roadwayNos.Contains(x.RoadwayNo)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList();
+                }
+                string roadwayNo=string.Empty;
+                foreach (var location in locationCounts.OrderBy(x => x.Count))
+                {
+                    if (location.Count == 1)
+                        continue;
+                    roadwayNo = location?.RoadwayNo ?? "";
+                    break;
+                }
                 return !string.IsNullOrEmpty(roadwayNo) ? WebResponseContent.Instance.OK(data: roadwayNo) : WebResponseContent.Instance.Error("鏈壘鍒板彲鍒嗛厤宸烽亾");
             }
             catch (Exception ex)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs"
index 2c3fbab..e74b420 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/MesTaskService.cs"
@@ -462,7 +462,7 @@
                     OutboundQuantity = 0,
                     SerialNumber = stockInfoDetail_Hty?.SerialNumber ?? "0",
                     StockQuantity = model.Quantity,
-                    Status = StockStatusEmun.MES閫�搴�.ObjToInt(),
+                    Status = model.Quantity <= 0.0 ? StockStatusEmun.MES绌烘墭閫�搴�.ObjToInt() : StockStatusEmun.MES閫�搴�.ObjToInt(),
                     Unit = model.Unit
                 };
                 Dt_StockInfo stockInfo = new Dt_StockInfo()
@@ -470,8 +470,9 @@
                     PalletCode = model.CarrierCode,
                     PalletType = palletTypeInfo.PalletType,
                     WarehouseId = warehouse.WarehouseId,
-                    StockStatus = StockStatusEmun.MES閫�搴�.ObjToInt(),
-                    Details = new List<Dt_StockInfoDetail> { stockInfoDetail }
+                    StockStatus = stockInfoDetail.StockQuantity<=0.0? StockStatusEmun.MES绌烘墭閫�搴�.ObjToInt():StockStatusEmun.MES閫�搴�.ObjToInt(),
+                    Details = new List<Dt_StockInfoDetail> { stockInfoDetail },
+                    Remark= stockInfoDetail.StockQuantity <= 0.0 ? StockStatusEmun.MES绌烘墭閫�搴�.ToString() : StockStatusEmun.MES閫�搴�.ToString()
                 };
                 //Dt_Task task = new Dt_Task()
                 //{
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
index 3cf8d6e..beea70e 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
@@ -180,7 +180,17 @@
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒拌鎵樼洏搴撳瓨鏄庣粏淇℃伅");
                 }
-
+                #region 绌烘墭閫�搴�
+                if (task.TaskType == TaskTypeEnum.MesPalletReturn.ObjToInt())
+                {
+                    _unitOfWorkManage.BeginTran();
+                    BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.浜哄伐瀹屾垚 : OperateTypeEnum.鑷姩瀹屾垚);
+                    _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
+                    _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(stockInfo.Details, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
+                    _unitOfWorkManage.CommitTran();
+                    return WebResponseContent.Instance.OK();
+                }
+                #endregion
                 Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
                 if (locationInfo == null)
                 {
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
index edeee12..b20f957 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
@@ -396,7 +396,7 @@
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒扮粍鐩樹俊鎭�");
                 }
-                if (stockInfo.StockStatus != StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鎵嬪姩缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鎷i�夊畬鎴�.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.閫�搴�.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.MES閫�搴�.ObjToInt())
+                if (stockInfo.StockStatus != StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鎵嬪姩缁勭洏鏆傚瓨.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.鎷i�夊畬鎴�.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.閫�搴�.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.MES閫�搴�.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.MES绌烘墭閫�搴�.ObjToInt())
                 {
                     return WebResponseContent.Instance.Error($"璇ユ墭鐩樼姸鎬佷笉姝g‘,涓嶅彲鐢宠鍏ュ簱");
                 }
@@ -429,6 +429,12 @@
                 {
                     newTask.TaskType = TaskTypeEnum.MesMatReturn.ObjToInt();
                 }
+                else if (stockInfo.StockStatus == StockStatusEmun.MES绌烘墭閫�搴�.ObjToInt())
+                {
+                    //todo 鏆傛椂鏈惎鐢�
+                    return WebResponseContent.Instance.Error($"绌烘墭鏈惎鐢�");
+                    //newTask.TaskType = TaskTypeEnum.MesPalletReturn.ObjToInt();
+                }
                 else
                 {
                     stockInfo.StockStatus = StockStatusEmun.鍏ュ簱纭.ObjToInt();
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
index ebba105..341b487 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Outbound.cs"
@@ -144,6 +144,14 @@
                 (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.OutboundOrderDetailService.AssignStockOutbound(outboundOrderDetail, stockSelectViews);
                 if (result.Item1 != null && result.Item1.Count > 0)
                 {
+                    Dt_OutboundOrder outboundOrder = _outboundService.OutboundOrderService.Repository.QueryFirst(x => x.Id == outboundOrderDetail.OrderId);
+                    TaskTypeEnum typeEnum = outboundOrder.OrderType switch
+                    {
+                        (int)OutOrderTypeEnum.Issue => TaskTypeEnum.Outbound,
+                        (int)OutOrderTypeEnum.Allocate => TaskTypeEnum.OutAllocate,
+                        (int)OutOrderTypeEnum.Quality => TaskTypeEnum.OutQuality,
+                        _ => new TaskTypeEnum()
+                    };
                     tasks = GetTasks(result.Item1, TaskTypeEnum.Outbound);
                     result.Item2.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
                     result.Item3.ForEach(x =>
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
index ed76f00..b4557ec 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
@@ -266,9 +266,9 @@
         /// <param name="roadwayNos"></param>
         /// <returns></returns>
         [HttpPost, Route("AssignRoadway"), AllowAnonymous]
-        public WebResponseContent AssignRoadway(int taskNum, [FromBody] List<string> roadwayNos)
+        public WebResponseContent AssignRoadway(int taskNum, [FromBody] List<string> roadwayNos,int heightType)
         {
-            return Service.AssignRoadway(taskNum, roadwayNos);
+            return Service.AssignRoadway(taskNum, roadwayNos, heightType);
         }
 
         /// <summary>

--
Gitblit v1.9.3