From d01658c63cd541fe4ea5cec5c4bd7f23b9408cdb Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期六, 18 十月 2025 15:04:56 +0800
Subject: [PATCH] 前端,pda,后端接口更改,新增,优化

---
 WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/TaskStatusEnum.cs                                    |   66 
 WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/HouseReturnOrder.cs                             |   63 
 WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs                              |    2 
 WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Base/TakeStockOrderDetailService.cs              |   26 
 WMS/WIDESEA_WMSServer/WIDESEA_DTO/Basic/MomRequestContent.cs                                  |   24 
 WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs                |   27 
 WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/Logger.cs                                        |   46 
 WMS/WIDESEA_WMSServer/WIDESEA_Common/MaterielEnum/MaterielTypeEnum.cs                         |   39 
 WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrderDetail.cs                   |   11 
 WMS/WIDESEA_WMSClient/src/extension/outbound/extend/AddOutboundOrder.vue                      |  467 ++
 WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundOrderService.cs                       |   18 
 WMS/WIDESEA_WMSClient/config/buttons.js                                                       |   22 
 WMS/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue                        |  206 
 吉安PDA/pages/stash/boxing.vue                                                                  |  232 
 WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/OrderEnum.cs                                         |   34 
 WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs                                       |   36 
 WMS/WIDESEA_WMSClient/src/extension/outbound/outboundOrderDetail.js                           |   41 
 WMS/WIDESEA_WMSClient/src/views/basic/materielInfo.vue                                        |  144 
 WMS/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue                                    |   56 
 WMS/WIDESEA_WMSClient/src/views/stock/stockView.vue                                           |  152 
 WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/TakeStockOrderDetailRepository.cs             |   21 
 WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrderDetail_Hty.cs               |   55 
 吉安PDA/common/config.js                                                                        |    4 
 WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/FeedbackInboundOrderERP.cs                              |   30 
 WMS/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js                                   |   85 
 WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderController.cs       |   38 
 WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IProductionService.cs                          |   14 
 WMS/WIDESEA_WMSServer/WIDESEA_IOutboundRepository/IProductionRepository.cs                    |   14 
 WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Base/ReturnOrderServive.cs                       |   21 
 WMS/WIDESEA_WMSClient/src/views/outbound/outboundOrderDetail.vue                              |  107 
 WMS/WIDESEA_WMSServer/WIDESEA_Common/MaterielEnum/MaterielSourceTypeEnum.cs                   |   30 
 WMS/WIDESEA_WMSClient/src/extension/inbound/returnOrder.js                                    |   58 
 WMS/WIDESEA_WMSClient/src/views/inbound/returnOrder.vue                                       |  268 +
 WMS/WIDESEA_WMSServer/WIDESEA_Common/HouseBackboundPassBack.cs                                |   75 
 WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IReturnOrderService.cs                          |   16 
 WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs                                |   10 
 WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReturnOrder.cs                          |  107 
 WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Base/TakeStockOrderService.cs                    |  317 +
 WMS/WIDESEA_WMSClient/src/extension/inbound/extend/inOrderDetail.vue                          |  409 ++
 WMS/WIDESEA_WMSClient/src/views/taskinfo/task_hty.vue                                         |    2 
 WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/ITakeStockOrderRepository.cs                 |   17 
 WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/TakeStockOrderRepository.cs                   |   21 
 WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs           |  111 
 WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs                                  | 1744 ++++++---
 WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder.cs                         |   12 
 WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfoDetail.cs                        |    8 
 WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/ITakeStockOrderDetailRepository.cs           |   17 
 WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/ConveyorLineJob_BC.cs                              |    1 
 WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/FeedbackOutorderERP.cs                                  |   45 
 WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WIDESEA_TaskInfoService.csproj                  |    6 
 WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/RGVJob_BC.cs                                       |    6 
 WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs                         |   11 
 WMS/WIDESEA_WMSServer/WIDESEA_DTO/Inbound/AddInboundOrderModel.cs                             |   76 
 WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/IReturnOrderRepository.cs                    |   14 
 WCS/WIDESEAWCS_Client/config/buttons.js                                                       |   10 
 WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs                        |   58 
 WMS/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js                                 |   11 
 WMS/WIDESEA_WMSClient/src/extension/stock/stockView.js                                        |  204 
 WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Base/OutboundOrderDetailService.cs              |    1 
 WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs                    |   11 
 WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_Production.cs                          |   29 
 WMS/WIDESEA_WMSClient/src/views/inbound/takeStockOrder.vue                                    |  293 +
 WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs                           |    2 
 WMS/WIDESEA_WMSServer/WIDESEA_SystemService/WIDESEA_SystemService.csproj                      |    1 
 WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Base/ProductionService.cs                       |   20 
 WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/ModelValidate.cs                                 |   44 
 WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs                   |   71 
 WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs         |   38 
 WCS/WIDESEAWCS_Client/src/api/http.js                                                         |    6 
 WMS/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue                                     |   28 
 WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_TakeStockOrder.cs                       |   56 
 WMS/WIDESEA_WMSClient/src/views/inbound/inboundOrderDetail.vue                                |    1 
 WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/TaskEnum.cs                                          |   17 
 WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_TakeStockOrderDetail.cs                 |   95 
 WCS/WIDESEAWCS_Client/src/extension/taskinfo/task.js                                          |   27 
 WMS/WIDESEA_WMSServer/WIDESEA_DTO/Outbound/OutboundOrderDetailAddDTO.cs                       |    4 
 WMS/WIDESEA_WMSServer/WIDESEA_StockService/Base/StockViewService.cs                           |  167 
 WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Base/OutboundOrderService.cs                    |  191 +
 WMS/WIDESEA_WMSServer/WIDESEA_OutboundRepository/ProductionRepository.cs                      |   18 
 WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderDetailController.cs |   13 
 WMS/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/OutboundOrderEnum.cs                           |   65 
 吉安PDA/pages/stash/raworderboxing.vue                                                          |  310 +
 WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs                          |  105 
 WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/InboundRepository.cs                          |    8 
 WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/IInboundRepository.cs                        |    3 
 WMS/WIDESEA_WMSServer/WIDESEA_InboundService/WIDESEA_InboundService.csproj                    |    8 
 WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ManageEnum.cs                                        |    1 
 WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_MaterielInfo.cs                           |    6 
 WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs           |    6 
 WMS/WIDESEA_WMSServer/WIDESEA_Common/HouseInbound.cs                                          |    8 
 WMS/WIDESEA_WMSClient/package.json                                                            |    1 
 WMS/WIDESEA_WMSClient/src/views/taskinfo/task.vue                                             |    2 
 WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/EntityProperties.cs                              |   22 
 WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs                                 |   18 
 WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/TakeStockOrderController.cs       |   54 
 WMS/WIDESEA_WMSClient/src/extension/inbound/takeStockOrder.js                                 |  104 
 WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/ITakeStockOrderService.cs                       |   37 
 WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/ReturnOrderController.cs          |   18 
 WMS/WIDESEA_WMSClient/src/extension/inbound/extend/AddInboundOrder.vue                        |  443 ++
 WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundOrderDetailService.cs                 |    2 
 WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs                          |    1 
 WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/ITakeStockOrderDetailService.cs                 |   18 
 WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/ReturnOrderRepository.cs                      |   18 
 WMS/WIDESEA_WMSServer/WIDESEA_Common/Houseounbound.cs                                         |    5 
 WMS/WIDESEA_WMSServer/WIDESEA_Core/CodeConfigEnum/RuleCodeEnum.cs                             |    3 
 WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrder.cs                       |   10 
 WMS/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue                                      |   80 
 WMS/WIDESEA_WMSServer/WIDESEA_DTO/Stock/StockViewDTO.cs                                       |  121 
 WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail.cs                 |   68 
 吉安PDA/pages/stash/TakeStock.vue                                                               |  685 +--
 WMS/WIDESEA_WMSClient/src/router/viewGird.js                                                  |    8 
 WMS/WIDESEA_WMSClient/src/views/stock/stockInfo.vue                                           |    8 
 WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder_Hty.cs                     |   62 
 WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/StockEnum.cs                                         |   12 
 WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs                  |  288 +
 WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Base/InboundOrderService.cs                      |  393 ++
 WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs                     |    1 
 WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ConfigEnum.cs                                        |   19 
 WMS/WIDESEA_WMSClient/src/extension/taskinfo/task.js                                          |   42 
 WMS/WIDESEA_WMSServer/WIDESEA_Core/AOP/SqlSugarAop.cs                                         |    9 
 WMS/WIDESEA_WMSServer/WIDESEA_DTO/Outbound/OutboundOrderAddDTO.cs                             |   10 
 WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/TakeStockOrderDetailController.cs |   22 
 122 files changed, 7,956 insertions(+), 2,046 deletions(-)

diff --git a/WCS/WIDESEAWCS_Client/config/buttons.js b/WCS/WIDESEAWCS_Client/config/buttons.js
index a34cc48..9c5b584 100644
--- a/WCS/WIDESEAWCS_Client/config/buttons.js
+++ b/WCS/WIDESEAWCS_Client/config/buttons.js
@@ -164,7 +164,15 @@
     onClick: function () {
     }
 },
-
+{
+    name: "RGV鍏ュ簱浠诲姟閲嶅彂",
+    icon: '',
+    class: '',
+    value: 'RGVTaskResending',
+    type: 'warning',
+    onClick: function () {
+    }
+},
 ]
 
 export default buttons
\ No newline at end of file
diff --git a/WCS/WIDESEAWCS_Client/src/api/http.js b/WCS/WIDESEAWCS_Client/src/api/http.js
index 85e3ebe..4d398af 100644
--- a/WCS/WIDESEAWCS_Client/src/api/http.js
+++ b/WCS/WIDESEAWCS_Client/src/api/http.js
@@ -13,16 +13,16 @@
 let loadingStatus = false;
 if (process.env.NODE_ENV == 'development') {
     // axios.defaults.baseURL = 'http://10.168.1.226:9291';
-    axios.defaults.baseURL = 'http://127.0.0.1:9291/';
+    axios.defaults.baseURL = 'http://127.0.0.1:9291';
 }
 else if (process.env.NODE_ENV == 'debug') {
     // axios.defaults.baseURL = 'http://10.168.1.226:9291';
-    axios.defaults.baseURL = 'http://127.0.0.1:8098/';
+    axios.defaults.baseURL = 'http://127.0.0.1:9291';
 }
 
 else if (process.env.NODE_ENV == 'production') {
     // axios.defaults.baseURL = 'http://10.168.1.226:9291';
-    axios.defaults.baseURL = 'http://10.30.4.92:9281/';
+    axios.defaults.baseURL = 'http://10.168.1.226:9291';
 }
 if (!axios.defaults.baseURL.endsWith('/')) {
     axios.defaults.baseURL+="/";
diff --git a/WCS/WIDESEAWCS_Client/src/extension/taskinfo/task.js b/WCS/WIDESEAWCS_Client/src/extension/taskinfo/task.js
index f5db920..b5d52af 100644
--- a/WCS/WIDESEAWCS_Client/src/extension/taskinfo/task.js
+++ b/WCS/WIDESEAWCS_Client/src/extension/taskinfo/task.js
@@ -122,6 +122,33 @@
                     });
                 }
             }
+
+            let RGVTaskResendingBtn = this.buttons.find(x => x.value == 'RGVTaskResending');
+            if (RGVTaskResendingBtn) {
+                RGVTaskResendingBtn.onClick = function () {
+                this.$confirm("鏄惁纭閲嶅彂RGV浠诲姟","鎵嬪姩浠诲姟閲嶅彂璀﹀憡",{
+                    confirmButtonText: "纭畾",
+                    cancelButtonText: "鍙栨秷",
+                    type: "warning",
+                    center: true,
+                    }).then(() => {
+                        let rows = this.$refs.table.getSelected();
+                        if (rows.length == 0) return this.$error("璇烽�夋嫨鏁版嵁!");
+                        if (rows.length > 1) return this.$error("璇烽�夋嫨涓�鏉℃暟鎹�!");
+                        var param = rows[0].taskNum;
+                        this.http
+                        .post("api/Task/RGVTaskResending?taskNum="+param, "鏁版嵁澶勭悊涓�...")
+                        .then((x) => {
+                            if (x.status) {
+                            this.$Message.success('浠诲姟閲嶅彂瀹屾垚');
+                            this.refresh();
+                        } else {
+                            return this.$error(x.message);
+                        }
+                        });
+                    });
+                }
+            }
         },
         onInited() {
             //妗嗘灦鍒濆鍖栭厤缃悗
diff --git a/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs b/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs
index 7fe6c29..edec45a 100644
--- a/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs
+++ b/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/TaskEnum/TaskTypeEnum.cs
@@ -20,7 +20,7 @@
         /// </summary>
         [Description("鐩樼偣鍑哄簱")]
         OutInventory = 110,
-
+            
         /// <summary>
         /// 鍒嗘嫞鍑哄簱
         /// </summary>
diff --git a/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs b/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs
index 1bfac75..7dbdafd 100644
--- a/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs
+++ b/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs
@@ -137,8 +137,8 @@
             }
         }
 
-        //鍫嗗灈鏈轰换鍔′紭鍏堟墽琛�
-        [HttpPost, HttpGet, Route("StackerCraneTaskPriority"), AllowAnonymous]
+        //RGV鍏ュ簱浠诲姟閲嶅彂
+        [HttpPost, HttpGet, Route("RGVTaskResending"), AllowAnonymous]
         public WebResponseContent StackerCraneTaskPriority(int taskNum)
         {
             try
@@ -148,15 +148,14 @@
                 {
                     return WebResponseContent.Instance.Error("鏈壘鍒拌浠诲姟淇℃伅");
                 }
-                if (task.TaskState == TaskStatusEnum.SC_Execute.ObjToInt())
+                if (task.TaskState == TaskStatusEnum.RGV_Executing.ObjToInt())
                 {
-                    task.Grade = 98;
+                    _taskService.UpdateTask(task, TaskStatusEnum.RGV_NEW);
                 }
                 else
                 {
-                    return WebResponseContent.Instance.Error("闈炲爢鍨涙満寰呮墽琛岀姸鎬�");
+                    return WebResponseContent.Instance.Error("闈濺GV鎵ц涓姸鎬�");
                 }
-                _taskRepository.UpdateData(task);
                 return WebResponseContent.Instance.OK();
             }
             catch (Exception ex)
diff --git "a/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs" "b/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs"
index 7c15d14..f85e773 100644
--- "a/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs"
+++ "b/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs"
@@ -136,6 +136,7 @@
                                                         {
                                                             _taskService.UpdateTask(task, TaskStatusEnum.RGV_NEW, sourceAddress: rout.StartPosi);
                                                             device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
+                                                            WriteDebug(device.DeviceName, $"鍏ュ簱杈撻�佺嚎ACK淇″彿{item.StationCode}宸插啓鍏�");
                                                         }
 
                                                     }
diff --git "a/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/RGVJob_BC.cs" "b/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/RGVJob_BC.cs"
index e48dd7e..7b640ff 100644
--- "a/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/RGVJob_BC.cs"
+++ "b/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/RGVJob_BC.cs"
@@ -87,7 +87,7 @@
                             Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == device.GetValue<R_ConveyorLineDB, int>(R_ConveyorLineDB.TaskNum) && x.TaskState == TaskStatusEnum.RGV_Executing.ObjToInt());
                             if (task != null)
                             {
-                                if (task.TaskType == TaskTypeEnum.Inbound.ObjToInt())//RGV鍏ュ簱浠诲姟瀹屾垚
+                                if (task.TaskType >= TaskTypeEnum.Inbound.ObjToInt())//RGV鍏ュ簱浠诲姟瀹屾垚
                                 {
                                     List<Dt_Router> routers = _routerService.QueryNextRoutes(task.NextAddress, task.Roadway, task.TaskType);
                                     Dt_Router? router = routers.FirstOrDefault();
@@ -116,8 +116,9 @@
                                 device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode);
                                 device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode);
                                 _taskService.UpdateTask(task, TaskStatusEnum.RGV_Executing);
+                                WriteDebug(device.DeviceName, $"鍏ュ簱RGV浠诲姟鍙穥task.TaskNum}宸插啓鍏�");
                             }
-                            Dt_Task task1 = _taskRepository.QueryFirst(x => x.TaskType >= TaskTypeEnum.Outbound.ObjToInt() && x.TaskState == TaskStatusEnum.RGV_Execute.ObjToInt());
+                            Dt_Task task1 = _taskRepository.QueryFirst(x => x.TaskType >= TaskTypeEnum.Outbound.ObjToInt()&&  x.TaskType <= TaskTypeEnum.Inbound.ObjToInt() && x.TaskState == TaskStatusEnum.RGV_Execute.ObjToInt());
                             if (task1 != null)
                             {
                                 //鍐欏叆RGV浠诲姟
@@ -128,6 +129,7 @@
                                 device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode);
 
                                 _taskService.UpdateTask(task1, TaskStatusEnum.RGV_Executing);
+                                WriteDebug(device.DeviceName, $"鍑哄簱RGV浠诲姟鍙穥task1.TaskNum}宸插啓鍏�");
                             }
                         }
 
diff --git a/WMS/WIDESEA_WMSClient/config/buttons.js b/WMS/WIDESEA_WMSClient/config/buttons.js
index 3a1f49b..7f0fc94 100644
--- a/WMS/WIDESEA_WMSClient/config/buttons.js
+++ b/WMS/WIDESEA_WMSClient/config/buttons.js
@@ -93,14 +93,6 @@
     }
 },
 {
-    name: "鎵� 鍔� 瀹� 鎴�",
-    icon: '',
-    class: '',
-    value: 'TaskHandCompleted',
-    onClick: function () {
-    }
-},
-{
     name: "鎴� 鍝�(绌烘墭) 鍑� 搴�",
     icon: 'el-icon-plus',
     value: 'HandOutbound',
@@ -145,10 +137,11 @@
     }
 },
 {
-    name: "鎵� 鍔� 瀹� 鎴�",
+    name: "浠� 鍔� 鎵� 鍔� 瀹� 鎴�",
     icon: '',
     class: '',
-    value: 'TaskHandCancel',
+    type: 'success',
+    value: 'TaskHandCompleted',
     onClick: function () {
     }
 },
@@ -206,6 +199,15 @@
     onClick: function () {
     }
 },
+{
+    name: "閫夊畾搴撳瓨鐩樼偣",
+    icon: '',
+    class: '',
+    value: 'SelectStockTake',
+    type: 'success',
+    onClick: function () {
+    }
+},
 
 ]
 
diff --git a/WMS/WIDESEA_WMSClient/package.json b/WMS/WIDESEA_WMSClient/package.json
index 42cd9e5..5bccc09 100644
--- a/WMS/WIDESEA_WMSClient/package.json
+++ b/WMS/WIDESEA_WMSClient/package.json
@@ -20,6 +20,7 @@
     "vue": "^3.2.37",
     "vue-draggable-next": "^2.0.1",
     "vue-router": "^4.0.0-0",
+    "vue-virtual-scroller": "next",
     "vuex": "^4.0.0-0"
   },
   "devDependencies": {
diff --git a/WMS/WIDESEA_WMSClient/src/extension/inbound/extend/AddInboundOrder.vue b/WMS/WIDESEA_WMSClient/src/extension/inbound/extend/AddInboundOrder.vue
new file mode 100644
index 0000000..797862b
--- /dev/null
+++ b/WMS/WIDESEA_WMSClient/src/extension/inbound/extend/AddInboundOrder.vue
@@ -0,0 +1,443 @@
+<template>
+  <div>
+    <!-- 寮圭獥缁勪欢锛歷-model缁戝畾showDetialBox锛岀‘淇濆弻鍚戠粦瀹氭甯� -->
+    <vol-box
+      v-model="showDetialBox"
+      :lazy="false"  
+      width="1300px"
+      height="700px"
+      :padding="20"
+      title="娣诲姞鎴愬搧瓒呮湡鎶ュ簾鏄庣粏"
+    >
+      <div style="max-height: 700px; overflow-y: auto;">
+        <el-form ref="form" :model="form" label-width="130px">
+          <!-- 浠撳簱閫夋嫨锛氫繚鐣欏師鐢焩-for锛屽吋瀹规�ф洿楂� -->
+          <el-form-item required label="鎵�灞炰粨搴擄細">
+            <el-select
+              v-model="form.warehouseId"
+              filterable
+              placeholder="璇烽�夋嫨浠撳簱"
+              @change="handleWarehouseChange"
+              style="width: 100%;"
+            >
+              <el-option
+                v-for="item in warehouses"
+                :key="item.key"  
+                :label="item.value"
+                :value="item.key"
+              >
+                <span style="float: left">{{ item.value }}</span>
+                <span style="float: right; color: #8492a6; font-size: 13px">{{ item.key }}</span>
+              </el-option>
+            </el-select>
+          </el-form-item>
+
+          <!-- 鍗曟嵁缂栧彿锛堝彧璇伙級 -->
+          <el-form-item required label="鍗曟嵁缂栧彿锛�">
+            <el-input
+              v-model="form.orderNo"
+              placeholder="绯荤粺灏嗚嚜鍔ㄧ敓鎴�"
+              readonly
+              style="width: 100%;"
+            ></el-input>
+          </el-form-item>
+
+          <el-form-item label="鎶ュ簾鏄庣粏锛�">
+            <div 
+              v-for="(detail, index) in detailList" 
+              :key="`detail-${index}-${detail.materielCode || ''}`" 
+              class="detail-item"
+            >
+              <div class="detail-header">
+                <span>鏄庣粏 {{ index + 1 }}</span>
+                <el-button
+                  type="text"
+                  size="mini"
+                  color="#f56c6c"
+                  @click="removeDetail(index)"
+                  :disabled="detailList.length <= 1"
+                >
+                  鍒犻櫎
+                </el-button>
+              </div>
+
+              <el-row :gutter="20" class="detail-row">
+                <!-- 浜у搧缂栫爜锛氭敼鍥炲師鐢焩-for锛岄伩鍏嶈櫄鎷熷垪琛ㄤ緷璧栭棶棰� -->
+                <el-col :span="6">
+                  <el-form-item required label="浜у搧缂栫爜锛�">
+                    <el-select
+                      v-model="detail.materielCode"
+                      filterable
+                      placeholder="浜у搧缂栫爜"
+                      @change="handleProCodeChange(detail, index)"
+                      clearable
+                      style="width: 100%;"
+                    >
+                      <el-option
+                        v-for="(code, idx) in proCodeOptions"
+                        :key="`code-${idx}-${code}`" 
+                        :label="code"
+                        :value="code"
+                      ></el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+
+                <!-- 鐗堟湰锛氬師鐢焩-for锛岀‘淇濈ǔ瀹� -->
+                <el-col :span="6">
+                  <el-form-item required label="鐗╂枡鍚嶇О锛�">
+                    <el-select
+                      v-model="detail.materielName"
+                      filterable
+                      placeholder="鐗╂枡鍚嶇О"
+                      clearable
+                      style="width: 100%;"
+                    >
+                      <el-option
+                        v-for="(item, idx) in detail.versionOptions"
+                        :key="`version-${idx}-${item}`"
+                        :label="item"
+                        :value="item"
+                      ></el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+
+                <el-col :span="5">
+                  <el-form-item required label="渚涘簲鍟嗘壒娆″彿锛�">
+                    <el-input
+                      v-model="detail.supplierBatch"
+                      placeholder="璇疯緭鍏ユ壒娆″彿"
+                      style="width: 100%;"
+                      clearable
+                      @blur="formatLotNo(detail,'supplierBatch')"
+                    ></el-input>
+                  </el-form-item>
+                </el-col>
+
+                <!-- PCS鏁伴噺锛氫繚鐣欐牸寮忔牎楠� -->
+                <el-col :span="4">
+                  <el-form-item required label="鍗曟嵁鏁伴噺锛�">
+                    <el-input
+                      v-model="detail.orderQuantity"
+                      placeholder="鍗曟嵁鏁伴噺"
+                      style="width: 100%;"
+                      @blur="formatNumber(detail, 'orderQuantity')"
+                    ></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+
+              <!-- 澶囨敞锛氫繚鐣欏師鏍� -->
+              <el-row :gutter="20" class="detail-row">
+                <el-col :span="24">
+                  <el-form-item label="澶囨敞锛�">
+                    <el-input
+                      v-model="detail.remark"
+                      placeholder="璇疯緭鍏ュ娉ㄤ俊鎭�"
+                      type="textarea"
+                      rows="2"
+                      style="width: 100%;"
+                    ></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+            </div>
+
+            <!-- 娣诲姞鏄庣粏鎸夐挳锛氫繚鐣欑鐢ㄩ�昏緫 -->
+            <el-button
+              type="dashed"
+              size="small"
+              class="add-detail-btn"
+              @click="addDetail"
+              :disabled="detailList.length >= 10"
+              style="width: 100%; margin-top: 15px;"
+            >
+              <i class="el-icon-plus"></i> 娣诲姞鏄庣粏
+            </el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+
+      <!-- 搴曢儴鎸夐挳锛氱‘淇濈偣鍑讳簨浠舵甯� -->
+      <template #footer>
+        <el-button type="primary" size="mini" @click="submitForm" style="padding: 8px 20px;">纭鎻愪氦</el-button>
+        <el-button type="danger" size="mini" @click="close" style="padding: 8px 20px; margin-left: 10px;">鍏抽棴</el-button>
+      </template>
+    </vol-box>
+  </div>
+</template>
+
+<script>
+// 浠呭紩鍏ュ繀瑕佺粍浠讹細VolBox锛堝脊绐楁牳蹇冿級锛岀Щ闄よ櫄鎷熷垪琛ㄩ伩鍏嶄緷璧栧啿绐�
+import VolBox from "@/components/basic/VolBox.vue";
+
+export default {
+  // 鏄庣‘娉ㄥ唽缁勪欢锛氫粎娉ㄥ唽鐢ㄥ埌鐨勭粍浠讹紝閬垮厤鍐椾綑
+  components: { VolBox },
+  data() {
+    return {
+      showDetialBox: false,  // 寮圭獥鎺у埗寮�鍏筹細鍒濆false锛堥殣钘忥級
+      // 浠撳簱鏋氫妇锛氭湰鍦版ā鎷燂紙鑻ヤ粠鐖剁粍浠朵紶鍏ワ紝鍙敼鐢╬rops锛屾澶勪繚鐣欐湰鍦伴伩鍏嶄緷璧栵級
+      warehouses: [
+        { key: "0", value: "鏉挎潗浠�" },
+        { key: "3", value: "鑽按浠�" },
+      ],
+      proCodeOptions: [],  // 浜у搧缂栫爜鍒楄〃锛氫粠鎺ュ彛鍔犺浇
+      form: {
+        warehouseId: "",    // 閫変腑鐨勪粨搴揑D
+        orderNo: ""  // 鍗曟嵁缂栧彿锛堝彧璇伙級
+      },
+      // 鏄庣粏鍒楄〃锛氬垵濮�1鏉$┖鏄庣粏
+      detailList: [this.createEmptyDetail()]
+    };
+  },
+  methods: {
+    // 鎵撳紑寮圭獥锛氭牳蹇冩柟娉曪紝纭繚鍚屾鎵ц
+    open() {
+      this.initForm();        // 鍒濆鍖栬〃鍗曪紙娓呯┖鏃ф暟鎹級
+      this.showDetialBox = true;  // 鍚屾璁剧疆涓簍rue锛岃Е鍙戝脊绐楁樉绀�
+      console.log("寮圭獥宸茶Е鍙戞樉绀猴紝showDetialBox:", this.showDetialBox);  // 璋冭瘯鏃ュ織锛氬彲鍦ㄦ帶鍒跺彴纭
+    },
+
+    // 鍒濆鍖栬〃鍗曪細绠�鍖栭�昏緫锛岀‘淇濇棤寮傛闃诲
+    initForm() {
+      // 閲嶇疆琛ㄥ崟鏁版嵁
+      this.form = {
+        warehouseId: "",
+        orderNo: ""
+      };
+      this.proCodeOptions = [];  // 娓呯┖浜у搧缂栫爜
+      this.detailList = [this.createEmptyDetail()];  // 閲嶇疆鏄庣粏
+
+      // 浠撳簱鍞竴鏃堕粯璁ら�変腑锛堝悓姝ラ�昏緫锛屼笉闃诲寮圭獥锛�
+      if (this.warehouses.length === 1) {
+        this.form.warehouseId = this.warehouses[0].key;
+        this.handleWarehouseChange(this.warehouses[0].key);
+      }
+    },
+
+    // 鍒涘缓绌烘槑缁嗭細缁撴瀯娓呮櫚锛岄伩鍏嶅啑浣欏瓧娈�
+    createEmptyDetail() {
+      return {
+        materielCode: "",      // 浜у搧缂栫爜
+        materielName: "",   // 鐗堟湰
+        supplierBatch: "",     // 鎵规鍙凤紙鎵嬪姩杈撳叆锛�
+        orderQuantity: "",       // PCS鏁伴噺
+        remark: "",            // 澶囨敞
+        versionOptions: []     // 鐗堟湰涓嬫媺鍒楄〃
+      };
+    },
+
+    // 浠撳簱鍙樻洿锛氬姞杞戒骇鍝佺紪鐮侊紙淇濈暀鍘熼�昏緫锛岀‘淇濇帴鍙f甯革級
+    handleWarehouseChange(warehouseId) {
+      if (!warehouseId) {
+        this.proCodeOptions = [];  // 浠撳簱涓虹┖鏃舵竻绌轰骇鍝佺紪鐮�
+        return;
+      }
+      // 璋冪敤鎺ュ彛鍔犺浇浜у搧缂栫爜锛堣嫢鎺ュ彛鍦板潃鏈夊彉鍔紝闇�鍚屾淇敼锛�
+      this.http
+        .post(`api/InboundOrder/GetMaterielCode?warehouseId=${warehouseId}`, null, "鍔犺浇浜у搧鏁版嵁涓�")
+        .then((res) => {
+          if (res.status) {
+            this.proCodeOptions = [...new Set(res.data)];  // 鍘婚噸鍚庤祴鍊�
+          } else {
+            this.$message.error(res.message);  // 鎺ュ彛澶辫触鎻愮ず
+          }
+        })
+        .catch(err => {
+          console.error("鍔犺浇浜у搧缂栫爜澶辫触锛�", err);  // 鎹曡幏閿欒锛岄伩鍏嶉樆濉�
+          this.$message.error("鍔犺浇浜у搧缂栫爜澶辫触锛岃閲嶈瘯");
+        });
+    },
+
+    // 浜у搧缂栫爜鍙樻洿锛氬姞杞界増鏈紙淇濈暀鍘熼�昏緫锛�
+    handleProCodeChange(detail, index) {
+      // 娓呯┖鍏宠仈鏁版嵁锛堝悓姝ラ�昏緫锛�
+      detail.versionOptions = [];
+      detail.materielName = "";
+      detail.supplierBatch = "";
+
+      if (!detail.materielCode) return;  // 鏃犱骇鍝佺紪鐮佹椂杩斿洖
+
+      // 鍔犺浇鐗堟湰鍒楄〃锛堟帴鍙h皟鐢細鑻ュ湴鍧�鍙樺姩闇�淇敼锛�
+      this.http
+        .post(
+          `api/InboundOrder/GetMaterielName?materielCode=${detail.materielCode}&warehouseId=${this.form.warehouseId}`,
+          null,
+          "鍔犺浇鐗堟湰鏁版嵁涓�"
+        )
+        .then((res) => {
+          if (res.status) {
+            detail.versionOptions = [...new Set(res.data)];  // 鍘婚噸璧嬪��
+          }
+        })
+        .catch(err => {
+          console.error("鍔犺浇鐗堟湰澶辫触锛�", err);
+          this.$message.error("鍔犺浇鐗堟湰澶辫触锛岃閲嶈瘯");
+        });
+    },
+
+    // 鏁伴噺鏍煎紡鍖栵細淇濈暀鍘熼�昏緫锛岀‘淇濊緭鍏ュ悎娉�
+    formatNumber(detail, field) {
+      if (!detail[field]) return;
+      // 浠呬繚鐣欐暟瀛楀拰灏忔暟鐐癸紝涓斿皬鏁扮偣鍚庢渶澶�2浣�
+      let value = detail[field].replace(/[^0-9.]/g, '');
+      const decimalIndex = value.indexOf('.');
+      if (decimalIndex !== -1) {
+        value = value.substring(0, decimalIndex + 1) + value.substring(decimalIndex + 1).replace(/\./g, '');
+      }
+      const parts = value.split('.');
+      if (parts.length > 1 && parts[1].length > 2) {
+        parts[1] = parts[1].substring(0, 2);
+        value = parts.join('.');
+      }
+      detail[field] = value;
+      // 鑻ヨ緭鍏ヤ负绌烘垨0锛屾彁绀洪敊璇�
+      if (value && (parseFloat(value) <= 0 || isNaN(parseFloat(value)))) {
+        this.$message.warning("鍗曟嵁鏁伴噺蹇呴』涓烘鏁�");
+      }
+    },
+
+    // 鎵规鍙锋牸寮忓寲锛氫繚鐣欏師閫昏緫
+    formatLotNo(detail) {
+      if (!detail.scrapProLotNo) return;
+      // 鍘婚櫎绌烘牸锛屼粎淇濈暀瀛楁瘝銆佹暟瀛椼�佹í鏉犲拰涓嬪垝绾�
+      const formatted = detail.scrapProLotNo.replace(/\s+/g, '').replace(/[^a-zA-Z0-9_\-]/g, '');
+      detail.scrapProLotNo = formatted;
+      // 鏍煎紡涓嶅悎娉曟椂鎻愮ず
+      if (formatted !== detail.scrapProLotNo) {
+        this.$message.warning("鎵规鍙蜂粎鏀寔瀛楁瘝銆佹暟瀛椼�佹í鏉犲拰涓嬪垝绾匡紝宸茶嚜鍔ㄨ繃婊ゆ棤鏁堝瓧绗�");
+      }
+    },
+
+    // 娣诲姞鏄庣粏锛氱畝鍗昿ush锛岀‘淇濇棤閫昏緫鍐茬獊
+    addDetail() {
+      this.detailList.push(this.createEmptyDetail());
+    },
+
+    // 鍒犻櫎鏄庣粏锛歴plice鍒犻櫎锛岀‘淇濈储寮曟纭�
+    removeDetail(index) {
+      if (this.detailList.length <= 1) return;  // 鑷冲皯淇濈暀1鏉�
+      this.detailList.splice(index, 1);
+    },
+
+    // 鎻愪氦琛ㄥ崟锛氫繚鐣欏師楠岃瘉閫昏緫
+    submitForm() {
+      let isValid = true;
+      let errorMessage = '';
+
+      // 楠岃瘉浠撳簱
+      if (!this.form.warehouseId) {
+        isValid = false;
+        errorMessage = '璇烽�夋嫨鎵�灞炰粨搴�';
+      }
+
+      // 楠岃瘉鏄庣粏
+      if (isValid) {
+        const invalidDetail = this.detailList.find(item => 
+          !item.materielCode ||
+          !item.materielName ||
+          !item.supplierBatch.trim() || 
+          !item.orderQuantity || 
+          isNaN(parseFloat(item.orderQuantity)) || 
+          parseFloat(item.orderQuantity) <= 0
+        );
+        if (invalidDetail) {
+          isValid = false;
+          errorMessage = '鎻愪氦鏁版嵁瀛樺湪绌哄�兼垨杈撳叆鏁伴噺涓嶅悎娉曪紝璇锋鏌ユ壒娆″彿鏄惁濉啓瀹屾暣锛�';
+        }
+      }
+
+      if (!isValid) {
+        this.$message.error(errorMessage);
+        return;
+      }
+
+      // 鏋勯�犳彁浜ゆ暟鎹�
+      const submitData = {
+        warehouseId: this.form.warehouseId,
+        details: this.detailList.map(item => ({
+          materielCode: item.materielCode,
+          materielName: item.materielName,
+          supplierBatch: item.supplierBatch.trim(),
+          orderQuantity: parseFloat(item.orderQuantity),
+          remark: item.remark
+        }))
+      };
+
+      // 鎻愪氦鎺ュ彛
+      this.http
+        .post("api/InboundOrder/Save", submitData, "鎻愪氦涓�")
+        .then((res) => {
+          if (!res.status) return this.$message.error(res.message);
+          this.$message.success("鎿嶄綔鎴愬姛");
+          this.close();  // 鎻愪氦鎴愬姛鍚庡叧闂脊绐�
+          this.$emit("parentCall", ($vue) => $vue.refresh());  // 閫氱煡鐖剁粍浠跺埛鏂�
+        })
+        .catch(err => {
+          console.error("鎻愪氦澶辫触锛�", err);
+          this.$message.error("鎻愪氦澶辫触锛岃閲嶈瘯");
+        });
+    },
+
+    // 鍏抽棴寮圭獥锛氬悓姝ヨ缃负false锛岀‘淇濆脊绐楅殣钘�
+    close() {
+      this.showDetialBox = false;
+      this.proCodeOptions = [];  // 娓呯┖鏁版嵁锛岄伩鍏嶄笅娆℃墦寮�娈嬬暀
+    }
+  },
+};
+</script>
+
+<style scoped>
+.detail-item {
+  border: 1px solid #e4e7ed;
+  border-radius: 6px;
+  padding: 15px;
+  margin-bottom: 20px;
+  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
+}
+
+.detail-header {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 15px;
+  padding-bottom: 10px;
+  border-bottom: 1px dashed #e4e7ed;
+  font-weight: 500;
+}
+
+.detail-row {
+  margin-bottom: 15px;
+}
+
+.add-detail-btn {
+  height: 40px;
+  line-height: 38px;
+}
+
+::-webkit-scrollbar {
+  width: 8px;
+  height: 8px;
+}
+::-webkit-scrollbar-thumb {
+  background-color: #ddd;
+  border-radius: 4px;
+}
+::-webkit-scrollbar-track {
+  background-color: #f5f5f5;
+}
+
+.el-select {
+  width: 100% !important;
+  min-width: 150px !important;
+  padding-right:10px;
+}
+.el-input {
+  width: 100% !important;
+  min-width: 150px !important;
+  padding-right:10px;
+}
+</style>
\ No newline at end of file
diff --git a/WMS/WIDESEA_WMSClient/src/extension/inbound/extend/inOrderDetail.vue b/WMS/WIDESEA_WMSClient/src/extension/inbound/extend/inOrderDetail.vue
new file mode 100644
index 0000000..9fb6e40
--- /dev/null
+++ b/WMS/WIDESEA_WMSClient/src/extension/inbound/extend/inOrderDetail.vue
@@ -0,0 +1,409 @@
+<template>
+  <div>
+    <vol-box
+      v-model="showDetialBox"
+      :lazy="true"
+      width="75%"
+      :padding="15"
+      title="鍗曟嵁鏄庣粏淇℃伅"
+    >
+      <div class="box-head">
+        <el-alert :closable="false" style="width: 100%">
+          <el-row style="height:15px">
+            <el-col :span="4">
+              <span>宸查�変腑 {{ selection.length }} 椤�</span>
+            </el-col>
+            <el-col :span="2">
+                <el-link
+                  type="primary"
+                  size="small"
+                  style="float: left;  margin-left: 800px ;width: 200px"
+                  @click="cancelOutFeedbackERP"
+                >
+                  鍏ュ簱鏄庣粏鍙栨秷鎺ㄩ�丒RP
+                </el-link
+                >
+            </el-col>
+          </el-row>
+        </el-alert>
+      </div>
+      <div class="box-table" style="margin-top: 1%">
+        <el-table
+          ref="singleTable"
+          :data="tableData"
+          :summary-method="getSummaries"
+          show-summary
+          style="width: 100%; height: 100%"
+          highlight-current-row
+          @current-change="handleCurrentChange"
+          height="500px"
+          @row-click="handleRowClick"
+          @selection-change="handleSelectionChange"
+        >
+          <el-table-column type="selection" width="55"> </el-table-column>
+          <el-table-column
+            label="搴忓彿"
+            type="index"
+            fixed="left"
+            width="55"
+            align="center"
+          ></el-table-column>
+          <el-table-column
+            v-for="(item, index) in tableColumns.filter((x) => !x.hidden)"
+            :key="index"
+            :prop="item.prop"
+            :label="item.title"
+            :width="item.width"
+            align="center"
+          >
+            <template #default="scoped">
+              <div v-if="item.type == 'icon'">
+                <el-tooltip
+                  class="item"
+                  effect="dark"
+                  :content="item.title"
+                  placement="bottom"
+                  ><el-link
+                    type="primary"
+                    :disabled="getButtonEnable(item.prop, scoped.row)"
+                    @click="tableButtonClick(scoped.row, item)"
+                    ><i :class="item.icon" style="font-size: 22px"></i></el-link
+                ></el-tooltip>
+              </div>
+
+              <div v-else-if="item.type == 'tag'">
+                <el-tag size="small">
+                  {{ getDictionary(scoped.row, item) }}
+                </el-tag>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </vol-box>
+    <stock-select ref="child" @parentCall="parentCall"></stock-select>
+    <selected-stock
+      ref="selectedStock"
+      @parentCall="parentCall"
+    ></selected-stock>
+  </div>
+</template>
+<script>
+import VolBox from "@/components/basic/VolBox.vue";
+import VolForm from "@/components/basic/VolForm.vue";
+export default {
+  components: { VolBox, VolForm },
+  data() {
+    return {
+      row: null,
+      showDetialBox: false,
+      flag: false,
+      currentRow: null,
+      selection: [],
+      tableData: [],
+      tableColumns: [
+        {
+          prop: "id",
+          title: "Id",
+          type: "int",
+          width: 90,
+          hidden: true,
+        },
+        {
+          prop: "orderId",
+          title: "鍏ュ簱鍗曚富閿�",
+          type: "string",
+          width: 90,
+          hidden: true,
+        },
+        {
+          prop: "materielCode",
+          title: "鐗╂枡缂栧彿",
+          type: "string",
+          width: 150,
+        },
+        {
+          prop: "materielName",
+          title: "鐗╂枡鍚嶇О",
+          type: "string",
+          width: 150,
+        },
+        {
+          prop: "supplierBatch",
+          title: "渚涘簲鍟嗘壒娆″彿",
+          type: "string",
+          width: 150,
+        },
+        {
+          prop: "batchNo",
+          title: "鍐呴儴鎵规鍙�",
+          type: "string",
+          width: 130,
+        },
+        {
+          prop: "orderQuantity",
+          title: "鍗曟嵁鏁伴噺",
+          type: "decimal",
+          width: 90,
+        },
+        {
+          prop: "receiptQuantity",
+          title: "缁勭洏鏁伴噺",
+          type: "int",
+          width: 120,
+        },
+        {
+          prop: "overInQuantity",
+          title: "涓婃灦鏁伴噺",
+          type: "string",
+          width: 200,
+        },
+        {
+          prop: "orderDetailStatus",
+          title: "璁㈠崟鏄庣粏鐘舵��",
+          type: "tag",
+          width: 180,
+          bindKey: "orderDetailStatusEnum",
+        },
+        {
+          prop: "creater",
+          title: "鍒涘缓浜�",
+          type: "string",
+          width: 90,
+        },
+        {
+          prop: "createDate",
+          title: "鍒涘缓鏃堕棿",
+          type: "datetime",
+          width: 160,
+        },
+        {
+          prop: "modifier",
+          title: "淇敼浜�",
+          type: "string",
+          width: 100,
+        },
+        {
+          prop: "modifyDate",
+          title: "淇敼鏃堕棿",
+          type: "datetime",
+          width: 160,
+        },
+        {
+          prop: "remark",
+          title: "澶囨敞",
+          type: "string",
+        },
+      ],
+      paginations: {
+        sort: "id",
+        order: "desc",
+        Foots: "",
+        total: 0,
+        // 2020.08.29澧炲姞鑷畾涔夊垎椤垫潯澶у皬
+        sizes: [60, 100, 120],
+        size: 60, // 榛樿鍒嗛〉澶у皬
+        Wheres: [],
+        page: 1,
+        rows: 60,
+      },
+      searchFormOptions: [
+        [
+          {
+            title: "鍗曟嵁缂栧彿",
+            field: "allocation_code",
+            type: "like",
+          },
+          {
+            title: "鍗曟嵁绫诲瀷",
+            field: "allocation_type",
+            type: "select",
+            dataKey: "OrderType",
+            data: [],
+          },
+          {
+            title: "鍗曟嵁鐘舵��",
+            field: "allocation_state",
+            type: "select",
+            dataKey: "OrderState",
+            data: [],
+          },
+        ],
+      ],
+      searchFormFields: {
+        allocation_code: "",
+        allocation_type: "",
+        allocation_state: "",
+      },
+      dictionaryList: null,
+    };
+  },
+  methods: {
+    open(row) {
+      this.row = row;
+      this.showDetialBox = true;
+      this.getDictionaryData();
+      this.getData();
+    },
+    getSummaries(param) {
+  const { columns, data } = param
+  const sums = []
+  
+  columns.forEach((column, index) => {
+    if (index === 0) {
+      sums[index] = '鍚堣'
+      return
+    }
+    
+    // 浠呭鎸囧畾鏁板�煎垪姹傚拰骞朵繚鐣欎袱浣嶅皬鏁�
+    if (['receiptQuantity', 'overInQuantity', 'orderQuantity'].includes(column.property)) {
+      const values = data.map(item => Number(item[column.property]))
+      
+      if (!values.every(value => isNaN(value))) {
+        // 璁$畻鎬诲拰
+        const total = values.reduce((prev, curr) => {
+          return prev + (isNaN(curr) ? 0 : curr)
+        }, 0)
+        
+        // 淇濈暀涓や綅灏忔暟锛堣繑鍥炲瓧绗︿覆绫诲瀷锛�
+        // 濡傛灉闇�瑕佹暟鍊肩被鍨嬪彲浠ュ啀鐢� parseFloat() 杞崲
+        sums[index] = total.toFixed(2)
+      } else {
+        sums[index] = '-'
+      }
+    } else {
+      // 闈炴寚瀹氬垪鍙互鐣欑┖鎴栨樉绀哄叾浠栧唴瀹�
+      sums[index] = ''
+    }
+  })
+
+  return sums
+
+    },
+    getData() {
+      var wheres = [{ name: "orderId", value: this.row.id }];
+      var param = {
+        page: this.paginations.page,
+        rows: this.paginations.rows,
+        sort: this.paginations.sort,
+        order: this.paginations.order,
+        wheres: JSON.stringify(wheres), // 鏌ヨ鏉′欢锛屾牸寮忎负[{ name: "瀛楁", value: "xx" }]
+      };
+      this.http
+        .post("api/InboundOrderDetail/GetPageData", param, "鏌ヨ涓�")
+        .then((x) => {
+          this.tableData = x.rows;
+        });
+    },
+    cancelOutFeedbackERP() {
+      if (this.selection.length === 0) {
+        return this.$message.error("璇烽�夋嫨鍗曟嵁鏄庣粏");
+      }
+      var keys = this.selection.map((item) => item.id); // 鑾峰彇閫変腑琛岀殑id
+      this.$confirm("鏄惁鍙栨秷璇ュ叆搴撳崟鏄庣粏","鍗曟嵁鍙栨秷璀﹀憡",{
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning",
+        center: true,
+        }).then(() => {
+          this.http
+          .post("api/InboundOrder/FeedbackInboundCanceERP", keys, "鏁版嵁澶勭悊涓�")
+          .then((x) => {
+            if (!x.status) return this.$message.error(x.message);
+            this.$message.success("鎿嶄綔鎴愬姛");
+            this.showDetialBox = false;
+            this.$emit("parentCall", ($vue) => {
+              $vue.getData();
+            });
+          });
+        });
+    },
+
+    setCurrent(row) {
+      this.$refs.singleTable.setCurrentRow(row);
+    },
+    handleCurrentChange(val) {
+      this.currentRow = val;
+    },
+    parentCall(fun) {
+      if (typeof fun != "function") {
+        return console.log("鎵╁睍缁勪欢闇�瑕佷紶鍏ヤ竴涓洖璋冩柟娉曟墠鑳借幏鍙栫埗绾ue瀵硅薄");
+      }
+      fun(this);
+    },
+    handleRowClick(row) {
+      this.$refs.singleTable.toggleRowSelection(row);
+    },
+    handleSelectionChange(val) {
+      this.selection = val;
+    },
+    getDictionaryData() {
+      if (this.dictionaryList) {
+        return;
+      }
+      var param = [];
+      this.tableColumns.forEach((x) => {
+        if (x.type == "tag" && x.bindKey != "") {
+          param.push(x.bindKey);
+        }
+      });
+      this.http
+        .post("api/Sys_Dictionary/GetVueDictionary", param, "鏌ヨ涓�")
+        .then((x) => {
+          if (x.length > 0) {
+            this.dictionaryList = x;
+          }
+        });
+    },
+    getDictionary(row, column) {
+      if (this.dictionaryList) {
+        var item = this.dictionaryList.find((x) => x.dicNo == column.bindKey);
+        if (item) {
+          var dicItem = item.data.find((x) => x.key == row[column.prop]);
+          console.log(dicItem);
+          if (dicItem) {
+            return dicItem.value;
+          } else {
+            return row[column.prop];
+          }
+        } else {
+          return row[column.prop];
+        }
+      }
+    },
+  },
+};
+</script>
+<style scoped>
+.text-button {
+  border: 0px;
+}
+</style>
+
+<style>
+.text-button:hover {
+  background-color: #f0f9eb !important;
+}
+
+.el-table .warning-row {
+  background: oldlace;
+}
+
+.box-table .el-table tbody tr:hover > td {
+  background-color: #d8e0d4 !important;
+  /* color: #ffffff; */
+}
+
+.box-table .el-table tbody tr.current-row > td {
+  background-color: #f0f9eb !important;
+  /* color: #ffffff; */
+}
+
+.el-table .success-row {
+  background: #f0f9eb;
+}
+
+.box-table .el-table {
+  border: 1px solid #ebeef5;
+}
+</style>
diff --git a/WMS/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js b/WMS/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js
index 0c319b9..9c84a6a 100644
--- a/WMS/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js
+++ b/WMS/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js
@@ -1,22 +1,73 @@
 
-//姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
-
+import gridHeader from './extend/AddInboundOrder.vue'
+import gridBody from './extend/inOrderDetail.vue'
 let extension = {
-    components: {
-      //鏌ヨ鐣岄潰鎵╁睍缁勪欢
-      gridHeader: '',
-      gridBody: '',
-      gridFooter: '',
-      //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
-      modelHeader: '',
-      modelBody: '',
-      modelFooter: ''
-    },
-    tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
-    buttons: { view: [], box: [], detail: [] }, //鎵╁睍鐨勬寜閽�
-    methods: {
-       //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
-      onInit() {  
+  components: {
+    //鏌ヨ鐣岄潰鎵╁睍缁勪欢
+    gridHeader: gridHeader,
+    gridBody: gridBody,
+    gridFooter: '',
+    //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
+    modelHeader: '',
+    modelBody: '',
+    modelFooter: ''
+  },
+  tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
+  buttons: { view: [], box: [], detail: [] }, //鎵╁睍鐨勬寜閽�
+  methods: {
+    //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
+    onInit() {
+
+      this.columns.push({
+          field: '鎿嶄綔',
+          title: '鎿嶄綔',
+          width: 90,
+          fixed: 'right',
+          align: 'center',
+          formatter: (row) => {
+              return (
+                  '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">鏌ョ湅鏄庣粏</i>'
+              );
+          },
+          click: (row) => {
+              this.$refs.gridBody.open(row);
+          }
+      });
+      
+      let addBtn = this.buttons.find(x => x.value == 'Add');
+      if (addBtn) {
+        addBtn.onClick = function () {
+          this.$refs.gridHeader.open();
+        }
+      };
+      let FeedbackInboundCanceERP = this.buttons.find(x => x.value == 'FeedbackInboundCanceERP');
+      if (FeedbackInboundCanceERP) {
+        FeedbackInboundCanceERP.onClick = function () {
+          this.$confirm("鏄惁纭鍙栨秷鍗曟嵁","鍗曟嵁鍙栨秷璀﹀憡",{
+              confirmButtonText: "纭畾",
+              cancelButtonText: "鍙栨秷",
+              type: "warning",
+              center: true,
+              }).then(() => {
+                let rows = this.$refs.table.getSelected();
+                if (rows.length == 0) return this.$error("璇烽�夋嫨鏁版嵁!");
+                if (rows.length > 1) return this.$error("璇烽�夋嫨涓�鏉℃暟鎹�!");
+                var param = rows[0].orderNo;
+                this.http
+                  .post("api/InboundOrder/FeedbackInboundCanceERP?orderNo="+param, "鏁版嵁澶勭悊涓�...")
+                  .then((x) => {
+                    if (x.status) {
+                      this.$Message.success('鍏ュ簱鍗曟嵁鍙栨秷鎴愬姛');
+                      this.refresh();
+                    } else {
+                      return this.$error(x.message);
+                    }
+                  });
+              });
+        }
+      }
+
+      
       },
       onInited() {
         //妗嗘灦鍒濆鍖栭厤缃悗
diff --git a/WMS/WIDESEA_WMSClient/src/extension/inbound/returnOrder.js b/WMS/WIDESEA_WMSClient/src/extension/inbound/returnOrder.js
new file mode 100644
index 0000000..24e1d94
--- /dev/null
+++ b/WMS/WIDESEA_WMSClient/src/extension/inbound/returnOrder.js
@@ -0,0 +1,58 @@
+
+//姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
+
+let extension = {
+    components: {
+      //鏌ヨ鐣岄潰鎵╁睍缁勪欢
+      gridHeader: '',
+      gridBody: '',
+      gridFooter: '',
+      //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
+      modelHeader: '',
+      modelBody: '',
+      modelFooter: ''
+    },
+    tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
+    buttons: { view: [], box: [], detail: [] }, //鎵╁睍鐨勬寜閽�
+    methods: {
+       //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
+      onInit() {  
+      },
+      onInited() {
+        //妗嗘灦鍒濆鍖栭厤缃悗
+        //濡傛灉瑕侀厤缃槑缁嗚〃,鍦ㄦ鏂规硶鎿嶄綔
+        //this.detailOptions.columns.forEach(column=>{ });
+      },
+      searchBefore(param) {
+        //鐣岄潰鏌ヨ鍓�,鍙互缁檖aram.wheres娣诲姞鏌ヨ鍙傛暟
+        //杩斿洖false锛屽垯涓嶄細鎵ц鏌ヨ
+        return true;
+      },
+      searchAfter(result) {
+        //鏌ヨ鍚庯紝result杩斿洖鐨勬煡璇㈡暟鎹�,鍙互鍦ㄦ樉绀哄埌琛ㄦ牸鍓嶅鐞嗚〃鏍肩殑鍊�
+        return true;
+      },
+      addBefore(formData) {
+        //鏂板缓淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛紝鍙互缁欑粰琛ㄥ崟璁剧疆鍊硷紝鑷繁杈撳嚭鐪媐ormData鐨勫��
+        return true;
+      },
+      updateBefore(formData) {
+        //缂栬緫淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛ㄣ�佸垹闄よ鐨処d
+        return true;
+      },
+      rowClick({ row, column, event }) {
+        //鏌ヨ鐣岄潰鐐瑰嚮琛屼簨浠�
+        this.$refs.table.$refs.table.toggleRowSelection(row); //鍗曞嚮琛屾椂閫変腑褰撳墠琛�;
+      },
+      modelOpenAfter(row) {
+        //鐐瑰嚮缂栬緫銆佹柊寤烘寜閽脊鍑烘鍚庯紝鍙互鍦ㄦ澶勫啓閫昏緫锛屽锛屼粠鍚庡彴鑾峰彇鏁版嵁
+        //(1)鍒ゆ柇鏄紪杈戣繕鏄柊寤烘搷浣滐細 this.currentAction=='Add';
+        //(2)缁欏脊鍑烘璁剧疆榛樿鍊�
+        //(3)this.editFormFields.瀛楁='xxx';
+        //濡傛灉闇�瑕佺粰涓嬫媺妗嗚缃粯璁ゅ�硷紝璇烽亶鍘唗his.editFormOptions鎵惧埌瀛楁閰嶇疆瀵瑰簲data灞炴�х殑key鍊�
+        //鐪嬩笉鎳傚氨鎶婅緭鍑虹湅锛歝onsole.log(this.editFormOptions)
+      }
+    }
+  };
+  export default extension;
+  
\ No newline at end of file
diff --git a/WMS/WIDESEA_WMSClient/src/extension/inbound/takeStockOrder.js b/WMS/WIDESEA_WMSClient/src/extension/inbound/takeStockOrder.js
new file mode 100644
index 0000000..a29e28c
--- /dev/null
+++ b/WMS/WIDESEA_WMSClient/src/extension/inbound/takeStockOrder.js
@@ -0,0 +1,104 @@
+
+//姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
+
+let extension = {
+    components: {
+      //鏌ヨ鐣岄潰鎵╁睍缁勪欢
+      gridHeader: '',
+      gridBody: '',
+      gridFooter: '',
+      //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
+      modelHeader: '',
+      modelBody: '',
+      modelFooter: ''
+    },
+    tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
+    buttons: { view: [], box: [], detail: [] }, //鎵╁睍鐨勬寜閽�
+    methods: {
+       //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
+      onInit() {  
+        this.columns.push({
+          title: '鎿嶄綔',
+          field: '鎿嶄綔',
+          width: 120,
+          align: 'center',
+          render: (h, { row, column, index }) => {
+              if ( row.takeStockStatus == 2 ) {
+                return (
+                  <div>
+                    <el-button
+                      onClick={($e) => {
+                        this.$confirm("纭鍏抽棴鐩樼偣鍗�" + row.orderNo + "鍚�?", "璀﹀憡", {
+                          confirmButtonText: "纭畾",
+                          cancelButtonText: "鍙栨秷",
+                          type: "warning",
+                          center: true,
+                        }).then(() => {
+                          this.http
+                            .post("api/TakeStockOrder/DisEnableTakeOrder?id=" + row.id, null, "鏁版嵁澶勭悊涓�")
+                            .then((x) => {
+                              if (!x.status) return this.$message.error(x.message);
+                              this.$message.success("鐩樼偣鍏抽棴鎴愬姛!");
+                              this.refresh();
+                            });
+                        });
+                      }}
+                      type="warning"
+                      plain
+                      size="small"
+                      style="height:26px; padding: 10px !important;"
+                    >
+                      鍏抽棴鐩樼偣
+                    </el-button>
+                  </div>
+                )
+              }
+            }
+            
+        });
+        this.columns.forEach(x=>{
+          //璁剧疆title鍒楀浐瀹�
+          if (x.field=='鎿嶄綔') {
+            x.fixed = 'right';
+              // x.align="center"//璁剧疆鏂囨湰灞呬腑
+          }
+      })
+      },
+      onInited() {
+        //妗嗘灦鍒濆鍖栭厤缃悗
+        //濡傛灉瑕侀厤缃槑缁嗚〃,鍦ㄦ鏂规硶鎿嶄綔
+        //this.detailOptions.columns.forEach(column=>{ });
+      },
+      searchBefore(param) {
+        //鐣岄潰鏌ヨ鍓�,鍙互缁檖aram.wheres娣诲姞鏌ヨ鍙傛暟
+        //杩斿洖false锛屽垯涓嶄細鎵ц鏌ヨ
+        return true;
+      },
+      searchAfter(result) {
+        //鏌ヨ鍚庯紝result杩斿洖鐨勬煡璇㈡暟鎹�,鍙互鍦ㄦ樉绀哄埌琛ㄦ牸鍓嶅鐞嗚〃鏍肩殑鍊�
+        return true;
+      },
+      addBefore(formData) {
+        //鏂板缓淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛紝鍙互缁欑粰琛ㄥ崟璁剧疆鍊硷紝鑷繁杈撳嚭鐪媐ormData鐨勫��
+        return true;
+      },
+      updateBefore(formData) {
+        //缂栬緫淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛ㄣ�佸垹闄よ鐨処d
+        return true;
+      },
+      rowClick({ row, column, event }) {
+        //鏌ヨ鐣岄潰鐐瑰嚮琛屼簨浠�
+        this.$refs.table.$refs.table.toggleRowSelection(row); //鍗曞嚮琛屾椂閫変腑褰撳墠琛�;
+      },
+      modelOpenAfter(row) {
+        //鐐瑰嚮缂栬緫銆佹柊寤烘寜閽脊鍑烘鍚庯紝鍙互鍦ㄦ澶勫啓閫昏緫锛屽锛屼粠鍚庡彴鑾峰彇鏁版嵁
+        //(1)鍒ゆ柇鏄紪杈戣繕鏄柊寤烘搷浣滐細 this.currentAction=='Add';
+        //(2)缁欏脊鍑烘璁剧疆榛樿鍊�
+        //(3)this.editFormFields.瀛楁='xxx';
+        //濡傛灉闇�瑕佺粰涓嬫媺妗嗚缃粯璁ゅ�硷紝璇烽亶鍘唗his.editFormOptions鎵惧埌瀛楁閰嶇疆瀵瑰簲data灞炴�х殑key鍊�
+        //鐪嬩笉鎳傚氨鎶婅緭鍑虹湅锛歝onsole.log(this.editFormOptions)
+      }
+    }
+  };
+  export default extension;
+  
\ No newline at end of file
diff --git a/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/AddOutboundOrder.vue b/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/AddOutboundOrder.vue
new file mode 100644
index 0000000..7b38566
--- /dev/null
+++ b/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/AddOutboundOrder.vue
@@ -0,0 +1,467 @@
+<template>
+  <div>
+    <!-- 寮圭獥缁勪欢锛歷-model缁戝畾showDetialBox锛岀‘淇濆弻鍚戠粦瀹氭甯� -->
+    <vol-box
+      v-model="showDetialBox"
+      :lazy="false"  
+      width="1300px"
+      height="700px"
+      :padding="20"
+      title="娣诲姞鎴愬搧瓒呮湡鎶ュ簾鏄庣粏"
+    >
+      <div style="max-height: 700px; overflow-y: auto;">
+        <el-form ref="form" :model="form" label-width="130px">
+          <!-- 浠撳簱閫夋嫨锛氫繚鐣欏師鐢焩-for锛屽吋瀹规�ф洿楂� -->
+          <el-form-item required label="鎵�灞炰粨搴擄細">
+            <el-select
+              v-model="form.warehouseId"
+              filterable
+              placeholder="璇烽�夋嫨浠撳簱"
+              @change="handleWarehouseChange"
+              style="width: 100%;"
+            >
+              <el-option
+                v-for="item in warehouses"
+                :key="item.key"  
+                :label="item.value"
+                :value="item.key"
+              >
+                <span style="float: left">{{ item.value }}</span>
+                <span style="float: right; color: #8492a6; font-size: 13px">{{ item.key }}</span>
+              </el-option>
+            </el-select>
+          </el-form-item>
+
+          <!-- 鍗曟嵁缂栧彿锛堝彧璇伙級 -->
+          <el-form-item required label="鍗曟嵁缂栧彿锛�">
+            <el-input
+              v-model="form.orderNo"
+              placeholder="绯荤粺灏嗚嚜鍔ㄧ敓鎴�"
+              readonly
+              style="width: 100%;"
+            ></el-input>
+          </el-form-item>
+
+          <el-form-item label="鎶ュ簾鏄庣粏锛�">
+            <div
+              v-for="(detail, index) in detailList" 
+              :key="`detail-${index}-${detail.materielCode || ''}`" 
+              class="detail-item"
+            >
+              <div class="detail-header">
+                <span>鏄庣粏 {{ index + 1 }}</span>
+                <el-button
+                  type="text"
+                  size="mini"
+                  color="#f56c6c"
+                  @click="removeDetail(index)"
+                  :disabled="detailList.length <= 1"
+                >
+                  鍒犻櫎
+                </el-button>
+              </div>
+
+              <el-row :gutter="20" class="detail-row">
+                <!-- 浜у搧缂栫爜锛氭敼鍥炲師鐢焩-for锛岄伩鍏嶈櫄鎷熷垪琛ㄤ緷璧栭棶棰� -->
+                <el-col :span="6">
+                  <el-form-item required label="浜у搧缂栫爜锛�">
+                    <el-select
+                      v-model="detail.materielCode"
+                      filterable
+                      placeholder="浜у搧缂栫爜"
+                      @change="handleProCodeChange(detail, index)"
+                      clearable
+                      style="width: 100%;"
+                    >
+                      <el-option
+                        v-for="(code, idx) in proCodeOptions"
+                        :key="`code-${idx}-${code}`" 
+                        :label="code"
+                        :value="code"
+                      ></el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+
+                <!-- 鐗堟湰锛氬師鐢焩-for锛岀‘淇濈ǔ瀹� -->
+                <el-col :span="6">
+                  <el-form-item required label="鐗╂枡鍚嶇О锛�">
+                    <el-select
+                      v-model="detail.materielName"
+                      filterable
+                      placeholder="鐗╂枡鍚嶇О"
+                      clearable
+                      style="width: 100%;"
+                    >
+                      <el-option
+                        v-for="(item, idx) in detail.versionOptions"
+                        :key="`version-${idx}-${item}`"
+                        :label="item"
+                        :value="item"
+                      ></el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+
+                <el-col :span="5">
+                  <el-form-item required label="鍐呴儴鎵规鍙凤細">
+                    <el-select
+                      v-model="detail.batchNo"
+                      filterable
+                      placeholder="鎵规鍙�"
+                      clearable
+                      style="width: 100%;"
+                    >
+                      <el-option
+                        v-for="(item, idx) in detail.batchNoOptions"
+                        :key="`batchNo-${idx}-${item}`"
+                        :label="item"
+                        :value="item"
+                      ></el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+
+                <!-- PCS鏁伴噺锛氫繚鐣欐牸寮忔牎楠� -->
+                <el-col :span="4">
+                  <el-form-item required label="鍗曟嵁鏁伴噺锛�">
+                    <el-input
+                      v-model="detail.orderQuantity"
+                      placeholder="鍗曟嵁鏁伴噺"
+                      style="width: 100%;"
+                      @blur="formatNumber(detail, 'orderQuantity')"
+                    ></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+
+              <!-- 澶囨敞锛氫繚鐣欏師鏍� -->
+              <el-row :gutter="20" class="detail-row">
+                <el-col :span="24">
+                  <el-form-item label="澶囨敞锛�">
+                    <el-input
+                      v-model="detail.remark"
+                      placeholder="璇疯緭鍏ュ娉ㄤ俊鎭�"
+                      type="textarea"
+                      rows="2"
+                      style="width: 100%;"
+                    ></el-input>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+            </div>
+
+            <!-- 娣诲姞鏄庣粏鎸夐挳锛氫繚鐣欑鐢ㄩ�昏緫 -->
+            <el-button
+              type="dashed"
+              size="small"
+              class="add-detail-btn"
+              @click="addDetail"
+              :disabled="detailList.length >= 10"
+              style="width: 100%; margin-top: 15px;"
+            >
+              <i class="el-icon-plus"></i> 娣诲姞鏄庣粏
+            </el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+
+      <!-- 搴曢儴鎸夐挳锛氱‘淇濈偣鍑讳簨浠舵甯� -->
+      <template #footer>
+        <el-button type="primary" size="mini" @click="submitForm" style="padding: 8px 20px;">纭鎻愪氦</el-button>
+        <el-button type="danger" size="mini" @click="close" style="padding: 8px 20px; margin-left: 10px;">鍏抽棴</el-button>
+      </template>
+    </vol-box>
+  </div>
+</template>
+
+<script>
+// 浠呭紩鍏ュ繀瑕佺粍浠讹細VolBox锛堝脊绐楁牳蹇冿級锛岀Щ闄よ櫄鎷熷垪琛ㄩ伩鍏嶄緷璧栧啿绐�
+import VolBox from "@/components/basic/VolBox.vue";
+
+export default {
+  // 鏄庣‘娉ㄥ唽缁勪欢锛氫粎娉ㄥ唽鐢ㄥ埌鐨勭粍浠讹紝閬垮厤鍐椾綑
+  components: { VolBox },
+  data() {
+    return {
+      showDetialBox: false,  // 寮圭獥鎺у埗寮�鍏筹細鍒濆false锛堥殣钘忥級
+      // 浠撳簱鏋氫妇锛氭湰鍦版ā鎷燂紙鑻ヤ粠鐖剁粍浠朵紶鍏ワ紝鍙敼鐢╬rops锛屾澶勪繚鐣欐湰鍦伴伩鍏嶄緷璧栵級
+      warehouses: [
+        { key: "1", value: "鏉挎潗浠�" },
+        { key: "2", value: "鑽按浠�" },
+      ],
+      proCodeOptions: [],  // 浜у搧缂栫爜鍒楄〃锛氫粠鎺ュ彛鍔犺浇
+      form: {
+        warehouseId: "",    // 閫変腑鐨勪粨搴揑D
+        orderNo: ""  // 鍗曟嵁缂栧彿锛堝彧璇伙級
+      },
+      // 鏄庣粏鍒楄〃锛氬垵濮�1鏉$┖鏄庣粏
+      detailList: [this.createEmptyDetail()]
+    };
+  },
+  methods: {
+    // 鎵撳紑寮圭獥锛氭牳蹇冩柟娉曪紝纭繚鍚屾鎵ц
+    open() {
+      this.initForm();        // 鍒濆鍖栬〃鍗曪紙娓呯┖鏃ф暟鎹級
+      this.showDetialBox = true;  // 鍚屾璁剧疆涓簍rue锛岃Е鍙戝脊绐楁樉绀�
+      console.log("寮圭獥宸茶Е鍙戞樉绀猴紝showDetialBox:", this.showDetialBox);  // 璋冭瘯鏃ュ織锛氬彲鍦ㄦ帶鍒跺彴纭
+    },
+
+    // 鍒濆鍖栬〃鍗曪細绠�鍖栭�昏緫锛岀‘淇濇棤寮傛闃诲
+    initForm() {
+      // 閲嶇疆琛ㄥ崟鏁版嵁
+      this.form = {
+        warehouseId: "",
+        orderNo: ""
+      };
+      this.proCodeOptions = [];  // 娓呯┖浜у搧缂栫爜
+      this.detailList = [this.createEmptyDetail()];  // 閲嶇疆鏄庣粏
+
+      // 浠撳簱鍞竴鏃堕粯璁ら�変腑锛堝悓姝ラ�昏緫锛屼笉闃诲寮圭獥锛�
+      if (this.warehouses.length === 1) {
+        this.form.warehouseId = this.warehouses[0].key;
+        this.handleWarehouseChange(this.warehouses[0].key);
+      }
+    },
+
+    // 鍒涘缓绌烘槑缁嗭細缁撴瀯娓呮櫚锛岄伩鍏嶅啑浣欏瓧娈�
+    createEmptyDetail() {
+      return {
+        materielCode: "",      // 浜у搧缂栫爜
+        materielName: "",   // 鐗堟湰
+        supplierBatch: "",     // 鎵规鍙凤紙鎵嬪姩杈撳叆锛�
+        orderQuantity: "",       // PCS鏁伴噺
+        remark: "",            // 澶囨敞
+        versionOptions: []     // 鐗堟湰涓嬫媺鍒楄〃
+      };
+    },
+
+    // 浠撳簱鍙樻洿锛氬姞杞戒骇鍝佺紪鐮侊紙淇濈暀鍘熼�昏緫锛岀‘淇濇帴鍙f甯革級
+    handleWarehouseChange(warehouseId) {
+      if (!warehouseId) {
+        this.proCodeOptions = [];  // 浠撳簱涓虹┖鏃舵竻绌轰骇鍝佺紪鐮�
+        return;
+      }
+      // 璋冪敤鎺ュ彛鍔犺浇浜у搧缂栫爜锛堣嫢鎺ュ彛鍦板潃鏈夊彉鍔紝闇�鍚屾淇敼锛�
+      this.http
+        .post(`api/OutboundOrder/GetCodeByWarehouse?warehouseId=${warehouseId}`, null, "鍔犺浇浜у搧鏁版嵁涓�")
+        .then((res) => {
+          if (res.status) {
+            this.proCodeOptions = [...new Set(res.data)];  // 鍘婚噸鍚庤祴鍊�
+          } else {
+            this.$message.error(res.message);  // 鎺ュ彛澶辫触鎻愮ず
+          }
+        })
+        .catch(err => {
+          console.error("鍔犺浇浜у搧缂栫爜澶辫触锛�", err);  // 鎹曡幏閿欒锛岄伩鍏嶉樆濉�
+          this.$message.error("鍔犺浇浜у搧缂栫爜澶辫触锛岃閲嶈瘯");
+        });
+    },
+
+    // 浜у搧缂栫爜鍙樻洿锛氬姞杞界増鏈紙淇濈暀鍘熼�昏緫锛�
+    handleProCodeChange(detail, index) {
+      // 娓呯┖鍏宠仈鏁版嵁锛堝悓姝ラ�昏緫锛�
+      detail.versionOptions = [];
+      detail.batchNoOptions = [];
+      detail.materielName = "";
+      detail.batchNo = "";
+
+      if (!detail.materielCode) return;  // 鏃犱骇鍝佺紪鐮佹椂杩斿洖
+
+      // 鍔犺浇鐗堟湰鍒楄〃锛堟帴鍙h皟鐢細鑻ュ湴鍧�鍙樺姩闇�淇敼锛�
+      this.http
+        .post(
+          `api/OutboundOrder/GetVersionByCode?materielCode=${detail.materielCode}&warehouseId=${this.form.warehouseId}`,
+          null,
+          "鍔犺浇鐗╂枡鍚嶇О鏁版嵁涓�"
+        )
+        .then((res) => {
+          if (res.status) {
+            detail.versionOptions = [...new Set(res.data)];  // 鍘婚噸璧嬪��
+          }
+        })
+        .catch(err => {
+          console.error("鍔犺浇鐗╂枡鍚嶇О澶辫触锛�", err);
+          this.$message.error("鍔犺浇鐗╂枡鍚嶇О澶辫触锛岃閲嶈瘯");
+        });
+
+        this.http
+        .post(
+          `api/OutboundOrder/GetLotNoByCode?materielCode=${detail.materielCode}&warehouseId=${this.form.warehouseId}`,
+          null,
+          "鍔犺浇鎵规鍙锋暟鎹腑"
+        )
+        .then((res) => {
+          if (res.status) {
+            detail.batchNoOptions = [...new Set(res.data)];  // 鍘婚噸璧嬪��
+          }
+        })
+        .catch(err => {
+          console.error("鍔犺浇鎵规鍙峰け璐ワ細", err);
+          this.$message.error("鍔犺浇鎵规鍙峰け璐ワ紝璇烽噸璇�");
+        });
+    },
+
+    // 鏁伴噺鏍煎紡鍖栵細淇濈暀鍘熼�昏緫锛岀‘淇濊緭鍏ュ悎娉�
+    formatNumber(detail, field) {
+      if (!detail[field]) return;
+      // 浠呬繚鐣欐暟瀛楀拰灏忔暟鐐癸紝涓斿皬鏁扮偣鍚庢渶澶�2浣�
+      let value = detail[field].replace(/[^0-9.]/g, '');
+      const decimalIndex = value.indexOf('.');
+      if (decimalIndex !== -1) {
+        value = value.substring(0, decimalIndex + 1) + value.substring(decimalIndex + 1).replace(/\./g, '');
+      }
+      const parts = value.split('.');
+      if (parts.length > 1 && parts[1].length > 2) {
+        parts[1] = parts[1].substring(0, 2);
+        value = parts.join('.');
+      }
+      detail[field] = value;
+      // 鑻ヨ緭鍏ヤ负绌烘垨0锛屾彁绀洪敊璇�
+      if (value && (parseFloat(value) <= 0 || isNaN(parseFloat(value)))) {
+        this.$message.warning("鍗曟嵁鏁伴噺蹇呴』涓烘鏁�");
+      }
+    },
+
+    // 鎵规鍙锋牸寮忓寲锛氫繚鐣欏師閫昏緫
+    formatLotNo(detail) {
+      if (!detail.scrapProLotNo) return;
+      // 鍘婚櫎绌烘牸锛屼粎淇濈暀瀛楁瘝銆佹暟瀛椼�佹í鏉犲拰涓嬪垝绾�
+      const formatted = detail.scrapProLotNo.replace(/\s+/g, '').replace(/[^a-zA-Z0-9_\-]/g, '');
+      detail.scrapProLotNo = formatted;
+      // 鏍煎紡涓嶅悎娉曟椂鎻愮ず
+      if (formatted !== detail.scrapProLotNo) {
+        this.$message.warning("鎵规鍙蜂粎鏀寔瀛楁瘝銆佹暟瀛椼�佹í鏉犲拰涓嬪垝绾匡紝宸茶嚜鍔ㄨ繃婊ゆ棤鏁堝瓧绗�");
+      }
+    },
+
+    // 娣诲姞鏄庣粏锛氱畝鍗昿ush锛岀‘淇濇棤閫昏緫鍐茬獊
+    addDetail() {
+      this.detailList.push(this.createEmptyDetail());
+    },
+
+    // 鍒犻櫎鏄庣粏锛歴plice鍒犻櫎锛岀‘淇濈储寮曟纭�
+    removeDetail(index) {
+      if (this.detailList.length <= 1) return;  // 鑷冲皯淇濈暀1鏉�
+      this.detailList.splice(index, 1);
+    },
+
+    // 鎻愪氦琛ㄥ崟锛氫繚鐣欏師楠岃瘉閫昏緫
+    submitForm() {
+      let isValid = true;
+      let errorMessage = '';
+
+      // 楠岃瘉浠撳簱
+      if (!this.form.warehouseId) {
+        isValid = false;
+        errorMessage = '璇烽�夋嫨鎵�灞炰粨搴�';
+      }
+
+      // 楠岃瘉鏄庣粏
+      if (isValid) {
+        const invalidDetail = this.detailList.find(item => 
+          !item.materielCode ||
+          !item.materielName ||
+          !item.batchNo.trim() || 
+          !item.orderQuantity || 
+          isNaN(parseFloat(item.orderQuantity)) || 
+          parseFloat(item.orderQuantity) <= 0
+        );
+        if (invalidDetail) {
+          isValid = false;
+          errorMessage = '鎻愪氦鏁版嵁瀛樺湪绌哄�兼垨杈撳叆鏁伴噺涓嶅悎娉曪紝璇锋鏌ユ壒娆″彿鏄惁濉啓瀹屾暣锛�';
+        }
+      }
+
+      if (!isValid) {
+        this.$message.error(errorMessage);
+        return;
+      }
+
+      // 鏋勯�犳彁浜ゆ暟鎹�
+      const submitData = {
+        warehouseId: this.form.warehouseId,
+        details: this.detailList.map(item => ({
+          materielCode: item.materielCode,
+          materielName: item.materielName,
+          batchNo: item.batchNo.trim(),
+          orderQuantity: parseFloat(item.orderQuantity),
+          remark: item.remark
+        }))
+      };
+
+      // 鎻愪氦鎺ュ彛
+      this.http
+        .post("api/OutboundOrder/Save", submitData, "鎻愪氦涓�")
+        .then((res) => {
+          if (!res.status) return this.$message.error(res.message);
+          this.$message.success("鎿嶄綔鎴愬姛");
+          this.close();  // 鎻愪氦鎴愬姛鍚庡叧闂脊绐�
+          this.$emit("parentCall", ($vue) => $vue.refresh());  // 閫氱煡鐖剁粍浠跺埛鏂�
+        })
+        .catch(err => {
+          console.error("鎻愪氦澶辫触锛�", err);
+          this.$message.error("鎻愪氦澶辫触锛岃閲嶈瘯");
+        });
+    },
+
+    // 鍏抽棴寮圭獥锛氬悓姝ヨ缃负false锛岀‘淇濆脊绐楅殣钘�
+    close() {
+      this.showDetialBox = false;
+      this.proCodeOptions = [];  // 娓呯┖鏁版嵁锛岄伩鍏嶄笅娆℃墦寮�娈嬬暀
+    }
+  },
+};
+</script>
+
+<style scoped>
+.detail-item {
+  border: 1px solid #e4e7ed;
+  border-radius: 6px;
+  padding: 15px;
+  margin-bottom: 20px;
+  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
+}
+
+.detail-header {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 15px;
+  padding-bottom: 10px;
+  border-bottom: 1px dashed #e4e7ed;
+  font-weight: 500;
+}
+
+.detail-row {
+  margin-bottom: 15px;
+}
+
+.add-detail-btn {
+  height: 40px;
+  line-height: 38px;
+}
+
+::-webkit-scrollbar {
+  width: 8px;
+  height: 8px;
+}
+::-webkit-scrollbar-thumb {
+  background-color: #ddd;
+  border-radius: 4px;
+}
+::-webkit-scrollbar-track {
+  background-color: #f5f5f5;
+}
+
+.el-select {
+  width: 100% !important;
+  min-width: 150px !important;
+  padding-right:10px;
+}
+.el-input {
+  width: 100% !important;
+  min-width: 150px !important;
+  padding-right:10px;
+}
+</style>
\ No newline at end of file
diff --git a/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue b/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue
index 67f59b2..a8bfa49 100644
--- a/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue
+++ b/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue
@@ -14,13 +14,13 @@
               <span>宸查�変腑 {{ selection.length }} 椤�</span>
             </el-col>
             <el-col :span="8">
-              <!-- <el-link
+              <el-link
                 type="primary"
                 size="small"
-                style="float: right; height: 20px"
-                @click="lockstocks"
-                >閿佸畾搴撳瓨</el-link
-              > -->
+                style="float: left; height: 20px;"
+                @click="cancelOutFeedbackERP"
+                >鍑哄簱鏄庣粏鍙栨秷鎺ㄩ�丒RP</el-link
+              >
               <el-link
                 type="primary"
                 size="small"
@@ -69,6 +69,7 @@
             align="center"
           >
             <template #default="scoped">
+              <!-- 鍥炬爣鍒� -->
               <div v-if="item.type == 'icon'">
                 <el-tooltip
                   class="item"
@@ -83,10 +84,29 @@
                 ></el-tooltip>
               </div>
 
+              <!-- 鏍囩鍒� -->
               <div v-else-if="item.type == 'tag'">
                 <el-tag size="small">
                   {{ getDictionary(scoped.row, item) }}
                 </el-tag>
+              </div>
+
+              <!-- 鏅�氭枃鏈垪 - 甯︽孩鍑洪殣钘忓拰Tooltip -->
+              <div v-else>
+                <el-tooltip
+                  class="item"
+                  effect="dark"
+                  :content="formatCellContent(scoped.row[item.prop])"
+                  placement="top"
+                  :disabled="!shouldShowTooltip(scoped.row[item.prop], item)"
+                >
+                  <span 
+                    class="ellipsis-cell" 
+                    :style="{ width: calculateCellWidth(item) }"
+                  >
+                    {{ formatCellContent(scoped.row[item.prop]) }}
+                  </span>
+                </el-tooltip>
               </div>
             </template>
           </el-table-column>
@@ -131,14 +151,15 @@
           hidden: true,
         },
         {
-          prop: "materielCode",
-          title: "鐗╂枡缂栧彿",
-          type: "string",
-          width: 150,
+          prop: "viewDetail",
+          title: "鍑哄簱璇︾粏",
+          type: "icon",
+          width: 90,
+          icon: "el-icon-s-operation",
         },
         {
-          prop: "materielName",
-          title: "鐗╂枡鍚嶇О",
+          prop: "materielCode",
+          title: "鐗╂枡缂栧彿",
           type: "string",
           width: 150,
         },
@@ -146,18 +167,18 @@
           prop: "batchNo",
           title: "鎵规鍙�",
           type: "string",
-          width: 90,
+          width: 180,
+        },
+        {
+          prop: "supplierBatch",
+          title: "渚涘簲鍟嗘壒娆″彿",
+          type: "string",
+          width: 180,
         },
         {
           prop: "orderQuantity",
           title: "鍗曟嵁鏁伴噺",
           type: "string",
-          width: 90,
-        },
-        {
-          prop: "lockQuantity",
-          title: "閿佸畾鏁伴噺",
-          type: "int",
           width: 90,
         },
         {
@@ -167,10 +188,10 @@
           width: 90,
         },
         {
-          prop: "unit",
-          title: "鍗曚綅",
+          prop: "remark",
+          title: "澶囨敞",
           type: "string",
-          width: 90,
+          width: 180,
         },
         {
           prop: "orderDetailStatus",
@@ -180,18 +201,16 @@
           bindKey: "orderDetailStatusEnum",
         },
         {
-          prop: "assignStock",
-          title: "鎸囧畾搴撳瓨",
-          type: "icon",
-          width: 90,
-          icon: "el-icon-s-grid",
+          prop: "materielName",
+          title: "鐗╂枡鍚嶇О",
+          type: "string",
+          width: 150,
         },
         {
-          prop: "viewDetail",
-          title: "鍑哄簱璇︾粏",
-          type: "icon",
-          width: 90,
-          icon: "el-icon-s-operation",
+          prop: "locationName",
+          title: "鍑哄簱璐т綅",
+          type: "string",
+          width: 200,
         },
         {
           prop: "creater",
@@ -218,9 +237,10 @@
           width: 160,
         },
         {
-          prop: "remark",
-          title: "澶囨敞",
-          type: "string",
+          prop: "lockQuantity",
+          title: "閿佸畾鏁伴噺",
+          type: "int",
+          width: 90,
         },
       ],
       paginations: {
@@ -228,9 +248,8 @@
         order: "desc",
         Foots: "",
         total: 0,
-        // 2020.08.29澧炲姞鑷畾涔夊垎椤垫潯澶у皬
         sizes: [60, 100, 120],
-        size: 60, // 榛樿鍒嗛〉澶у皬
+        size: 60,
         Wheres: [],
         page: 1,
         rows: 60,
@@ -283,20 +302,24 @@
           return
         }
         
-        // 浠呭鏁板�煎垪姹傚拰
-        // 浠呭鏌愪竴鍒楁眰鍜�
-        if (column.property === 'lockQuantity' || column.property === 'overOutQuantity' || column.property === 'orderQuantity') {
+        // 浠呭鎸囧畾鏁板�煎垪姹傚拰骞朵繚鐣欎袱浣嶅皬鏁�
+        if (['lockQuantity', 'overOutQuantity', 'orderQuantity'].includes(column.property)) {
           const values = data.map(item => Number(item[column.property]))
-        console.log(values);
-        if (!values.every(value => isNaN(value))) {
-          sums[index] = values.reduce((prev, curr) => {
-            return prev + (isNaN(curr) ? 0 : curr)
-          }, 0)
+          
+          if (!values.every(value => isNaN(value))) {
+            // 璁$畻鎬诲拰
+            const total = values.reduce((prev, curr) => {
+              return prev + (isNaN(curr) ? 0 : curr)
+            }, 0)
+            
+            // 淇濈暀涓や綅灏忔暟
+            sums[index] = total.toFixed(2)
+          } else {
+            sums[index] = '-'
+          }
         } else {
-          sums[index] = '-'
+          sums[index] = ''
         }
-        }
-        
       })
 
       return sums
@@ -308,7 +331,7 @@
         rows: this.paginations.rows,
         sort: this.paginations.sort,
         order: this.paginations.order,
-        wheres: JSON.stringify(wheres), // 鏌ヨ鏉′欢锛屾牸寮忎负[{ name: "瀛楁", value: "xx" }]
+        wheres: JSON.stringify(wheres),
       };
       this.http
         .post("api/OutboundOrderDetail/GetPageData", param, "鏌ヨ涓�")
@@ -320,7 +343,6 @@
       if (column.prop == "assignStock") {
         this.$refs.child.open(row);
       } else {
-        //鐐瑰嚮鎵撳紑鍑哄簱璇︽儏
         this.$refs.selectedStock.open(row);
       }
     },
@@ -328,7 +350,7 @@
       if (this.selection.length === 0) {
         return this.$message.error("璇烽�夋嫨鍗曟嵁鏄庣粏");
       }
-      var keys = this.selection.map((item) => item.id); // 鑾峰彇閫変腑琛岀殑id
+      var keys = this.selection.map((item) => item.id);
       this.http
         .post("api/OutboundOrderDetail/LockOutboundStocks", keys, "鏁版嵁澶勭悊涓�")
         .then((x) => {
@@ -344,8 +366,7 @@
       if (this.selection.length === 0) {
         return this.$message.error("璇烽�夋嫨鍗曟嵁鏄庣粏");
       }
-      var keys = this.selection.map((item) => item.id); // 鑾峰彇閫変腑琛岀殑id
-console.log(keys);
+      var keys = this.selection.map((item) => item.id);
       this.http
         .post("api/Task/WMSGenerateOutboundTask", keys, "鏁版嵁澶勭悊涓�")
         .then((x) => {
@@ -357,6 +378,31 @@
           });
         });
     },
+
+    cancelOutFeedbackERP() {
+      if (this.selection.length === 0) {
+        return this.$message.error("璇烽�夋嫨鍗曟嵁鏄庣粏");
+      }
+      var keys = this.selection.map((item) => item.id);
+      this.$confirm("鏄惁鍙栨秷璇ュ嚭搴撳崟鏄庣粏","鍗曟嵁鍙栨秷璀﹀憡",{
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning",
+        center: true,
+        }).then(() => {
+          this.http
+          .post("api/OutboundOrderDetail/CancelOutFeedbackERP", keys, "鏁版嵁澶勭悊涓�")
+          .then((x) => {
+            if (!x.status) return this.$message.error(x.message);
+            this.$message.success("鎿嶄綔鎴愬姛");
+            this.showDetialBox = false;
+            this.$emit("parentCall", ($vue) => {
+              $vue.getData();
+            });
+          });
+        });
+    },
+
     setCurrent(row) {
       this.$refs.singleTable.setCurrentRow(row);
     },
@@ -413,7 +459,6 @@
         var item = this.dictionaryList.find((x) => x.dicNo == column.bindKey);
         if (item) {
           var dicItem = item.data.find((x) => x.key == row[column.prop]);
-          console.log(dicItem);
           if (dicItem) {
             return dicItem.value;
           } else {
@@ -424,12 +469,56 @@
         }
       }
     },
+    // 鏍煎紡鍖栧崟鍏冩牸鍐呭锛屽鐞唍ull/undefined
+    formatCellContent(content) {
+      if (content === null || content === undefined) {
+        return "鏃犳暟鎹�";
+      }
+      // 瀵规棩鏈熺被鍨嬭繘琛岀壒娈婂鐞嗭紙濡傛灉闇�瑕侊級
+      return content.toString();
+    },
+    // 璁$畻鍗曞厓鏍煎搴︼紝棰勭暀杈硅窛
+    calculateCellWidth(column) {
+      // 濡傛灉鍒楀畾涔変簡瀹藉害锛屽噺鍘�20px浣滀负鍐呰竟璺�
+      if (column.width) {
+        return `${column.width - 20}px`;
+      }
+      // 鏈畾涔夊搴﹀垯浣跨敤100%
+      return "100%";
+    },
+    // 鍒ゆ柇鏄惁闇�瑕佹樉绀篢ooltip
+    shouldShowTooltip(content, column) {
+      // 鏍囪涓轰笉闇�瑕佹孩鍑哄鐞嗙殑鍒椾笉鏄剧ずTooltip
+      if (column.noEllipsis) {
+        return false;
+      }
+      
+      // 绌哄唴瀹逛笉鏄剧ずTooltip
+      const cellContent = this.formatCellContent(content);
+      if (cellContent === "鏃犳暟鎹�") {
+        return false;
+      }
+      
+      // 鍐呭杈冪煭鏃朵篃涓嶆樉绀篢ooltip锛堟牴鎹疄闄呴渶姹傝皟鏁撮暱搴﹂槇鍊硷級
+      return cellContent.length > 8;
+    }
   },
 };
 </script>
 <style scoped>
 .text-button {
   border: 0px;
+}
+
+/* 鏂囨湰婧㈠嚭闅愯棌鏍峰紡 */
+.ellipsis-cell {
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  position: relative;
+  z-index: 1;
+  display: inline-block;
+  max-width: 100%;
 }
 </style>
 
@@ -444,12 +533,10 @@
 
 .box-table .el-table tbody tr:hover > td {
   background-color: #d8e0d4 !important;
-  /* color: #ffffff; */
 }
 
 .box-table .el-table tbody tr.current-row > td {
   background-color: #f0f9eb !important;
-  /* color: #ffffff; */
 }
 
 .el-table .success-row {
@@ -459,4 +546,13 @@
 .box-table .el-table {
   border: 1px solid #ebeef5;
 }
+
+/* 鍚堣琛屾枃鏈孩鍑哄鐞� */
+.el-table__footer-wrapper .el-table__cell {
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  position: relative;
+  z-index: 1;
+}
 </style>
diff --git a/WMS/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js b/WMS/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js
index 122b98c..42ac775 100644
--- a/WMS/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js
+++ b/WMS/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js
@@ -1,10 +1,11 @@
 
 //姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
 import gridBody from './extend/outOrderDetail.vue'
+import gridHeader from './extend/AddOutboundOrder.vue'
 let extension = {
     components: {
       //鏌ヨ鐣岄潰鎵╁睍缁勪欢
-      gridHeader: '',
+      gridHeader: gridHeader,
       gridBody: gridBody,
       gridFooter: '',
       //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
@@ -16,7 +17,13 @@
     buttons: { view: [], box: [], detail: [] }, //鎵╁睍鐨勬寜閽�
     methods: {
        //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
-      onInit() {  
+      onInit() {
+        let addBtn = this.buttons.find(x => x.value == 'Add');
+        if (addBtn) {
+          addBtn.onClick = function () {
+            this.$refs.gridHeader.open();
+          }
+        };  
         //鎵╁睍椤甸潰鍒濆鍖栨搷浣�
         this.columns.push({
           field: '鎿嶄綔',
diff --git a/WMS/WIDESEA_WMSClient/src/extension/outbound/outboundOrderDetail.js b/WMS/WIDESEA_WMSClient/src/extension/outbound/outboundOrderDetail.js
index 24e1d94..fd3c673 100644
--- a/WMS/WIDESEA_WMSClient/src/extension/outbound/outboundOrderDetail.js
+++ b/WMS/WIDESEA_WMSClient/src/extension/outbound/outboundOrderDetail.js
@@ -1,6 +1,3 @@
-
-//姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
-
 let extension = {
     components: {
       //鏌ヨ鐣岄潰鎵╁睍缁勪欢
@@ -15,8 +12,43 @@
     tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
     buttons: { view: [], box: [], detail: [] }, //鎵╁睍鐨勬寜閽�
     methods: {
-       //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
       onInit() {  
+        this.columns.push({
+          field: '鎿嶄綔',
+          title: '鎿嶄綔',
+          width: 90,
+          fixed: 'right',
+          align: 'center',
+          formatter: (row) => {
+              return (
+                  '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">鐩存帴鍑哄簱</i>'
+              );
+          },
+          click: (row) => {
+              this.$confirm("鏄惁纭鍑哄簱","鍑哄簱鎿嶄綔纭",{
+              confirmButtonText: "纭畾",
+              cancelButtonText: "鍙栨秷",
+              type: "warning",
+              center: true,
+              }).then(() => {
+                let rows = this.$refs.table.getSelected();
+                if (rows.length == 0) return this.$error("璇烽�夋嫨鏁版嵁!");
+                if (rows.length > 1) return this.$error("璇烽�夋嫨涓�鏉℃暟鎹�!");
+                const keys = rows.map(row => row.id);
+                // 鍙戦�丳OST璇锋眰锛屽皢ID鏁扮粍浣滀负璇锋眰浣撳彂閫�
+                this.http
+                .post("api/Task/WMSGenerateOutboundTask", keys, "鏁版嵁澶勭悊涓�...")
+                .then((x) => {
+                    if (x.status) {
+                    this.$Message.success('鎿嶄綔鎴愬姛');
+                    this.refresh();
+                  } else {
+                    return this.$error(x.message);
+                  }
+                });
+              });
+          }
+      });
       },
       onInited() {
         //妗嗘灦鍒濆鍖栭厤缃悗
@@ -55,4 +87,3 @@
     }
   };
   export default extension;
-  
\ No newline at end of file
diff --git a/WMS/WIDESEA_WMSClient/src/extension/stock/stockView.js b/WMS/WIDESEA_WMSClient/src/extension/stock/stockView.js
index 24e1d94..862e246 100644
--- a/WMS/WIDESEA_WMSClient/src/extension/stock/stockView.js
+++ b/WMS/WIDESEA_WMSClient/src/extension/stock/stockView.js
@@ -1,58 +1,156 @@
-
 //姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
 
+import { el } from "element-plus/es/locales.mjs";
+
 let extension = {
-    components: {
-      //鏌ヨ鐣岄潰鎵╁睍缁勪欢
-      gridHeader: '',
-      gridBody: '',
-      gridFooter: '',
-      //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
-      modelHeader: '',
-      modelBody: '',
-      modelFooter: ''
-    },
-    tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
-    buttons: { view: [], box: [], detail: [] }, //鎵╁睍鐨勬寜閽�
-    methods: {
-       //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
-      onInit() {  
-      },
-      onInited() {
-        //妗嗘灦鍒濆鍖栭厤缃悗
-        //濡傛灉瑕侀厤缃槑缁嗚〃,鍦ㄦ鏂规硶鎿嶄綔
-        //this.detailOptions.columns.forEach(column=>{ });
-      },
-      searchBefore(param) {
-        //鐣岄潰鏌ヨ鍓�,鍙互缁檖aram.wheres娣诲姞鏌ヨ鍙傛暟
-        //杩斿洖false锛屽垯涓嶄細鎵ц鏌ヨ
-        return true;
-      },
-      searchAfter(result) {
-        //鏌ヨ鍚庯紝result杩斿洖鐨勬煡璇㈡暟鎹�,鍙互鍦ㄦ樉绀哄埌琛ㄦ牸鍓嶅鐞嗚〃鏍肩殑鍊�
-        return true;
-      },
-      addBefore(formData) {
-        //鏂板缓淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛紝鍙互缁欑粰琛ㄥ崟璁剧疆鍊硷紝鑷繁杈撳嚭鐪媐ormData鐨勫��
-        return true;
-      },
-      updateBefore(formData) {
-        //缂栬緫淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛ㄣ�佸垹闄よ鐨処d
-        return true;
-      },
-      rowClick({ row, column, event }) {
-        //鏌ヨ鐣岄潰鐐瑰嚮琛屼簨浠�
-        this.$refs.table.$refs.table.toggleRowSelection(row); //鍗曞嚮琛屾椂閫変腑褰撳墠琛�;
-      },
-      modelOpenAfter(row) {
-        //鐐瑰嚮缂栬緫銆佹柊寤烘寜閽脊鍑烘鍚庯紝鍙互鍦ㄦ澶勫啓閫昏緫锛屽锛屼粠鍚庡彴鑾峰彇鏁版嵁
-        //(1)鍒ゆ柇鏄紪杈戣繕鏄柊寤烘搷浣滐細 this.currentAction=='Add';
-        //(2)缁欏脊鍑烘璁剧疆榛樿鍊�
-        //(3)this.editFormFields.瀛楁='xxx';
-        //濡傛灉闇�瑕佺粰涓嬫媺妗嗚缃粯璁ゅ�硷紝璇烽亶鍘唗his.editFormOptions鎵惧埌瀛楁閰嶇疆瀵瑰簲data灞炴�х殑key鍊�
-        //鐪嬩笉鎳傚氨鎶婅緭鍑虹湅锛歝onsole.log(this.editFormOptions)
+  components: {
+    //鏌ヨ鐣岄潰鎵╁睍缁勪欢
+    gridHeader: '',
+    gridBody: '',
+    gridFooter: '',
+    //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
+    modelHeader: '',
+    modelBody: '',
+    modelFooter: ''
+  },
+  tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
+  buttons: { view: [], box: [], detail: [] }, //鎵╁睍鐨勬寜閽�
+  methods: {
+    //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
+    onInit() {
+      
+      let SelectTake = this.buttons.find(x => x.value == 'SelectStockTake');
+      if (SelectTake) {
+        SelectTake.onClick = function () {
+          let stockViews = this.$refs.table.getSelected();
+          this.http
+            .post("api/Task/TakeOutbound",stockViews, "鏁版嵁澶勭悊涓�")
+            .then((x) => {
+              if (!x.status) return this.$message.error(x.message);
+              this.$message.success("鎿嶄綔鎴愬姛");
+              this.refresh();
+            });
+        }
       }
+      this.columns.forEach(column => {
+        if (column.field == 'materielCode') {
+          column.formatter = (row) => {
+            var str = '';
+            var list = row.materielCode.split(',');
+            for (let index = 0; index < list.length; index++) {
+              str += list[index] + '<br>';
+            }
+            return str = list[0] == "" ? "绌虹" : str;
+          }
+        }
+        if (column.field == 'batchNo') {
+          column.formatter = (row) => {
+            var str = '';
+            var list = row.batchNo.split(',');
+            for (let index = 0; index < list.length; index++) {
+              str += list[index] + '<br>';
+            }
+            return str = list[0] == "" ? "鏃�" : str;
+          }
+        }
+
+      if (column.field == 'inventoryage') {
+          const today = new Date()
+          column.formatter = (row) => {
+              if (row.details.length > 0) {
+                  const closestDate = row.details
+                      .map(x => {
+                          const date = new Date(x.createDate);
+                          const ageInDays = Math.ceil((today - date) / (1000 * 60 * 60 * 24));
+                          return { date, ageInDays };
+                      })
+                      .reduce((closest, current) => (current.ageInDays < closest.ageInDays ? current : closest))
+                      .date;
+
+                  const inventoryAge = Math.ceil((today - closestDate) / (1000 * 60 * 60 * 24));
+                  
+                  row.inventoryAge = inventoryAge; 
+                  
+                  return `${inventoryAge} 澶ー;
+              } 
+              // 濡傛灉娌℃湁鏄庣粏锛岃繑鍥炵┖鎴栨彁绀轰俊鎭�
+              return '-';
+          }       
+        }
+        if (column.field == 'sumStock') {
+          column.formatter = (row) => {
+            if (row.details.length > 0) {
+              var sum = 0;
+              const closestDate = row.details
+                .map(x => {
+                  sum += (x.stockQuantity)
+                })
+              return '<span style="color: rgb(24, 18, 18)">' + sum.toFixed(3) + '</span>';
+            } else {
+              return '<span style="color: rgb(24, 18, 18)">' + "1涓�" + '</span>';
+            }
+
+          }
+        }
+      })
+      this.columns.forEach((column) => {
+        column.cellStyle = (row) => {
+          if (row.expirationlabel !== undefined && row.expirationlabel !== null) {
+            if (row.expirationlabel === 2) {
+              return { background: 'yellow' }; 
+            } else if (row.expirationlabel === 3) {
+              return { background: '#ffc0cb' };
+            }
+          }
+          return {};
+        };
+      });
+
+    },
+    onInited() {
+      //妗嗘灦鍒濆鍖栭厤缃悗
+      //濡傛灉瑕侀厤缃槑缁嗚〃,鍦ㄦ鏂规硶鎿嶄綔
+      //this.detailOptions.columns.forEach(column=>{ });
+      this.detailOptions.summary = true;
+        this.detailOptions.columns.forEach(x => {
+          if (x.field == 'stockQuantity') {
+              x.summary = true;
+              //璁$畻骞冲潎鍊�
+              // x.summary = 'avg';//2023.05.03鏇存柊voltable鏂囦欢鍚庢墠鑳戒娇鐢�
+              //璁剧疆灏忔暟鏄剧ず浣嶆暟(榛樿2浣�)
+              // x.numberLength = 4;
+          }
+        });
+    },
+    searchBefore(param) {
+      //鐣岄潰鏌ヨ鍓�,鍙互缁檖aram.wheres娣诲姞鏌ヨ鍙傛暟
+      //杩斿洖false锛屽垯涓嶄細鎵ц鏌ヨ
+      return true;
+    },
+    searchAfter(result) {
+      //鏌ヨ鍚庯紝result杩斿洖鐨勬煡璇㈡暟鎹�,鍙互鍦ㄦ樉绀哄埌琛ㄦ牸鍓嶅鐞嗚〃鏍肩殑鍊�
+      return true;
+    },
+    addBefore(formData) {
+      //鏂板缓淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛紝鍙互缁欑粰琛ㄥ崟璁剧疆鍊硷紝鑷繁杈撳嚭鐪媐ormData鐨勫��
+      return true;
+    },
+    updateBefore(formData) {
+      //缂栬緫淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛ㄣ�佸垹闄よ鐨処d
+      return true;
+    },
+    rowClick({ row, column, event }) {
+      //鏌ヨ鐣岄潰鐐瑰嚮琛屼簨浠�
+      this.$refs.table.$refs.table.toggleRowSelection(row); //鍗曞嚮琛屾椂閫変腑褰撳墠琛�;
+    },
+    modelOpenAfter(row) {
+      //鐐瑰嚮缂栬緫銆佹柊寤烘寜閽脊鍑烘鍚庯紝鍙互鍦ㄦ澶勫啓閫昏緫锛屽锛屼粠鍚庡彴鑾峰彇鏁版嵁
+      //(1)鍒ゆ柇鏄紪杈戣繕鏄柊寤烘搷浣滐細 this.currentAction=='Add';
+      //(2)缁欏脊鍑烘璁剧疆榛樿鍊�
+      //(3)this.editFormFields.瀛楁='xxx';
+      //濡傛灉闇�瑕佺粰涓嬫媺妗嗚缃粯璁ゅ�硷紝璇烽亶鍘唗his.editFormOptions鎵惧埌瀛楁閰嶇疆瀵瑰簲data灞炴�х殑key鍊�
+      //鐪嬩笉鎳傚氨鎶婅緭鍑虹湅锛歝onsole.log(this.editFormOptions)
     }
-  };
-  export default extension;
-  
\ No newline at end of file
+  }
+};
+export default extension;
\ No newline at end of file
diff --git a/WMS/WIDESEA_WMSClient/src/extension/taskinfo/task.js b/WMS/WIDESEA_WMSClient/src/extension/taskinfo/task.js
index c60206e..0594895 100644
--- a/WMS/WIDESEA_WMSClient/src/extension/taskinfo/task.js
+++ b/WMS/WIDESEA_WMSClient/src/extension/taskinfo/task.js
@@ -26,29 +26,27 @@
       let TaskHandCompletedBtn = this.buttons.find(x => x.value == 'TaskHandCompleted');
       if (TaskHandCompletedBtn) {
         TaskHandCompletedBtn.onClick = function () {
-          let rows = this.$refs.table.getSelected();
-          if (rows.length == 0) return this.$error("璇烽�夋嫨鏁版嵁!");
-          this.$confirm("鏄惁纭畾瑕佹墜鍔ㄥ畬鎴愶紝鎵嬪姩瀹屾垚鍚庤鍒犻櫎WCS绯荤粺涓殑浠诲姟锛�", "鎻愮ず", {
-            // iconClass:"el-icon-success",//el-icon-remove鑷畾涔夊浘鏍囨牱寮�
-            confirmButtonText: "纭",//纭鎸夐挳鏂囧瓧鏇存崲
-            cancelButtonText: "鍙栨秷",//鍙栨秷鎸夐挳鏂囧瓧鏇存崲
-            // cancelBtn:"鍙栨秷",//鍙栨秷鎸夐挳鏂囧瓧鏇存崲
-            showClose: true,//鏄惁鏄剧ず鍙充笂瑙掑叧闂寜閽�
-            type: "warning",//鎻愮ず绫诲瀷 success:鎴愬姛/info:淇℃伅/warning:璀﹀憡/error:鎶ラ敊
-          }).then(() => {
-            var param = rows[0].taskNum;
-            this.http
-              .get("api/Task/TaskCompleted?taskNum=" + param, "鏁版嵁澶勭悊涓�...")
-              .then((x) => {
-                if (x.status) {
-                  this.$Message.success('浠诲姟鎵嬪姩瀹屾垚鎴愬姛.');
-                  this.refresh();
-                } else {
-                  return this.$error(x.message);
-                }
+          this.$confirm("鏄惁纭瀹屾垚浠诲姟","鎵嬪姩浠诲姟瀹屾垚璀﹀憡",{
+              confirmButtonText: "纭畾",
+              cancelButtonText: "鍙栨秷",
+              type: "warning",
+              center: true,
+              }).then(() => {
+                let rows = this.$refs.table.getSelected();
+                if (rows.length == 0) return this.$error("璇烽�夋嫨鏁版嵁!");
+                if (rows.length > 1) return this.$error("璇烽�夋嫨涓�鏉℃暟鎹�!");
+                var param = rows[0].taskNum;
+                this.http
+                .post("api/Task/TaskCompleted?taskNum="+param, "鏁版嵁澶勭悊涓�...")
+                .then((x) => {
+                    if (x.status) {
+                    this.$Message.success('浠诲姟鎵嬪姩瀹屾垚');
+                    this.refresh();
+                  } else {
+                    return this.$error(x.message);
+                  }
+                });
               });
-          })
-
         }
       }
 
diff --git a/WMS/WIDESEA_WMSClient/src/router/viewGird.js b/WMS/WIDESEA_WMSClient/src/router/viewGird.js
index f1acc47..0d66c41 100644
--- a/WMS/WIDESEA_WMSClient/src/router/viewGird.js
+++ b/WMS/WIDESEA_WMSClient/src/router/viewGird.js
@@ -116,6 +116,14 @@
     path: '/palletTypeInfo',
     name: 'palletTypeInfo',
     component: () => import('@/views/basic/palletTypeInfo.vue')
+  }, {
+    path: '/returnOrder',
+    name: 'returnOrder',
+    component: () => import('@/views/inbound/returnOrder.vue')
+  }, {
+    path: '/takeStockOrder',
+    name: 'takeStockOrder',
+    component: () => import('@/views/inbound/takeStockOrder.vue')
   }]
 
 export default viewgird
diff --git a/WMS/WIDESEA_WMSClient/src/views/basic/materielInfo.vue b/WMS/WIDESEA_WMSClient/src/views/basic/materielInfo.vue
index c0490f8..ee1597d 100644
--- a/WMS/WIDESEA_WMSClient/src/views/basic/materielInfo.vue
+++ b/WMS/WIDESEA_WMSClient/src/views/basic/materielInfo.vue
@@ -27,7 +27,7 @@
       sortName: "id",
     });
     const editFormFields = ref({
-      areaId: "",
+      warehouseId: "",
       materielCode: "",
       materielName: "",
       materielDes: "",
@@ -37,10 +37,10 @@
     const editFormOptions = ref([
       [
         {
-          title: "鍖哄煙",
+          title: "鐗╂枡id",
           required: true,
-          field: "areaId",
-          type: "string",
+          field: "materielId",
+          type: "int",
         },
         {
           title: "鐗╂枡缂栧彿",
@@ -48,38 +48,63 @@
           field: "materielCode",
           type: "string",
         },
-        {
+      ],
+      [
+         {
           title: "鐗╂枡鍚嶇О",
           required: true,
           field: "materielName",
           type: "string",
         },
         {
-          title: "璁¢噺鍗曚綅",
+          title: "鐗╂枡瑙勬牸",
           required: true,
-          field: "unit",
+          field: "materielSpec",
           type: "string",
         },
       ],
       [
-        
-        {
-          title: "鐗╂枡鎻忚堪",
-          field: "materielDes",
-          type: "textarea",
+       {
+          title: "鐗╂枡鍩烘湰鍒嗙被",
+          required: true,
+          field: "materielType",
+          type: "string",
+
+          
         },
+        {
+        field: "materielSourceType",
+        title: "鐗╂枡灞炴�у垎绫�",
+        required: true,
+        type: "string",
+      },  
       ],
+      [
+        {
+          title: "鍩烘湰鍗曚綅",
+          required: true,
+          field: "materielUnit",
+          type: "string",
+        },
+        {
+          title: "鐗╂枡鐘舵��",
+          required: true,
+          field: "materielState",
+          type: "select",
+          data:[{key:'Enable',value:'鍚敤'},{key:'Disable',value:'绂佺敤'}]
+        },
+        
+      ],
+      
     ]);
     const searchFormFields = ref({
       materielCode: "",
       materielName: "",
-      areaId: "",
     });
     const searchFormOptions = ref([
       [
         { title: "鐗╂枡缂栧彿", field: "materielCode", type: "like" },
         { title: "鐗╂枡鍚嶇О", field: "materielName", type: "like" },
-        { title: "璁惧鐘舵��", field: "deviceStatus" },
       ],
     ]);
     const columns = ref([
@@ -94,12 +119,12 @@
         align: "left",
       },
       {
-        field: "areaId",
-        title: "鍖哄煙涓婚敭",
-        type: "string",
-        width: 90,
-        align: "left",
-      },
+          title: "鐗╂枡id",
+          field: "materielId",
+          type: "int",
+          width:80,
+          align:"left"
+        },
       {
         field: "materielCode",
         title: "鐗╂枡缂栧彿",
@@ -115,54 +140,65 @@
         align: "left",
       },
       {
-        field: "materielDes",
-        title: "鐗╂枡鎻忚堪",
-        type: "decimal",
-        width: 90,
-        align: "left",
-      },
-      {
-        field: "cotainerType",
-        title: "瀹瑰櫒绫诲瀷",
+        field: "materielSpec",
+        title: "鐗╂枡瑙勬牸",
         type: "string",
-        width: 90,
+        width: 240,
         align: "left",
       },
       {
-        field: "packspes",
-        title: "鍖呰瑙勬牸",
-        type: "int",
+        field: "materielSourceType",
+        title: "鐗╂枡灞炴�у垎绫�",
+        type: "string",
+        width: 120,
+        align: "left",
+        bind: { key: "materielSourceTypeEnum", data: [] },
+      },
+      {
+        field: "materielType",
+        title: "鐗╂枡鍩烘湰鍒嗙被",
+        type: "string",
+        width: 120,
+        align: "left",
+    
+      },
+      {
+        field: "materielUnit",
+        title: "鍩烘湰鍗曚綅",
+        type: "string",
         width: 120,
         align: "left",
       },
       {
-        field: "attribute",
-        title: "鐗╂枡灞炴��",
-        type: "string",
-        width: 200,
-        align: "left",
-      },
-      {
-        field: "unit",
-        title: "璁¢噺鍗曚綅",
-        type: "string",
+        field: "materielSize",
+        title: "鐗╂枡灏哄",
+        type: "float",
         width: 180,
         align: "left",
       },
       {
-        field: "validity",
-        title: "鏈夋晥鏈�",
-        type: "string",
+        field: "materielLength",
+        title: "鐗╂枡闀垮害",
+        type: "float",
         width: 120,
         align: "left",
       },
       {
-        field: "safetyStock",
-        title: "瀹夊叏搴撳瓨",
-        type: "string",
+        field: "materielThickness",
+        title: "鐗╂枡鍘氬害",
+        type: "float",
         width: 120,
         align: "left",
       },
+      {
+        field: "materielState",
+        title: "鐗╂枡鐘舵��",
+        type: "select",
+        width: 100,
+        bind:{key:"",data: [{key:'Enable',value:'鍚敤'},{key:'Disable',value:'绂佺敤'}] },
+        align: "left",
+      },
+
       {
         field: "creater",
         title: "鍒涘缓浜�",
@@ -183,6 +219,7 @@
         type: "string",
         width: 100,
         align: "left",
+        hidden:true
       },
       {
         field: "modifyDate",
@@ -190,14 +227,9 @@
         type: "datetime",
         width: 160,
         align: "left",
+        hidden:true
       },
-      {
-        field: "remark",
-        title: "澶囨敞",
-        type: "string",
-        width: 100,
-        align: "left",
-      },
+      
     ]);
     const detail = ref({
       cnName: "#detailCnName",
diff --git a/WMS/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue b/WMS/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue
index 3d83141..ff69a6f 100644
--- a/WMS/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue
+++ b/WMS/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue
@@ -45,12 +45,15 @@
         {
           field: "warehouseId",
           title: "浠撳簱ID",
-          type: "int",
+          type: "select",
+          dataKey:"warehouses",
+          data:[]
         },
         {
           field: "orderNo",
           title: "鍗曟嵁缂栧彿",
           type: "string",
+          readonly:true
         },
                 {
           title: "鍗曟嵁鐘舵��",
@@ -63,12 +66,9 @@
           title: "涓婃父鍗曟嵁缂栧彿",
           field: "upperOrderNo",
           type: "string",
+          readonly:true
         },
-        {
-          title: "澶囨敞",
-          field: "remark",
-          type: "textarea",
-        },
+        
       ],
       [
         {
@@ -77,6 +77,11 @@
           type: "select",
           dataKey: "createType",
           data: [],
+        },
+        {
+          title: "澶囨敞",
+          field: "remark",
+          type: "textarea",
         },
       ],
     ]);
@@ -110,14 +115,30 @@
       ],
       [
         {
+          title: "鍑哄叆搴撶被鍨�",
+          field: "inoutType",
+          type: "select",
+          dataKey: "inoutTypeEnum",
+          data: [],
+        },
+        {
+          title: "鎵�灞炰粨搴�",
+          field: "warehouseId",
+          type: "select",
+          dataKey: "warehouses",
+          data: [],
+        },
+        { title: "鍒涘缓鑰�", field: "creater", type: "like" },
+        { title: "鍒涘缓鏃堕棿", field: "createDate", type: "datetime" },
+      ],
+      [
+        {
           title: "鍒涘缓鏂瑰紡",
           field: "createType",
           type: "select",
           dataKey: "createType",
           data: [],
         },
-        { title: "鍒涘缓鑰�", field: "creater", type: "like" },
-        { title: "鍒涘缓鏃堕棿", field: "createDate", type: "datetime" },
       ],
     ]);
     const columns = ref([
@@ -133,16 +154,18 @@
       },
       {
         field: "warehouseId",
-        title: "浠撳簱ID",
-        type: "int",
-        width: 90,
+        title: "浠撳簱",
+        type: "string",
+        width: 120,
         align: "left",
+        bind:{key:"warehouses",data:[]}
       },
+      
       {
         field: "orderNo",
         title: "鍗曟嵁缂栧彿",
         type: "string",
-        width: 120,
+        width: 170,
         align: "left",
         link: true,
       },
@@ -155,7 +178,7 @@
       },
       {
         field: "orderType",
-        title: "鍗曟嵁绫诲瀷",
+        title: "鍗曟嵁澶х被",
         type: "string",
         width: 150,
         align: "left",
@@ -163,11 +186,11 @@
       },
       {
         field: "inoutType",
-        title: "鍗曟嵁澶х被",
-        type: "string",
-        width: 150,
+        title: "鍑哄叆搴撶被鍨�",
+        type: "select",
+        width: 90,
         align: "left",
-        bind: { key: "inoutType", data: [] },
+        bind: { key: "inoutTypeEnum", data: [] },
       },
       {
         field: "orderStatus",
@@ -260,13 +283,22 @@
           edit: { type: "" },
         },
         {
-          field: "batchNo",
-          title: "鎵规鍙�",
-          type: "decimal",
-          width: 90,
+          field: "supplierBatch",
+          title: "渚涘簲鍟嗘壒娆″彿",
+          type: "string",
+          width: 150,
           align: "left",
           edit: { type: "" },
           required: true,
+        },
+        {
+          field: "batchNo",
+          title: "鍐呴儴鎵规鍙�",
+          type: "string",
+          width: 130,
+          align: "left",
+          readonly:true,
+
         },
         {
           field: "orderQuantity",
@@ -274,7 +306,6 @@
           type: "decimal",
           width: 90,
           align: "left",
-          edit: { type: "number" },
           required: true,
         },
         {
@@ -283,6 +314,7 @@
           type: "int",
           width: 120,
           align: "left",
+          edit: { type: "number" },
         },
         {
           field: "overInQuantity",
@@ -294,11 +326,11 @@
         {
           field: "orderDetailStatus",
           title: "璁㈠崟鏄庣粏鐘舵��",
-          type: "string",
+          type: "select",
           width: 180,
           align: "left",
-                    edit: { type: "" },
           bind: { key: "orderDetailStatusEnum", data: [] },
+          edit: { type: "number" },
         },
         {
           field: "creater",
diff --git a/WMS/WIDESEA_WMSClient/src/views/inbound/inboundOrderDetail.vue b/WMS/WIDESEA_WMSClient/src/views/inbound/inboundOrderDetail.vue
index 5046820..394a4c1 100644
--- a/WMS/WIDESEA_WMSClient/src/views/inbound/inboundOrderDetail.vue
+++ b/WMS/WIDESEA_WMSClient/src/views/inbound/inboundOrderDetail.vue
@@ -218,4 +218,3 @@
     },
   });
   </script>
-    
\ No newline at end of file
diff --git a/WMS/WIDESEA_WMSClient/src/views/inbound/returnOrder.vue b/WMS/WIDESEA_WMSClient/src/views/inbound/returnOrder.vue
new file mode 100644
index 0000000..2a2d988
--- /dev/null
+++ b/WMS/WIDESEA_WMSClient/src/views/inbound/returnOrder.vue
@@ -0,0 +1,268 @@
+
+<template>
+    <view-grid
+      ref="grid"
+      :columns="columns"
+      :detail="detail"
+      :editFormFields="editFormFields"
+      :editFormOptions="editFormOptions"
+      :searchFormFields="searchFormFields"
+      :searchFormOptions="searchFormOptions"
+      :table="table"
+      :extend="extend"
+    >
+    </view-grid>
+  </template>
+    <script>
+  import extend from "@/extension/inbound/returnOrder.js";
+  import { ref, defineComponent } from "vue";
+  export default defineComponent({
+    setup() {
+      const table = ref({
+        key: "id",
+        footer: "Foots",
+        cnName: "鍥炲簱鍗�",
+        name: "returnOrder",
+        url: "/ReturnOrder/",
+        sortName: "id",
+      });
+      const editFormFields = ref({
+        deviceCode: "",
+        deviceName: "",
+        deviceType: "",
+        deviceStatus: "",
+        deviceIp: "",
+        devicePort: "",
+        devicePlcType: "",
+        deviceRemark: "",
+      });
+      const editFormOptions = ref([
+        [
+          {
+            title: "璁惧缂栧彿",
+            required: true,
+            field: "deviceCode",
+            type: "string",
+          },
+          {
+            title: "璁惧鍚嶇О",
+            required: true,
+            field: "deviceName",
+            type: "string",
+          },
+          {
+            title: "璁惧绫诲瀷",
+            required: true,
+            field: "deviceType",
+            type: "string",
+          },
+          {
+            title: "璁惧鐘舵��",
+            required: true,
+            field: "deviceStatus",
+            type: "string",
+          },
+        ],
+        [
+          { title: "璁惧IP", required: true, field: "deviceIp", type: "string" },
+          {
+            title: "璁惧绔彛",
+            required: true,
+            field: "devicePort",
+            type: "string",
+          },
+          {
+            title: "PLC绫诲瀷",
+            required: true,
+            field: "devicePlcType",
+            type: "string",
+          },
+          {
+            title: "澶囨敞",
+            field: "deviceRemark",
+            type: "string",
+          },
+        ],
+      ]);
+      const searchFormFields = ref({
+        deviceCode: "",
+        deviceType: "",
+        deviceStatus: "",
+      });
+      const searchFormOptions = ref([
+        [
+        { title: "鍗曟嵁缂栧彿", field: "orderNo",type:"like"},
+        { title: "鎵樼洏缂栧彿", field: "palletCode",type: "like" },
+        { title: "璐т綅缂栧彿", field: "locationCode",type: "like" },
+        {
+        field: "orderType",
+        title: "鍗曟嵁绫诲瀷",
+        type: "select",
+        width: 150,
+        align: "left",
+        dataKey: "inOrderType", data: []
+      },
+      ],
+      [
+        { title: "鐗╂枡缂栧彿", field: "materielCode",type: "like"},
+        { title: "鎵规鍙�", field: "batchNo",type: "like"},
+        { title: "鍒涘缓鏃堕棿",field: "createDate",type: "datetime"},
+        
+      ],
+        
+      ]);
+      const columns = ref([
+        {
+          field: "id",
+          title: "Id",
+          type: "int",
+          width: 90,
+          hidden: true,
+          readonly: true,
+          require: true,
+          align: "left",
+        },
+        {
+          field: "orderNo",
+          title: "鍗曟嵁缂栧彿",
+          type: "string",
+          width: 190,
+          align: "left",
+        },
+        {
+        field: "orderType",
+        title: "鍗曟嵁绫诲瀷",
+        type: "string",
+        width: 150,
+        align: "left",
+        bind: { key: "inOrderType", data: [] },
+      },
+        {
+          field: "materielCode",
+          title: "鐗╂枡缂栧彿",
+          type: "string",
+          width: 150,
+          align: "left",
+        },
+        {
+          field: "lpnNo",
+          title: "LPN鍙�(鎵樼洏鍙�)",
+          type: "string",
+          width: 150,
+          align: "left",
+        },
+        {
+          field: "locationCode",
+          title: "璐т綅缂栧彿",
+          type: "string",
+          width: 150,
+          align: "left",
+        },
+        {
+          field: "materielName",
+          title: "鐗╂枡鍚嶇О",
+          type: "string",
+          width: 150,
+          align: "left",
+        },
+        {
+          field: "batchNo",
+          title: "鎵规鍙�",
+          type: "decimal",
+          width: 90,
+          align: "left",
+        },
+        {
+          field: "orderQuantity",
+          title: "鍗曟嵁鏁伴噺",
+          type: "string",
+          width: 90,
+          align: "left",
+        },
+        {
+          field: "receiptQuantity",
+          title: "缁勭洏鏁伴噺",
+          type: "int",
+          width: 120,
+          align: "left",
+        },
+        {
+          field: "overInQuantity",
+          title: "涓婃灦鏁伴噺",
+          type: "string",
+          width: 90,
+          align: "left",
+        },
+        {
+          field: "orderStatus",
+          title: "鍗曟嵁鐘舵��",
+          type: "string",
+          width: 180,
+          align: "left",
+          bind: { key: "inboundState", data: [] },
+        },
+        {
+          field: "materieSpec",
+          title: "鐗╂枡瑙勬牸",
+          type: "string",
+          width: 180,
+          align: "left",
+          edit: { type: "" },
+          bind: { key: "orderDetailStatusEnum", data: [] },
+        },
+        {
+          field: "creater",
+          title: "鍒涘缓浜�",
+          type: "string",
+          width: 90,
+          align: "left",
+        },
+        {
+          field: "createDate",
+          title: "鍒涘缓鏃堕棿",
+          type: "datetime",
+          width: 160,
+          align: "left",
+        },
+        {
+          field: "modifier",
+          title: "淇敼浜�",
+          type: "string",
+          width: 100,
+          align: "left",
+        },
+        {
+          field: "modifyDate",
+          title: "淇敼鏃堕棿",
+          type: "datetime",
+          width: 160,
+          align: "left",
+        },
+        {
+          field: "remark",
+          title: "澶囨敞",
+          type: "string",
+          width: 100,
+          align: "left",
+        },
+      ]);
+      const detail = ref({
+        cnName: "#detailCnName",
+        table: "",
+        columns: [],
+        sortName: "",
+      });
+      return {
+        table,
+        extend,
+        editFormFields,
+        editFormOptions,
+        searchFormFields,
+        searchFormOptions,
+        columns,
+        detail,
+      };
+    },
+  });
+  </script>
+    
\ No newline at end of file
diff --git a/WMS/WIDESEA_WMSClient/src/views/inbound/takeStockOrder.vue b/WMS/WIDESEA_WMSClient/src/views/inbound/takeStockOrder.vue
new file mode 100644
index 0000000..21611d9
--- /dev/null
+++ b/WMS/WIDESEA_WMSClient/src/views/inbound/takeStockOrder.vue
@@ -0,0 +1,293 @@
+
+<template>
+    <!-- <div>
+      <assemble-dist></assemble-dist>
+    </div> -->
+    <view-grid
+      ref="grid"
+      :columns="columns"
+      :detail="detail"
+      :editFormFields="editFormFields"
+      :editFormOptions="editFormOptions"
+      :searchFormFields="searchFormFields"
+      :searchFormOptions="searchFormOptions"
+      :table="table"
+      :extend="extend"
+    >
+    </view-grid>
+  </template>
+<script>
+  import extend from "@/extension/inbound/takeStockOrder.js";
+  import { ref, defineComponent } from "vue";
+  // import AssembleDistVue from '../charts/AssembleDist.vue';
+  export default defineComponent({
+    // components: {
+    //   'assemble-dist': AssembleDistVue,
+    // },
+    setup() {
+      //浣跨敤缁勪欢AssembleDist
+      const table = ref({ 
+        key: "id",
+        footer: "Foots",
+        cnName: "鐩樼偣鍗�",
+        name: "takeStockOrder",
+        url: "/TakeStockOrder/",
+        sortName: "id",
+      });
+  
+      const searchFormFields = ref({
+        orderNo:""
+      });
+      const searchFormOptions = ref([
+        [
+        { title: "鍗曟嵁缂栧彿", field: "orderNo", type: "like" },
+        ]
+      ]);
+  
+      const editFormFields = ref({
+        orderNo:"",
+        warehouseId: "",
+        remark:""
+      });
+      const editFormOptions = ref([
+      [
+        {
+          field: "orderNo",
+          title: "鍗曟嵁缂栧彿",
+          type: "string",
+          readonly: "true",
+        },
+        {
+          title: "浠撳簱",
+          field: "warehouseId",
+          type: "select",
+          dataKey: "warehouses",
+          data: [],
+          required: true,
+        },
+        {
+          field: "remark",
+          title: "澶囨敞",
+          type: "string",
+        }
+      ]
+      ]);
+      const columns = ref([
+        {
+          field: "id",
+          title: "Id",
+          type: "int",
+          width: 90,
+          hidden: true,
+          readonly: true,
+          require: true,
+          align: "left",
+        },
+        {
+          field: "orderNo",
+          title: "鐩樼偣鍗曞彿",
+          type: "string",
+          width: 150,
+          align: "left",
+          link: true,
+        },
+        {
+          field: "takeStockStatus",
+          title: "鐩樼偣鐘舵��",
+          type: "string",
+          width: 120,
+          align: "left",
+          bind: { key: "takeStockStatusEnum", data: [] },
+        },
+        {
+          field: "warehouseId",
+          title: "浠撳簱",
+          type: "string",
+          width: 90,
+          align: "left",
+          bind:{key: "warehouses", data: []}
+        },
+        {
+          field: "creater",
+          title: "鍒涘缓浜�",
+          type: "string",
+          width: 90,
+          align: "left",
+        },
+        {
+          field: "createDate",
+          title: "鍒涘缓鏃堕棿",
+          type: "datetime",
+          width: 160,
+          align: "left",
+        },
+        {
+          field: "modifier",
+          title: "淇敼浜�",
+          type: "string",
+          width: 100,
+          align: "left",
+        },
+        {
+          field: "modifyDate",
+          title: "淇敼鏃堕棿",
+          type: "datetime",
+          width: 160,
+          align: "left",
+        },
+        {
+          field: "remark",
+          title: "澶囨敞",
+          type: "string",
+          width: 100,
+          align: "left",
+        },
+      ]);
+      const detail = ref({
+        cnName: "鐩樼偣鏄庣粏",
+        table: "Dt_TakeStockOrderDetail",
+        columns: [
+          {
+            field: "id",
+            title: "Id",
+            type: "int",
+            width: 90,
+            hidden: true,
+            readonly: true,
+            require: true,
+            align: "left",
+          },
+          {
+            field: "takeStockId",
+            title: "鐩樼偣鍗曚富閿�",
+            type: "string",
+            width: 90,
+            align: "left",
+            hidden: true,
+          },
+          {
+            field: "takePalletCode",
+            title: "鐩樼偣鎵樼洏",
+            type: "string",
+            width: 150,
+            align: "left",
+            required: true,
+          },
+          {
+            field: "takeDetalStatus",
+            title: "鐩樼偣鏄庣粏鐘舵��",
+            type: "int",
+            width: 130,
+            align: "left",
+            bind: { key: "takeStockDetailStatusEnum", data: [] },
+          },
+          {
+            field: "materielCode",
+            title: "鐗╂枡缂栫爜",
+            type: "string",
+            width: 110,
+            align: "left",
+            required: true,
+          },
+          {
+            field: "materielName",
+            title: "鐗╂枡鍚嶇О",
+            type: "string",
+            width: 120,
+            align: "left",
+            required: true,
+          },
+          {
+            field: "batchNo",
+            title: "鎵规鍙�",
+            type: "string",
+            width: 130,
+            align: "left",
+            required: true,
+          },
+          {
+            field: "materielSpec",
+            title: "鐗╂枡鍚嶇О",
+            type: "string",
+            width: 120,
+            align: "left",
+            required: true,
+          },
+          {
+            field: "sysQty",
+            title: "璐﹂潰鏁伴噺",
+            type: "decimal",
+            width: 90,
+            align: "left",
+            required: true,
+            edit: { type: "decimal" }
+          },
+          {
+            field: "qty",
+            title: "瀹炵洏鏁伴噺",
+            type: "decimal",
+            width: 90,
+            align: "left",
+            required: true,
+            edit: { type: "decimal" }
+          },
+          {
+            field: "unit",
+            title: "鍗曚綅",
+            type: "string",
+            width: 90,
+            align: "left",
+          },
+          {
+            field: "creater",
+            title: "鍒涘缓浜�",
+            type: "string",
+            width: 90,
+            align: "left",
+          },
+          {
+            field: "createDate",
+            title: "鍒涘缓鏃堕棿",
+            type: "datetime",
+            width: 160,
+            align: "left",
+          },
+          {
+            field: "modifier",
+            title: "淇敼浜�",
+            type: "string",
+            width: 100,
+            align: "left",
+          },
+          {
+            field: "modifyDate",
+            title: "淇敼鏃堕棿",
+            type: "datetime",
+            width: 160,
+            align: "left",
+          },
+          {
+            field: "remark",
+            title: "澶囨敞",
+            type: "string",
+            width: 100,
+            align: "left",
+          },
+        ],
+        sortName: "id",
+        key: "id",
+      });
+      return {
+        table,
+        extend,
+        editFormFields,
+        editFormOptions,
+        searchFormFields,
+        searchFormOptions,
+        columns,
+        detail,
+      };
+    },
+  });
+  </script>
+        
\ No newline at end of file
diff --git a/WMS/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue b/WMS/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue
index 3816dd5..467bd51 100644
--- a/WMS/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue
+++ b/WMS/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue
@@ -40,7 +40,7 @@
           required: true,
           field: "orderType",
           type: "select",
-          dataKey: "outOrderType",
+          dataKey: "inOrderType",
           data: [],
         },
         {
@@ -87,10 +87,10 @@
         { title: "鍗曟嵁缂栧彿", field: "orderNo", type: "like" },
         { title: "涓婃父鍗曟嵁缂栧彿", field: "upperOrderNo", type: "like" },
         {
-          title: "鍗曟嵁绫诲瀷",
+          title: "鍗曟嵁澶х被",
           field: "orderType",
           type: "select",
-          dataKey: "outOrderType",
+          dataKey: "inOrderType",
           data: [],
         },
         {
@@ -102,6 +102,14 @@
         },
       ],
       [
+        {
+        field: "outWareHouse",
+        title: "鍑哄簱浠撳簱",
+        type: "select",
+        width: 120,
+        align: "left",
+        datakey:"",data:[{key:"SC01_BC", value:"鏉挎潗浠�"},{key:"SC02_BC", value:"鏉挎潗浠�(2)"}]
+      },
         {
           title: "鍒涘缓鏂瑰紡",
           field: "createType",
@@ -125,10 +133,25 @@
         align: "left",
       },
       {
+        field: "id",
+        title: "涓婚敭",
+        type: "int",
+        width: 90,
+        align: "left",
+      },
+      {
+        field: "outWareHouse",
+        title: "浠撳簱",
+        type: "string",
+        width: 120,
+        align: "left",
+        bind:{key:"",data:[{key:"SC01_BC", value:"鏉挎潗浠�"},{key:"SC02_BC", value:"鏉挎潗浠�(2)"}]}
+      },
+      {
         field: "orderNo",
         title: "鍗曟嵁缂栧彿",
         type: "string",
-        width: 120,
+        width: 170,
         align: "left",
         link: true,
       },
@@ -141,11 +164,19 @@
       },
       {
         field: "orderType",
-        title: "鍗曟嵁绫诲瀷",
+        title: "鍗曟嵁澶х被",
         type: "string",
         width: 150,
         align: "left",
-        bind: { key: "outOrderType", data: [] },
+        bind: { key: "inOrderType", data: [] },
+      },
+      {
+        field: "inoutType",
+        title: "鍑哄叆搴撶被鍨�",
+        type: "string",
+        width: 90,
+        align: "left",
+        bind: { key: "inoutTypeEnum", data: [] },
       },
       {
         field: "orderStatus",
@@ -236,14 +267,23 @@
           type: "string",
           width: 150,
           align: "left",
-                edit: { type: "string" },
+          edit: { type: "string" },
           required: true,
         },
         {
           field: "batchNo",
           title: "鎵规鍙�",
           type: "decimal",
-          width: 90,
+          width: 150,
+          align: "left",
+          edit: { type: "string" },
+          required: true,
+        },
+        {
+          field: "supplierBatch",
+          title: "渚涘簲鍟嗘壒娆″彿",
+          type: "decimal",
+          width: 180,
           align: "left",
           edit: { type: "string" },
           required: true,
diff --git a/WMS/WIDESEA_WMSClient/src/views/outbound/outboundOrderDetail.vue b/WMS/WIDESEA_WMSClient/src/views/outbound/outboundOrderDetail.vue
index e992c4c..871ce9b 100644
--- a/WMS/WIDESEA_WMSClient/src/views/outbound/outboundOrderDetail.vue
+++ b/WMS/WIDESEA_WMSClient/src/views/outbound/outboundOrderDetail.vue
@@ -38,50 +38,7 @@
       });
       const editFormOptions = ref([
         [
-          {
-            title: "璁惧缂栧彿",
-            required: true,
-            field: "deviceCode",
-            type: "string",
-          },
-          {
-            title: "璁惧鍚嶇О",
-            required: true,
-            field: "deviceName",
-            type: "string",
-          },
-          {
-            title: "璁惧绫诲瀷",
-            required: true,
-            field: "deviceType",
-            type: "string",
-          },
-          {
-            title: "璁惧鐘舵��",
-            required: true,
-            field: "deviceStatus",
-            type: "string",
-          },
-        ],
-        [
-          { title: "璁惧IP", required: true, field: "deviceIp", type: "string" },
-          {
-            title: "璁惧绔彛",
-            required: true,
-            field: "devicePort",
-            type: "string",
-          },
-          {
-            title: "PLC绫诲瀷",
-            required: true,
-            field: "devicePlcType",
-            type: "string",
-          },
-          {
-            title: "澶囨敞",
-            field: "deviceRemark",
-            type: "string",
-          },
+          
         ],
       ]);
       const searchFormFields = ref({
@@ -91,10 +48,18 @@
       });
       const searchFormOptions = ref([
         [
-          { title: "璁惧缂栧彿", field: "deviceCode" },
-          { title: "璁惧绫诲瀷", field: "deviceType" },
-          { title: "璁惧鐘舵��", field: "deviceStatus" },
-        ],
+        { title: "鐗╂枡缂栧彿", field: "materielCode", type: "like" },
+        { title: "鐗╂枡鍚嶇О", field: "materielName", type: "like" },
+        { title: "鍑哄簱鍗曚富閿�", field: "orderId", type: "int" },
+        { title: "鎵规鍙�", field: "batchNo", type: "like" },
+      ],
+      [
+        {
+          field: "orderDetailStatus",title: "璁㈠崟鏄庣粏鐘舵��",type: "select",dataKey:"orderDetailStatusEnum", data: []
+        },
+        { title: "鍒涘缓鑰�", field: "creater", type: "like" },
+        { title: "鍒涘缓鏃堕棿", field: "createDate", type: "datetime" },
+      ],
       ]);
       const columns = ref([
       {
@@ -112,7 +77,6 @@
           type: "string",
           width: 90,
           align: "left",
-          hidden: true,
         },
         {
           field: "materielCode",
@@ -122,17 +86,19 @@
           align: "left",
         },
         {
-          field: "materielName",
-          title: "鐗╂枡鍚嶇О",
+          field: "remark",
+          title: "澶囨敞",
           type: "string",
-          width: 150,
+          width: 600,
           align: "left",
+          color:"red"
         },
+        
         {
           field: "batchNo",
           title: "鎵规鍙�",
           type: "decimal",
-          width: 90,
+          width: 150,
           align: "left",
         },
         {
@@ -142,26 +108,26 @@
           width: 90,
           align: "left",
         },
-        {
-          field: "lockQuantity",
-          title: "閿佸畾鏁伴噺",
-          type: "int",
-          width: 120,
-          align: "left",
-        },
+        
         {
           field: "overOutQuantity",
           title: "宸插嚭鏁伴噺",
           type: "string",
-          width: 200,
+          width: 80,
           align: "left",
         },
         {
           field: "orderDetailStatus",
           title: "璁㈠崟鏄庣粏鐘舵��",
           type: "string",
-          width: 180,
-          align: "left",
+          width: 90,
+          bind: { key: "orderDetailStatusEnum", data: [] },
+        },
+        {
+          field: "locationName",
+          title: "鎸囧畾鍑哄簱璐т綅",
+          type: "string",
+          width: 200,
         },
         {
           field: "creater",
@@ -192,12 +158,20 @@
           align: "left",
         },
         {
-          field: "remark",
-          title: "澶囨敞",
+          field: "materielName",
+          title: "鐗╂枡鍚嶇О",
           type: "string",
-          width: 100,
+          width: 150,
           align: "left",
         },
+        {
+          field: "lockQuantity",
+          title: "閿佸畾鏁伴噺",
+          type: "int",
+          width: 120,
+          align: "left",
+        },
+        
       ]);
       const detail = ref({
         cnName: "#detailCnName",
@@ -218,4 +192,3 @@
     },
   });
   </script>
-    
\ No newline at end of file
diff --git a/WMS/WIDESEA_WMSClient/src/views/stock/stockInfo.vue b/WMS/WIDESEA_WMSClient/src/views/stock/stockInfo.vue
index 7ae264a..9fd1442 100644
--- a/WMS/WIDESEA_WMSClient/src/views/stock/stockInfo.vue
+++ b/WMS/WIDESEA_WMSClient/src/views/stock/stockInfo.vue
@@ -98,13 +98,6 @@
           dataKey: "stockStatusEmun",
           data: [],
         },
-        {
-          title: "鐗╂枡鐘舵��",
-          field: "wlstatus",
-          type: "selectList",
-          dataKey: "InventoryMaterialStatus",
-          data: [],
-        },
         { title: "搴撳瓨缂栧彿",
             field: "id",
             type: "like",
@@ -112,7 +105,6 @@
         ],
         [
         { title: "鍒涘缓鏃堕棿", field: "createDate", type: "datetime" },
-        { title: "鐢熶骇鏃堕棿", field: "mgeneratetime", type: "datetime" },
         ]
       ]);
       const columns = ref([
diff --git a/WMS/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue b/WMS/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue
index ad11c22..8df3cba 100644
--- a/WMS/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue
+++ b/WMS/WIDESEA_WMSClient/src/views/stock/stockInfoDetail.vue
@@ -63,31 +63,15 @@
     });
     const searchFormOptions = ref([
       [
-        { title: "鐗╂枡缂栧彿", field: "materielCode",type:"like"},
-        { title: "鐗╂枡鍚嶇О", field: "materielName",type:"like" },
-        { title: "鐗╂枡璇︽儏", field: "orderNo" ,type:"like"},
-        
-        
+        { title: "鐗╂枡缂栧彿", field: "materielCode",type :"like"},
+        { title: "鐗╂枡鍚嶇О", field: "materielName",type :"like"},
+        { title: "鍗曟嵁缂栧彿", field: "orderNo",type :"like"},
       ],
       [
-      { title: "鐗╂枡鎵规", field: "batchNo",type:"like" },
-        { title: "鐗╂枡鎵规璇︽儏", field: "batchNoName",type:"like" },
-        { title: "閲嶉噺", field: "stockQuantity",type:"like" },
+        { title: "鎵规鍙�", field: "batchNo",type :"like"},
+        {title: "搴撳瓨鏄庣粏鐘舵��",field: "status",type: "select",dataKey:"stockStatusEmun", data: []},
+        { title: "鍒涘缓鏃ユ湡",field: "createDate",type: "datetime"},
       ],
-      [
-      {
-          title: "搴撳瓨鏄庣粏鐘舵��",
-          field: "stockQuantity",
-          type:"like"
-        },
-        {
-        field: "stockId",
-        title: "搴撳瓨淇℃伅涓婚敭",
-        type: "string",
-        width: 90,
-        align: "left",
-      },
-      ]
     ]);
     const columns = ref([
       {
diff --git a/WMS/WIDESEA_WMSClient/src/views/stock/stockView.vue b/WMS/WIDESEA_WMSClient/src/views/stock/stockView.vue
index f3c37e5..b35fb25 100644
--- a/WMS/WIDESEA_WMSClient/src/views/stock/stockView.vue
+++ b/WMS/WIDESEA_WMSClient/src/views/stock/stockView.vue
@@ -32,35 +32,26 @@
       locationName: "",
     });
     const editFormOptions = ref([
-      [
-        {
-          title: "鎵樼洏缂栧彿",
-          required: true,
-          field: "palletCode",
-          type: "string",
-        },
-        {
-          title: "璐т綅缂栧彿",
-          required: true,
-          field: "locationCode",
-          type: "string",
-        },
-        {
-          title: "璐т綅鍚嶇О",
-          required: true,
-          field: "locationName",
-          type: "string",
-        },
-      ],
+      
     ]);
     const searchFormFields = ref({
       palletCode: "",
-      locationCode: "",
+      // locationCode: "",
+      materielCode:"",
+      batchNo:""
     });
     const searchFormOptions = ref([
       [
-        { title: "鎵樼洏缂栧彿", field: "palletCode" },
-        { title: "璐т綅缂栧彿", field: "locationCode" },
+        { title: "鎵樼洏缂栧彿", field: "palletCode",type: "like" },
+        { title: "璐т綅缂栧彿", field: "locationCode",type: "like" },
+        { title: "璐т綅鐘舵��", field: "locationStatus" ,type: "selectList",dataKey: "locationStatusEnum",data: [],},
+        { title: "搴撳瓨鐘舵��", field: "stockStatus",type: "select",dataKey: "stockStatusEmun",data: [],},
+      ],
+      [
+        { title: "鐗╂枡缂栧彿", field: "materielCode",type: "like"},
+        { title: "鎵规鍙�", field: "batchNo",type: "like"},
+        { title: "鎵�灞炰粨搴�", field: "warehouseId",type: "select",dataKey: "warehouses",data: [],},
+        { title: "搴撳瓨鍒涘缓鏃堕棿",field: "createDate",type: "datetime"},
       ],
     ]);
     const columns = ref([
@@ -86,21 +77,51 @@
         field: "locationCode",
         title: "璐т綅缂栧彿",
         type: "string",
-        width: 180,
+        width: 200,
         align: "left",
       },
       {
         field: "locationName",
         title: "璐т綅鍚嶇О",
         type: "string",
-        width: 220,
+        width: 270,
         align: "left",
+      },
+      {
+        field: "warehouseId",
+        title: "鎵�灞炰粨搴�",
+        type: "string",
+        width: 80,
+        align: "left",
+        bind: { key: "warehouses", data: [] },
       },
       {
         field: "roadwayNo",
         title: "宸烽亾缂栧彿",
         type: "decimal",
-        width: 90,
+        width: 100,
+        align: "left",
+        hidden:true
+      },
+      {
+        field: "materielCode",
+        title: "鎵�鍚墿鏂欑紪鍙�",
+        type: "string",
+        width: 120,
+        align: "left",
+      },
+      {
+        field: "batchNo",
+        title: "鎵�鍚墿鏂欐壒娆�",
+        type: "string",
+        width: 200,
+        align: "left"
+      },
+      {
+        field: "sumStock",
+        title: "鎬诲簱瀛�",
+        type: "string",
+        width: 140,
         align: "left",
       },
       {
@@ -143,11 +164,12 @@
         align: "left",
         bind: { key: "stockStatusEmun", data: [] },
       },
+
       {
         field: "locationType",
         title: "璐т綅绫诲瀷",
         type: "string",
-        width: 120,
+        width: 100,
         align: "left",
         bind:{key: "locationTypeEnum", data: []}
       },
@@ -155,7 +177,7 @@
         field: "locationStatus",
         title: "璐т綅鐘舵��",
         type: "string",
-        width: 200,
+        width: 120,
         align: "left",
         bind: { key: "locationStatusEnum", data: [] },
       },
@@ -163,18 +185,9 @@
         field: "enalbeStatus",
         title: "绂佺敤鐘舵��",
         type: "string",
-        width: 180,
+        width: 80,
         align: "left",
         bind: { key: "enableStatusEnum", data: [] },
-      },
-      {
-        field: "isFull",
-        title: "鏄惁婊$洏",
-        type: "string",
-        width: 150,
-        align: "left",
-        hidden: true,
-          bind: { key: "yesno", data: [] },
       },
       {
         field: "creater",
@@ -210,6 +223,7 @@
         type: "string",
         width: 100,
         align: "left",
+        hidden:true
       },
     ]);
     const detail = ref({
@@ -232,39 +246,42 @@
           type: "string",
           width: 90,
           align: "left",
-          sort:true,
+          hidden: true
         },
         {
           field: "materielCode",
           title: "鐗╂枡缂栧彿",
           type: "string",
-          width: 150,
+          width: 110,
           align: "left",
-          sort:true,
         },
         {
           field: "materielName",
           title: "鐗╂枡鍚嶇О",
           type: "string",
-          width: 150,
+          width: 130,
           align: "left",
-          sort:true,
         },
         {
           field: "orderNo",
           title: "鍗曟嵁缂栧彿",
           type: "decimal",
-          width: 90,
+          width: 130,
           align: "left",
-          sort:true,
         },
         {
           field: "batchNo",
           title: "鎵规鍙�",
           type: "string",
-          width: 90,
+          width: 180,
           align: "left",
-          sort:true,
+        },
+        {
+          field: "materielSpec",
+          title: "瑙勬牸鍨嬪彿",
+          type: "string",
+          width: 180,
+          align: "left",
         },
         {
           field: "serialNumber",
@@ -272,23 +289,42 @@
           type: "int",
           width: 120,
           align: "left",
-          sort:true,
+          hidden: true,
         },
         {
           field: "stockQuantity",
           title: "搴撳瓨鏁伴噺",
           type: "string",
-          width: 200,
+          width: 80,
           align: "left",
-          sort:true,
         },
         {
           field: "outboundQuantity",
           title: "鍑哄簱鏁伴噺",
           type: "string",
-          width: 180,
+          width: 80,
           align: "left",
-          sort:true,
+        },
+        {
+          field: "unit",
+          title: "鍗曚綅",
+          type: "string",
+          width: 50,
+          align: "left",
+        },
+        {
+          field: "productionDate",
+          title: "鐢熶骇鏃ユ湡",
+          type: "string",
+          width: 120,
+          align: "left",
+        },
+        {
+          field: "effectiveDate",
+          title: "鏈夋晥鏃ユ湡",
+          type: "string",
+          width: 120,
+          align: "left",
         },
         {
           field: "status",
@@ -296,7 +332,7 @@
           type: "string",
           width: 120,
           align: "left",
-          sort:true,
+          bind: { key: "stockStatusEmun", data: [] }
         },
         {
           field: "creater",
@@ -304,7 +340,7 @@
           type: "string",
           width: 90,
           align: "left",
-          sort:true,
+          hidden: true
         },
         {
           field: "createDate",
@@ -312,7 +348,7 @@
           type: "datetime",
           width: 160,
           align: "left",
-          sort:true,
+          hidden: true
         },
         {
           field: "modifier",
@@ -320,7 +356,7 @@
           type: "string",
           width: 100,
           align: "left",
-          sort:true,
+          hidden: true
         },
         {
           field: "modifyDate",
@@ -328,7 +364,7 @@
           type: "datetime",
           width: 160,
           align: "left",
-          sort:true,
+          hidden: true
         },
         {
           field: "remark",
@@ -336,7 +372,7 @@
           type: "string",
           width: 100,
           align: "left",
-          sort:true,
+          hidden: true
         },
       ],
       sortName: "id",
diff --git a/WMS/WIDESEA_WMSClient/src/views/taskinfo/task.vue b/WMS/WIDESEA_WMSClient/src/views/taskinfo/task.vue
index 889d1f8..8a1acd5 100644
--- a/WMS/WIDESEA_WMSClient/src/views/taskinfo/task.vue
+++ b/WMS/WIDESEA_WMSClient/src/views/taskinfo/task.vue
@@ -55,7 +55,7 @@
         {
           title: "浠诲姟鐘舵��",
           field: "taskStatus",
-          type: "selectList",
+          type: "select",
           dataKey: "taskStatusEnum",
           data: [],
         },
diff --git a/WMS/WIDESEA_WMSClient/src/views/taskinfo/task_hty.vue b/WMS/WIDESEA_WMSClient/src/views/taskinfo/task_hty.vue
index b68fa6a..1c135db 100644
--- a/WMS/WIDESEA_WMSClient/src/views/taskinfo/task_hty.vue
+++ b/WMS/WIDESEA_WMSClient/src/views/taskinfo/task_hty.vue
@@ -56,7 +56,7 @@
         {
           title: "浠诲姟鐘舵��",
           field: "taskStatus",
-          type: "selectList",
+          type: "select",
           dataKey: "taskStatusEnum",
           data: [],
         },
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs
index 24c04ad..0ae970f 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs
@@ -6,6 +6,7 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using WIDESEA_Common.OrderEnum;
 using WIDESEA_Core;
 using WIDESEA_Core.BaseRepository;
 using WIDESEA_Core.BaseServices;
@@ -16,6 +17,7 @@
 using WIDESEA_IBasicRepository;
 using WIDESEA_IBasicService;
 using WIDESEA_Model.Models;
+using WIDESEA_Model.Models.Inbound;
 
 namespace WIDESEA_BasicService
 {
@@ -289,6 +291,62 @@
             }
             return groupLocations;
         }
+        /// <summary>
+        /// 璐т綅閲婃斁
+        /// </summary>
+        /// <param name="locationCodes"></param>
+        /// <returns></returns>
+        public WebResponseContent LocationRelease(List<string> locationCodes)
+        {
+            try
+            {
+                if (locationCodes == null || locationCodes.Count == 0)
+                {
+                    return WebResponseContent.Instance.Error("璇锋彁渚涜揣浣嶇紪鐮�");
+                }
+
+                List<Dt_LocationInfo> locationInfos = BaseDal.GetLocationInfos(locationCodes);
+                var matchedCodes = locationInfos.Select(x => x.LocationCode).ToList();
+                var unmatchedCode = locationCodes.Except(matchedCodes).ToList();
+
+                if (unmatchedCode.Any())
+                {
+                    return WebResponseContent.Instance.Error($"浠ヤ笅璐т綅缂栧彿{string.Join(",", unmatchedCode)}鏈壘鍒拌揣浣嶄俊鎭�");
+                }
+
+                foreach (var x in locationInfos)
+                {
+                    if (x.EnableStatus == EnableStatusEnum.Disable.ObjToInt()|| x.EnableStatus == LocationStatusEnum.InStock.ObjToInt())
+                    {
+                        return WebResponseContent.Instance.OK($"璐т綅閲婃斁鎿嶄綔宸茬粓姝�,璇ヨ揣浣峽x.LocationCode}宸茬鐢ㄦ垨澶勪簬鏈夎揣鐘舵��");
+                    }
+
+                    if (x.LocationStatus == LocationStatusEnum.Lock.ObjToInt())
+                    {
+                        Dt_ReturnOrder returnOrder = BaseDal.Db.Queryable<Dt_ReturnOrder>()
+                            .Where(y => y.LocationCode == x.LocationCode && y.OrderStatus == InOrderStatusEnum.鏈紑濮�.ObjToInt())
+                            .First();
+
+                        if (returnOrder == null)
+                        {
+                            continue;
+                        }
+                        else
+                        {
+                            x.LocationStatus = LocationStatusEnum.Free.ObjToInt();
+                        }
+                    }
+                }
+
+                Repository.UpdateData(locationInfos);
+                return WebResponseContent.Instance.OK("璐т綅閲婃斁鎴愬姛");
+            }
+            catch (Exception ex)
+            {
+                return WebResponseContent.Instance.Error(ex.Message);
+            }
+        }
+
         public class LocationCache
         {
             public string LocationCode { get; set; }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs
index 0620ddc..a15eb27 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs
@@ -22,7 +22,6 @@
     public partial class LocationInfoService : ServiceBase<Dt_LocationInfo, ILocationInfoRepository>, ILocationInfoService
     {
         private readonly IRecordService _recordService;
-
         public LocationInfoService(ILocationInfoRepository BaseDal, IBasicRepository basicRepository, IRecordService recordService) : base(BaseDal)
         {
             _basicRepository = basicRepository;
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Common/HouseBackboundPassBack.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Common/HouseBackboundPassBack.cs
new file mode 100644
index 0000000..54922ff
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Common/HouseBackboundPassBack.cs
@@ -0,0 +1,75 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using static WIDESEA_Common.HouseBackboundPassBack;
+
+namespace WIDESEA_Common
+{
+    public class HouseBackboundPassBack
+    {
+        public List<backdata> Parameters = new List<backdata>();
+        public string ApiType { get; set; }
+        public string Method { get; set; }
+        public Dictionary<string, string> Context { get; set; }
+        public class backdata
+        {
+            public List<backdata1> Value = new List<backdata1>();
+
+            public class backdata1
+            {
+                public int OrderType { get; set; }
+                /// <summary>
+                /// 鐗╂枡缂栧彿
+                /// </summary>
+                public string MaterielCode { get; set; }
+                /// <summary>
+                /// 鐗╂枡鍚嶇О
+                /// </summary>
+                public string MaterielName { get; set; }
+                /// <summary>
+                /// 鎵规鍙�
+                /// </summary>
+                public string BatchNo { get; set; }
+                /// <summary>
+                /// 鍗曟嵁鏁伴噺
+                /// </summary>
+                public decimal OrderQuantity { get; set; }
+                /// <summary>
+                /// 鐗╂枡瑙勬牸
+                /// </summary>
+                public string MaterieSpec { get; set; }
+                /// <summary>
+                /// 澶囨敞
+                /// </summary>
+                public string Remark { get; set; }
+                /// <summary>
+                /// 鏄庣粏id
+                /// </summary>
+                public string LinId { get; set; }
+                /// <summary>
+                /// LPN鍙�
+                /// </summary>
+                public string LPNNo { get; set; }
+                /// <summary>
+                /// 璐т綅缂栧彿
+                /// </summary>
+                public string LocationCode { get; set; }
+
+                /// <summary>
+                /// 浠撳簱缂栧彿
+                /// </summary>
+                public string WarehouseCode { get; set; }
+
+                /// <summary>
+                /// 鎺ㄥ崟绯荤粺
+                /// </summary>
+                public string System { get; set; }
+
+            }
+        }
+
+    }
+}
+
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Common/HouseInbound.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Common/HouseInbound.cs
index 6deaea8..61cfc42 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Common/HouseInbound.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Common/HouseInbound.cs
@@ -34,6 +34,10 @@
         public string InoutType { get; set; }
 
         /// <summary>
+        /// 鎺ㄥ崟绯荤粺
+        /// </summary>
+        public string System { get; set; }
+        /// <summary>
         /// 鍏ュ簱鍗曟槑缁�
         /// </summary>
         public List<DetailList> DetailList { get; set; }
@@ -70,5 +74,9 @@
         /// 鍗曟嵁鏁伴噺
         /// </summary>
         public decimal OrderQuantity { get; set; }
+        /// <summary>
+        /// 渚涘簲鍟嗘壒娆�
+        /// </summary>
+        public string SupplierBatch { get; set; }
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Common/Houseounbound.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Common/Houseounbound.cs
index acf0df3..672fee7 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Common/Houseounbound.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Common/Houseounbound.cs
@@ -28,6 +28,11 @@
         /// 鍗曟嵁灏忕被
         /// </summary>
         public string TransactionCode { get; set; }
+
+        /// <summary>
+        /// 鎺ㄥ崟绯荤粺
+        /// </summary>
+        public string System { get; set; }
         /// <summary>
         /// 鍑哄叆搴撶被鍨�
         /// </summary>
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Common/MaterielEnum/MaterielSourceTypeEnum.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Common/MaterielEnum/MaterielSourceTypeEnum.cs
new file mode 100644
index 0000000..157b741
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Common/MaterielEnum/MaterielSourceTypeEnum.cs
@@ -0,0 +1,30 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEA_Common.MaterielEnum
+{
+    public enum MaterielSourceTypeEnum
+    {
+        /// <summary>
+        /// 閲囪喘浠�
+        /// </summary>
+        [Description("閲囪喘浠�")]
+        閲囪喘浠� = 1,
+
+        /// <summary>
+        /// 鑷埗浠�
+        /// </summary>
+        [Description("鑷埗浠�")]
+        鑷埗浠� = 2,
+
+        /// <summary>
+        /// 閲囪喘&鑷埗浠�
+        /// </summary>
+        [Description("閲囪喘鍜岃嚜鍒朵欢")]
+        閲囪喘鍜岃嚜鍒朵欢 = 3
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Common/MaterielEnum/MaterielTypeEnum.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Common/MaterielEnum/MaterielTypeEnum.cs
new file mode 100644
index 0000000..9d07de4
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Common/MaterielEnum/MaterielTypeEnum.cs
@@ -0,0 +1,39 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEA_Common.MaterielEnum
+{
+    /// <summary>
+    /// 鐗╂枡鍩烘湰鍒嗙被
+    /// </summary>
+    public enum MaterielTypeEnum
+    {
+        /// <summary>
+        /// 鎴愬搧
+        /// </summary>
+        [Description("鎴愬搧")]
+        鎴愬搧,
+
+        /// <summary>
+        /// 鍗婃垚鍝�
+        /// </summary>
+        [Description("鍗婃垚鍝�")]
+        鍗婃垚鍝�,
+
+        /// <summary>
+        /// 鍘熸潗鏂�
+        /// </summary>
+        [Description("鍘熸潗鏂�")]
+        鍘熸潗鏂�,
+
+        /// <summary>
+        /// 澶囦欢
+        /// </summary>
+        [Description("澶囦欢")]
+        澶囦欢
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/OutboundOrderEnum.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/OutboundOrderEnum.cs
index 79a1f01..364be73 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/OutboundOrderEnum.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/OutboundOrderEnum.cs
@@ -40,71 +40,6 @@
         鍙栨秷 = 98
     }
 
-    /// <summary>
-    /// 鍑哄簱鍗曠被鍨�
-    /// </summary>
-    public enum OutOrderTypeEnum
-    {
-
-        /// <summary>
-        /// MES鍑哄簱鍗�
-        /// </summary>
-        [Description("MES鍑哄簱鍗�")]
-        MesOutOrder = 100,
-        /// <summary>
-        /// 鐢熶骇杩斿伐鍗�
-        /// </summary>
-        [Description("鐢熶骇杩斿伐鍗�")]
-        Rework = 200,
-
-        /// <summary>
-        /// 鐢熶骇鍙戞枡鍗�
-        /// </summary>
-        [Description("鐢熶骇鍙戞枡鍗�")]
-        Issue = 205,
-
-        /// <summary>
-        /// 閲囪喘閫�璐у崟
-        /// </summary>
-        [Description("閲囪喘閫�璐у崟")]
-        ProcureReturn = 210,
-
-        /// <summary>
-        /// 璋冩嫧鍑哄簱鍗�
-        /// </summary>
-        [Description("璋冩嫧鍑哄簱鍗�")]
-        Allocate = 215,
-
-        /// <summary>
-        /// 閿�鍞嚭搴撳崟
-        /// </summary>
-        [Description("閿�鍞嚭搴撳崟")]
-        SaleOut = 220,
-
-        /// <summary>
-        /// 绌虹洏鍑哄簱鍗�
-        /// </summary>
-        [Description("绌虹洏鍑哄簱鍗�")]
-        EmptyDisk = 225,
-
-        /// <summary>
-        /// 璐ㄦ鍑哄簱鍗�
-        /// </summary>
-        [Description("璐ㄦ鍑哄簱鍗�")]
-        Quality = 230,
-
-        /// <summary>
-        /// 鍏朵粬鍑哄簱鍗�
-        /// </summary>
-        [Description("鍏朵粬鍑哄簱鍗�")]
-        Other = 235,
-
-        /// <summary>
-        /// 缁翠慨鍙戞枡鍗�
-        /// </summary>
-        [Description("缁翠慨鍙戞枡鍗�")]
-        MaintenanceIssue = 240,
-    }
     public enum ProOrderTypeEnum
     {
         /// <summary>
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/HouseReturnOrder.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/HouseReturnOrder.cs
new file mode 100644
index 0000000..a02f0e4
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/HouseReturnOrder.cs
@@ -0,0 +1,63 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEA_Common.TaskEnum
+{
+    public class HouseReturnOrder
+    {
+
+        /// <summary>
+        /// 鍗曟嵁绫诲瀷
+        /// </summary>
+        public int OrderType { get; set; }
+        /// <summary>
+        /// 鐗╂枡缂栧彿
+        /// </summary>
+        public string MaterielCode { get; set; }
+        /// <summary>
+        /// 鐗╂枡鍚嶇О
+        /// </summary>
+        public string MaterielName { get; set; }
+        /// <summary>
+        /// 鎵规鍙�
+        /// </summary>
+        public string BatchNo { get; set; }
+        /// <summary>
+        /// 鍗曟嵁鏁伴噺
+        /// </summary>
+        public decimal OrderQuantity { get; set; }
+        /// <summary>
+        /// 鐗╂枡瑙勬牸
+        /// </summary>
+        public string MaterieSpec { get; set; }
+        /// <summary>
+        /// 澶囨敞
+        /// </summary>
+        public string Remark { get; set; }
+        /// <summary>
+        /// 鏄庣粏id
+        /// </summary>
+        public string LinId { get; set; }
+        /// <summary>
+        /// LPN鍙�
+        /// </summary>
+        public string LPNNo { get; set; }
+        /// <summary>
+        /// 璐т綅缂栧彿
+        /// </summary>
+        public string LocationCode { get; set; }
+
+        /// <summary>
+        /// 浠撳簱缂栧彿
+        /// </summary>
+        public string WarehouseCode { get; set; }
+
+        /// <summary>
+        /// 鎺ㄥ崟绯荤粺
+        /// </summary>
+        public string System { get; set; }
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs
index a69a3d1..ad3e3be 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs
@@ -18,7 +18,7 @@
         /// 鐩樼偣鍏ュ簱
         /// </summary>
         [Description("鐩樼偣鍏ュ簱")]
-        InInventory = 201,
+        InInventory = 520,
         /// <summary>
         /// 鍒嗘嫞鍏ュ簱
         /// </summary>
@@ -27,14 +27,20 @@
         /// <summary>
         /// 璐ㄦ鍏ュ簱
         /// </summary>
-        [Description("璐ㄦ鍏ュ簱")]
-        InQuality = 203,
+        [Description("鍙嶆嫞鍏ュ簱")]
+        InQuality = 580,
 
         /// <summary>
         /// 鍏ョ┖鎵�
         /// </summary>
         [Description("鍏ョ┖鎵�")]
         PalletInbound = 204,
+
+        /// <summary>
+        /// 鍏ュ簱
+        /// </summary>
+        [Description("浣欐枡鍥炲簱")]
+        SurplusReturn = 560,
     }
 
     public enum TaskOutboundTypeEnum
@@ -48,12 +54,12 @@
         /// 鐩樼偣鍑哄簱
         /// </summary>
         [Description("鐩樼偣鍑哄簱")]
-        OutInventory = 101,
+        OutInventory = 110,
         /// <summary>
         /// 鍒嗘嫞鍑哄簱
         /// </summary>
-        [Description("鍒嗘嫞鍑哄簱")]
-        OutPick = 102,
+        [Description("鍙嶆嫞鍑哄簱")]
+        OutPick = 160,
         /// <summary>
         /// 璐ㄦ鍑哄簱
         /// </summary>
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Core/AOP/SqlSugarAop.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Core/AOP/SqlSugarAop.cs
index dac84c9..cc53452 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Core/AOP/SqlSugarAop.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Core/AOP/SqlSugarAop.cs
@@ -98,6 +98,15 @@
                             break;
                     }
                 }
+
+            }
+
+            if (entityInfo.EntityValue is IBaseHistoryEntity baseHistoryEntity)
+            {
+                if (entityInfo.OperationType == DataFilterType.InsertByObject && entityInfo.PropertyName == nameof(IBaseHistoryEntity.InsertTime))
+                {
+                    baseHistoryEntity.InsertTime = DateTime.Now;
+                }
             }
         }
 
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Core/CodeConfigEnum/RuleCodeEnum.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Core/CodeConfigEnum/RuleCodeEnum.cs
index e883580..bfdde8d 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Core/CodeConfigEnum/RuleCodeEnum.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Core/CodeConfigEnum/RuleCodeEnum.cs
@@ -69,6 +69,7 @@
         /// 鎴愬搧鎶ュ簾鍗曞彿缂栫爜瑙勫垯
         /// </summary>
         [Description("鎴愬搧鎶ュ簾鍗曞彿缂栫爜瑙勫垯")]
-        ProScrapSheetRule
+        ProScrapSheetRule,
+        
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ConfigEnum.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ConfigEnum.cs
index 635b560..09fcaab 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ConfigEnum.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ConfigEnum.cs
@@ -88,7 +88,24 @@
         /// 鍑哄簱鍗曞彿缂栫爜瑙勫垯缂栧彿
         /// </summary>
         [Description("鍑哄簱鍗曞彿缂栫爜瑙勫垯缂栧彿")]
-        OutboundOrderRule
+        OutboundOrderRule,
+        /// <summary>
+        /// 閫�鏂欏崟鍙风紪鐮佽鍒�
+        /// </summary>
+        [Description("閫�鏂欏崟鍙风紪鐮佽鍒�")]
+        TKCodeRule,
+
+        /// <summary>
+        /// 鍐呴儴鎵规缂栫爜瑙勫垯缂栧彿
+        /// </summary>
+        [Description("鍐呴儴鎵规缂栫爜瑙勫垯缂栧彿")]
+        BatchNORule,
+
+        /// <summary>
+        /// 鐩樼偣鍗曞彿缂栫爜瑙勫垯
+        /// </summary>
+        [Description("鐩樼偣鍗曞彿缂栫爜瑙勫垯")]
+        PDCodeRule,
     }
 
     public enum CodeFormat
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ManageEnum.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ManageEnum.cs
index 17216eb..d87c627 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ManageEnum.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/ManageEnum.cs
@@ -40,5 +40,6 @@
         鑷姩鎭㈠ = 4,
         浜哄伐瀹屾垚 = 5,
         鑷姩瀹屾垚 = 6,
+        浜哄伐鍙栨秷 =7,
     }
 }
\ No newline at end of file
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/OrderEnum.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/OrderEnum.cs
index 8b5562f..215bac6 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/OrderEnum.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/OrderEnum.cs
@@ -36,6 +36,23 @@
         /// </summary>
         [Description("璋冩嫧鍑哄簱鍗�")]
         璋冩嫧鍑哄簱鍗� = 3,
+        /// <summary>
+        /// 浣欐枡鍥炲簱鍗�
+        /// </summary>
+        [Description("浣欐枡鍥炲簱鍗�")]
+        浣欐枡鍥炲簱鍗� = 4,
+
+        /// <summary>
+        /// 鍙嶆嫞鍥炲簱鍗�
+        /// </summary>
+        [Description("鍙嶆嫞鍥炲簱鍗�")]
+        鍙嶆嫞鍥炲簱鍗� = 5,
+
+        /// <summary>
+        /// 鍙嶆嫞鍑哄簱鍗�
+        /// </summary>
+        [Description("鍙嶆嫞鍑哄簱鍗�")]
+        鍙嶆嫞鍑哄簱鍗� = 6,
 
     }
     /// <summary>
@@ -118,7 +135,7 @@
         /// </summary>
         [Description("搴撳瓨璋冩暣")]
         InventoryAdjust,
-
+        
         /// <summary>
         /// 鏍囧噯鐩樼偣
         /// </summary>
@@ -406,21 +423,6 @@
         [Description("瀵煎叆")]
         daoru
     }
-
-    #region 搴撳瓨鐘舵��
-
-    /// <summary>
-    /// 搴撳瓨鐘舵�侊細 1锛岀粍鐩樻殏瀛�  2锛岀粍鐩樻挙閿�  3锛屽叆搴撶‘璁� 4锛屽叆搴撴挙閿�   5锛屽凡鍏ュ簱  6锛屽凡鍑哄簱
-    /// </summary>
-    public enum StockStateEmun
-    {
-        缁勭洏鏆傚瓨 = 1,
-        鍏ュ簱瀹屾垚 = 2,
-        鍑哄簱閿佸畾 = 3,
-        鍑哄簱瀹屾垚 = 4,
-    }
-
-    #endregion 搴撳瓨鐘舵��
 
     public enum OrderTypeEmun
     {
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/StockEnum.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/StockEnum.cs
index 35b34f6..7c8247a 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/StockEnum.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/StockEnum.cs
@@ -80,6 +80,18 @@
 
         [Description("鍏ュ簱涓�")]
         鍏ュ簱涓� = 12,
+
+        [Description("鍙嶆嫞鍏ュ簱")]
+        鍙嶆嫞鍏ュ簱 = 13,
+
+        [Description("浣欐枡閫�搴�")]
+        浣欐枡閫�搴� = 14,
+
+        [Description("鐩樼偣鍑哄簱瀹屾垚")]
+        鐩樼偣鍑哄簱瀹屾垚 = 20,
+
+        [Description("鐩樼偣搴撳瓨瀹屾垚")]
+        鐩樼偣搴撳瓨瀹屾垚 = 32,
     }
 
     public enum OutStockStatus
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/TaskEnum.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/TaskEnum.cs
index 3663fe9..e76c32a 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/TaskEnum.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/TaskEnum.cs
@@ -52,6 +52,12 @@
         OutAllocate = 150,
 
         /// <summary>
+        /// 鍙嶆嫞鍑哄簱
+        /// </summary>
+        [Description("鍙嶆嫞鍑哄簱")]
+        ReverseOut = 160,
+
+        /// <summary>
         /// 鎴愬搧鍑哄簱
         /// </summary>
         [Description("鎴愬搧鍑哄簱")]
@@ -92,6 +98,11 @@
         /// </summary>
         [Description("鐢熶骇閫�鏂�")]
         ProductionReturn = 550,
+        /// <summary>
+        /// 浣欐枡閫�搴�
+        /// </summary>
+        [Description("浣欐枡閫�搴�")]
+        SurplusReturn = 560,
 
         /// <summary>
         /// 璋冩嫧鍏ュ簱
@@ -100,6 +111,12 @@
         InAllocate = 570,
 
         /// <summary>
+        /// 鍙嶆嫞鍏ュ簱
+        /// </summary>
+        [Description("鍙嶆嫞鍏ュ簱")]
+        ReverseIn = 580,
+
+        /// <summary>
         /// 绌虹鍏ュ簱
         /// </summary>
         [Description("绌虹鍏ュ簱")]
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/TaskStatusEnum.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/TaskStatusEnum.cs
index 472ffcb..0394f20 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/TaskStatusEnum.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Enums/TaskStatusEnum.cs
@@ -19,6 +19,12 @@
         New = 100,
 
         /// <summary>
+        /// 鎻愬崌鏈烘墽琛屼腑
+        /// </summary>
+        [Description("鎻愬崌鏈烘墽琛屼腑")]
+        HT_Executing = 110,
+
+        /// <summary>
         /// 鍫嗗灈鏈哄緟鎵ц
         /// </summary>
         [Description("鍫嗗灈鏈哄緟鎵ц")]
@@ -55,33 +61,48 @@
         Line_Finish = 420,
 
         /// <summary>
-        /// AGV寰呮墽琛�
+        /// RGV鏂板缓浠诲姟
         /// </summary>
-        [Description("AGV寰呮墽琛�")]
-        AGV_Execute = 300,
+        [Description("RGV鏂板缓浠诲姟")]
+        RGV_NEW = 290,
+        /// <summary>
+        /// RGV寰呮墽琛�
+        /// </summary>
+        [Description("RGV寰呮墽琛�")]
+        RGV_Execute = 300,
+        /// <summary>
+        /// RGV鍙栬揣涓�
+        /// </summary>
+        [Description("RGV鍙栬揣涓�")]
+        RGV_Takeing = 305,
+        /// <summary>
+        /// RGV鎵ц涓�
+        /// </summary>
+        [Description("RGV鎵ц涓�")]
+        RGV_Executing = 310,
 
         /// <summary>
-        /// AGV鎵ц涓�
+        /// RGV寰呯户缁墽琛�
         /// </summary>
-        [Description("AGV鎵ц涓�")]
-        AGV_Executing = 310,
+        [Description("RGV寰呯户缁墽琛�")]
+        RGV_WaitToExecute = 320,
+        /// <summary>
+        /// RGV鏀捐揣涓�
+        /// </summary>
+        [Description("RGV鏀捐揣涓�")]
+        RGV_Puting = 325,
 
         /// <summary>
-        /// AGV寰呯户缁墽琛�
+        /// RGV瀹屾垚
         /// </summary>
-        [Description("AGV寰呯户缁墽琛�")]
-        AGV_WaitToExecute = 320,
-        /// <summary>
-        /// AGV鏀捐揣涓�
-        /// </summary>
-        [Description("AGV鏀捐揣涓�")]
-        AGV_Puting = 325,
+        [Description("RGV瀹屾垚")]
+        RGV_Finish = 330,
 
         /// <summary>
-        /// AGV瀹屾垚
+        /// RGV鍙栬揣鍐欏叆寮傚父
         /// </summary>
-        [Description("AGV瀹屾垚")]
-        AGV_Finish = 330,
+        [Description("RGV鍙栬揣鍐欏叆寮傚父")]
+        RGV_TakeError = 335,
 
         /// <summary>
         /// 浠诲姟瀹屾垚
@@ -96,6 +117,12 @@
         Pending = 970,
 
         /// <summary>
+        /// Mes鍑哄簱鎸傝捣
+        /// </summary>
+        [Description("Mes鍑哄簱鎸傝捣")]
+        MesPending = 975,
+
+        /// <summary>
         /// 浠诲姟鍙栨秷
         /// </summary>
         [Description("浠诲姟鍙栨秷")]
@@ -106,10 +133,5 @@
         /// </summary>
         [Description("浠诲姟寮傚父")]
         Exception = 990,
-        /// <summary>
-        /// 鎻愬崌鏈烘墽琛屼腑
-        /// </summary>
-        [Description("鎻愬崌鏈烘墽琛屼腑")]
-        HT_Executing = 110,
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs
index 275eeae..8853a91 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/HttpHelper.cs
@@ -6,6 +6,7 @@
 using System.Net.Http.Headers;
 using System.Text;
 using System.Threading.Tasks;
+using WIDESEA_Core.LogHelper;
 
 namespace WIDESEA_Core.Helper
 {
@@ -59,23 +60,31 @@
 
         public static string Get(string serviceAddress, string contentType = "application/json", Dictionary<string, string>? headers = null)
         {
+            string text = string.Empty;
+            DateTime now = DateTime.Now;
             try
             {
-                string result = string.Empty;
                 using HttpClient httpClient = new HttpClient();
                 httpClient.Timeout = new TimeSpan(0, 0, 60);
+                if (headers != null)
+                {
+                    foreach (KeyValuePair<string, string> header in headers)
+                    {
+                        httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
+                    }
+                }
 
-                foreach (var header in headers)
-                    httpClient.DefaultRequestHeaders.Add(header.Key, header.Value);
-
-                result = httpClient.GetStringAsync(serviceAddress).Result;
-                return result;
+                text = httpClient.GetStringAsync(serviceAddress).Result;
+                return text;
             }
-            catch (Exception e)
+            catch (Exception ex)
             {
-                Console.WriteLine(e.Message);
+                throw new Exception(ex.Message);
             }
-            return null;
+            finally
+            {
+                Logger.Add(serviceAddress, "", text, now);
+            }
         }
 
         public static string Post(string serviceAddress, string requestJson = "", string contentType = "application/json", Dictionary<string, string>? headers = null)
@@ -121,6 +130,7 @@
         /// <returns></returns>
         public static T Post<T>(string url, object parm, string rquestName = "") where T : class
         {
+            DateTime beginDate = DateTime.Now;
             HttpWebResponse response = null;
             StreamReader resultReader = null;
             string responseContent = string.Empty;
@@ -139,7 +149,7 @@
                 };
 
                 response = (HttpWebResponse)request.GetResponse();
-                Stream webStream = response.GetResponseStream();
+               Stream webStream = response.GetResponseStream();
                 if (webStream == null)
                 {
                     throw new Exception("Network error");
@@ -148,6 +158,7 @@
                 int statsCode = (int)response.StatusCode;
                 resultReader = new StreamReader(webStream, Encoding.UTF8);
                 responseContent = resultReader.ReadToEnd();
+
 
                 if (response != null)
                     response.Close();
@@ -158,13 +169,16 @@
                 {
                     throw new Exception("寮傚父锛屽搷搴旂爜锛�" + statsCode.ToString());
                 }
-
                 return JsonConvert.DeserializeObject<T>(responseContent);
             }
             catch (Exception ex)
             {
                 throw ex;
             }
+            finally
+            {
+                Logger.Add(url, parm, responseContent, beginDate);
+            }
         }
 
     }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/Logger.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/Logger.cs
index 5ab7d24..692ce6c 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/Logger.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Core/LogHelper/Logger.cs
@@ -238,6 +238,52 @@
             //娣诲姞绯荤粺鏃ュ織
             loggerQueueData.Enqueue(log);
         }
+        public static void Add(string url, object requestParameter, string responseParameter, DateTime beginDate)
+        {
+            dynamic? log = null;
+            try
+            {
+                //鑾峰彇褰撳墠鐢ㄦ埛
+                IUser? user = App.User;
+                //鍒涘缓鏃ュ織瀵硅薄
+                log = new
+                {
+                    //璇锋眰寮�濮嬫椂闂�
+                    BeginDate = beginDate,
+                    //璇锋眰缁撴潫鏃堕棿
+                    EndDate = DateTime.Now,
+                    //璇锋眰鍙傛暟
+                    RequestParam = requestParameter,
+                    //鍝嶅簲鍙傛暟
+                    ResponseParam = responseParameter,
+                    //璇锋眰URL
+                    Url = url,
+                    //瀹㈡埛绔疘P
+                    UserIP = "",
+                    //鐢ㄦ埛ID
+                    UserId = user?.UserId,
+                    //鐢ㄦ埛鍚�
+                    UserName = user?.UserName
+                };
+            }
+            catch (Exception exception)
+            {
+                //濡傛灉鍙戠敓寮傚父锛屽垯鍒涘缓鏃ュ織瀵硅薄
+                log = log ?? new
+                {
+                    //璇锋眰寮�濮嬫椂闂�
+                    BeginDate = DateTime.Now,
+                    //璇锋眰缁撴潫鏃堕棿
+                    EndDate = DateTime.Now,
+                    //璇锋眰鍙傛暟
+                    RequestParam = requestParameter,
+                    //鍝嶅簲鍙傛暟
+                    ResponseParam = responseParameter,
+                };
+            }
+            //娣诲姞绯荤粺鏃ュ織
+            loggerQueueData.Enqueue(log);
+        }
 
         public static string GetClientIP(HttpContext context)
         {
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/EntityProperties.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/EntityProperties.cs
index c351b8b..94771e6 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/EntityProperties.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/EntityProperties.cs
@@ -85,17 +85,19 @@
                 }
                 else
                 {
-
-                    int length = sugarColumn.Length;
-                    if (length == 0) { return (true, null, null); }
-                    //鍒ゆ柇鍙屽瓧鑺備笌鍗曞瓧娈�
-                    else if (length < 8000 &&
-                        ((dbType.Substring(0, 1) != "n"
-                        && Encoding.UTF8.GetBytes(val.ToCharArray()).Length > length)
-                         || val.Length > length)
-                         )
+                    if (sugarColumn != null)
                     {
-                        reslutMsg = $"鏈�澶氬彧鑳姐�恵length}銆戜釜瀛楃銆�";
+                        int length = sugarColumn.Length;
+                        if (length == 0) { return (true, null, null); }
+                        //鍒ゆ柇鍙屽瓧鑺備笌鍗曞瓧娈�
+                        else if (length < 8000 &&
+                            ((dbType.Substring(0, 1) != "n"
+                            && Encoding.UTF8.GetBytes(val.ToCharArray()).Length > length)
+                             || val.Length > length)
+                             )
+                        {
+                            reslutMsg = $"鏈�澶氬彧鑳姐�恵length}銆戜釜瀛楃銆�";
+                        }
                     }
                 }
             }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/ModelValidate.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/ModelValidate.cs
index 9440915..52a9e11 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/ModelValidate.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Core/Utilities/ModelValidate.cs
@@ -99,35 +99,63 @@
                     if (propertyAttribute == null) continue;
 
                     object? value = propertyInfo.GetValue(data, null);
+                    // 鎻愬彇鎻忚堪锛堝噺灏戦噸澶嶄唬鐮侊級
+                    string propDesc = string.IsNullOrEmpty(propertyAttribute.Description) ? propertyInfo.Name : propertyAttribute.Description;
+
+                    // 闈炵┖楠岃瘉锛堜繚鎸佷笉鍙橈級
                     if (propertyAttribute.NotNullAndEmpty)
                     {
-                        if (value == null) return (false, $"{(string.IsNullOrEmpty(propertyAttribute.Description) ? propertyInfo.Name : propertyAttribute.Description)}涓嶅彲涓簄ull", data);
-                        if (string.IsNullOrEmpty(value.ToString())) return (false, $"{(string.IsNullOrEmpty(propertyAttribute.Description) ? propertyInfo.Name : propertyAttribute.Description)}涓嶅彲涓虹┖瀛楃涓�", data);
+                        if (value == null) return (false, $"{propDesc}涓嶅彲涓簄ull", data);
+                        if (string.IsNullOrEmpty(value.ToString())) return (false, $"{propDesc}涓嶅彲涓虹┖瀛楃涓�", data);
                     }
 
+                    // 鏈�灏忓�奸獙璇侊紙鏍稿績淇敼锛氬吋瀹瑰皬鏁帮級
                     if (propertyAttribute.MinValue > int.MinValue)
                     {
-                        if (value == null) return (false, $"{(string.IsNullOrEmpty(propertyAttribute.Description) ? propertyInfo.Name : propertyAttribute.Description)}涓嶅彲涓簄ull", data);
+                        if (value == null) return (false, $"{propDesc}涓嶅彲涓簄ull", data);
+
+                        // 鍏抽敭锛氬厛灏嗗�艰浆鎹负decimal锛堟敮鎸佸皬鏁帮級锛岄伩鍏嶇洿鎺ヨ浆int鎶ラ敊
+                        if (!decimal.TryParse(value.ToString(), out decimal valueDecimal))
+                        {
+                            return (false, $"{propDesc}鐨勫�笺�恵value}銆戜笉鏄湁鏁堢殑鏁板�兼牸寮忥紙闇�涓烘暣鏁版垨灏忔暟锛�", data);
+                        }
+
+                        // 灏唅nt绫诲瀷鐨凪inValue杞负decimal鍐嶆瘮杈冿紙int鍙殣寮忚浆decimal锛�
+                        decimal minValue = propertyAttribute.MinValue;
                         if (propertyAttribute.IsContainMinValue)
                         {
-                            if (Convert.ToInt32(value.ToString()) < propertyAttribute.MinValue) return (false, $"{(string.IsNullOrEmpty(propertyAttribute.Description) ? propertyInfo.Name : propertyAttribute.Description)}鐨勫�笺�恵value}銆戜笉鍙皬浜庛�恵propertyAttribute.MinValue}銆�", data);
+                            if (valueDecimal < minValue)
+                                return (false, $"{propDesc}鐨勫�笺�恵value}銆戜笉鍙皬浜庛�恵minValue}銆�", data);
                         }
                         else
                         {
-                            if (Convert.ToInt32(value.ToString()) <= propertyAttribute.MinValue) return (false, $"{(string.IsNullOrEmpty(propertyAttribute.Description) ? propertyInfo.Name : propertyAttribute.Description)}鐨勫�笺�恵value}銆戣澶т簬銆恵propertyAttribute.MinValue}銆�", data);
+                            if (valueDecimal <= minValue)
+                                return (false, $"{propDesc}鐨勫�笺�恵value}銆戣澶т簬銆恵minValue}銆�", data);
                         }
                     }
 
+                    // 鏈�澶у�奸獙璇侊紙鏍稿績淇敼锛氬吋瀹瑰皬鏁帮級
                     if (propertyAttribute.MaxValue < int.MaxValue)
                     {
-                        if (value == null) return (false, $"{(string.IsNullOrEmpty(propertyAttribute.Description) ? propertyInfo.Name : propertyAttribute.Description)}涓嶅彲涓簄ull", data);
+                        if (value == null) return (false, $"{propDesc}涓嶅彲涓簄ull", data);
+
+                        // 鍚屾牱鍏堣浆decimal
+                        if (!decimal.TryParse(value.ToString(), out decimal valueDecimal))
+                        {
+                            return (false, $"{propDesc}鐨勫�笺�恵value}銆戜笉鏄湁鏁堢殑鏁板�兼牸寮忥紙闇�涓烘暣鏁版垨灏忔暟锛�", data);
+                        }
+
+                        // int杞琩ecimal姣旇緝
+                        decimal maxValue = propertyAttribute.MaxValue;
                         if (propertyAttribute.IsContainMaxValue)
                         {
-                            if (Convert.ToInt32(value.ToString()) >= propertyAttribute.MaxValue) return (false, $"{(string.IsNullOrEmpty(propertyAttribute.Description) ? propertyInfo.Name : propertyAttribute.Description)}鐨勫�笺�恵value}銆戜笉鍙ぇ浜庛�恵propertyAttribute.MaxValue}銆�", data);
+                            if (valueDecimal > maxValue)
+                                return (false, $"{propDesc}鐨勫�笺�恵value}銆戜笉鍙ぇ浜庛�恵maxValue}銆�", data);
                         }
                         else
                         {
-                            if (Convert.ToInt32(value.ToString()) > propertyAttribute.MaxValue) return (false, $"{(string.IsNullOrEmpty(propertyAttribute.Description) ? propertyInfo.Name : propertyAttribute.Description)}鐨勫�笺�恵value}銆戣灏忎簬銆恵propertyAttribute.MaxValue}銆�", data);
+                            if (valueDecimal >= maxValue)
+                                return (false, $"{propDesc}鐨勫�笺�恵value}銆戣灏忎簬銆恵maxValue}銆�", data);
                         }
                     }
 
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Basic/MomRequestContent.cs b/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Basic/MomRequestContent.cs
new file mode 100644
index 0000000..76c8e0c
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Basic/MomRequestContent.cs
@@ -0,0 +1,24 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WIDESEA_DTO.Basic
+{
+    public class MomRequestContent
+    {
+        /// <summary>
+        /// 瑙i噴
+        /// </summary>
+        public string Message { get; set; }
+        /// <summary>
+        /// 
+        /// </summary>
+        public string Result { get; set; }
+        /// <summary>
+        /// 鍝嶅簲鐘舵��
+        /// </summary>
+        public bool Success { get; set; }
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/FeedbackInboundOrderERP.cs b/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/FeedbackInboundOrderERP.cs
new file mode 100644
index 0000000..363f1b6
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/FeedbackInboundOrderERP.cs
@@ -0,0 +1,30 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.Attributes;
+
+namespace WIDESEA_DTO.ERP
+{
+    public class  FeedbackInboundOrderERP
+    {
+        /// <summary>
+        /// 鍗曟嵁鍙�
+        /// </summary>
+        [PropertyValidate("鍗曟嵁鍙�", NotNullAndEmpty = true)]
+        public string code { get; set; }
+
+        /// <summary>
+        /// 鏄庣粏id
+        /// </summary>
+        [PropertyValidate("鏄庣粏id", NotNullAndEmpty = true)]
+        public string itemId { get; set; }
+
+        /// <summary>
+        /// 鏄惁鎴愬姛
+        /// </summary>
+        [PropertyValidate("鏄惁鎴愬姛")]
+        public bool success { get; set; }
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/FeedbackOutorderERP.cs b/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/FeedbackOutorderERP.cs
new file mode 100644
index 0000000..4d92bfa
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_DTO/ERP/FeedbackOutorderERP.cs
@@ -0,0 +1,45 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.Attributes;
+
+namespace WIDESEA_DTO.ERP
+{
+    public class FeedbackOutorderERP
+    {
+        /// <summary>
+        /// 鐗╂枡缂栫爜
+        /// </summary>
+        [PropertyValidate("鏄庣粏id", NotNullAndEmpty = true)]
+        public string ids { get; set; }
+
+        /// <summary>
+        /// 鐗╂枡缂栫爜
+        /// </summary>
+        [PropertyValidate("鐗╂枡缂栫爜", NotNullAndEmpty = true)]
+        public string materialCode { get; set; }
+        /// <summary>
+        /// 鍙戞枡鍗曞彿
+        /// </summary>
+        [PropertyValidate("鍙戞枡鍗曞彿", NotNullAndEmpty = true)]
+        public string issuanceCode { get; set; }
+        /// <summary>
+        /// 鎵规鍙�
+        /// </summary>
+        [PropertyValidate("鎵规鍙�", NotNullAndEmpty = true)]
+        public string internalBatchNo { get; set; }
+
+        /// <summary>
+        /// 棰嗘枡鍗曞彿
+        /// </summary>
+        [PropertyValidate("棰嗘枡鍗曞彿", NotNullAndEmpty = true)]
+        public string pickingCode { get; set; }
+        /// <summary>
+        /// 鍗曟嵁鏁伴噺
+        /// </summary>
+        [PropertyValidate("棰嗘枡鏁伴噺", NotNullAndEmpty = true)]
+        public decimal internalBatchNum { get; set; }
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Inbound/AddInboundOrderModel.cs b/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Inbound/AddInboundOrderModel.cs
new file mode 100644
index 0000000..6247158
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Inbound/AddInboundOrderModel.cs
@@ -0,0 +1,76 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.Attributes;
+using WIDESEA_Core.CodeConfigEnum;
+
+namespace WIDESEA_DTO.Inbound
+{
+    public class AddInboundOrderModel
+    {
+        // <summary>
+        /// 浠撳簱Id
+        /// </summary>
+        [PropertyValidate("浠撳簱Id", NotNullAndEmpty = true)]
+        public int WarehouseId { get; set; }
+        /// <summary>
+        /// 鍗曟嵁缂栧彿
+        /// </summary>
+        [PropertyValidate("鍗曟嵁缂栧彿", NotNullAndEmpty = true)]
+        public string OrderNo { get; set; }
+        /// <summary>
+        /// 鍗曟嵁缂栧彿
+        /// </summary>
+        [PropertyValidate("涓婃父鍗曟嵁缂栧彿", NotNullAndEmpty = true)]
+        public string UpperOrderNo { get; set; }
+        /// <summary>
+        /// 鍗曟嵁缂栧彿
+        /// </summary>
+        [PropertyValidate("鍗曟嵁绫诲瀷", NotNullAndEmpty = true)]
+        public int OrderType { get; set; }
+        /// <summary>
+        /// 鎶ュ簾鏄庣粏
+        /// </summary>
+        [PropertyValidate("鍏ュ簱鍗曟槑缁�", NotNullAndEmpty = true)]
+        public List<InboundOrderDetailDTO> Details { get; set; }
+    }
+
+    [ModelValidate]
+    public class InboundOrderDetailDTO
+    {
+        /// <summary>
+        /// 鐗╂枡缂栫爜
+        /// </summary>
+        [PropertyValidate("鐗╂枡缂栫爜", NotNullAndEmpty = true)]
+        public string MaterielCode { get; set; }
+        /// <summary>
+        /// 鐗╂枡鍚嶇О
+        /// </summary>
+        [PropertyValidate("鐗╂枡鍚嶇О", NotNullAndEmpty = true)]
+        public string MaterielName { get; set; }
+        /// <summary>
+        /// 鎵规鍙�
+        /// </summary>
+        [PropertyValidate("鎵规鍙�", NotNullAndEmpty = true)]
+        public string BatchNo { get; set; }
+
+        /// <summary>
+        /// 渚涘簲鍟嗘壒娆″彿
+        /// </summary>
+        [PropertyValidate("渚涘簲鍟嗘壒娆″彿", NotNullAndEmpty = true)]
+        public string SupplierBatch { get; set; }
+        /// <summary>
+        /// 鍗曟嵁鏁伴噺
+        /// </summary>
+        [PropertyValidate("鍗曟嵁鏁伴噺", NotNullAndEmpty = true)]
+        public decimal OrderQuantity { get; set; }
+        /// <summary>
+        /// 澶囨敞
+        /// </summary>
+        [PropertyValidate("澶囨敞", NotNullAndEmpty = false)]
+        public string Remark { get; set; }
+    }
+}
+
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Outbound/OutboundOrderAddDTO.cs b/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Outbound/OutboundOrderAddDTO.cs
index 24d593d..5766dc7 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Outbound/OutboundOrderAddDTO.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Outbound/OutboundOrderAddDTO.cs
@@ -39,10 +39,20 @@
         public string InoutType { get; set; }
 
         /// <summary>
+        /// 鎺ㄥ崟绯荤粺
+        /// </summary>
+        public string System { get; set; }
+
+        /// <summary>
         /// 澶囨敞
         /// </summary>
         public string Remark { get; set; }
 
+        /// <summary>
+        /// 鏂板缓鏃跺紩鐢ㄤ粨搴揑D
+        /// </summary>
+        public int WarehouseId { get; set; }
+
         [PropertyValidate("鍗曟嵁鏄庣粏淇℃伅", NotNullAndEmpty = true)]
         public List<OutboundOrderDetailAddDTO> Details { get; set; }
 
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Outbound/OutboundOrderDetailAddDTO.cs b/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Outbound/OutboundOrderDetailAddDTO.cs
index b80dd09..eb1fde8 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Outbound/OutboundOrderDetailAddDTO.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Outbound/OutboundOrderDetailAddDTO.cs
@@ -59,5 +59,9 @@
         /// 搴撲綅
         /// </summary>
         public string StorageLocationCode { get; set; }
+
+        public string LocationName { get; set; }
+
+        public string SupplierBatch { get; set; }
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Stock/StockViewDTO.cs b/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Stock/StockViewDTO.cs
index ae06f8b..b61cf36 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Stock/StockViewDTO.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_DTO/Stock/StockViewDTO.cs
@@ -14,45 +14,164 @@
     {
         public int AreaId { get; set; }
 
+        /// <summary>
+        /// 浠撳簱ID
+        /// </summary>
+        [ExporterHeader(DisplayName = "浠撳簱ID")]
+        public int WarehouseId { get; set; }
+        /// <summary>
+        /// 璐т綅缂栧彿
+        /// </summary>
+        [ExporterHeader(DisplayName = "璐т綅缂栧彿")]
         public string LocationCode { get; set; }
 
+        /// <summary>
+        /// 璐т綅鍚嶇О
+        /// </summary>
+        [ExporterHeader(DisplayName = "璐т綅鍚嶇О")]
         public string LocationName { get; set; }
 
+        /// <summary>
+        /// 璐т綅鍒�
+        /// </summary>
+        [ExporterHeader(DisplayName = "璐т綅鍒�")]
         public int Column { get; set; }
 
+        /// <summary>
+        /// 璐т綅琛�
+        /// </summary>
+        [ExporterHeader(DisplayName = "璐т綅琛�")]
         public int Row { get; set; }
 
+        /// <summary>
+        /// 璐т綅灞�
+        /// </summary>
+        [ExporterHeader(DisplayName = "璐т綅灞�")]
         public int Layer { get; set; }
 
+        /// <summary>
+        /// 璐т綅娣卞害
+        /// </summary>
+        [ExporterHeader(DisplayName = "璐т綅娣卞害")]
         public int Depth { get; set; }
 
+        /// <summary>
+        /// 璐т綅鐘舵��
+        /// </summary>
+        [ExporterHeader(DisplayName = "璐т綅鐘舵��")]
         public int LocationStatus { get; set; }
 
+        /// <summary>
+        /// 璐т綅绫诲瀷
+        /// </summary>
+        [ExporterHeader(DisplayName = "璐т綅绫诲瀷")]
         public int LocationType { get; set; }
 
+        /// <summary>
+        /// 宸烽亾缂栧彿
+        /// </summary>
+        [ExporterHeader(DisplayName = "宸烽亾缂栧彿")]
         public string RoadwayNo { get; set; }
 
+        /// <summary>
+        /// 绂佺敤鐘舵��
+        /// </summary>
+        [ExporterHeader(IsIgnore = true)]
         public int EnalbeStatus { get; set; }
 
-        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")]
+        /// <summary>
+        /// 搴撳瓨涓婚敭
+        /// </summary>
+        [ExporterHeader(IsIgnore = true)]
         public int StockId { get; set; }
 
+        /// <summary>
+        /// 鎵樼洏鍙�
+        /// </summary>
+        [ExporterHeader(DisplayName = "鎵樼洏鍙�")]
         public string PalletCode { get; set; }
 
+        /// <summary>
+        /// 
+        /// </summary>
+        [ExporterHeader(IsIgnore = true)]
         public bool IsFull { get; set; }
 
+        /// <summary>
+        /// 鐗╂枡缂栫爜
+        /// </summary>
+        [ExporterHeader(DisplayName = "鐗╂枡缂栫爜")]
+        public string MaterielCode { get; set; }
+
+        /// <summary>
+        /// 鐗╂枡鍚嶇О
+        /// </summary>
+        [ExporterHeader(DisplayName = "鐗╂枡鍚嶇О")]
+        public string MaterielName { get; set; }
+
+        /// <summary>
+        /// 鐗╂枡瑙勬牸
+        /// </summary>
+        [ExporterHeader(DisplayName = "鐗╂枡瑙勬牸")]
+        public string MaterielSpec { get; set; }
+
+        /// <summary>
+        /// 鐗╂枡鎵瑰彿
+        /// </summary>
+        [ExporterHeader(DisplayName = "鐗╂枡鎵瑰彿")]
+        public string BatchNo { get; set; }
+        /// <summary>
+        /// 搴撳瓨鏁伴噺
+        /// </summary>
+        [ExporterHeader(DisplayName = "搴撳瓨鏁伴噺")]
+        public string StockCounts { get; set; }
+
+        /// <summary>
+        /// 搴撳瓨鐘舵��
+        /// </summary>
+        [ExporterHeader(IsIgnore = true)]
         public int StockStatus { get; set; }
 
+        /// <summary>
+        /// 搴撳瓨瓒呮湡鏍囪瘑
+        /// </summary>
+        [ExporterHeader(IsIgnore = true)]
+        public int Expirationlabel { get; set; }
+
+        /// <summary>
+        /// 搴撳瓨澶囨敞
+        /// </summary>
+        [ExporterHeader(IsIgnore = true)]
         public string StockRemark { get; set; }
 
+        /// <summary>
+        /// 鍒涘缓浜�
+        /// </summary>
+        [ExporterHeader(DisplayName = "鍒涘缓浜�")]
         public string Creater { get; set; }
 
+        /// <summary>
+        /// 鍒涘缓鏃堕棿
+        /// </summary>
+        [ExporterHeader(DisplayName = "鍒涘缓鏃堕棿")]
         public DateTime CreateDate { get; set; }
 
+        /// <summary>
+        /// 淇敼浜�
+        /// </summary>
+        [ExporterHeader(DisplayName = "淇敼浜�")]
         public string Modifier { get; set; }
 
+        /// <summary>
+        /// 淇敼鏃堕棿
+        /// </summary>
+        [ExporterHeader(DisplayName = "淇敼鏃堕棿")]
         public DateTime? ModifyDate { get; set; }
 
+        /// <summary>
+        /// 搴撳瓨璇︽儏
+        /// </summary>
+        [ExporterHeader(IsIgnore = true)]
         [Navigate(NavigateType.OneToMany, nameof(Dt_StockInfoDetail.StockId), nameof(StockId))]
         public List<Dt_StockInfoDetail> Details { get; set; }
     }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs
index 5fdd2a4..c9fc087 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_IBasicService/ILocationInfoService.cs
@@ -58,5 +58,7 @@
         /// <param name="palletType">鎵樼洏绫诲瀷</param>
         /// <param name="locationStatus">璐т綅鐘舵��</param>
         //void UpdateLocationStatus(Dt_LocationInfo location, int palletType, LocationStatusEnum locationStatus, int warehousId);
+
+        WebResponseContent LocationRelease(List<string> locationCodes);
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/IInboundRepository.cs b/WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/IInboundRepository.cs
index cd77bda..726610d 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/IInboundRepository.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/IInboundRepository.cs
@@ -12,5 +12,8 @@
         IInboundOrderDetailRepository InboundOrderDetailRepository { get; }
 
         IInboundOrderRepository InboundOrderRepository { get; }
+
+        ITakeStockOrderRepository TakeStockOrderRepository { get; }
+        ITakeStockOrderDetailRepository TakeStockOrderDetailRepository { get; }
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/IReturnOrderRepository.cs b/WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/IReturnOrderRepository.cs
new file mode 100644
index 0000000..03c8445
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/IReturnOrderRepository.cs
@@ -0,0 +1,14 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_Model.Models.Inbound;
+
+namespace WIDESEA_IInboundRepository
+{
+    public interface IReturnOrderRepository :IRepository<Dt_ReturnOrder>
+    {
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/ITakeStockOrderDetailRepository.cs b/WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/ITakeStockOrderDetailRepository.cs
new file mode 100644
index 0000000..889f98a
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/ITakeStockOrderDetailRepository.cs
@@ -0,0 +1,17 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_IInboundRepository
+{
+    /// <summary>
+    /// 鐩樼偣鍗曟槑缁嗕粨鍌ㄦ帴鍙e眰
+    /// </summary>
+    public interface ITakeStockOrderDetailRepository : IRepository<Dt_TakeStockOrderDetail>
+    {
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/ITakeStockOrderRepository.cs b/WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/ITakeStockOrderRepository.cs
new file mode 100644
index 0000000..94f385f
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_IInboundRepository/ITakeStockOrderRepository.cs
@@ -0,0 +1,17 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_IInboundRepository
+{
+    /// <summary>
+    /// 鐩樼偣鍗曚粨鍌ㄦ帴鍙e眰
+    /// </summary>
+    public interface ITakeStockOrderRepository : IRepository<Dt_TakeStockOrder>
+    {
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs
index 94fcd24..f56ccea 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs
@@ -4,6 +4,7 @@
 using System.Text;
 using System.Threading.Tasks;
 using WIDESEA_Common;
+using WIDESEA_Common.TaskEnum;
 using WIDESEA_Core;
 using WIDESEA_Core.BaseServices;
 using WIDESEA_DTO.Inbound;
@@ -28,5 +29,15 @@
 
         Dt_InboundOrder GetInboundOrder(string InboundOrderNo);
         WebResponseContent GetInboundOrders(SaveModel saveModel);
+
+        public WebResponseContent Save(AddInboundOrderModel addInboundOrder);
+
+        public WebResponseContent FeedbackInboundCanceERP(int[] keys);
+
+        public WebResponseContent ReceiveReturnOrder(List<HouseReturnOrder> houseReturnOrder);
+
+        public WebResponseContent GetMaterielCode(int warehouseId);
+
+        public WebResponseContent GetMaterielName(int warehouseId , string materielCode);
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IReturnOrderService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IReturnOrderService.cs
new file mode 100644
index 0000000..6e7ee15
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/IReturnOrderService.cs
@@ -0,0 +1,16 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_IInboundRepository;
+using WIDESEA_Model.Models.Inbound;
+
+namespace WIDESEA_IInboundService
+{
+    public interface IReturnOrderService : IService<Dt_ReturnOrder>
+    {
+        IReturnOrderRepository Repository { get; }
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/ITakeStockOrderDetailService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/ITakeStockOrderDetailService.cs
new file mode 100644
index 0000000..1a01783
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/ITakeStockOrderDetailService.cs
@@ -0,0 +1,18 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_DTO.ERP;
+using WIDESEA_IInboundRepository;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_IInboundService
+{
+    public interface ITakeStockOrderDetailService : IService<Dt_TakeStockOrderDetail>
+    {
+        ITakeStockOrderDetailRepository Repository { get; }
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/ITakeStockOrderService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/ITakeStockOrderService.cs
new file mode 100644
index 0000000..709efa1
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_IInboundService/ITakeStockOrderService.cs
@@ -0,0 +1,37 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_DTO.ERP;
+using WIDESEA_IInboundRepository;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_IInboundService
+{
+    public interface ITakeStockOrderService : IService<Dt_TakeStockOrder>
+    {
+        ITakeStockOrderRepository Repository { get; }
+        /// <summary>
+        /// 鑾峰彇瀵瑰簲浠撳簱鐩樼偣鍗�
+        /// </summary>
+        WebResponseContent GetTakeStockOrders(SaveModel saveModel);
+
+        /// <summary>
+        /// 閫氳繃鐩樼偣鍗曞彿+妗嗗彿鑾峰彇鐩樼偣淇℃伅璇︽儏
+        /// </summary>
+        WebResponseContent GetTakeDetailInfo(SaveModel saveModel);
+        /// <summary>
+        /// 鐩樼偣鎿嶄綔
+        /// </summary>
+        /// <param name="saveModel"></param>
+        /// <returns></returns>
+        WebResponseContent MatPicking(SaveModel saveModel);
+        /// <summary>
+        /// 鐩樼偣鍗曞叧闂�
+        /// </summary>
+        WebResponseContent DisEnableTakeOrder(int id);
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundRepository/IProductionRepository.cs b/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundRepository/IProductionRepository.cs
new file mode 100644
index 0000000..6fe5da0
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundRepository/IProductionRepository.cs
@@ -0,0 +1,14 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_Model.Models.Outbound;
+
+namespace WIDESEA_IOutboundRepository
+{
+    public interface IProductionRepository:IRepository<Dt_Production>
+    {
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundOrderDetailService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundOrderDetailService.cs
index bf34bfc..2dbe63d 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundOrderDetailService.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundOrderDetailService.cs
@@ -35,5 +35,7 @@
         WebResponseContent LockOutboundStockDataUpdate(List<Dt_StockInfo> stockInfos, List<Dt_OutboundOrderDetail> outboundOrderDetails, List<Dt_OutStockLockInfo> outStockLockInfos, List<Dt_LocationInfo> locationInfos, LocationStatusEnum locationStatus = LocationStatusEnum.Lock, List<Dt_Task>? tasks = null);
 
         WebResponseContent RevokeLockOutboundStock(int orderDetailId);
+
+        WebResponseContent CancelOutFeedbackERP(int[] keys);
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundOrderService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundOrderService.cs
index 23fdb6c..1835fd5 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundOrderService.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundOrderService.cs
@@ -19,5 +19,23 @@
         WebResponseContent AddOutboundOrder(OutboundOrderAddDTO orderAddDTO);
 
         WebResponseContent CancelOut(HouseCancelOut houseCancelOut);
+
+        WebResponseContent Save(OutboundOrderAddDTO orderAddDTO);
+
+        WebResponseContent GetCodeByWarehouse(int warehouseId);
+        /// <summary>
+        /// 鍑哄簱鍗曞簱瀛樺悕绉版煡璇�
+        /// </summary>
+        /// <param name="materielCode"></param>
+        /// <returns></returns>
+        public WebResponseContent GetVersionByCode(string materielCode, int warehouseId);
+        /// <summary>
+        /// 鍑哄簱鍗曞簱瀛樻壒娆″彿鏌ヨ
+        /// </summary>
+        /// <param name="materielCode"></param>
+        /// <returns></returns>
+        public WebResponseContent GetLotNoByCode(string materielCode, int warehouseId);
+
+        string CreateCodeByRule(string ruleCode);
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IProductionService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IProductionService.cs
new file mode 100644
index 0000000..bc04562
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IProductionService.cs
@@ -0,0 +1,14 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_Model.Models.Outbound;
+
+namespace WIDESEA_IInboundService
+{
+    public interface IProductionService : IService<Dt_Production>
+    {
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs
index d48e352..442ccc1 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs
@@ -84,5 +84,15 @@
         /// <param name="task"></param>
         /// <returns></returns>
         WebResponseContent UpdateTaskInfo(WCSTaskDTO task);
+
+        WebResponseContent FeedBackInboundERP(string upperOrderNo, string linId);
+
+        WebResponseContent FeedBackOutERP(string orderNO, string linId);
+        /// <summary>
+        /// 搴撳瓨鐩樼偣
+        /// </summary>
+        /// <param name="stockViews"></param>
+        /// <returns></returns>
+        WebResponseContent TakeOutbound(List<StockViewDTO> stockViews);
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/InboundRepository.cs b/WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/InboundRepository.cs
index 511585a..73b4181 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/InboundRepository.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/InboundRepository.cs
@@ -13,10 +13,16 @@
 
         public IInboundOrderRepository InboundOrderRepository { get; }
 
-        public InboundRepository(IInboundOrderDetailRepository inboundOrderDetailRepository, IInboundOrderRepository inboundOrderRepository)
+        public ITakeStockOrderRepository TakeStockOrderRepository { get; }
+
+        public ITakeStockOrderDetailRepository TakeStockOrderDetailRepository { get; }
+
+        public InboundRepository(IInboundOrderDetailRepository inboundOrderDetailRepository, IInboundOrderRepository inboundOrderRepository, ITakeStockOrderRepository takeStockOrderRepository, ITakeStockOrderDetailRepository takeStockOrderDetailRepository)
         {
             InboundOrderDetailRepository = inboundOrderDetailRepository;
             InboundOrderRepository = inboundOrderRepository;
+            TakeStockOrderRepository = takeStockOrderRepository;
+            TakeStockOrderDetailRepository = takeStockOrderDetailRepository;
         }
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/ReturnOrderRepository.cs b/WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/ReturnOrderRepository.cs
new file mode 100644
index 0000000..8152190
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/ReturnOrderRepository.cs
@@ -0,0 +1,18 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_IInboundRepository;
+using WIDESEA_Model.Models.Inbound;
+
+namespace WIDESEA_InboundRepository
+{
+    public class ReturnOrderRepository : RepositoryBase<Dt_ReturnOrder>, IReturnOrderRepository
+    {
+        public ReturnOrderRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
+        {
+        }
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/TakeStockOrderDetailRepository.cs b/WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/TakeStockOrderDetailRepository.cs
new file mode 100644
index 0000000..101b836
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/TakeStockOrderDetailRepository.cs
@@ -0,0 +1,21 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_IInboundRepository;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_InboundRepository
+{
+    /// <summary>
+    /// 鐩樼偣鍗曚粨鍌ㄥ疄鐜板眰
+    /// </summary>
+    public class TakeStockOrderDetailRepository : RepositoryBase<Dt_TakeStockOrderDetail>, ITakeStockOrderDetailRepository
+    {
+        public TakeStockOrderDetailRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
+        {
+        }
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/TakeStockOrderRepository.cs b/WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/TakeStockOrderRepository.cs
new file mode 100644
index 0000000..735f0f0
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_InboundRepository/TakeStockOrderRepository.cs
@@ -0,0 +1,21 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_IInboundRepository;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_InboundRepository
+{
+    /// <summary>
+    /// 鐩樼偣鍗曚粨鍌ㄥ疄鐜板眰
+    /// </summary>
+    public class TakeStockOrderRepository : RepositoryBase<Dt_TakeStockOrder>, ITakeStockOrderRepository
+    {
+        public TakeStockOrderRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
+        {
+        }
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Base/InboundOrderService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Base/InboundOrderService.cs
index da8a5a3..5166513 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Base/InboundOrderService.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Base/InboundOrderService.cs
@@ -1,5 +1,6 @@
 锘縰sing AutoMapper;
 using MailKit.Search;
+using Newtonsoft.Json;
 using SqlSugar;
 using System;
 using System.Collections.Generic;
@@ -12,6 +13,7 @@
 using WIDESEA_BasicRepository;
 using WIDESEA_Common;
 using WIDESEA_Common.OrderEnum;
+using WIDESEA_Common.TaskEnum;
 using WIDESEA_Core;
 using WIDESEA_Core.BaseRepository;
 using WIDESEA_Core.BaseServices;
@@ -21,6 +23,7 @@
 using WIDESEA_Core.Utilities;
 using WIDESEA_DTO;
 using WIDESEA_DTO.Basic;
+using WIDESEA_DTO.ERP;
 using WIDESEA_DTO.Inbound;
 using WIDESEA_DTO.Outbound;
 using WIDESEA_IBasicRepository;
@@ -32,6 +35,7 @@
 using WIDESEA_IStockService;
 using WIDESEA_ITaskInfoRepository;
 using WIDESEA_Model.Models;
+using WIDESEA_Model.Models.Inbound;
 using static WIDESEA_Common.HouseInventoryIn;
 
 namespace WIDESEA_InboundService
@@ -51,10 +55,11 @@
         private IWarehouseService _warehouseService;
         private readonly IStockRepository _stockRepository;
         private IPalletTypeInfoRepository _palletTypeInfoRepository;
+        private readonly IReturnOrderRepository _returnOrderRepository;
 
         public IInboundOrderRepository Repository => BaseDal;
 
-        public InboundOrderService(IInboundOrderRepository BaseDal, IMapper mapper, IBasicService basicService, IBasicRepository basicRepository, IInboundRepository inboundRepository, IUnitOfWorkManage unitOfWorkManage, ITaskRepository taskRepository, IStockService stockService, IInboundOrderDetailService inboundOrderDetailService, IInboundOrder_HtyService inboundOrderHtyService, IInboundOrderDetail_HtyService inboundOrderDetail_HtyService, IWarehouseService warehouseService, IStockRepository stockRepository, IPalletTypeInfoRepository palletTypeInfoRepository) : base(BaseDal)
+        public InboundOrderService(IInboundOrderRepository BaseDal, IMapper mapper, IBasicService basicService, IBasicRepository basicRepository, IInboundRepository inboundRepository, IUnitOfWorkManage unitOfWorkManage, ITaskRepository taskRepository, IStockService stockService, IInboundOrderDetailService inboundOrderDetailService, IInboundOrder_HtyService inboundOrderHtyService, IInboundOrderDetail_HtyService inboundOrderDetail_HtyService, IWarehouseService warehouseService, IStockRepository stockRepository, IPalletTypeInfoRepository palletTypeInfoRepository,IReturnOrderRepository returnOrderRepository) : base(BaseDal)
         {
             _mapper = mapper;
             _unitOfWorkManage = unitOfWorkManage;
@@ -69,6 +74,7 @@
             _warehouseService = warehouseService;
             _stockRepository = stockRepository;
             _palletTypeInfoRepository = palletTypeInfoRepository;
+            _returnOrderRepository = returnOrderRepository;
         }
 
         /// <summary>
@@ -86,7 +92,53 @@
                 var palletCode = saveModel.MainData["palletCode"].ToString();
                 var warehouseId = saveModel.MainData["warehouseId"].ObjToInt();
                 var Initiallife = saveModel.MainData["initiallife"].ObjToInt();
-                var serNums = saveModel.DelKeys.Select(x => x.ToString()).ToList();
+                List<string> serialNumbers = new List<string>();
+                List<decimal> quantitys = new List<decimal>();
+                foreach (var item in saveModel.DelKeys)
+                {
+                    string json = JsonConvert.SerializeObject(item);
+                    Dictionary<string, object> delKeyDict = JsonConvert.DeserializeObject<Dictionary<string, object>>(json);
+
+
+                    if (delKeyDict.TryGetValue("serialNumber", out object serialNumberObj))
+                    {
+                        string serialNumber = serialNumberObj?.ToString();
+                        if (!string.IsNullOrEmpty(serialNumber))
+                        {
+                            serialNumbers.Add(serialNumber);
+                        }
+                        else
+                        {
+                            return WebResponseContent.Instance.Error("serialNumber鐨勫�间负绌�");
+                        }
+                    }
+                    if (delKeyDict.TryGetValue("quantity", out object quantityObj))
+                    {
+                        if (quantityObj == null)
+                        {
+                            return WebResponseContent.Instance.Error("鐗╂枡鏁伴噺鐨勫�间负绌�");
+                        }
+                        decimal quantity;
+                        try
+                        {
+                            quantity = Convert.ToDecimal(quantityObj);
+                        }
+                        catch
+                        {
+                            return WebResponseContent.Instance.Error($"鐗╂枡鏁伴噺{quantityObj}鏃犳硶杞崲涓烘暟瀛�");
+                        }
+                        if (quantity <= 0)
+                        {
+                            return WebResponseContent.Instance.Error("鐗╂枡鏁伴噺蹇呴』澶т簬0");
+                        }
+
+                        quantitys.Add(quantity);
+                    }
+                    else
+                    {
+                        return WebResponseContent.Instance.Error("缂哄皯鐗╂枡鏁伴噺瀛楁");
+                    }
+                }
                 Dt_Warehouse warehouse = _warehouseService.Repository.QueryFirst(x => x.WarehouseId == warehouseId);
                 if (warehouse == null)
                 {
@@ -102,7 +154,7 @@
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒板叆搴撳崟鏄庣粏淇℃伅");
                 }
-                List<MatSerNumAnalysisModel> models = CodeAnalysisHelper.CodeAnalysis<MatSerNumAnalysisModel>(AnalysisCodeEnum.MatSerNumAnalysis, serNums);
+                List<MatSerNumAnalysisModel> models = CodeAnalysisHelper.CodeAnalysis<MatSerNumAnalysisModel>(AnalysisCodeEnum.MatSerNumAnalysis, serialNumbers);
                 //楠岃瘉鍒ゆ柇鏃堕棿鏍煎紡
                 WebResponseContent IsValidContent = IsValidMCDates(models);
                 if (!IsValidContent.Status)
@@ -116,14 +168,15 @@
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒拌鐗╂枡鐨勪俊鎭�");
                 }
-
-                List<Dt_InboundOrderDetail> inboundOrderDetails = inboundOrder.Details.Where(x => x.MaterielCode == materielCode && x.BatchNo == (models.FirstOrDefault()?.LotNo ?? "")).ToList();
+                ///鎵炬暟閲忓尮閰嶇殑
+                List<Dt_InboundOrderDetail> inboundOrderDetails = inboundOrder.Details.Where(x => x.MaterielCode == materielCode && x.SupplierBatch == (models.FirstOrDefault()?.LotNo ?? "")&& x.OrderQuantity >x.ReceiptQuantity && x.OrderQuantity == (quantitys.FirstOrDefault())).ToList();
 
                 if (inboundOrderDetails == null || inboundOrderDetails.Count <= 0)
                 {
-                    return WebResponseContent.Instance.Error($"鏈湪鍏ュ簱鍗曟槑缁嗕腑鎵惧埌璇ョ墿鏂欎俊鎭�");
+                     return WebResponseContent.Instance.Error($"鏈湪鍏ュ簱鍗曟槑缁嗕腑鎵惧埌璇ョ墿鏂欎俊鎭垨鏁伴噺涓嶅尮閰�");
                 }
                 var inboundOrderDet = inboundOrderDetails.FirstOrDefault();
+
                 //Dt_StockInfo? stockInfo = _stockService.StockInfoService.GetStockByPalletCode(palletCode);
 
                 decimal beforeQuantity = 0;
@@ -190,7 +243,7 @@
                 List<Dt_StockInfoDetail> stockInfoDetails = new List<Dt_StockInfoDetail>();
                 foreach (var model in models)
                 {
-                    Dt_InboundOrderDetail? notGroupDetail = inboundOrderDetails.Where(x => x.OrderDetailStatus <= OrderDetailStatusEnum.Inbounding.ObjToInt() && x.MaterielCode == model.MaterielCode && x.BatchNo == model.LotNo && x.OrderQuantity > x.ReceiptQuantity).FirstOrDefault();
+                    Dt_InboundOrderDetail? notGroupDetail = inboundOrderDetails.Where(x => x.OrderDetailStatus <= OrderDetailStatusEnum.Inbounding.ObjToInt() && x.MaterielCode == model.MaterielCode && x.SupplierBatch== model.LotNo && x.OrderQuantity > x.ReceiptQuantity).FirstOrDefault();
 
                     if (notGroupDetail == null)
                     {
@@ -203,12 +256,14 @@
                         OrderNo = inboundOrder.OrderNo,
                         BatchNo = inboundOrderDet.BatchNo,
                         LinId = inboundOrderDet.LinId,
-                        StockQuantity = model.Quantity,
+                        StockQuantity = (quantitys.FirstOrDefault()),
                         Status = (int)StockStatusEmun.缁勭洏鏆傚瓨,
                         Creater = "WMS",
                         CreateDate = DateTime.Now,
                         Id = inboundOrderDet.LinId.ObjToInt(),
-                        DeliveryNote = model.DeliveryNote
+                        DeliveryNote = model.DeliveryNote,
+                        SupplierBatch = inboundOrderDet.SupplierBatch,
+                        MaterieSpec = inboundOrderDet.MaterieSpec
                     };
 
                     if (stockInfo.Id > 0)
@@ -220,7 +275,7 @@
                     stockInfoDetails.Add(stockInfoDetail);
 
                     decimal decimalReceiptQuantity = Convert.ToDecimal(notGroupDetail.ReceiptQuantity);
-                    decimal decimalModelQuantity = Convert.ToDecimal(model.Quantity);
+                    decimal decimalModelQuantity = Convert.ToDecimal((quantitys.FirstOrDefault()));
                     decimal decimalOrderQuantity = Convert.ToDecimal(notGroupDetail.OrderQuantity);
                     decimalReceiptQuantity += decimalModelQuantity;
                     // 妫�鏌ユ槸鍚﹁秴鍑鸿鍗曟暟閲�
@@ -361,6 +416,7 @@
             WebResponseContent content = new WebResponseContent();
             try
             {
+                _unitOfWorkManage.BeginTran();
                 foreach (var item in model.DetailList)
                 {
                     //鑾峰彇鐗╂枡淇℃伅
@@ -374,13 +430,19 @@
                     {
                         return content.Error($"鏈壘鍒颁粨搴撲俊鎭�");
                     }
+                    if (item.SupplierBatch == null)
+                    {
+                        return content.Error("渚涘簲鍟嗘壒娆′笉鍙负绌�");
+                    }
                     Dt_InboundOrder inboundOrderOld = BaseDal.Db.Queryable<Dt_InboundOrder>().Where(x => x.UpperOrderNo == model.AsnNo).Includes(x => x.Details).First();
+                    
                     if (inboundOrderOld != null)
                     {
                         if (inboundOrderOld.OrderStatus != OrderDetailStatusEnum.New.ObjToInt())
                         {
                             return content.Error($"{model.AsnNo}鍗曟嵁宸插紑濮�!");
                         }
+                        Dt_InboundOrderDetail orderDetail1 = BaseDal.Db.Queryable<Dt_InboundOrderDetail>().Where(x => x.OrderId == inboundOrderOld.Id).First();
                         Dt_InboundOrderDetail? inboundOrderDetailOld = inboundOrderOld.Details?.FirstOrDefault(x => x.LinId == item.LinId && x.MaterielCode == item.MaterielCode);
                         if (inboundOrderDetailOld != null)
                         {
@@ -391,6 +453,7 @@
                         {
                             Dt_InboundOrderDetail orderDetail = new Dt_InboundOrderDetail()
                             {
+                                OrderId = orderDetail1.OrderId,
                                 MaterielCode = item.MaterielCode,
                                 BatchNo = item.BatchNo,
                                 OrderQuantity = item.OrderQuantity,
@@ -401,7 +464,8 @@
                                 LPNNo = item.LPN_No,
                                 MaterielName = item.MaterielName,
                                 MaterieSpec = item.MaterieSpec,
-                                Creater = "涓婃父WMS"
+                                Creater = "涓婃父WMS",
+                                SupplierBatch = item.SupplierBatch
                             };
                             _inboundRepository.InboundOrderDetailRepository.AddData(orderDetail);
                         }
@@ -420,7 +484,8 @@
                             LPNNo = item.LPN_No,
                             MaterielName = item.MaterielName,
                             MaterieSpec = item.MaterieSpec,
-                            Creater = "涓婃父WMS"
+                            Creater = "涓婃父WMS",
+                            SupplierBatch = item.SupplierBatch
                         };
 
                         Dt_InboundOrder inboundOrder = new Dt_InboundOrder()
@@ -436,6 +501,7 @@
                             InoutType = model.OrderType,
                             OrderType = model.InoutType.ObjToInt(),
                             Creater = "涓婃父WMS",
+                            System = model.System,
                             Details = new List<Dt_InboundOrderDetail> { orderDetail }
                         };
                         //switch (model.OrderType)//鍗曟嵁绫诲瀷
@@ -453,13 +519,11 @@
                         //        break;
                         //};
                         Db.InsertNav(inboundOrder).Include(x => x.Details).ExecuteCommand();
+                        
                     }
                 }
+                _unitOfWorkManage.CommitTran();
                 content = WebResponseContent.Instance.OK();
-
-
-
-
                 //InboundOrderAddDTO orderAddDTO1 = new InboundOrderAddDTO();
                 //orderAddDTO1.OrderNo = orderAddDTO.AsnNo;
                 //orderAddDTO1.UpperOrderNo = orderAddDTO.AsnNo;
@@ -482,7 +546,9 @@
             }
             catch (Exception ex)
             {
+                _unitOfWorkManage.RollbackTran();
                 content = WebResponseContent.Instance.Error(ex.Message);
+                
             }
             finally
             {
@@ -632,6 +698,301 @@
             return content;
         }
 
+        public WebResponseContent Save(AddInboundOrderModel addInboundOrder)
+        {
+            try
+            {
+                List<Dt_InboundOrderDetail> inboundOrderDetails = new List<Dt_InboundOrderDetail>();
+                Random random = new Random();
+                if (addInboundOrder.Details != null)
+                {
+                    foreach (var model in addInboundOrder.Details)
+                    {
+                        // 鐢熸垚3浣嶉殢鏈烘暟锛�1-999涔嬮棿锛�
+                        int randomNum = random.Next(1, 1000);
+
+                        // 鏍煎紡鍖栧綋鍓嶆棩鏈熶负骞存湀鏃ワ紙渚嬪锛�20230820锛�
+                        string datePart = DateTime.Now.ToString("yyyyMMdd");
+                        Dt_InboundOrderDetail inboundOrderDetail = new Dt_InboundOrderDetail()
+                        {
+                            MaterielCode = model.MaterielCode,
+                            MaterielName = model.MaterielName,
+                            SupplierBatch = model.SupplierBatch,
+                            OrderQuantity = model.OrderQuantity,
+                            BatchNo ="PC"+$"{datePart}{randomNum}",
+                            OrderDetailStatus = InOrderStatusEnum.鏈紑濮�.ObjToInt(),
+                            Creater = "WMS",
+                            CreateDate = DateTime.Now,
+
+                        };
+                        inboundOrderDetails.Add(inboundOrderDetail);
+                    }
+                }
+                int randomNum2 = random.Next(1, 1000);
+                string datePart2 = DateTime.Now.ToString("yyyyMMdd");
+                Dt_InboundOrder erpProScrapSheet = new Dt_InboundOrder()
+                {
+                    OrderNo = "WMSIN" + $"{datePart2}{randomNum2}",
+                    UpperOrderNo = "WMSIN" + $"{datePart2}{randomNum2}",
+                    WarehouseId = addInboundOrder.WarehouseId,
+                    OrderType = OrderTypeEnum.鐢熶骇鍏ュ簱鍗�.ObjToInt(),
+                    InoutType = InoutTypeEnum.OtherIn.ToString(),
+                    OrderStatus = InOrderStatusEnum.鏈紑濮�.ObjToInt(),
+                    CreateType = OrderCreateTypeEnum.CreateInSystem.ObjToInt(),
+                    System = "WMS",
+                    Details = inboundOrderDetails,
+                    Creater = "WMS",
+                    CreateDate = DateTime.Now,
+                };
+                _unitOfWorkManage.BeginTran();
+                Db.InsertNav(erpProScrapSheet).Include(x => x.Details).ExecuteCommand();
+                _unitOfWorkManage.CommitTran();
+                return WebResponseContent.Instance.OK();
+
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                return WebResponseContent.Instance.Error(ex.Message);
+            }
+
+        }
+
+        public string CancelInMaterialWarehousing = WIDESEA_Core.Helper.AppSettings.Configuration["CancelInMaterialWarehousing"];
+        /// <summary>
+        /// 鍏ュ簱鍗曟嵁鍙栨秷鎺ㄩ�丒RP
+        /// </summary>
+        /// <param name="orderNo"></param>
+        /// <returns></returns>
+        public WebResponseContent FeedbackInboundCanceERP(int[] keys)
+        {
+            try
+            {
+                List<Dt_InboundOrderDetail> inboundOrderDetails = _inboundRepository.InboundOrderDetailRepository.QueryData(x => keys.Contains(x.Id));
+
+                if (inboundOrderDetails == null || inboundOrderDetails.Count == 0)
+                {
+                    return WebResponseContent.Instance.Error("鏈壘鍒板叆搴撳崟鏄庣粏淇℃伅");
+                }
+                if (inboundOrderDetails.FirstOrDefault(x => x.OrderDetailStatus > OrderDetailStatusEnum.New.ObjToInt() && x.OrderDetailStatus != OrderDetailStatusEnum.AssignOverPartial.ObjToInt()) != null)
+                {
+                    return WebResponseContent.Instance.Error("鎵�閫夊叆搴撳崟鏄庣粏瀛樺湪鍏ュ簱涓垨宸插畬鎴�");
+                }
+                Dt_InboundOrder inboundOrder = _inboundRepository.InboundOrderRepository.QueryFirst(x => x.Id == inboundOrderDetails[0].OrderId);
+                if (inboundOrder == null)
+                {
+                    return WebResponseContent.Instance.Error("鏈�氳繃璇ユ槑缁嗘壘鍒板叆搴撳崟淇℃伅");
+                }
+                if (!inboundOrder.System.Equals("ERP"))
+                {
+                    return WebResponseContent.Instance.Error("璇ュ叆搴撳崟鎹潪ERP鎺ㄩ�侊紝鏃犳硶鍙栨秷");
+                }
+                List<FeedbackInboundOrderERP> feedbackInboundOrders = new List<FeedbackInboundOrderERP>();
+                foreach (var item in inboundOrderDetails)
+                {
+                    FeedbackInboundOrderERP feedbackInbound = new FeedbackInboundOrderERP()
+                    {
+                        code = inboundOrder.UpperOrderNo,
+                        itemId = item.LinId,
+                    };
+                    feedbackInboundOrders.Add(feedbackInbound);
+                }
+
+                var response = HttpHelper.Post<WebResponseContent>(CancelInMaterialWarehousing, feedbackInboundOrders, "鍏ュ簱鏄庣粏鍙栨秷鍥炰紶ERP");
+                _unitOfWorkManage.BeginTran();
+                if (response.Code == 0)
+                {
+                    _inboundRepository.InboundOrderDetailRepository.DeleteAndMoveIntoHty(inboundOrderDetails, OperateType.浜哄伐鍙栨秷);
+
+                    //妫�鏌ヨ涓昏鍗曟槸鍚﹁繕鏈夊墿浣欐槑缁�
+                    int remainingDetailsCount = _inboundRepository.InboundOrderDetailRepository
+                        .Db.Queryable<Dt_InboundOrderDetail>()
+                        .Where(d => d.OrderId == inboundOrder.Id)
+                        .Count();
+
+                    // 濡傛灉娌℃湁鍓╀綑鏄庣粏锛屽啀鍒犻櫎涓昏鍗�
+                    if (remainingDetailsCount == 0)
+                    {
+                        _inboundRepository.InboundOrderRepository.DeleteAndMoveIntoHty(inboundOrder, OperateType.浜哄伐鍙栨秷);
+                    }
+
+                    _unitOfWorkManage.CommitTran();
+                    return WebResponseContent.Instance.OK();
+                }
+                else
+                {
+                    throw new Exception($"鎿嶄綔澶辫触: {response.Message ?? "鏈彁渚涢敊璇俊鎭�"}");
+
+                }
+
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                return WebResponseContent.Instance.Error(ex.Message);
+            }
+        }
+
+        public WebResponseContent ReceiveReturnOrder(List<HouseReturnOrder> houseReturnOrder)
+        {
+            try
+            {
+                Random random = new Random();
+                List<Dt_ReturnOrder> returnOrders = new List<Dt_ReturnOrder>();
+                _unitOfWorkManage.BeginTran();
+                foreach(var item in houseReturnOrder)
+                {
+                    int randomNum = random.Next(1, 1000);
+                    string datePart = DateTime.Now.ToString("yyyyMMdd");
+                    Dt_ReturnOrder returnOrder = _returnOrderRepository.QueryFirst(x => x.LPNNo == item.LPNNo && x.OrderStatus == InOrderStatusEnum.鏈紑濮�.ObjToInt());
+                    if(returnOrder == null)
+                    {
+                        Dt_ReturnOrder newReturnOrder = new Dt_ReturnOrder
+                        {
+                            OrderType = OrderTypeEnum.鍙嶆嫞鍥炲簱鍗�.ObjToInt(),
+                            MaterielCode = item.MaterielCode,
+                            MaterielName = item.MaterielName,
+                            MaterieSpec = item.MaterieSpec,
+                            BatchNo = item.BatchNo,
+                            OrderQuantity = item.OrderQuantity,
+                            Remark = item.Remark,
+                            LinId = item.LinId,
+                            LPNNo = item.LPNNo,
+                            LocationCode = item.LocationCode,
+                            WarehouseCode = item.WarehouseCode,
+                            System = item.System,
+                            OrderStatus = InOrderStatusEnum.鏈紑濮�.ObjToInt(),
+                            Creater = "SMOM",
+                            CreateDate = DateTime.Now
+                        };
+                        _returnOrderRepository.AddData(newReturnOrder);
+                        Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo, Dt_StockInfoDetail>((stock, detail) => stock.Id == detail.StockId).Where((stock, detail) => stock.PalletCode == item.LPNNo && stock.LocationCode == item.LocationCode).First();
+                        Dt_OutboundOrderDetail outboundOrderDetail = new Dt_OutboundOrderDetail();
+                        Dt_OutboundOrder outboundOrder = new Dt_OutboundOrder();
+                        if (stockInfo == null)
+                        {
+                            Dt_Warehouse warehouse = _warehouseService.Repository.QueryData(x => x.WarehouseCode == item.WarehouseCode).FirstOrDefault();
+                            if(warehouse == null)
+                            {
+                                return WebResponseContent.Instance.Error($"璇ヤ粨搴撶紪鍙穥item.WarehouseCode}鏈厤缃�");
+                            }
+                            Dt_StockInfoDetail stockInfoDetail = new Dt_StockInfoDetail
+                            {
+                                MaterielCode = item.MaterielCode,
+                                MaterielName = item.MaterielName,
+                                MaterieSpec = item.MaterieSpec,
+                                BatchNo = item.BatchNo,
+                                LinId = item.LinId,
+                                Status = StockStatusEmun.缁勭洏鏆傚瓨.ObjToInt(),
+                                Creater = "SMOM",
+                                CreateDate = DateTime.Now,
+                                OrderNo = newReturnOrder.OrderNo,
+                                StockQuantity = item.OrderQuantity,
+                            };
+                            Dt_StockInfo stockInfo1 = new Dt_StockInfo
+                            {
+                                PalletCode = item.LPNNo,
+                                WarehouseId = warehouse.WarehouseId,
+                                BatchNo = item.BatchNo,
+                                PalletType = GetPalletType(warehouse, item.LPNNo),
+                                IsFull = true,
+                                StockStatus = (int)StockStatusEmun.鍙嶆嫞鍏ュ簱,
+                                Creater = "WMS",
+                                CreateDate = DateTime.Now,
+                                MaterialType = (int)InventoryMaterialType.鍘熸潗鏂�,
+                                Materialweight = 0,
+                                Wlstatus = (int)InventoryMaterialStatus.鍚堟牸,
+                                Mgeneratetime = DateTime.Now,
+                                Details = new List<Dt_StockInfoDetail> { stockInfoDetail}
+                            };
+                            Db.InsertNav(stockInfo1).Include(x => x.Details).ExecuteCommand();
+                        }
+                        else
+                        {
+                             outboundOrderDetail = new Dt_OutboundOrderDetail
+                            {
+                                MaterielCode = item.MaterielCode,
+                                MaterielName = item.MaterielName,
+                                MaterieSpec = item.MaterieSpec,
+                                BatchNo = item.BatchNo,
+                                OrderQuantity = stockInfo.Details.Sum(x=>x.StockQuantity),
+                                Remark = item.Remark,
+                                LinId = item.LinId,
+                                LPNNo = item.LPNNo,
+                                Creater = "SMOM",
+                                CreateDate = DateTime.Now,
+                                LocationName = item.LocationCode
+                            };
+                             outboundOrder = new Dt_OutboundOrder
+                            {
+                                OrderNo = "FJCK" + $"{datePart}{randomNum}",
+                                UpperOrderNo = "WMSFJCK" + $"{datePart}{randomNum}",
+                                OrderStatus = OutOrderStatusEnum.鏈紑濮�.ObjToInt(),
+                                OrderType = OrderTypeEnum.鍙嶆嫞鍑哄簱鍗�.ObjToInt(),
+                                InoutType = InoutTypeEnum.OtherOut.ToString(),
+                                System = item.System,
+                                Creater = "SMOM",
+                                CreateDate = DateTime.Now,
+                                CreateType = OrderCreateTypeEnum.UpperSystemPush.ObjToInt(),
+                                Details = new List<Dt_OutboundOrderDetail> { outboundOrderDetail }
+                             };
+                            Db.InsertNav(outboundOrder).Include(x => x.Details).ExecuteCommand();
+                        }
+                        
+                    }
+                    else
+                    {
+                        Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo, Dt_StockInfoDetail>((stock, detail) => stock.Id == detail.StockId).Where((stock, detail) => stock.PalletCode == item.LPNNo && stock.StockStatus == StockStatusEmun.浣欐枡閫�搴�.ObjToInt()).First();
+                        stockInfo.StockStatus = StockStatusEmun.鍙嶆嫞鍏ュ簱.ObjToInt();
+                        returnOrder.LinId = item.LinId;
+                        returnOrder.System = item.System;
+                        returnOrder.WarehouseCode = item.WarehouseCode;
+                        returnOrder.LocationCode = item.LocationCode;
+                        returnOrder.OrderType = OrderTypeEnum.鍙嶆嫞鍥炲簱鍗�.ObjToInt();
+                        returnOrder.OrderQuantity += item.OrderQuantity;
+                        returnOrder.ReceiptQuantity += item.OrderQuantity;
+                        _returnOrderRepository.UpdateData(returnOrder);
+                        _stockRepository.StockInfoRepository.UpdateData(stockInfo);
+                        
+                    }
+                }
+                _unitOfWorkManage.CommitTran();
+                return WebResponseContent.Instance.OK();
+            }
+            catch(Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                return WebResponseContent.Instance.Error(ex.Message);
+            }
+        }
+
+        public WebResponseContent GetMaterielCode(int warehouseId)
+        {
+            try
+            {
+                List<Dt_MaterielInfo> materielInfos = _basicRepository.MaterielInfoRepository.QueryData(x => x.WarehouseId == warehouseId).ToList();
+                List<string> materielCodes = materielInfos.Select(x => x.MaterielCode).Distinct().ToList();
+                return WebResponseContent.Instance.OK("鎴愬姛", data: materielCodes);
+            }
+            catch(Exception ex)
+            {
+                return WebResponseContent.Instance.Error(ex.Message);
+            }
+        }
+
+        public WebResponseContent GetMaterielName(int warehouseId, string materielCode)
+        {
+            try
+            {
+                List<Dt_MaterielInfo> materielInfos = _basicRepository.MaterielInfoRepository.QueryData(x => x.WarehouseId == warehouseId && x.MaterielCode == materielCode).ToList();
+                List<string> materielNames = materielInfos.Select(x => x.MaterielName).Distinct().ToList();
+                return WebResponseContent.Instance.OK("鎴愬姛", data: materielNames);
+            }
+            catch (Exception ex)
+            {
+                return WebResponseContent.Instance.Error(ex.Message);
+            }
+        }
         /// <summary>
         /// 楠岃瘉鍗曟嵁娣诲姞DTO瀵硅薄
         /// </summary>
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Base/ReturnOrderServive.cs b/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Base/ReturnOrderServive.cs
new file mode 100644
index 0000000..c097b87
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Base/ReturnOrderServive.cs
@@ -0,0 +1,21 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_IInboundRepository;
+using WIDESEA_IInboundService;
+using WIDESEA_Model.Models.Inbound;
+
+namespace WIDESEA_InboundService.Base
+{
+    public class ReturnOrderServive : ServiceBase<Dt_ReturnOrder, IReturnOrderRepository>, IReturnOrderService
+    {
+        public ReturnOrderServive(IReturnOrderRepository BaseDal) : base(BaseDal)
+        {
+        }
+
+        public IReturnOrderRepository Repository => BaseDal;
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Base/TakeStockOrderDetailService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Base/TakeStockOrderDetailService.cs
new file mode 100644
index 0000000..6b21278
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Base/TakeStockOrderDetailService.cs
@@ -0,0 +1,26 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_Core;
+using WIDESEA_IInboundRepository;
+using WIDESEA_IInboundService;
+using WIDESEA_Model.Models;
+using WIDESEA_DTO.ERP;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_IBasicRepository;
+
+namespace WIDESEA_InboundService
+{
+    public class TakeStockOrderDetailService : ServiceBase<Dt_TakeStockOrderDetail, ITakeStockOrderDetailRepository>, ITakeStockOrderDetailService
+    {
+        public ITakeStockOrderDetailRepository Repository => BaseDal;
+        private readonly IUnitOfWorkManage _unitOfWorkManage;
+        public TakeStockOrderDetailService(ITakeStockOrderDetailRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal)
+        {
+            _unitOfWorkManage = unitOfWorkManage;
+        }
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Base/TakeStockOrderService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Base/TakeStockOrderService.cs
new file mode 100644
index 0000000..43e088b
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/Base/TakeStockOrderService.cs
@@ -0,0 +1,317 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_Core;
+using WIDESEA_IInboundRepository;
+using WIDESEA_IInboundService;
+using WIDESEA_Model.Models;
+using WIDESEA_DTO.ERP;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_IBasicRepository;
+using WIDESEA_Common.OrderEnum;
+using WIDESEA_Core.Helper;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+using WIDESEA_InboundRepository;
+using WIDESEA_IStockRepository;
+using WIDESEA_Core.Enums;
+using SqlSugar;
+
+namespace WIDESEA_InboundService
+{
+    public class TakeStockOrderService : ServiceBase<Dt_TakeStockOrder, ITakeStockOrderRepository>, ITakeStockOrderService
+    {
+        public ITakeStockOrderRepository Repository => BaseDal;
+        private readonly IUnitOfWorkManage _unitOfWorkManage;
+        private readonly IBasicRepository _basicRepository;
+        private readonly ITakeStockOrderDetailRepository _takeStockOrderDetailRepository;
+        private readonly IStockInfoRepository _stockInfoRepository;
+        private readonly IStockInfoDetailRepository _stockInfoDetailRepository;
+        public TakeStockOrderService(ITakeStockOrderRepository BaseDal, IUnitOfWorkManage unitOfWorkManage, IBasicRepository basicRepository,ITakeStockOrderDetailRepository takeStockOrderDetailRepository,IStockInfoRepository stockInfoRepository,IStockInfoDetailRepository stockInfoDetailRepository) : base(BaseDal)
+        {
+            _unitOfWorkManage = unitOfWorkManage;
+            _basicRepository = basicRepository;
+            _takeStockOrderDetailRepository= takeStockOrderDetailRepository;
+            _stockInfoRepository= stockInfoRepository;
+            _stockInfoDetailRepository= stockInfoDetailRepository;
+        }
+        /// <summary>
+        /// 鏂板
+        /// </summary>
+        public override WebResponseContent AddData(SaveModel saveModel)
+        {
+            Dt_Warehouse? warehouse = null;
+            if (saveModel.MainData.TryGetValue(nameof(Dt_TakeStockOrder.WarehouseId).FirstLetterToLower(), out object? warehouseId) && warehouseId != null && !string.IsNullOrEmpty(warehouseId.ToString()))
+            {
+                warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == warehouseId.ObjToInt());
+                if (warehouse == null)
+                    return WebResponseContent.Instance.Error("鏈壘鍒颁粨搴撲俊鎭�");
+            }
+
+            if (saveModel.DetailData.Count>0)
+            {
+                for (int i = 0; i < saveModel.DetailData.Count; i++)
+                {
+                    if (saveModel.DetailData[i].TryGetValue(nameof(Dt_TakeStockOrderDetail.MaterielCode).FirstLetterToLower(), out object? materielCode) && materielCode != null && !string.IsNullOrEmpty(materielCode.ToString()))
+                    {
+                        Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterielCode == materielCode.ToString() && x.WarehouseId == warehouse.WarehouseId);
+                        if (materielInfo == null) return WebResponseContent.Instance.Error($"鏈壘鍒版湰浠撳簱鐗╂枡{materielCode}淇℃伅");
+                        saveModel.DetailData[i].Add(nameof(Dt_TakeStockOrderDetail.MaterielName).FirstLetterToLower(),materielInfo.MaterielName);
+                        saveModel.DetailData[i].Add(nameof(Dt_TakeStockOrderDetail.MaterielSpec).FirstLetterToLower(), materielInfo.MaterielSpec);
+                        saveModel.DetailData[i].Add(nameof(Dt_TakeStockOrderDetail.Unit).FirstLetterToLower(), materielInfo.MaterielUnit);
+                    }
+                }
+            }
+            saveModel.MainData.Add(nameof(Dt_TakeStockOrder.TakeStockStatus).FirstLetterToLower(), TakeStockStatusEnum.鏈洏鐐�.ObjToInt());
+            return base.AddData(saveModel); 
+        }
+        /// <summary>
+        /// 鑾峰彇瀵瑰簲浠撳簱鐩樼偣鍗�
+        /// </summary>
+        /// <returns></returns>
+        public WebResponseContent GetTakeStockOrders(SaveModel saveModel)
+        {
+            WebResponseContent content =new WebResponseContent();
+            try
+            {
+                int pageNo = saveModel.MainData["pageNo"].ObjToInt();
+                string? orderNo = saveModel.MainData["orderNo"].ToString();
+                int warehouseId = saveModel.MainData["warehouseId"].ObjToInt();
+                List<Dt_TakeStockOrder> takeStockOrders = new List<Dt_TakeStockOrder>();
+                if (string.IsNullOrEmpty(orderNo))
+                {
+                    takeStockOrders = Db.Queryable<Dt_TakeStockOrder>().Where(x => x.TakeStockStatus < TakeStockStatusEnum.鐩樼偣瀹屾垚.ObjToInt() && x.WarehouseId == warehouseId).ToPageList(pageNo, 5);
+                }
+                else
+                {
+                    takeStockOrders = Db.Queryable<Dt_TakeStockOrder>().Where(x => (x.OrderNo.Contains(orderNo) && x.TakeStockStatus < TakeStockStatusEnum.鐩樼偣瀹屾垚.ObjToInt() && x.WarehouseId == warehouseId)).ToPageList(pageNo, 5);
+                }
+                content.OK(data: takeStockOrders);
+            }
+            catch (Exception ex)
+            {
+                content.Error(ex.Message);
+            }
+            return content;
+        }
+        /// <summary>
+        /// 閫氳繃鐩樼偣鍗曞彿+妗嗗彿鑾峰彇鐩樼偣淇℃伅璇︽儏
+        /// </summary>
+        /// <param name="saveModel"></param>
+        /// <returns></returns>
+        public WebResponseContent GetTakeDetailInfo(SaveModel saveModel)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                string? orderNo = saveModel.MainData["orderNo"].ToString();
+                string? takePalletCode = saveModel.MainData["takePalletCode"].ToString();
+                Dt_TakeStockOrderDetail takeStockOrderDetail=new Dt_TakeStockOrderDetail();
+                if (!string.IsNullOrEmpty(orderNo) && !string.IsNullOrEmpty(takePalletCode))
+                {
+                    //鑾峰彇鐩樼偣鏄庣粏
+                    takeStockOrderDetail = BaseDal.Db.Queryable<Dt_TakeStockOrder, Dt_TakeStockOrderDetail>((master, detail) => master.Id == detail.TakeStockId)
+                    .Where((master, detail) => master.OrderNo == orderNo && detail.TakePalletCode== takePalletCode)
+                    .Select((master, detail) => detail).First();
+                    if (takeStockOrderDetail==null)
+                    {
+                        return content.Error($"鐩樼偣鍗晎orderNo}涓湭鎵惧埌{takePalletCode}鐩樼偣鏄庣粏");
+                    }
+                    if (takeStockOrderDetail.TakeDetalStatus != TakeStockDetailStatusEnum.鐩樼偣鍑哄簱瀹屾垚.ObjToInt())
+                    {
+                        return content.Error($"鐩樼偣鍗晎orderNo}涓湭鎵惧埌{takePalletCode}鍙洏鐘舵��");
+                    }
+                    Dt_StockInfo stockInfo = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x=>x.PalletCode== takePalletCode && x.StockStatus==StockStatusEmun.鐩樼偣鍑哄簱瀹屾垚.ObjToInt()).Includes(x=>x.Details).First();
+                    if (stockInfo == null)
+                    {
+                        return content.Error($"鏈壘鍒皗takePalletCode}鐩樼偣搴撳瓨鐘舵��");
+                    }
+                    content.OK(data: takeStockOrderDetail);
+                }
+                else
+                {
+                    return content.Error("璇锋眰淇℃伅涓虹┖");
+                }
+            }
+            catch (Exception ex)
+            {
+                content.Error(ex.Message);
+            }
+            return content;
+        }
+        /// <summary>
+        /// 鐩樼偣鎿嶄綔
+        /// </summary>
+        /// <param name="saveModel"></param>
+        /// <returns></returns>
+        public WebResponseContent MatPicking(SaveModel saveModel)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                int id = saveModel.MainData["id"].ObjToInt();
+                decimal stockNum =saveModel.MainData["num"].ObjToDecimal();
+                if (stockNum<0)
+                {
+                    return content.Error("鐩樹簭涓嶈兘涓鸿礋");
+                }
+                if (id>0)
+                {
+                    //鑾峰彇鐩樼偣璇︽儏
+                    Dt_TakeStockOrderDetail takeStockOrderDetail = _takeStockOrderDetailRepository.QueryFirst(x=>x.Id== id);
+                    if (takeStockOrderDetail.TakeDetalStatus != TakeStockDetailStatusEnum.鐩樼偣鍑哄簱瀹屾垚.ObjToInt())
+                    {
+                        return content.Error("闈炲彲鐩樼偣鐘舵��");
+                    }
+                    Dt_TakeStockOrder takeStockOrder = BaseDal.Db.Queryable<Dt_TakeStockOrder>().Where(x => x.Id == takeStockOrderDetail.TakeStockId).Includes(x => x.Details).First();
+                    if (takeStockOrder.TakeStockStatus != TakeStockStatusEnum.鐩樼偣涓�.ObjToInt())
+                    {
+                        return content.Error("闈炲彲鐩樼偣鐘舵��");
+                    }
+                    //鑾峰彇搴撳瓨
+                    Dt_StockInfo stockInfo = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == takeStockOrderDetail.TakePalletCode && x.StockStatus == StockStatusEmun.鐩樼偣鍑哄簱瀹屾垚.ObjToInt()).Includes(x => x.Details).First();
+                    List<Dt_StockInfoDetail> addStockDetails = new List<Dt_StockInfoDetail>();
+                    List<Dt_StockInfoDetail> delStockDetails = new List<Dt_StockInfoDetail>();
+                    List<Dt_StockInfoDetail> updateStockDetails = new List<Dt_StockInfoDetail>();
+                    if (stockInfo == null || stockInfo.Details.Count<=0 || stockInfo.Details==null)
+                    {
+                        return content.Error("鏈壘鍒板簱瀛�");
+                    }
+                    takeStockOrderDetail.Qty = stockNum;
+                    takeStockOrderDetail.TakeDetalStatus = TakeStockDetailStatusEnum.鐩樼偣瀹屾垚.ObjToInt();
+                    int stockCount=stockInfo.Details.Count;
+                    //鍒ゆ柇鏄惁鐩樿耽杩樻槸鐩樹簭
+                    if (takeStockOrderDetail.SysQty< takeStockOrderDetail.Qty) //鐩樿耽
+                    {
+                        //float stockMaxQty = stockInfo.Details.Max(x => x.StockQuantity);
+                        //float stockMinQty = stockInfo.Details.Min(x => x.StockQuantity);
+                        Dt_StockInfoDetail? addstockInfoDetail = stockInfo.Details?.FirstOrDefault();
+                        addstockInfoDetail.Id = 0;
+                        addstockInfoDetail.StockQuantity = (decimal)(takeStockOrderDetail.Qty - takeStockOrderDetail.SysQty);
+                        addStockDetails.Add(addstockInfoDetail);
+                    }
+                    else if (takeStockOrderDetail.Qty==0) //鐩樹簭
+                    {
+                        delStockDetails.AddRange(stockInfo.Details);
+                    }
+                    else if(takeStockOrderDetail.SysQty > takeStockOrderDetail.Qty) //鐩樹簭
+                    {
+                        decimal totalQty = (takeStockOrderDetail.SysQty - takeStockOrderDetail.Qty).ObjToDecimal();
+                        while (totalQty>0)
+                        {
+                            Dt_StockInfoDetail addstockInfoDetail=stockInfo.Details.OrderByDescending(x => x.Id).FirstOrDefault();
+                            decimal stockQty = addstockInfoDetail.StockQuantity.ObjToDecimal();
+                            if (stockQty < totalQty)
+                            {
+                                delStockDetails.Add(addstockInfoDetail);
+                                stockInfo.Details.Remove(addstockInfoDetail);
+                                totalQty -= stockQty;
+                            }
+                            else if (stockQty >= totalQty)
+                            {
+                                stockQty-=totalQty;
+                                if (stockQty==0)
+                                {
+                                    delStockDetails.Add(addstockInfoDetail);
+                                    stockInfo.Details.Remove(addstockInfoDetail);
+                                }
+                                else
+                                {
+                                    addstockInfoDetail.StockQuantity = stockQty;
+                                    updateStockDetails.Add(addstockInfoDetail);
+                                    stockInfo.Details.Remove(addstockInfoDetail);
+                                }
+                                totalQty = 0;
+                            }
+                            
+                        }
+                    }
+                    List<Dt_TakeStockOrderDetail> takeStockOrderDetails=new List<Dt_TakeStockOrderDetail>();
+                    Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x=>x.WarehouseId==takeStockOrder.WarehouseId);
+                    List<Dt_TakeStockOrderDetail> overTakeStockOrderDetails = takeStockOrder.Details.Where(x => x.TakeDetalStatus == TakeStockDetailStatusEnum.鐩樼偣瀹屾垚.ObjToInt()).ToList();
+                    if ((overTakeStockOrderDetails.Count + 1) == takeStockOrder.Details.Count)
+                    {
+                        takeStockOrder.TakeStockStatus = TakeStockStatusEnum.鐩樼偣瀹屾垚.ObjToInt();
+                        takeStockOrderDetails.AddRange(overTakeStockOrderDetails);
+                        takeStockOrderDetails.Add(takeStockOrderDetail);
+                    }
+                    //鏁版嵁鎿嶄綔
+                    _unitOfWorkManage.BeginTran();
+                    if (stockCount== delStockDetails.Count)
+                    {
+                        _stockInfoRepository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
+                    }
+                    else
+                    {
+                        stockInfo.StockStatus = StockStatusEmun.鐩樼偣搴撳瓨瀹屾垚.ObjToInt();
+                        _stockInfoRepository.UpdateData(stockInfo);
+                        if (stockInfo.Details!=null && stockInfo.Details.Count>0)
+                        {
+                            stockInfo.Details.ForEach(x =>
+                            {
+                                x.Status = StockStatusEmun.鐩樼偣搴撳瓨瀹屾垚.ObjToInt();
+                            });
+                        }
+                    }
+                    if (delStockDetails.Count>0)
+                    {
+                        _stockInfoDetailRepository.DeleteAndMoveIntoHty(delStockDetails, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
+                    }
+                    if (addStockDetails.Count>0)
+                    {
+                        addStockDetails.ForEach(x =>
+                        {
+                            x.Status = StockStatusEmun.鐩樼偣搴撳瓨瀹屾垚.ObjToInt();
+                        });
+                        _stockInfoDetailRepository.AddData(addStockDetails);
+                    }
+                    if (updateStockDetails.Count>0)
+                    {
+                        updateStockDetails.ForEach(x =>
+                        {
+                            x.Status = StockStatusEmun.鐩樼偣搴撳瓨瀹屾垚.ObjToInt();
+                        });
+                        _stockInfoDetailRepository.UpdateData(updateStockDetails);
+                    }
+                    _takeStockOrderDetailRepository.UpdateData(takeStockOrderDetail);
+                    BaseDal.UpdateData(takeStockOrder);
+                    
+                    _unitOfWorkManage.CommitTran();
+                    content.OK("鐩樼偣鎴愬姛");
+                }
+                else
+                {
+                    return content.Error("璇锋眰淇℃伅涓虹┖");
+                }
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                content.Error(ex.Message);
+            }
+            return content;
+        }
+        public WebResponseContent DisEnableTakeOrder(int id)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                //鑾峰彇鐩樼偣鍗�
+                Dt_TakeStockOrder takeStockOrder = BaseDal.QueryFirst(x=>x.Id==id);
+                if (takeStockOrder!=null)
+                {
+                    takeStockOrder.TakeStockStatus = TakeStockStatusEnum.鐩樼偣鍏抽棴.ObjToInt();
+                    BaseDal.UpdateData(takeStockOrder);
+                    content.OK("鍏抽棴鐩樼偣鎴愬姛!");
+                }
+            }
+            catch (Exception ex)
+            {
+                content.Error(ex.Message);
+            }
+            return content;
+        }
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/WIDESEA_InboundService.csproj b/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/WIDESEA_InboundService.csproj
index 61191b5..7fb89a6 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/WIDESEA_InboundService.csproj
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/WIDESEA_InboundService.csproj
@@ -7,6 +7,14 @@
   </PropertyGroup>
 
   <ItemGroup>
+    <Compile Remove="TakeStockOrderDetailService.cs" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <PackageReference Include="PdfiumViewer" Version="2.13.0" />
+  </ItemGroup>
+
+  <ItemGroup>
     <ProjectReference Include="..\WIDESEA_IBasicService\WIDESEA_IBasicService.csproj" />
     <ProjectReference Include="..\WIDESEA_IInboundService\WIDESEA_IInboundService.csproj" />
     <ProjectReference Include="..\WIDESEA_IStockService\WIDESEA_IStockService.csproj" />
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_MaterielInfo.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_MaterielInfo.cs
index 9baa6c2..79e1071 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_MaterielInfo.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Basic/Dt_MaterielInfo.cs
@@ -49,7 +49,7 @@
         /// <summary>
         /// 鐗╂枡瑙勬牸
         /// </summary>
-        [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "鐗╂枡瑙勬牸")]
+        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "鐗╂枡瑙勬牸")]
         public string MaterielSpec { get; set; }
 
         /// <summary>
@@ -113,9 +113,9 @@
         public EnableEnum MaterielState { get; set; }
 
         /// <summary>
-        /// 搴撳瓨缁勭粐(榛樿:娣畨鐗瑰垱浜屽巶)
+        /// 淇濊川鏈�
         /// </summary>
-        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "搴撳瓨缁勭粐(榛樿:娣畨鐗瑰垱浜屽巶)")]
+        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "淇濊川鏈�")]
         public float? MaterielQa{ get; set; }
 
 
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder.cs
index 278ccd7..71ecf59 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder.cs
@@ -25,9 +25,6 @@
         [SugarColumn(IsNullable = false, ColumnDescription = "浠撳簱涓婚敭")]
         public int WarehouseId { get; set; }
 
-        [ImporterHeader(Name = "鍗曟嵁缂栧彿")]
-        [ExporterHeader(DisplayName = "鍗曟嵁缂栧彿")]
-        [CodeRule(WIDESEA_Core.Enums.RuleCode.InboundOrderRule)]
         [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鍗曟嵁缂栧彿")]
         public string OrderNo { get; set; }
 
@@ -41,6 +38,7 @@
         /// <summary>
         /// 涓婃父鍗曟嵁缂栧彿
         /// </summary>
+
         [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "涓婃父鍗曟嵁缂栧彿")]
         public string UpperOrderNo { get; set; }
 
@@ -76,9 +74,15 @@
         /// <summary>
         /// 鍑哄叆搴撶被鍨�
         /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDescription = "鍑哄叆搴撶被鍨�")]
+        [SugarColumn(IsNullable = true, ColumnDescription = "鍑哄叆搴撶被鍨�",Length = 50)]
         public string InoutType { get; set; }
 
+        /// <summary>
+        /// 鎺ㄥ崟绯荤粺
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDescription = "鎺ㄥ崟绯荤粺")]
+        public string System { get; set; }
+
         [ImporterHeader(IsIgnore = true)]
         [ExporterHeader(IsIgnore = true)]
         [Navigate(NavigateType.OneToMany, nameof(Dt_InboundOrderDetail.OrderId), nameof(Id))]
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrderDetail.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrderDetail.cs
index f7cad1d..780441c 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrderDetail.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrderDetail.cs
@@ -1,9 +1,11 @@
-锘縰sing SqlSugar;
+锘縰sing Magicodes.ExporterAndImporter.Core;
+using SqlSugar;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using WIDESEA_Core.Attributes;
 using WIDESEA_Core.DB.Models;
 
 namespace WIDESEA_Model.Models
@@ -23,7 +25,7 @@
         [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "鐗╂枡鍚嶇О")]
         public string MaterielName { get; set; }
 
-        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鎵规鍙�")]
+        [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "鎵规鍙�")]
         public string BatchNo { get; set; }
 
         [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "鍗曟嵁鏁伴噺")]
@@ -35,7 +37,7 @@
         [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "涓婃灦鏁伴噺", DefaultValue = "0")]
         public decimal OverInQuantity { get; set; }
 
-        [SugarColumn(IsNullable = false, ColumnDescription = "璁㈠崟鏄庣粏鐘舵��")]
+        [SugarColumn(IsNullable = false, ColumnDescription = "璁㈠崟鏄庣粏鐘舵��", DefaultValue = "0")]
         public int OrderDetailStatus { get; set; }
 
         [SugarColumn(IsNullable = true, ColumnDescription = "鐗╂枡瑙勬牸")]
@@ -49,5 +51,8 @@
 
         [SugarColumn(IsNullable = true, ColumnDescription = "LPN鍙�")]
         public string LPNNo { get; set; }
+
+        [SugarColumn(IsNullable = true, ColumnDescription = "渚涘簲鍟嗘壒娆�")]
+        public string SupplierBatch { get; set; }
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrderDetail_Hty.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrderDetail_Hty.cs
index dd7ca55..b85c625 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrderDetail_Hty.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrderDetail_Hty.cs
@@ -10,42 +10,31 @@
 namespace WIDESEA_Model.Models
 {
     [SugarTable(nameof(Dt_InboundOrderDetail_Hty), "鍏ュ簱鍗曟槑缁�")]
-    public class Dt_InboundOrderDetail_Hty : BaseEntity
+    public class Dt_InboundOrderDetail_Hty : Dt_InboundOrderDetail,IBaseHistoryEntity
     {
-        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")]
-        public int Id {  get; set; }
-
-        [SugarColumn(IsNullable = false, ColumnDescription = "鍏ュ簱鍗曚富閿�")]
-        public int OrderId { get; set; }
-
-        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鐗╂枡缂栧彿")]
-        public string MaterielCode {  get; set; }
-
-        [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "鐗╂枡鍚嶇О")]
-        public string MaterielName { get; set; }
-
-        [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鎵规鍙�")]
-        public string BatchNo {  get; set; }
-
-        [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "鍗曟嵁鏁伴噺")]
-        public decimal OrderQuantity {  get; set; }
-
-        [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "缁勭洏鏁伴噺", DefaultValue = "0")]
-        public decimal ReceiptQuantity {  get; set; }
-
-        [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "涓婃灦鏁伴噺", DefaultValue = "0")]
-        public decimal OverInQuantity {  get; set; }
-
-        [SugarColumn(IsNullable = false, ColumnDescription = "璁㈠崟鏄庣粏鐘舵��")]
-        public int OrderDetailStatus {  get; set; }
-
-        [SugarColumn(IsNullable = false, ColumnDescription = "澶囨敞")]
-        public string Remark {  get; set; }
-        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "婧愪富閿�")]
+        /// <summary>
+        /// 鍘熻〃涓婚敭
+        /// </summary>
+        [ImporterHeader(Name = "鍘熻〃涓婚敭")]
+        [ExporterHeader(DisplayName = "鍘熻〃涓婚敭")]
+        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "鍘熻〃涓婚敭")]
         public int SourceId { get; set; }
 
-        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "澶囨敞")]
+        /// <summary>
+        /// 鎿嶄綔绫诲瀷
+        /// </summary>
+        [ImporterHeader(Name = "鎿嶄綔绫诲瀷")]
+        [ExporterHeader(DisplayName = "鎿嶄綔绫诲瀷")]
+        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鎿嶄綔绫诲瀷")]
         public string OperateType { get; set; }
-      
+
+        /// <summary>
+        /// 绉诲叆鍘嗗彶鏃堕棿
+        /// </summary>
+        [ImporterHeader(Name = "绉诲叆鍘嗗彶鏃堕棿")]
+        [ExporterHeader(DisplayName = "绉诲叆鍘嗗彶鏃堕棿")]
+        [SugarColumn(IsNullable = false, ColumnDescription = "绉诲叆鍘嗗彶鏃堕棿")]
+        public DateTime InsertTime { get; set; }
+
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder_Hty.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder_Hty.cs
index 7980a55..f06de8f 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder_Hty.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_InboundOrder_Hty.cs
@@ -11,52 +11,30 @@
 namespace WIDESEA_Model.Models
 {
     [SugarTable(nameof(Dt_InboundOrder_Hty), "鍏ュ簱鍗�")]
-    public class Dt_InboundOrder_Hty :BaseEntity
+    public class Dt_InboundOrder_Hty : Dt_InboundOrder, IBaseHistoryEntity
     {
-        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")]
-        public int Id { get; set; }
-
-        [CodeRule(WIDESEA_Core.Enums.RuleCode.InboundOrderRule)]
-        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鍗曟嵁缂栧彿")]
-        public string OrderNo { get; set; }
-
-        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "涓婃父鍗曟嵁缂栧彿")]
-        public string UpperOrderNo { get; set; }
-
-        [SugarColumn(IsNullable = true, ColumnDescription = "鍗曟嵁绫诲瀷")]
-        public int OrderType { get; set; }
-
-        [SugarColumn(IsNullable = false, ColumnDescription = "鍗曟嵁鐘舵��")]
-        public int OrderStatus { get; set; }
-
-        [SugarColumn(IsNullable = false, ColumnDescription = "鍒涘缓鏂瑰紡")]
-        public int CreateType { get; set; }
-
-        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "澶囨敞")]
-        public string Remark { get; set; }
-
-        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "婧愪富閿�")]
+        /// <summary>
+        /// 鍘熻〃涓婚敭
+        /// </summary>
+        [ImporterHeader(Name = "鍘熻〃涓婚敭")]
+        [ExporterHeader(DisplayName = "鍘熻〃涓婚敭")]
+        [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "鍘熻〃涓婚敭")]
         public int SourceId { get; set; }
 
-        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "澶囨敞")]
+        /// <summary>
+        /// 鎿嶄綔绫诲瀷
+        /// </summary>
+        [ImporterHeader(Name = "鎿嶄綔绫诲瀷")]
+        [ExporterHeader(DisplayName = "鎿嶄綔绫诲瀷")]
+        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鎿嶄綔绫诲瀷")]
         public string OperateType { get; set; }
 
-        [ImporterHeader(Name = "浠撳簱缂栫爜")]
-        [ExporterHeader(DisplayName = "浠撳簱缂栫爜")]
-        [SugarColumn(IsNullable = false, ColumnDescription = "浠撳簱缂栫爜")]
-        public string OutWareHouse { get; set; }
-        [ImporterHeader(Name = "鍗曟嵁灏忕被")]
-        [ExporterHeader(DisplayName = "鍗曟嵁灏忕被")]
-        [SugarColumn(IsNullable = false, ColumnDescription = "鍗曟嵁灏忕被")]
-        public string TransactionCode { get; set; }
-        [ImporterHeader(Name = "鍑哄叆搴撶被鍨�")]
-        [ExporterHeader(DisplayName = "鍑哄叆搴撶被鍨�")]
-        [SugarColumn(IsNullable = false, ColumnDescription = "鍑哄叆搴撶被鍨�")]
-        public string InoutType { get; set; }
-
-        [ImporterHeader(IsIgnore = true)]
-        [ExporterHeader(IsIgnore = true)]
-        [Navigate(NavigateType.OneToMany, nameof(Dt_InboundOrderDetail_Hty.OrderId), nameof(Id))]
-        public List<Dt_InboundOrderDetail_Hty> Details { get; set; }
+        /// <summary>
+        /// 绉诲叆鍘嗗彶鏃堕棿
+        /// </summary>
+        [ImporterHeader(Name = "绉诲叆鍘嗗彶鏃堕棿")]
+        [ExporterHeader(DisplayName = "绉诲叆鍘嗗彶鏃堕棿")]
+        [SugarColumn(IsNullable = false, ColumnDescription = "绉诲叆鍘嗗彶鏃堕棿")]
+        public DateTime InsertTime { get; set; }
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReturnOrder.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReturnOrder.cs
new file mode 100644
index 0000000..34c8c5a
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_ReturnOrder.cs
@@ -0,0 +1,107 @@
+锘縰sing SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.Attributes;
+using WIDESEA_Core.CodeConfigEnum;
+using WIDESEA_Core.DB.Models;
+using WIDESEA_Core.Enums;
+
+namespace WIDESEA_Model.Models.Inbound
+{
+    [SugarTable(nameof(Dt_ReturnOrder), "鍥炲簱鍗�")]
+    public class Dt_ReturnOrder :BaseEntity
+    {
+        /// <summary>
+        /// 涓婚敭
+        /// </summary>
+        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")]
+        public int Id { get; set; }
+        /// <summary>
+        /// 鍗曟嵁缂栧彿
+        /// </summary>
+        [CodeRule(RuleCode.TKCodeRule)]
+        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鍗曟嵁缂栧彿", IsOnlyIgnoreUpdate = true)]
+        public string OrderNo { get; set; }
+
+        /// <summary>
+        /// 鍗曟嵁绫诲瀷
+        /// </summary>
+        [SugarColumn(IsNullable = false, ColumnDescription = "鍗曟嵁绫诲瀷")]
+        public int OrderType { get; set; }
+        /// <summary>
+        /// 鐗╂枡缂栧彿
+        /// </summary>
+        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鐗╂枡缂栧彿")]
+        public string MaterielCode { get; set; }
+        /// <summary>
+        /// 鐗╂枡鍚嶇О
+        /// </summary>
+        [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "鐗╂枡鍚嶇О")]
+        public string MaterielName { get; set; }
+        /// <summary>
+        /// 鎵规鍙�
+        /// </summary>
+        [SugarColumn(IsNullable = false, Length = 30, ColumnDescription = "鎵规鍙�")]
+        public string BatchNo { get; set; }
+        /// <summary>
+        /// 鍗曟嵁鏁伴噺
+        /// </summary>
+        [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "鍗曟嵁鏁伴噺")]
+        public decimal OrderQuantity { get; set; }
+        /// <summary>
+        /// 缁勭洏鏁伴噺
+        /// </summary>
+        [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "缁勭洏鏁伴噺", DefaultValue = "0")]
+        public decimal ReceiptQuantity { get; set; }
+        /// <summary>
+        /// 涓婃灦鏁伴噺
+        /// </summary>
+        [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "涓婃灦鏁伴噺", DefaultValue = "0")]
+        public decimal OverInQuantity { get; set; }
+        /// <summary>
+        /// 鍗曟嵁鐘舵��
+        /// </summary>
+        [SugarColumn(IsNullable = false, ColumnDescription = "鍗曟嵁鐘舵��")]
+        public int OrderStatus { get; set; }
+        /// <summary>
+        /// 鐗╂枡瑙勬牸
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDescription = "鐗╂枡瑙勬牸")]
+        public string MaterieSpec { get; set; }
+        /// <summary>
+        /// 澶囨敞
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDescription = "澶囨敞")]
+        public string Remark { get; set; }
+        /// <summary>
+        /// 鏄庣粏id
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDescription = "鏄庣粏id")]
+        public string LinId { get; set; }
+        /// <summary>
+        /// LPN鍙�
+        /// </summary>
+        [SugarColumn(IsNullable = false, ColumnDescription = "LPN鍙�")]
+        public string LPNNo { get; set; }
+        /// <summary>
+        /// 璐т綅缂栧彿
+        /// </summary>
+        [SugarColumn(IsNullable = false, ColumnDescription = "璐т綅缂栧彿")]
+        public string LocationCode { get; set; }
+
+        /// <summary>
+        /// 璐т綅缂栧彿
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDescription = "浠撳簱缂栧彿")]
+        public string WarehouseCode { get; set; }
+
+        /// <summary>
+        /// 鎺ㄥ崟绯荤粺
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDescription = "鎺ㄥ崟绯荤粺")]
+        public string System { get; set; }
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_TakeStockOrder.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_TakeStockOrder.cs
new file mode 100644
index 0000000..46d473c
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_TakeStockOrder.cs
@@ -0,0 +1,56 @@
+锘縰sing SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.Attributes;
+using WIDESEA_Core.CodeConfigEnum;
+using WIDESEA_Core.DB.Models;
+using WIDESEA_Core.Enums;
+
+namespace WIDESEA_Model.Models
+{
+    /// <summary>
+    /// 鐩樼偣鍗�
+    /// </summary>
+    [SugarTable(nameof(Dt_TakeStockOrder), "鐩樼偣鍗�")]
+    public class Dt_TakeStockOrder : BaseEntity
+    {
+        /// <summary>
+        /// 涓婚敭
+        /// </summary>
+        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")]
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 鐩樼偣鍗曞彿
+        /// </summary>
+        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鐩樼偣鍗曞彿")]
+        public string OrderNo { get; set; }
+
+        /// <summary>
+        /// 浠撳簱涓婚敭
+        /// </summary>
+        [SugarColumn(IsNullable = false, ColumnDescription = "浠撳簱涓婚敭")]
+        public int WarehouseId { get; set; }
+
+        /// <summary>
+        /// 鐩樼偣鐘舵��
+        /// </summary>
+        [SugarColumn(IsNullable = false, ColumnDescription = "鐩樼偣鐘舵��")]
+        public int TakeStockStatus { get; set; }
+
+        /// <summary>
+        /// 澶囨敞
+        /// </summary>
+        [SugarColumn(IsNullable = true, Length = 500, ColumnDescription = "澶囨敞")]
+        public string Remark { get; set; }
+
+        /// <summary>
+        /// 鐩樼偣鏄庣粏
+        /// </summary>
+        [PropertyValidate("鐩樼偣鏄庣粏", NotNullAndEmpty = true), Navigate(NavigateType.OneToMany, nameof(Dt_TakeStockOrderDetail.TakeStockId), nameof(Id))]
+        public List<Dt_TakeStockOrderDetail> Details { get; set; }
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_TakeStockOrderDetail.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_TakeStockOrderDetail.cs
new file mode 100644
index 0000000..a562caf
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Inbound/Dt_TakeStockOrderDetail.cs
@@ -0,0 +1,95 @@
+锘縰sing SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.DB.Models;
+
+namespace WIDESEA_Model.Models
+{
+    /// <summary>
+    /// 鐩樼偣鍗曟槑缁�
+    /// </summary>
+    [SugarTable(nameof(Dt_TakeStockOrderDetail), "鐩樼偣鍗曟槑缁�")]
+    public class Dt_TakeStockOrderDetail : BaseEntity
+    {
+        /// <summary>
+        /// 涓婚敭
+        /// </summary>
+        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")]
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 鐩樼偣鍗曚富閿�
+        /// </summary>
+        [SugarColumn(IsNullable = false, ColumnDescription = "鐩樼偣鍗曚富閿�")]
+        public int TakeStockId { get; set; }
+
+        /// <summary>
+        /// 鐗╂枡缂栫爜
+        /// </summary>
+        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鐗╂枡缂栫爜")]
+        public string MaterielCode { get; set; }
+
+        /// <summary>
+        /// 鐗╂枡鍚嶇О
+        /// </summary>
+        [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "鐗╂枡鍚嶇О")]
+        public string MaterielName { get; set; }
+
+        /// <summary>
+        /// 鎵规鍙�
+        /// </summary>
+        [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鎵规鍙�")]
+        public string BatchNo { get; set; }
+
+        /// <summary>
+        /// 鐗╂枡瑙勬牸
+        /// </summary>
+        [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "鐗╂枡瑙勬牸")]
+        public string MaterielSpec { get; set; }
+
+        /// <summary>
+        /// 鍘熶粨浣�
+        /// </summary>
+        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鍘熶粨浣�")]
+        public string LocationCode { get; set; }
+
+        /// <summary>
+        /// 鐩樼偣鎵樼洏
+        /// </summary>
+        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鐩樼偣鎵樼洏")]
+        public string TakePalletCode { get; set; }
+
+        /// <summary>
+        /// 鐩樼偣鏄庣粏鐘舵��
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDescription = "鐩樼偣鏄庣粏鐘舵��")]
+        public int TakeDetalStatus { get; set; }
+
+        /// <summary>
+        /// 鍗曚綅
+        /// </summary>
+        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鍗曚綅")]
+        public string Unit { get; set; }
+
+        /// <summary>
+        /// 璐﹂潰鏁伴噺
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDescription = "璐﹂潰鏁伴噺")]
+        public decimal SysQty { get; set; }
+
+        /// <summary>
+        /// 瀹炵洏鏁伴噺
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDescription = "瀹炵洏鏁伴噺")]
+        public decimal Qty { get; set; }
+
+        /// <summary>
+        /// 澶囨敞
+        /// </summary>
+        [SugarColumn(IsNullable = true, Length = 500, ColumnDescription = "澶囨敞")]
+        public string Remark { get; set; }
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrder.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrder.cs
index 8c2c11d..65692b3 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrder.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrder.cs
@@ -16,7 +16,6 @@
         [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")]
         public int Id { get; set; }
 
-        [CodeRule(WIDESEA_Core.Enums.RuleCode.OutboundOrderRule)]
         [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鍗曟嵁缂栧彿", IsOnlyIgnoreUpdate = true)]
         public string OrderNo { get; set; }
 
@@ -34,6 +33,11 @@
 
         [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "澶囨敞")]
         public string Remark { get; set; }
+        /// <summary>
+        /// 鎺ㄥ崟绯荤粺
+        /// </summary>
+        [SugarColumn(IsNullable = true, Length = 10, ColumnDescription = "鎺ㄥ崟绯荤粺")]
+        public string System { get; set; }
 
 
         [ImporterHeader(Name = "浠撳簱缂栫爜")]
@@ -43,11 +47,11 @@
 
         [ImporterHeader(Name = "鍗曟嵁灏忕被")]
         [ExporterHeader(DisplayName = "鍗曟嵁灏忕被")]
-        [SugarColumn(IsNullable = true, ColumnDescription = "鍗曟嵁灏忕被")]
+        [SugarColumn(IsNullable = true, ColumnDescription = "鍗曟嵁灏忕被", Length = 50)]
         public string TransactionCode { get; set; }
         [ImporterHeader(Name = "鍑哄叆搴撶被鍨�")]
         [ExporterHeader(DisplayName = "鍑哄叆搴撶被鍨�")]
-        [SugarColumn(IsNullable = true, ColumnDescription = "鍑哄叆搴撶被鍨�")]
+        [SugarColumn(IsNullable = true, ColumnDescription = "鍑哄叆搴撶被鍨�",Length = 50)]
         public string InoutType { get; set; }
 
         [Navigate(NavigateType.OneToMany, nameof(Dt_OutboundOrderDetail.OrderId), nameof(Id))]
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail.cs
index c1549fa..db01dca 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_OutboundOrderDetail.cs
@@ -11,49 +11,93 @@
     [SugarTable(nameof(Dt_OutboundOrderDetail), "鍑哄簱鍗曟槑缁�")]
     public class Dt_OutboundOrderDetail : BaseEntity
     {
+        /// <summary>
+        /// 涓婚敭
+        /// </summary>
         [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")]
         public int Id { get; set; }
-
+        /// <summary>
+        /// 鍑哄簱鍗曚富閿�
+        /// </summary>
         [SugarColumn(IsNullable = false, ColumnDescription = "鍑哄簱鍗曚富閿�")]
         public int OrderId { get; set; }
-
+        /// <summary>
+        /// 鐗╂枡缂栧彿
+        /// </summary>
         [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "鐗╂枡缂栧彿")]
         public string MaterielCode { get; set; }
-
+        /// <summary>
+        /// 鐗╂枡鍚嶇О
+        /// </summary>
         [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "鐗╂枡鍚嶇О")]
         public string MaterielName { get; set; }
-
+        /// <summary>
+        /// 鎵规鍙�
+        /// </summary>
         [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "鎵规鍙�")]
         public string BatchNo { get; set; }
-
+        /// <summary>
+        /// 鍗曟嵁鏁伴噺
+        /// </summary>
         [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "鍗曟嵁鏁伴噺")]
         public decimal OrderQuantity { get; set; }
-
+        /// <summary>
+        /// 閿佸畾鏁伴噺
+        /// </summary>
         [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "閿佸畾鏁伴噺", DefaultValue = "0")]
         public decimal LockQuantity { get; set; }
-
+        /// <summary>
+        /// 宸插嚭鏁伴噺
+        /// </summary>
         [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "宸插嚭鏁伴噺", DefaultValue = "0")]
         public decimal OverOutQuantity { get; set; }
-
+        /// <summary>
+        /// 鍗曟嵁鏄庣粏鐘舵��
+        /// </summary>
         [SugarColumn(IsNullable = false, ColumnDescription = "璁㈠崟鏄庣粏鐘舵��")]
         public int OrderDetailStatus { get; set; }
-
+        /// <summary>
+        /// 鐗╂枡瑙勬牸
+        /// </summary>
         [SugarColumn(IsNullable = false, ColumnDescription = "鐗╂枡瑙勬牸")]
         public string MaterieSpec { get; set; }
-
+        /// <summary>
+        /// 澶囨敞
+        /// </summary>
         [SugarColumn(IsNullable = true, ColumnDescription = "澶囨敞")]
         public string Remark { get; set; }
+        /// <summary>
+        /// 鏄庣粏id
+        /// </summary>
         [SugarColumn(IsNullable = true, ColumnDescription = "鏄庣粏id")]
         public string LinId { get; set; }
-
+        /// <summary>
+        /// LPN鍙�
+        /// </summary>
         [SugarColumn(IsNullable = true, ColumnDescription = "LPN鍙�")]
         public string LPNNo { get; set; }
-
+        /// <summary>
+        /// 浠撳簱
+        /// </summary>
         [SugarColumn(IsNullable = true, ColumnDescription = "浠撳簱")]
         public string WarehouseCode { get; set; }
+        /// <summary>
+        /// 搴撳尯
+        /// </summary>
         [SugarColumn(IsNullable = true, ColumnDescription = "搴撳尯")]
         public string StorageAreaCode { get; set; }
+        /// <summary>
+        /// 搴撲綅
+        /// </summary>
         [SugarColumn(IsNullable = true, ColumnDescription = "搴撲綅")]
         public string StorageLocationCode { get; set; }
+        /// <summary>
+        /// SMOM鎸囧畾鍑哄簱璐т綅
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDescription = "SMOM鎸囧畾鍑哄簱璐т綅")]
+        public string LocationName { get; set; }
+
+        [SugarColumn(IsNullable = true, ColumnDescription = "渚涘簲鍟嗘壒娆�")]
+        public string SupplierBatch { get; set; }
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_Production.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_Production.cs
new file mode 100644
index 0000000..94e0ade
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Outbound/Dt_Production.cs
@@ -0,0 +1,29 @@
+锘縰sing SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.DB.Models;
+
+namespace WIDESEA_Model.Models.Outbound
+{
+    [SugarTable(nameof(Dt_Production), "鏂欏彿鍒堕�犲崟")]
+    public class Dt_Production:BaseEntity
+    {
+        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "涓婚敭")]
+        public int Id { get; set; }
+
+        [SugarColumn(IsNullable = false, ColumnDescription = "鍑哄簱鍗曚富閿�")]
+        public int OrderId { get; set; }
+
+        [SugarColumn(IsNullable = true, Length = 255, ColumnDescription = "鍒堕�犲崟鍙�")]
+        public string ProductionNo { get; set; }
+
+        [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "鍒堕�犻儴浠�")]
+        public string ManufacturingCo { get; set; }
+
+        [SugarColumn(IsNullable = false, DecimalDigits = 2, ColumnDescription = "鍑哄簱鏁伴噺")]
+        public decimal OutQuantity { get; set; }
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfoDetail.cs b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfoDetail.cs
index 194a47c..a234e66 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfoDetail.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_Model/Models/Stock/Dt_StockInfoDetail.cs
@@ -73,6 +73,14 @@
         [SugarColumn(IsNullable = true, ColumnDescription = "閫佽揣鍗曞彿")]
         public string DeliveryNote { get; set; }
 
+        [ExporterHeader(DisplayName = "渚涘簲鍟嗘壒娆�")]
+        [SugarColumn(IsNullable = true, ColumnDescription = "渚涘簲鍟嗘壒娆�")]
+        public string SupplierBatch { get; set; }
+
+        [ExporterHeader(DisplayName = "鐗╂枡瑙勬牸")]
+        [SugarColumn(IsNullable = true, ColumnDescription = "鐗╂枡瑙勬牸")]
+        public string MaterieSpec { get; set; }
+
         [ExporterHeader(IsIgnore = true)]
         [Navigate(NavigateType.OneToOne, nameof(Dt_StockQuantityChangeRecord.StockDetailId), nameof(Id))]
         public Dt_StockQuantityChangeRecord StockQuantityChangeRecord { get; set; }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_OutboundRepository/ProductionRepository.cs b/WMS/WIDESEA_WMSServer/WIDESEA_OutboundRepository/ProductionRepository.cs
new file mode 100644
index 0000000..0973c1d
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_OutboundRepository/ProductionRepository.cs
@@ -0,0 +1,18 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_IOutboundRepository;
+using WIDESEA_Model.Models.Outbound;
+
+namespace WIDESEA_OutboundRepository
+{
+    public class ProductionRepository : RepositoryBase<Dt_Production>, IProductionRepository
+    {
+        public ProductionRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
+        {
+        }
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Base/OutboundOrderDetailService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Base/OutboundOrderDetailService.cs
index d7ef4d1..8457d32 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Base/OutboundOrderDetailService.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Base/OutboundOrderDetailService.cs
@@ -30,6 +30,7 @@
         private readonly IStockService _stockService;
         private readonly IBasicService _basicService;
         private readonly IRecordService _recordService;
+
         private readonly IOutboundRepository _outboundRepository;
         private readonly IOutStockLockInfoService _outStockLockInfoService;
 
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Base/OutboundOrderService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Base/OutboundOrderService.cs
index 9de318b..89cd668 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Base/OutboundOrderService.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Base/OutboundOrderService.cs
@@ -1,16 +1,22 @@
 锘縰sing AutoMapper;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Serialization;
+using SqlSugar;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using WIDESEA_Common;
+using WIDESEA_Common.OrderEnum;
 using WIDESEA_Core;
+using WIDESEA_Core.BaseRepository;
 using WIDESEA_Core.BaseServices;
+using WIDESEA_Core.CodeConfigEnum;
+using WIDESEA_Core.DB;
 using WIDESEA_Core.Enums;
 using WIDESEA_Core.Helper;
+using WIDESEA_Core.Seed;
 using WIDESEA_Core.Utilities;
 using WIDESEA_DTO.Inbound;
 using WIDESEA_DTO.Outbound;
@@ -28,6 +34,7 @@
     public partial class OutboundOrderService : ServiceBase<Dt_OutboundOrder, IOutboundOrderRepository>, IOutboundOrderService
     {
         private readonly IMapper _mapper;
+        private readonly IUnitOfWorkManage _unitOfWorkManage;
         private readonly IMaterielInfoService _materielInfoService;
         private readonly IStockInfoService _stockService;
         private readonly IStockInfoDetailService _stockDetailService;
@@ -38,9 +45,10 @@
 
         public IOutboundOrderRepository Repository => BaseDal;
 
-        public OutboundOrderService(IOutboundOrderRepository BaseDal, IMapper mapper, IMaterielInfoService materielInfoService, IOutboundOrderDetailService outboundOrderDetailService, IOutboundOrder_HtyService outboundOrder_HtyService, IOutboundOrderDetail_HtyService outboundOrderDetail_HtyService, IStockInfoDetailService stockDetailService, IStockInfoService stockInfoService) : base(BaseDal)
+        public OutboundOrderService(IOutboundOrderRepository BaseDal, IMapper mapper, IMaterielInfoService materielInfoService, IUnitOfWorkManage unitOfWorkManage, IOutboundOrderDetailService outboundOrderDetailService, IOutboundOrder_HtyService outboundOrder_HtyService, IOutboundOrderDetail_HtyService outboundOrderDetail_HtyService, IStockInfoDetailService stockDetailService, IStockInfoService stockInfoService) : base(BaseDal)
         {
             _mapper = mapper;
+            _unitOfWorkManage = unitOfWorkManage;
             _materielInfoService = materielInfoService;
             _stockDetailService = stockDetailService;
             _stockService = stockInfoService;
@@ -58,6 +66,7 @@
             {
                 BatchNo = x.FirstOrDefault()?.BatchNo ?? "",
                 MaterielCode = x.Key,
+                MaterielName = x.FirstOrDefault()?.MaterielName??"",
                 OrderQuantity = x.Sum(x => x.OrderQuantity),
                 Remark = x.FirstOrDefault(v => !string.IsNullOrEmpty(v.Remark))?.Remark ?? ""
             }).ToList();
@@ -166,9 +175,9 @@
                 {
                     return WebResponseContent.Instance.Error("鏈壘鍒版鍑哄簱鍗曟嵁");
                 }
-                if (oldOutboundOrder.OrderStatus != InboundStatusEnum.鏈紑濮�.ObjToInt())
+                if (oldOutboundOrder.OrderStatus == OutboundStatusEnum.鍑哄簱瀹屾垚.ObjToInt())
                 {
-                    return WebResponseContent.Instance.Error("璇ュ叆搴撳崟浠诲姟宸插紑濮嬫墽琛�,涓嶅彲鍙栨秷");
+                    return WebResponseContent.Instance.OK();
                 }
                 oldOutboundOrder.OrderStatus = InboundStatusEnum.鍙栨秷.ObjToInt();
                 BaseDal.UpdateData(oldOutboundOrder);
@@ -246,19 +255,185 @@
             return (true, "鎴愬姛", outboundOrderAddDTO);
         }
 
-
-        public WebResponseContent ReleaseOutOrder(int orderId)
+        /// <summary>
+        /// 閲嶅啓鍑哄簱鏂板缓椤甸潰
+        /// </summary>
+        /// <param name="orderAddDTO"></param>
+        /// <returns></returns>
+        public WebResponseContent Save(OutboundOrderAddDTO orderAddDTO)
         {
-            WebResponseContent content = new WebResponseContent();
             try
             {
+                List<Dt_OutboundOrderDetail> outboundOrderDetails = new List<Dt_OutboundOrderDetail>();
+                Random random = new Random();
+                if (orderAddDTO.Details != null)
+                {
+                    foreach (var model in orderAddDTO.Details)
+                    {
+                        Dt_OutboundOrderDetail outboundOrderDetail = new Dt_OutboundOrderDetail()
+                        {
+                            MaterielCode = model.MaterielCode,
+                            MaterielName = model.MaterielName,
+                            OrderQuantity = model.OrderQuantity,
+                            BatchNo = model.BatchNo,
+                            OrderDetailStatus = InOrderStatusEnum.鏈紑濮�.ObjToInt(),
+                            Creater = "WMS",
+                            CreateDate = DateTime.Now,
+
+                        };
+                        outboundOrderDetails.Add(outboundOrderDetail);
+                    }
+                }
+                int randomNum2 = random.Next(1, 1000);
+                string datePart2 = DateTime.Now.ToString("yyyyMMdd");
+                Dt_Warehouse warehouse = BaseDal.Db.Queryable<Dt_Warehouse>().Where(x => x.WarehouseId == orderAddDTO.WarehouseId).First();
+                if (warehouse == null)
+                {
+                    return WebResponseContent.Instance.Error("璇ヤ粨搴撲俊鎭皻鏈厤缃�");
+                }
+                Dt_OutboundOrder outboundOrder = new Dt_OutboundOrder()
+                {
+                    OrderNo = "WMSOUT" + $"{datePart2}{randomNum2}",
+                    UpperOrderNo = "WMSOUT" + $"{datePart2}{randomNum2}",
+                    OutWareHouse = warehouse.WarehouseCode,
+                    OrderType = OrderTypeEnum.鐢熶骇鍑哄簱鍗�.ObjToInt(),
+                    InoutType = InoutTypeEnum.OtherOut.ToString(),
+                    OrderStatus = InOrderStatusEnum.鏈紑濮�.ObjToInt(),
+                    CreateType = OrderCreateTypeEnum.CreateInSystem.ObjToInt(),
+                    System = "WMS",
+                    Details = outboundOrderDetails,
+                    Creater = "WMS",
+                    CreateDate = DateTime.Now,
+                };
+                _unitOfWorkManage.BeginTran();
+                Db.InsertNav(outboundOrder).Include(x => x.Details).ExecuteCommand();
+                _unitOfWorkManage.CommitTran();
+                return WebResponseContent.Instance.OK();
 
             }
             catch (Exception ex)
             {
-
+                _unitOfWorkManage.RollbackTran();
+                return WebResponseContent.Instance.Error(ex.Message);
             }
-            return content;
+
         }
+
+        public WebResponseContent GetCodeByWarehouse(int warehouseId)
+        {
+            try
+            {
+                //鑾峰彇鎵�鏈夊簱瀛樺瀷鍙�
+                List<Dt_StockInfoDetail> StockInfoDetails = _stockService.Db.Queryable<Dt_StockInfo, Dt_StockInfoDetail>((master, detail) => master.Id == detail.StockId)
+                .Where((master, detail) => master.WarehouseId == warehouseId)
+                .Select((master, detail) => detail)
+                .ToList();
+                //杩囨护閲嶅
+                List<string> code = StockInfoDetails.Select(x => x.MaterielCode).Distinct().ToList();
+                return WebResponseContent.Instance.OK("鎴愬姛", data: code);
+            }
+            catch (Exception ex)
+            {
+                return WebResponseContent.Instance.Error(ex.Message);
+            }
+        }
+
+        public WebResponseContent GetVersionByCode(string materielCode, int warehouseId)
+        {
+            try
+            {
+                //鑾峰彇鎸囧畾浜у搧搴撳瓨鐗堟湰
+                List<Dt_StockInfoDetail> StockInfoDetails = _stockService.Db.Queryable<Dt_StockInfo, Dt_StockInfoDetail>((master, detail) => master.Id == detail.StockId)
+                .Where((master, detail) => master.WarehouseId == warehouseId && detail.MaterielCode == materielCode)
+                .Select((master, detail) => detail)
+                .ToList();
+                //杩囨护閲嶅
+                List<string> materielName = StockInfoDetails.Select(x => x.MaterielName).Distinct().ToList();
+                return WebResponseContent.Instance.OK("鎴愬姛", data: materielName);
+            }
+            catch (Exception ex)
+            {
+                return WebResponseContent.Instance.Error(ex.Message);
+            }
+        }
+
+        public WebResponseContent GetLotNoByCode(string materielCode, int warehouseId)
+        {
+            try
+            {
+                List<Dt_StockInfoDetail> StockInfoDetails = _stockService.Db.Queryable<Dt_StockInfo, Dt_StockInfoDetail>((master, detail) => master.Id == detail.StockId)
+                .Where((master, detail) => master.WarehouseId == warehouseId && detail.MaterielCode == materielCode)
+                .Select((master, detail) => detail)
+                .ToList();
+                //杩囨护閲嶅
+                List<string> batchNo = StockInfoDetails.Select(x => x.BatchNo).Distinct().ToList();
+                return WebResponseContent.Instance.OK("鎴愬姛", data: batchNo);
+            }
+            catch (Exception ex)
+            {
+                return WebResponseContent.Instance.Error(ex.Message);
+            }
+        }
+
+        static object lock_code = new object();
+        public string CreateCodeByRule(string ruleCode)
+        {
+            lock (lock_code)
+            {
+
+                string code = string.Empty;
+                DateTime dateTime = DateTime.Now;
+                DateTime now = DateTime.Now;
+                try
+                {
+                    if (string.IsNullOrEmpty(ruleCode))
+                        throw new ArgumentNullException(nameof(ruleCode));
+                    SqlSugarClient sugarClient = new SqlSugarClient(new ConnectionConfig
+                    {
+                        IsAutoCloseConnection = true,
+                        DbType = DbType.SqlServer,
+                        ConnectionString = DBContext.ConnectionString
+                    });
+                    Dt_CodeRuleConfig codeRuleConfig = sugarClient.Queryable<Dt_CodeRuleConfig>().Where(x => x.RuleCode == ruleCode).First();
+                    if (codeRuleConfig == null)
+                        throw new ArgumentNullException(nameof(codeRuleConfig));
+                    if (codeRuleConfig.ModifyDate != null)
+                    {
+                        dateTime = Convert.ToDateTime(codeRuleConfig.ModifyDate);
+                    }
+                    else
+                    {
+                        dateTime = Convert.ToDateTime(codeRuleConfig.CreateDate);
+                    }
+
+                    if (now.Year == dateTime.Year && now.Month == dateTime.Month && now.Day == dateTime.Day)
+                    {
+                        now = dateTime;
+                        codeRuleConfig.CurrentVal = Convert.ToInt32(codeRuleConfig.CurrentVal) + 1;
+                    }
+                    else
+                    {
+                        codeRuleConfig.CurrentVal = 1;
+                    }
+                    codeRuleConfig.ModifyDate = DateTime.Now;
+                    code = codeRuleConfig.Format;
+                    code = code.Replace($"[{CodeFormatTypeEnum.YYYY}]", now.Year.ToString().PadLeft(4, '0'));
+                    code = code.Replace($"[{CodeFormatTypeEnum.MM}]", now.Month.ToString().PadLeft(2, '0'));
+                    code = code.Replace($"[{CodeFormatTypeEnum.DD}]", now.Day.ToString().PadLeft(2, '0'));
+                    code = code.Replace($"[{CodeFormatTypeEnum.ST}]", codeRuleConfig.StartStr?.ToString() ?? "");
+                    code = code.Replace($"[{CodeFormatTypeEnum.NUM}]", codeRuleConfig.CurrentVal.ToString().PadLeft(codeRuleConfig.Length, '0'));
+                    Dictionary<string, object> keyValuePairs = new Dictionary<string, object>() { { nameof(codeRuleConfig.CurrentVal), codeRuleConfig.CurrentVal }, { nameof(codeRuleConfig.Id), codeRuleConfig.Id }, { nameof(codeRuleConfig.ModifyDate), DateTime.Now } };
+                    sugarClient.Updateable(keyValuePairs).AS(MainDb.CodeRuleConfig).WhereColumns(nameof(codeRuleConfig.Id)).ExecuteCommand();
+                    sugarClient.Updateable(codeRuleConfig);
+
+                }
+                catch (Exception ex)
+                {
+
+                }
+                return code;
+            }
+        }
+
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Base/ProductionService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Base/ProductionService.cs
new file mode 100644
index 0000000..23a5b0c
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Base/ProductionService.cs
@@ -0,0 +1,20 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_IInboundService;
+using WIDESEA_IOutboundRepository;
+using WIDESEA_Model.Models.Outbound;
+
+namespace WIDESEA_InboundService
+{
+    public class ProductionService : ServiceBase<Dt_Production, IProductionRepository>, IProductionService
+    {
+        public IProductionRepository Repository => BaseDal;
+        public ProductionService(IProductionRepository BaseDal) : base(BaseDal)
+        {
+        }
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs
index 0647c35..b103c2a 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/Service/OutboundOrderDetailService.cs
@@ -10,6 +10,7 @@
 using WIDESEA_Core.BaseServices;
 using WIDESEA_Core.Enums;
 using WIDESEA_Core.Helper;
+using WIDESEA_DTO.ERP;
 using WIDESEA_DTO.Stock;
 using WIDESEA_IBasicRepository;
 using WIDESEA_IBasicService;
@@ -23,8 +24,11 @@
 
 namespace WIDESEA_OutboundService
 {
+
+    
     public partial class OutboundOrderDetailService : ServiceBase<Dt_OutboundOrderDetail, IOutboundOrderDetailRepository>, IOutboundOrderDetailService
     {
+
         public WebResponseContent LockOutboundStock(int orderDetailId)
         {
             Dt_OutboundOrderDetail outboundOrderDetail = BaseDal.QueryFirst(x => x.Id == orderDetailId);
@@ -318,8 +322,16 @@
             }
             Dt_OutboundOrder outboundOrder = _outboundRepository.OutboundOrderRepository.QueryFirst(x => x.Id == outboundOrderDetails.FirstOrDefault().OrderId);
             List<Dt_StockInfo> outStocks = new List<Dt_StockInfo>();
-            List<Dt_OutboundOrderDetail> groupDetails = outboundOrderDetails.GroupBy(x => new { x.MaterielCode, x.BatchNo }).Select(x => new Dt_OutboundOrderDetail { OrderQuantity = x.Sum(v => v.OrderQuantity) - x.Sum(v => v.LockQuantity), MaterielCode = x.Key.MaterielCode, BatchNo = x.Key.BatchNo }).ToList();
-            List<Dt_Warehouse> warehouse = _basicService.WarehouseService.Repository.QueryData(x => x.WarehouseDes == outboundOrder.OutWareHouse);
+            List<Dt_OutboundOrderDetail> groupDetails = outboundOrderDetails.GroupBy(x => new { x.MaterielCode, x.BatchNo , x.LocationName}).Select(x => new Dt_OutboundOrderDetail { OrderQuantity = x.Sum(v => v.OrderQuantity) - x.Sum(v => v.LockQuantity), MaterielCode = x.Key.MaterielCode, BatchNo = x.Key.BatchNo,LocationName = x.Key.LocationName}).ToList();
+            List<Dt_Warehouse> warehouse = new List<Dt_Warehouse>();
+            if (outboundOrder.OutWareHouse == "SC01_BC")
+            {
+                warehouse = _basicService.WarehouseService.Repository.QueryData(x => x.WarehouseDes == outboundOrder.OutWareHouse || x.WarehouseDes =="SC02_BC");
+            }
+            else
+            {
+                warehouse = _basicService.WarehouseService.Repository.QueryData(x => x.WarehouseDes == outboundOrder.OutWareHouse);
+            }
             List<Dt_OutStockLockInfo> outStockLockInfos = new List<Dt_OutStockLockInfo>();
             List<Dt_LocationInfo> locationInfos = new List<Dt_LocationInfo>();
             foreach (var item in groupDetails)
@@ -328,7 +340,17 @@
 
                 decimal needQuantity = originalNeedQuantity;
 
-                List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(item.MaterielCode, item.BatchNo, warehouse);
+                List<Dt_StockInfo> stockInfos = new List<Dt_StockInfo>();
+                ///鍑哄簱鎸囧畾搴撲綅鍑哄簱鍒ゆ柇
+                if (item.LocationName != null && item.LocationName != "")
+                {
+                   stockInfos = _stockService.StockInfoService.GetUseableStocks(item.MaterielCode, item.BatchNo, warehouse).Where(x=>x.LocationCode == item.LocationName).ToList();
+                }
+                else
+                {
+                   stockInfos = _stockService.StockInfoService.GetUseableStocks(item.MaterielCode, item.BatchNo, warehouse);
+                }
+                    
                 if (!stockInfos.Any())
                 {
                     throw new Exception($"鏈壘鍒板彲鍒嗛厤搴撳瓨");
@@ -374,7 +396,6 @@
                         }
                     }
                 }
-
 
                 locationInfos.AddRange(_basicService.LocationInfoService.Repository.GetLocationInfos(outStocks.Select(x => x.LocationCode).ToList()));
             }
@@ -448,5 +469,87 @@
             }
             return (true, "鎴愬姛");
         }
+
+
+        public string ToCancelOutFeedbackERP = WIDESEA_Core.Helper.AppSettings.Configuration["CancelOutFeedbackERP"];
+        public WebResponseContent CancelOutFeedbackERP(int[] keys)
+        {
+            List<Dt_OutboundOrderDetail> outboundOrderDetails = _outboundRepository.OutboundOrderDetailRepository.QueryData(x => keys.Contains(x.Id));
+
+            if (outboundOrderDetails == null || outboundOrderDetails.Count == 0)
+            {
+                return WebResponseContent.Instance.Error("鏈壘鍒板嚭搴撳崟鏄庣粏淇℃伅");
+            }
+            if (outboundOrderDetails.FirstOrDefault(x => x.OrderDetailStatus > OrderDetailStatusEnum.New.ObjToInt() && x.OrderDetailStatus != OrderDetailStatusEnum.AssignOverPartial.ObjToInt()) != null)
+            {
+                return WebResponseContent.Instance.Error("鎵�閫夊嚭搴撳崟鏄庣粏瀛樺湪鍑哄簱涓垨宸插畬鎴�");
+            }
+            Dt_OutboundOrder outboundOrder = _outboundRepository.OutboundOrderRepository.QueryFirst(x => x.Id == outboundOrderDetails[0].OrderId);
+            if(outboundOrder == null)
+            {
+                return WebResponseContent.Instance.Error("鏈�氳繃璇ユ槑缁嗘壘鍒板嚭搴撳崟淇℃伅");
+            }
+            if (!outboundOrder.System.Equals("ERP")) 
+            {
+                return WebResponseContent.Instance.Error("璇ュ嚭搴撳崟鎹潪ERP鎺ㄩ�侊紝鏃犳硶鍙栨秷");
+            }
+            string ids ="";
+            foreach (var item in outboundOrderDetails)
+            {
+                ids = item.LinId;
+                var postContent = new MultipartFormDataContent();
+                postContent.Headers.Add("ContentType", $"multipart/form-data");
+                postContent.Add(new StringContent(ids), "ids");
+                string result = string.Empty;
+                HttpClient client = null;
+                try
+                {
+                    using (client = new HttpClient())
+                    {
+                        HttpResponseMessage response = client.PostAsync(ToCancelOutFeedbackERP, postContent)
+                            .ConfigureAwait(false).GetAwaiter().GetResult();
+
+                        // 纭繚鍝嶅簲鎴愬姛
+                        response.EnsureSuccessStatusCode();
+                        result = response.Content.ReadAsStringAsync()
+                            .ConfigureAwait(false).GetAwaiter().GetResult();
+                    }
+                    _unitOfWorkManage.BeginTran();
+                    _outboundRepository.OutboundOrderDetailRepository.DeleteAndMoveIntoHty(outboundOrderDetails, OperateType.浜哄伐鍙栨秷);
+
+                    //妫�鏌ヨ涓昏鍗曟槸鍚﹁繕鏈夊墿浣欐槑缁�
+                    int remainingDetailsCount = _outboundRepository.OutboundOrderDetailRepository
+                        .Db.Queryable<Dt_OutboundOrderDetail>()
+                        .Where(d => d.OrderId == outboundOrder.Id)
+                        .Count();
+
+                    // 濡傛灉娌℃湁鍓╀綑鏄庣粏锛屽啀鍒犻櫎涓昏鍗�
+                    if (remainingDetailsCount == 0)
+                    {
+                        _outboundRepository.OutboundOrderRepository.DeleteAndMoveIntoHty(outboundOrder, OperateType.浜哄伐鍙栨秷);
+                    }
+                    _unitOfWorkManage.CommitTran();
+                    // 鍋囪ERP杩斿洖鎴愬姛鏃惰繑鍥炴垚鍔熷搷搴�
+                    return WebResponseContent.Instance.OK(result);
+
+                }
+                catch (HttpRequestException ex)
+                {
+                    _unitOfWorkManage.RollbackTran();
+                    // 澶勭悊HTTP璇锋眰鐩稿叧寮傚父
+                    return WebResponseContent.Instance.Error($"HTTP璇锋眰閿欒: {ex.Message}");
+                    
+                }
+                catch (Exception ex)
+                {
+                    _unitOfWorkManage.RollbackTran();
+                    // 澶勭悊鍏朵粬寮傚父
+                    return WebResponseContent.Instance.Error($"澶勭悊澶辫触: {ex.Message}");
+                }
+
+            }
+            return WebResponseContent.Instance.OK();
+        }
+
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs b/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs
index e22363d..35c3d00 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_StockRepository/StockInfoRepository.cs
@@ -28,6 +28,7 @@
 
             return sugarQueryable.InnerJoin(sugarQueryable1, (a, b) => a.LocationCode == b.LocationCode).Select((a, b) => new StockViewDTO
             {
+                WarehouseId = a.WarehouseId,
                 AreaId = a.AreaId,
                 LocationCode = b.LocationCode,
                 Column = a.Column,
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_StockService/Base/StockViewService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_StockService/Base/StockViewService.cs
index 68c747f..8f4b3b5 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_StockService/Base/StockViewService.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_StockService/Base/StockViewService.cs
@@ -35,54 +35,133 @@
 
         public virtual PageGridData<StockViewDTO> GetPageData(PageDataOptions options)
         {
-            string where = options.ValidatePageOptions(typeof(StockViewDTO).GetProperties());
-            //鑾峰彇鎺掑簭瀛楁
-            //Dictionary<string, OrderByType> orderbyDic = options.GetPageDataSort(typeof(StockViewDTO).GetProperties());
-            //List<OrderByModel> orderByModels = new List<OrderByModel>();
-            //foreach (var item in orderbyDic)
-            //{
-            //    OrderByModel orderByModel = new OrderByModel()
-            //    {
-            //        FieldName = item.Key,
-            //        OrderByType = item.Value
-            //    };
-            //    orderByModels.Add(orderByModel);
-            //}
-            int totalCount = 0;
-
-            ISugarQueryable<Dt_StockInfo> sugarQueryable1 = _dbBase.Queryable<Dt_StockInfo>();
-            ISugarQueryable<Dt_LocationInfo> sugarQueryable = _dbBase.Queryable<Dt_LocationInfo>();
-            ISugarQueryable<Dt_StockInfoDetail> sugarQueryable2 = _dbBase.Queryable<Dt_StockInfoDetail>();
-           
-
-            List<StockViewDTO> list = sugarQueryable1.InnerJoin(sugarQueryable, (b, a) => a.LocationCode == b.LocationCode).WhereIF(!string.IsNullOrEmpty(where), where).Select((b, a) => new StockViewDTO
+            try
             {
-                AreaId = a.AreaId,
-                LocationCode = b.LocationCode,
-                Column = a.Column,
-                CreateDate = b.CreateDate,
-                Creater = b.Creater,
-                Depth = a.Depth,
-                EnalbeStatus = a.EnableStatus,
-                IsFull = b.IsFull,
-                Layer = a.Layer,
-                LocationName = a.LocationName,
-                LocationStatus = a.LocationStatus,
-                LocationType = a.LocationType,
-                Modifier = b.Modifier,
-                ModifyDate = b.ModifyDate,
-                PalletCode = b.PalletCode,
-                StockRemark = b.Remark,
-                RoadwayNo = a.RoadwayNo,
-                Row = a.Row,
-                StockId = b.Id,
-                StockStatus = b.StockStatus,
-                Details = b.Details,
-            }).ToPageList(options.Page, options.Rows, ref totalCount);
+                ISugarQueryable<Dt_StockInfo> sugarQueryable1 = _dbBase.Queryable<Dt_StockInfo>().Includes(x => x.Details);
+                ISugarQueryable<Dt_LocationInfo> sugarQueryable = _dbBase.Queryable<Dt_LocationInfo>();
+                ISugarQueryable<Dt_StockInfoDetail> sugarQueryable2 = _dbBase.Queryable<Dt_StockInfoDetail>();
+                if (!string.IsNullOrEmpty(options.Wheres))
+                {
+                    try
+                    {
+                        
+                        List<SearchParameters> searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>();
+                        if (searchParametersList?.Any() == true)
+                        {
+                            foreach (var param in searchParametersList)
+                            {
+                                switch (param.Name)
+                                {
+                                    case var name when name == nameof(Dt_StockInfoDetail.MaterielCode).FirstLetterToLower():
+                                        if (!string.IsNullOrEmpty(param.Value?.ToString()))
+                                        {
+                                            sugarQueryable1 = sugarQueryable1
+                                                .Where(x => x.Details.Any(v => v.MaterielCode.Contains(param.Value.ToString())));
+                                        }
+                                        break;
+                                    case var name when name == nameof(Dt_StockInfoDetail.BatchNo).FirstLetterToLower():
+                                        if (!string.IsNullOrEmpty(param.Value?.ToString()))
+                                        {
+                                            sugarQueryable1 = sugarQueryable1
+                                                .Where(x => x.Details.Any(v => v.BatchNo.Contains(param.Value.ToString())));
+                                        }
+                                        break;
 
+                                    case var name when name == nameof(Dt_StockInfo.LocationCode).FirstLetterToLower():
+                                        if (!string.IsNullOrEmpty(param.Value?.ToString()))
+                                        {
+                                            sugarQueryable1 = sugarQueryable1
+                                                .Where(x => x.LocationCode == param.Value.ToString());
+                                        }
+                                        break;
+                                    case var name when name == nameof(Dt_LocationInfo.LocationStatus).FirstLetterToLower():
+                                        if (!string.IsNullOrEmpty(param.Value?.ToString()))
+                                        {
+                                            sugarQueryable = sugarQueryable
+                                                .Where(x => x.LocationStatus == param.Value.ObjToInt());
+                                        }
+                                        break;
+                                    case var name when name == nameof(Dt_StockInfo.StockStatus).FirstLetterToLower():
+                                        if (!string.IsNullOrEmpty(param.Value?.ToString()))
+                                        {
+                                            sugarQueryable1 = sugarQueryable1
+                                                .Where(x => x.StockStatus == param.Value.ObjToInt());
+                                        }
+                                        break;
+                                    case var name when name == nameof(Dt_StockInfo.WarehouseId).FirstLetterToLower():
+                                        if (!string.IsNullOrEmpty(param.Value?.ToString()))
+                                        {
+                                            sugarQueryable1 = sugarQueryable1
+                                                .Where(x => x.WarehouseId == param.Value.ObjToInt());
+                                        }
+                                        break;
+                                    case var name when name == nameof(Dt_StockInfo.CreateDate).FirstLetterToLower():
+                                        if (DateTime.TryParse(param.Value?.ToString(), out DateTime minDate))
+                                        {
+                                            LinqExpressionType expressionType = param.DisplayType.GetLinqCondition();
+                                            if (expressionType == LinqExpressionType.ThanOrEqual)
+                                            {
+                                                sugarQueryable1 = sugarQueryable1.Where(x => x.CreateDate >= minDate);
+                                            }
+                                            else if (expressionType == LinqExpressionType.LessThanOrEqual)
+                                            {
+                                                sugarQueryable1 = sugarQueryable1.Where(x => x.CreateDate <= minDate);
+                                            }
+                                        }
+                                        break;
+                                }
+                            }
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                    }
+                }
+                
 
-            return new PageGridData<StockViewDTO>(totalCount, list);
+                ISugarQueryable<StockViewDTO> list = sugarQueryable1
+                    .InnerJoin(sugarQueryable, (b, a) => a.LocationCode == b.LocationCode)
+                    .Select((b, a) => new StockViewDTO
+                    {
+                        LocationCode = b.LocationCode,
+                        Column = a.Column,
+                        WarehouseId = b.WarehouseId,
+                        CreateDate = b.CreateDate,
+                        Creater = b.Creater,
+                        Depth = a.Depth,
+                        EnalbeStatus = a.EnableStatus,
+                        Layer = a.Layer,
+                        LocationName = a.LocationName,
+                        LocationStatus = a.LocationStatus,
+                        LocationType = a.LocationType,
+                        Modifier = b.Modifier,
+                        ModifyDate = b.ModifyDate,
+                        PalletCode = b.PalletCode,
+                        StockRemark = b.Remark,
+                        RoadwayNo = a.RoadwayNo,
+                        Row = a.Row,
+                        StockId = b.Id,
+                        StockStatus = b.StockStatus,
+                        Details = b.Details,
+                    });
 
+                int totalCount = 0;
+                var stockViewDTOs = list.ToPageList(options.Page, options.Rows, ref totalCount);
+
+                stockViewDTOs.ForEach(x =>
+                {
+                    x.MaterielCode = string.Join(",", x.Details.Select(d => d.MaterielCode).Distinct());
+                    x.BatchNo = string.Join(",", x.Details.Select(d => d.BatchNo).Distinct());
+                    x.MaterielSpec = x.Details.FirstOrDefault()?.MaterieSpec ?? "";
+                    x.MaterielName = x.Details.FirstOrDefault()?.MaterielName ?? "";
+                });
+
+                return new PageGridData<StockViewDTO>(totalCount, stockViewDTOs);
+            }
+            catch (Exception ex)
+            {
+            }
+            return new PageGridData<StockViewDTO>();
         }
 
         public virtual object GetDetailPage(PageDataOptions pageData)
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs
index 469d70d..d52ec0f 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_DictionaryService.cs
@@ -8,6 +8,7 @@
 using System.Reflection;
 using System.Text;
 using System.Threading.Tasks;
+using WIDESEA_Common.OrderEnum;
 using WIDESEA_Core;
 using WIDESEA_Core.BaseRepository;
 using WIDESEA_Core.BaseServices;
@@ -15,7 +16,9 @@
 using WIDESEA_Core.DB;
 using WIDESEA_Core.Enums;
 using WIDESEA_Core.Helper;
+using WIDESEA_Core.TaskEnum;
 using WIDESEA_DTO.System;
+using WIDESEA_IBasicRepository;
 using WIDESEA_ISystemRepository;
 using WIDESEA_ISystemService;
 using WIDESEA_Model.Models;
@@ -26,11 +29,13 @@
     {
         private readonly IUnitOfWorkManage _unitOfWorkManage;
         private readonly ICacheService _cacheService;
+        private readonly IBasicRepository _basicRepository;
 
-        public Sys_DictionaryService(ISys_DictionaryRepository BaseDal, IUnitOfWorkManage unitOfWorkManage, ICacheService cacheService) : base(BaseDal)
+        public Sys_DictionaryService(ISys_DictionaryRepository BaseDal, IUnitOfWorkManage unitOfWorkManage, ICacheService cacheService, IBasicRepository basicRepository) : base(BaseDal)
         {
             _unitOfWorkManage = unitOfWorkManage;
             _cacheService = cacheService;
+            _basicRepository = basicRepository;
         }
 
         public ISys_DictionaryRepository Repository => BaseDal;
@@ -151,6 +156,23 @@
             {
                 switch (key)
                 {
+                    case "warehouses":
+                        {
+                            List<object> data = new List<object>();
+
+                            {
+                                List<Dt_Warehouse> warehouses = _basicRepository.WarehouseRepository.QueryData();
+                                int index = 0;
+                                foreach (var item in warehouses)
+                                {
+                                    data.Add(new { key = item.WarehouseId, value = item.WarehouseName });
+                                    index++;
+                                }
+                            }
+
+                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
+                        }
+                        break;
                     case "inboundState":
                         {
                             List<object> data = new List<object>();
@@ -471,12 +493,12 @@
                             List<object> data = new List<object>();
 
                             {
-                                Type type = typeof(InTaskStatusEnum);
-                                List<int> enums = Enum.GetValues(typeof(InTaskStatusEnum)).Cast<int>().ToList();
+                                Type type = typeof(TaskStatusEnum);
+                                List<int> enums = Enum.GetValues(typeof(TaskStatusEnum)).Cast<int>().ToList();
                                 int index = 0;
                                 foreach (var item in enums)
                                 {
-                                    FieldInfo? fieldInfo = typeof(InTaskStatusEnum).GetField(((InTaskStatusEnum)item).ToString());
+                                    FieldInfo? fieldInfo = typeof(TaskStatusEnum).GetField(((TaskStatusEnum)item).ToString());
                                     DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
                                     if (description != null)
                                     {
@@ -654,6 +676,81 @@
                             result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
                         }
                         break;
+                    case "inoutTypeEnum":
+                        {
+                            List<object> data = new List<object>();
+                            Type enumType = typeof(InoutTypeEnum);
+
+                            // 鑾峰彇鎵�鏈夋灇涓炬垚鍛樼殑瀛楁淇℃伅
+                            foreach (var field in enumType.GetFields(BindingFlags.Public | BindingFlags.Static))
+                            {
+                                // 瀛楁鍚嶇О灏辨槸鏋氫妇鎴愬憳鐨勫瓧绗︽爣璇嗭紙濡�"StandardCount"锛�
+                                string enumName = field.Name;
+
+                                // 鑾峰彇鎻忚堪灞炴��
+                                var descriptionAttr = field.GetCustomAttribute<DescriptionAttribute>();
+                                string description = descriptionAttr?.Description ?? enumName;
+                                int enumValue = (int)field.GetValue(null);
+
+                                data.Add(new
+                                {
+                                    key = enumName,  // 浣跨敤鏋氫妇鍚嶇О浣滀负key
+                                    value = description,
+                                    enumValue = enumValue  // 鍙�夛細淇濈暀鏁存暟value
+                                });
+                            }
+                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
+                        }
+                        break;
+                    case "takeStockStatusEnum":
+                        {
+                            List<object> data = new List<object>();
+                            Type type = typeof(TakeStockStatusEnum);
+                            List<int> enums = Enum.GetValues(typeof(TakeStockStatusEnum)).Cast<int>().ToList();
+                            int index = 0;
+                            foreach (var item in enums)
+                            {
+                                FieldInfo? fieldInfo = typeof(TakeStockStatusEnum).GetField(((TakeStockStatusEnum)item).ToString());
+                                DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
+                                if (description != null)
+                                {
+                                    data.Add(new { key = item.ToString(), value = description.Description });
+                                }
+                                else
+                                {
+                                    data.Add(new { key = item.ToString(), value = item.ToString() });
+                                }
+                                index++;
+                            }
+
+                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
+                        }
+                        break;
+                    case "takeStockDetailStatusEnum":
+                        {
+                            List<object> data = new List<object>();
+                            Type type = typeof(TakeStockDetailStatusEnum);
+                            List<int> enums = Enum.GetValues(typeof(TakeStockDetailStatusEnum)).Cast<int>().ToList();
+                            int index = 0;
+                            foreach (var item in enums)
+                            {
+                                FieldInfo? fieldInfo = typeof(TakeStockDetailStatusEnum).GetField(((TakeStockDetailStatusEnum)item).ToString());
+                                DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>();
+                                if (description != null)
+                                {
+                                    data.Add(new { key = item.ToString(), value = description.Description });
+                                }
+                                else
+                                {
+                                    data.Add(new { key = item.ToString(), value = item.ToString() });
+                                }
+                                index++;
+                            }
+
+                            result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data };
+                        }
+                        break;
+
                 }
                 return result;
             }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/WIDESEA_SystemService.csproj b/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/WIDESEA_SystemService.csproj
index 37aa4de..32c2e5c 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/WIDESEA_SystemService.csproj
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/WIDESEA_SystemService.csproj
@@ -7,6 +7,7 @@
   </PropertyGroup>
 
   <ItemGroup>
+    <ProjectReference Include="..\WIDESEA_IBasicRepository\WIDESEA_IBasicRepository.csproj" />
     <ProjectReference Include="..\WIDESEA_ISystemService\WIDESEA_ISystemService.csproj" />
   </ItemGroup>
 
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs
index 9d5b14f..8246572 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs
@@ -18,6 +18,8 @@
 using WIDESEA_Core.LogHelper;
 using WIDESEA_DTO.Task;
 using WIDESEA_Core.TaskEnum;
+using WIDESEA_Model.Models.Inbound;
+using WIDESEA_Common.OrderEnum;
 
 namespace WIDESEA_TaskInfoService
 {
@@ -40,43 +42,69 @@
                     PushTasksToWCS(new List<Dt_Task> { task });
                     return WebResponseContent.Instance.OK($"璇ユ墭鐩樺凡鐢熸垚浠诲姟", _mapper.Map<WMSTaskDTO>(task));
                 }
-
-                if (Repository.QueryFirst(x => x.SourceAddress == stationCode && x.TaskStatus == TaskStatusEnum.New.ObjToInt()) != null)
-                {
-                    return WebResponseContent.Instance.Error($"璇ョ珯鐐瑰凡鏈夋湭鎵ц鐨勪换鍔�");
-                }
                 Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode).Includes(x => x.Details).First();
 
                 if (stockInfo == null)
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒扮粍鐩樹俊鎭�");
                 }
+                ///鍒ゆ柇鏄惁瀛樺湪鍥炲簱鍗�,杩涜鍥炲師搴撲綅閫昏緫
+                string returnOrderNo = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.OrderNo;
+                Dt_ReturnOrder returnOrder = _returnOrderRepository.QueryFirst(x => x.OrderNo == returnOrderNo && x.OrderStatus == InOrderStatusEnum.鏈紑濮�.ObjToInt());
+                Dt_RoadwayInfo returnRoadwayInfo = new Dt_RoadwayInfo();
+                if(returnOrder != null && !string.IsNullOrEmpty(returnOrder.LocationCode))
+                {
+                    Dt_LocationInfo locationInfo1 = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == returnOrder.LocationCode);
+                    if(locationInfo1 == null)
+                    {
+                        return WebResponseContent.Instance.Error($"鍥炲簱鍗曚腑璇ュ簱浣峽returnOrder.LocationCode}鏈壘鍒�");
+                    }
+                    returnRoadwayInfo = _basicRepository.RoadwayInfoRepository.QueryFirst(x => x.RoadwayNo == locationInfo1.RoadwayNo);
+                }
+
+                if (Repository.QueryFirst(x => x.SourceAddress == (returnRoadwayInfo.InStationCode != null ? returnRoadwayInfo.InStationCode:stationCode) && x.TaskStatus == TaskStatusEnum.New.ObjToInt()) != null)
+                {
+                    return WebResponseContent.Instance.Error($"璇ョ珯鐐瑰凡鏈夋湭鎵ц鐨勪换鍔�");
+                }
+                
                 var details = stockInfo.Details.FirstOrDefault();
                 if (!string.IsNullOrEmpty(stockInfo.LocationCode))
                 {
                     return WebResponseContent.Instance.Error($"璇ユ墭鐩樺凡缁戝畾璐т綅");
                 }
-                Dt_RoadwayInfo roadwayInfo = _basicRepository.RoadwayInfoRepository.QueryFirst(x => x.InStationCode == stationCode);
+                Dt_RoadwayInfo roadwayInfo = _basicRepository.RoadwayInfoRepository.QueryFirst(x => x.InStationCode == (returnRoadwayInfo.InStationCode != null ? returnRoadwayInfo.InStationCode : stationCode));
                 if (roadwayInfo == null)
                 {
-                    return WebResponseContent.Instance.Error($"鏈壘鍒板垰鍏ュ簱绔欏彴鍦板潃");
+                    return WebResponseContent.Instance.Error($"鏈壘鍒拌鍏ュ簱绔欏彴鍦板潃");
                 }
                 Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == roadwayInfo.RoadwayNo);
                 if (warehouse == null)
                 {
-                    return WebResponseContent.Instance.Error("鏈壘鍒版敼浠撳簱");
+                    return WebResponseContent.Instance.Error("鏈壘鍒拌浠撳簱");
                 }
-                Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(roadwayInfo.RoadwayNo, stockInfo.PalletType, warehouse.WarehouseId, "", heightType);//, stockInfo.WarehouseId
-                if (locationInfo == null)
+                Dt_LocationInfo? locationInfo = new Dt_LocationInfo();
+                if (returnOrder != null && !string.IsNullOrEmpty(returnOrder.LocationCode))
                 {
-                    return WebResponseContent.Instance.Error($"璐т綅鍒嗛厤澶辫触,鏈壘鍒板彲鍒嗛厤璐т綅");
+                    locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == returnOrder.LocationCode);
+                    if (locationInfo.LocationStatus != LocationStatusEnum.Lock.ObjToInt() || locationInfo.EnableStatus == EnableStatusEnum.Disable.ObjToInt() || locationInfo.EnableStatus == EnableStatusEnum.OnlyOut.ObjToInt())
+                    {
+                        return WebResponseContent.Instance.Error($"璇ュ洖搴撳崟璐т綅{locationInfo.LocationCode}闈為攣瀹氱姸鎬佹垨璐т綅鍚敤鐘舵�佷笉姝g‘锛岃妫�鏌�");
+                    }
+                }
+                else
+                {
+                    locationInfo = _basicService.LocationInfoService.AssignLocation(roadwayInfo.RoadwayNo, stockInfo.PalletType, warehouse.WarehouseId, "", heightType);//, stockInfo.WarehouseId
+                    if (locationInfo == null)
+                    {
+                        return WebResponseContent.Instance.Error($"璐т綅鍒嗛厤澶辫触,鏈壘鍒板彲鍒嗛厤璐т綅");
+                    }
                 }
 
                 Dt_Task newTask = new Dt_Task()
                 {
                     CurrentAddress = "",
                     Grade = 0,
-                    NextAddress = stationCode,
+                    NextAddress = returnRoadwayInfo.InStationCode != null ? returnRoadwayInfo.InStationCode : stationCode,
                     PalletCode = palletCode,
                     OrderNo = details.OrderNo,
                     Roadway = roadwayInfo.RoadwayNo,
@@ -96,7 +124,18 @@
                     newTask.MaterielCode = MaterielCode;
                     newTask.Quantity = (float)Quantity;
                 }
-
+                if(stockInfo.StockStatus == StockStatusEmun.浣欐枡閫�搴�.ObjToInt())
+                {
+                    newTask.TaskType = TaskTypeEnum.SurplusReturn.ObjToInt();
+                }
+                if(stockInfo.StockStatus == StockStatusEmun.鍙嶆嫞鍏ュ簱.ObjToInt())
+                {
+                    newTask.TaskType = TaskTypeEnum.ReverseIn.ObjToInt();
+                }
+                if(stockInfo.StockStatus == StockStatusEmun.鐩樼偣搴撳瓨瀹屾垚.ObjToInt())
+                {
+                    newTask.TaskType = TaskTypeEnum.InInventory.ObjToInt();
+                }
                 //if (stockInfo.StockStatus == StockStatusEmun.鎵嬪姩缁勭洏鏆傚瓨.ObjToInt())
                 //{
                 //    stockInfo.StockStatus = StockStatusEmun.鎵嬪姩缁勭洏鍏ュ簱纭.ObjToInt();
@@ -127,8 +166,14 @@
                 _unitOfWorkManage.BeginTran();
                 int taskId = BaseDal.AddData(newTask);
                 newTask.TaskId = taskId;
+                if (returnOrder != null)
+                {
+                    returnOrder.OrderStatus = InOrderStatusEnum.鍏ュ簱涓�.ObjToInt();
+                    _returnOrderRepository.UpdateData(returnOrder);
+                }
                 _stockRepository.StockInfoRepository.UpdateData(stockInfo);
                 _locationInfoService.UpdateData(locationInfo);
+                
                 _unitOfWorkManage.CommitTran();
                 WMSTaskDTO wMSTaskDTO = _mapper.Map<WMSTaskDTO>(newTask);
 
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs
index 3591fee..2448941 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs
@@ -23,6 +23,9 @@
 using WIDESEA_Core.Utilities;
 using System.Transactions;
 using Microsoft.Data.SqlClient;
+using WIDESEA_Model.Models.Outbound;
+using WIDESEA_Common.OrderEnum;
+using WIDESEA_Core.CodeConfigEnum;
 
 namespace WIDESEA_TaskInfoService
 {
@@ -34,7 +37,7 @@
         /// </summary>
         /// <param name="stockInfos"></param>
         /// <returns></returns>
-        public List<Dt_Task> GetTasks(List<Dt_StockInfo> stockInfos)
+        public List<Dt_Task> GetTasks(List<Dt_StockInfo> stockInfos, TaskTypeEnum taskType)
         {
             List<Dt_Task> tasks = new List<Dt_Task>();
             for (int i = 0; i < stockInfos.Count; i++)
@@ -71,13 +74,17 @@
                             SourceAddress = locationInfo.LocationCode,
                             TargetAddress = "",
                             TaskStatus = OutTaskStatusEnum.OutNew.ObjToInt(),
-                            TaskType = TaskTypeEnum.Outbound.ObjToInt(),
+                            TaskType = taskType.ObjToInt(),
                             Depth = locationInfo.Depth,
                             WarehouseId = stockInfo.WarehouseId,
                             TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum))
                         };
+                        if (taskType != TaskTypeEnum.OutEmpty)
+                        {
+                            task.MaterielCode = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode;
+                            task.Quantity = (float)stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).Sum(x => x.StockQuantity);
+                        }
                         tasks.Add(task);
-                        //var responses = HttpHelper.Post<WebResponseContent>(ReceiveTask, tasks, "绔嬪簱鍑哄簱鏁伴噺鍥炰紶WMS");
                     }
                 }
 
@@ -119,15 +126,15 @@
                     Dt_OutboundOrder outboundOrder = _outboundService.OutboundOrderService.Repository.QueryFirst(x => x.Id == outboundOrderDetails.FirstOrDefault().OrderId);
                     TaskTypeEnum typeEnum = outboundOrder.OrderType switch
                     {
-                        (int)OutOrderTypeEnum.work => TaskTypeEnum.Outbound,
-                        (int)OutOrderTypeEnum.Allocate => TaskTypeEnum.OutAllocate,
-                        (int)OutOrderTypeEnum.Quality => TaskTypeEnum.OutQuality,
+                        (int)OrderTypeEnum.鐢熶骇鍑哄簱鍗� => TaskTypeEnum.Outbound,
+                        (int)OrderTypeEnum.璋冩嫧鍑哄簱鍗� => TaskTypeEnum.OutAllocate,
+                        (int)OrderTypeEnum.鍙嶆嫞鍑哄簱鍗� => TaskTypeEnum.ReverseOut,
                         _ => new TaskTypeEnum()
                     };
-                    tasks = GetTasks(result.Item1);
+                    tasks = GetTasks(result.Item1,typeEnum);
                     tasks.ForEach(x =>
                     {
-                        x.OrderNo = outboundOrder.UpperOrderNo;
+                        x.OrderNo = outboundOrder.OrderNo;
                     });
                     result.Item2.ForEach(x =>
                     {
@@ -162,6 +169,7 @@
             return (tasks, stockInfos, orderDetails, outStockLockInfos, locationInfos);
         }
 
+
         /// <summary>
         /// 鍑哄簱浠诲姟鏁版嵁澶勭悊
         /// </summary>
@@ -192,12 +200,15 @@
                 (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)
                 {
-                    tasks = GetTasks(result.Item1);
-                    int task = tasks[0].TaskNum;
-                    result.Item3.ForEach(x =>
+                    Dt_OutboundOrder outboundOrder = _outboundService.OutboundOrderService.Repository.QueryFirst(x => x.Id == outboundOrderDetail.OrderId);
+                    TaskTypeEnum typeEnum = outboundOrder.OrderType switch
                     {
-                        x.TaskNum = task;
-                    });
+                        (int)OrderTypeEnum.鐢熶骇鍑哄簱鍗� => TaskTypeEnum.Outbound,
+                        (int)OrderTypeEnum.璋冩嫧鍑哄簱鍗� => TaskTypeEnum.OutAllocate,
+                        (int)OrderTypeEnum.鍙嶆嫞鍥炲簱鍗� => TaskTypeEnum.ReverseIn,
+                        _ => new TaskTypeEnum()
+                    };
+                    tasks = GetTasks(result.Item1, typeEnum);
                     result.Item2.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
                     result.Item3.ForEach(x =>
                     {
@@ -219,12 +230,14 @@
                 if (stockLockInfos != null && stockLockInfos.Count > 0)
                 {
                     List<Dt_StockInfo> stocks = _stockService.StockInfoService.Repository.GetStockInfosByPalletCodes(stockLockInfos.Select(x => x.PalletCode).Distinct().ToList());
-                    tasks = GetTasks(stocks);
+                    tasks = GetTasks(stocks, TaskTypeEnum.Outbound);
                 }
             }
 
             return (tasks, stockInfos, orderDetail == null ? null : new List<Dt_OutboundOrderDetail> { orderDetail }, outStockLockInfos, locationInfos);
         }
+
+
         /// <summary>
         /// 绔嬪簱鍑哄簱鎸囦护涓婁紶锛屽嚭搴撲换鍔′笅鍙�
         /// </summary>
@@ -242,12 +255,9 @@
                     return WebResponseContent.Instance.Error($"鏈壘鍒拌浠撳簱淇℃伅");
                 }
                 Dt_OutboundOrder oldOuboundOrder = BaseDal.Db.Queryable<Dt_OutboundOrder>().Where(x => x.UpperOrderNo == orderAddDTO.No).Includes(x => x.Details).First();
+                Dt_Production production = new Dt_Production();
                 if (oldOuboundOrder != null)
                 {
-                    //if (oldOuboundOrder.Details.FirstOrDefault(x => x.LinId == Convert.ToInt32(orderAddDTO.LinId)) != null)
-                    //{
-                    //    return WebResponseContent.Instance.Error($"璇ユ槑缁嗚鍙峰凡瀛樺湪");
-                    //}
                     if (oldOuboundOrder.OutWareHouse != warehouse.WarehouseCode)
                     {
                         return WebResponseContent.Instance.Error($"浠撳簱涓嶄竴鑷�");
@@ -266,12 +276,72 @@
                             MaterieSpec = details.MaterieSpec,
                             OrderDetailStatus = OrderDetailStatusEnum.New.ObjToInt(),
                             OrderQuantity = details.OrderQuantity,
+                            LinId = details.LinId,
                             OrderId = oldOuboundOrder.Id,
                             Creater = "WMS",
                             CreateDate = DateTime.Now,
+                            Remark = details.Remark,
+                            SupplierBatch = details.SupplierBatch
                         };
                         _outboundOrderDetailRepository.AddData(outboundOrderDetail);
-                        //_outboundOrderDetailRepository.AddData(outboundOrderDetail);
+                        foreach (var item in orderAddDTO1.Details)
+                        {
+                            if (string.IsNullOrWhiteSpace(item.Remark))
+                            {
+                                continue;
+                            }
+                            string[] remarkEntries = item.Remark.Split(
+                                new[] { ';' },
+                                StringSplitOptions.RemoveEmptyEntries
+                            );
+
+                            foreach (var entry in remarkEntries)
+                            {
+                                string[] keyValuePairs = entry.Split(
+                                    new[] { ',' },
+                                    StringSplitOptions.RemoveEmptyEntries
+                                );
+
+                                foreach (var kvp in keyValuePairs)
+                                {
+                                    int colonIndex = kvp.IndexOf(':');
+                                    if (colonIndex <= 0 || colonIndex >= kvp.Length - 1)
+                                    {
+                                        continue;
+                                    }
+
+                                    string key = kvp.Substring(0, colonIndex).Trim();
+                                    string value = kvp.Substring(colonIndex + 1).Trim();
+
+                                    switch (key)
+                                    {
+                                        case "鍒堕�犲崟鍙�":
+                                            production.ProductionNo = value;
+                                            break;
+                                        case "鍒堕�犻儴浠�":
+                                            production.ManufacturingCo = value;
+                                            break;
+                                        case "鍑哄簱鏁伴噺":
+                                            if (decimal.TryParse(value, out decimal outQuantity))
+                                            {
+                                                production.OutQuantity = outQuantity;
+                                            }
+                                            else
+                                            {
+                                                Console.WriteLine($"鍑哄簱鏁伴噺鏍煎紡閿欒锛歿value}锛堝簲涓烘暟鍊硷紝濡�14.0000锛�");
+                                            }
+                                            break;
+                                        default:
+                                            Console.WriteLine($"鏈煡閿悕锛歿key}锛堝搴斿�硷細{value}锛岃烦杩囪閿�煎锛�");
+                                            break;
+                                    }
+
+                                }
+                                production.Creater = "WMS";
+                                production.OrderId = outboundOrderDetail.Id;
+                                _productionRepository.AddData(production);
+                            }
+                        }
                     }
                 }
                 else
@@ -280,41 +350,82 @@
                     orderAddDTO1.OrderNo = orderAddDTO.No;
                     orderAddDTO1.UpperOrderNo = orderAddDTO.No;
                     orderAddDTO1.OutWareHouse = orderAddDTO.OutWareHouse;
-                    orderAddDTO1.TransactionCode = orderAddDTO.TransactionCode;
-                    orderAddDTO1.InoutType = orderAddDTO.OrderType;
-                    orderAddDTO1.OrderType = orderAddDTO.InoutType.ObjToInt();
+                    orderAddDTO1.TransactionCode = orderAddDTO.TransactionCode?? "宸ュ崟鍙戞枡";
+                    orderAddDTO1.InoutType = orderAddDTO.OrderType ?? InoutTypeEnum.WorkFeed.ToString();
+                    orderAddDTO1.OrderType = orderAddDTO.InoutType;
+                    orderAddDTO1.System = orderAddDTO.System;
                     IEnumerable<int> inOrderTypes = Enum.GetValues<OrderTypeEmun>().Cast<int>();
-                    //orderAddDTO1.OrderType = orderAddDTO.OrderType.ObjToInt();
                     orderAddDTO1.Details = orderAddDTO.DetailList.DicToIEnumerable<OutboundOrderDetailAddDTO>();
                     #region 楠岃瘉鏁版嵁
                     (bool, string, object?) result = CheckOutboundOrderAddData(orderAddDTO1);
                     if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2);
                     #endregion
-
                     Dt_OutboundOrder inboundOrder = _mapper.Map<Dt_OutboundOrder>(orderAddDTO1);
                     inboundOrder.OrderStatus = InboundStatusEnum.鏈紑濮�.ObjToInt();
                     inboundOrder.Creater = "WMS";
                     inboundOrder.CreateDate = DateTime.Now;
+                    inboundOrder.CreateType = CreateType.UpperSystemPush.ObjToInt();
                     _unitOfWorkManage.BeginTran();
                     bool a = BaseDal.Db.InsertNav(inboundOrder).Include(x => x.Details).ExecuteCommand();
-                    //Dt_OutboundOrder oldOutboundOrder = BaseDal.Db.Queryable<Dt_OutboundOrder>().Where(x => x.UpperOrderNo == orderAddDTO1.OrderNo).Includes(x => x.Details).First();
-                    //Dt_OutboundOrderDetail outboundOrderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.OrderId == oldOutboundOrder.Id);
-                    //List<StockSelectViewDTO> stockSelectViews = new List<StockSelectViewDTO>();
-                    //StockSelectViewDTO stockSelectViewDTO = new()
-                    //{
-                    //    OrderNo = orderAddDTO1.OrderNo,
-                    //    MaterielCode = outboundOrderDetail.MaterielCode,
-                    //    MaterielName = outboundOrderDetail.MaterielName,
-                    //    UseableQuantity = outboundOrderDetail.OrderQuantity,
-                    //    BatchNo = outboundOrderDetail.BatchNo,
-                    //    LinId = outboundOrderDetail.LinId,
-                    //    PalletCode = outboundOrderDetail.LPNNo,
-                    //};
+                    
+                    foreach (var item in orderAddDTO1.Details)
+                    {
+                        if (string.IsNullOrWhiteSpace(item.Remark))
+                        {
+                            continue;
+                        }
+                        string[] remarkEntries = item.Remark.Split(
+                            new[] { ';' },
+                            StringSplitOptions.RemoveEmptyEntries
+                        );
 
+                        foreach (var entry in remarkEntries)
+                        {
+                            string[] keyValuePairs = entry.Split(
+                                new[] { ',' },
+                                StringSplitOptions.RemoveEmptyEntries
+                            );
 
-                    //stockSelectViews.Add(stockSelectViewDTO);
-                    //GenerateOutboundTasks(oldOutboundOrder.Id, stockSelectViews);
+                            foreach (var kvp in keyValuePairs)
+                            {
+                                int colonIndex = kvp.IndexOf(':');
+                                if (colonIndex <= 0 || colonIndex >= kvp.Length - 1)
+                                {
+                                    continue;
+                                }
 
+                                string key = kvp.Substring(0, colonIndex).Trim();
+                                string value = kvp.Substring(colonIndex + 1).Trim();
+
+                                switch (key)
+                                {
+                                    case "鍒堕�犲崟鍙�":
+                                        production.ProductionNo = value;
+                                        break;
+                                    case "鍒堕�犻儴浠�":
+                                        production.ManufacturingCo = value;
+                                        break;
+                                    case "鍑哄簱鏁伴噺":
+                                        if (decimal.TryParse(value, out decimal outQuantity))
+                                        {
+                                            production.OutQuantity = outQuantity;
+                                        }
+                                        else
+                                        {
+                                            Console.WriteLine($"鍑哄簱鏁伴噺鏍煎紡閿欒锛歿value}锛堝簲涓烘暟鍊硷紝濡�14.0000锛�");
+                                        }
+                                        break;
+                                    default:
+                                        Console.WriteLine($"鏈煡閿悕锛歿key}锛堝搴斿�硷細{value}锛岃烦杩囪閿�煎锛�");
+                                        break;
+                                }
+                                
+                            }
+                            production.Creater = "WMS";
+                            production.OrderId = inboundOrder.Details.FirstOrDefault().Id;
+                            _productionRepository.AddData(production);
+                        }
+                    }
                     _unitOfWorkManage.CommitTran();
                 }
 
@@ -778,5 +889,104 @@
                 return content = WebResponseContent.Instance.Error($"鏈壘鍒颁换鍔″彿");
             }
         }
+
+        /// <summary>
+        /// 閫夊畾搴撳瓨鐢熸垚鐩樼偣鍗曞嚭搴�
+        /// </summary>
+        /// <param name="id"></param>
+        /// <returns></returns>
+        public WebResponseContent TakeOutbound(List<StockViewDTO> stockViews)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                if (stockViews.Select(x => x.WarehouseId).Distinct().Count() >= 2)
+                {
+                    return content.Error($"璇烽�夋嫨鍚屼竴浠撳簱搴撳瓨杩涜鐩樼偣");
+                }
+                List<int> ids = stockViews.Select(x => x.StockId).ToList();
+                //鑾峰彇搴撳瓨
+                List<Dt_StockInfo> stockInfos = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => ids.Contains(x.Id)).Includes(x => x.Details).ToList();
+                if (stockInfos.Count != stockViews.Count)
+                {
+                    StockViewDTO? stockViewDTO = stockViews.FirstOrDefault(x => !stockInfos.Select(x => x.PalletCode).ToList().Contains(x.PalletCode));
+                    return content.Error($"鏈壘鍒皗stockViewDTO?.PalletCode}搴撳瓨");
+                }
+                //鑾峰彇璐т綅
+                List<string> locStrs = stockInfos.Select(x => x.LocationCode).ToList();
+                List<Dt_LocationInfo> locationInfos = _basicRepository.LocationInfoRepository.QueryData(x => locStrs.Contains(x.LocationCode));
+                if (stockInfos.Count != locationInfos.Count)
+                {
+                    string? locStr = locStrs.FirstOrDefault(x => !locationInfos.Select(x => x.LocationCode).ToList().Contains(x));
+                    return content.Error($"鏈壘鍒皗locStr}璐т綅鏁版嵁");
+                }
+                Dt_TakeStockOrder takeStockOrder = new Dt_TakeStockOrder()
+                {
+                    WarehouseId = stockInfos.FirstOrDefault().WarehouseId,
+                    TakeStockStatus = TakeStockStatusEnum.鐩樼偣涓�.ObjToInt(),
+                    OrderNo = _outboundService.OutboundOrderService.CreateCodeByRule(nameof(RuleCode.PDCodeRule)),
+                    Details = new List<Dt_TakeStockOrderDetail>()
+                };
+                foreach (var item in stockInfos)
+                {
+                    if (item.Details.Count <= 0)
+                    {
+                        return content.Error($"鏈壘鍒皗item.PalletCode}搴撳瓨鏄庣粏鏁版嵁");
+                    }
+                    Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.LocationCode == item.LocationCode);
+                    if (locationInfo != null && (locationInfo.EnableStatus == EnableStatusEnum.OnlyOut.ObjToInt() || locationInfo.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && locationInfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt() && item.StockStatus == StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt())
+                    {
+                        //鍒涘缓鏄庣粏
+                        Dt_TakeStockOrderDetail takeStockOrderDetail = new Dt_TakeStockOrderDetail()
+                        {
+                            MaterielCode = item.Details.FirstOrDefault().MaterielCode,
+                            MaterielName = item.Details.FirstOrDefault().MaterielName ?? "鏃犵墿鏂欏悕绉�",
+                            BatchNo = item.Details.FirstOrDefault().BatchNo,
+                            MaterielSpec = item.Details.FirstOrDefault().MaterieSpec ?? "鏃犵墿鏂欒鏍�",
+                            LocationCode = item.LocationCode,
+                            TakePalletCode = item.PalletCode,
+                            TakeDetalStatus = TakeStockDetailStatusEnum.鐩樼偣鍑哄簱涓�.ObjToInt(),
+                            SysQty = item.Details.Sum(x => x.StockQuantity),
+                            Qty = 0
+                        };
+                        takeStockOrder.Details.Add(takeStockOrderDetail);
+                    }
+                    else
+                    {
+                        content.Error($"璐т綅鎴栧簱瀛樼姸鎬佷笉婊¤冻鍑哄簱鏉′欢");
+                    }
+                }
+                List<Dt_Task> tasks = GetTasks(stockInfos, TaskTypeEnum.OutInventory);
+                if (tasks == null || tasks.Count <= 0)
+                {
+                    return content.Error($"鐢熸垚浠诲姟澶辫触");
+                }
+                stockInfos.ForEach(x =>
+                {
+                    x.StockStatus = StockStatusEmun.鍑哄簱閿佸畾.ObjToInt();
+                });
+                tasks.ForEach(x =>
+                {
+                    x.OrderNo = takeStockOrder.OrderNo;
+                });
+                LocationStatusEnum locationStatus = LocationStatusEnum.Lock;
+                _unitOfWorkManage.BeginTran();
+                //鏇存柊搴撳瓨鐘舵��
+                _stockRepository.StockInfoRepository.UpdateData(stockInfos);
+                BaseDal.Db.InsertNav(takeStockOrder).Include(x => x.Details).ExecuteCommand();
+                //鏂板缓浠诲姟
+                BaseDal.AddData(tasks);
+                _basicService.LocationInfoService.Repository.UpdateLocationStatus(locationInfos, locationStatus);
+                _unitOfWorkManage.CommitTran();
+                PushTasksToWCS(tasks);
+                content.OK();
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                content.Error(ex.Message);
+            }
+            return content;
+        }
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
index f264e11..dc164dc 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -34,6 +34,7 @@
 using System.Threading.Tasks;
 using WIDESEA_BasicRepository;
 using WIDESEA_Common;
+using WIDESEA_Common.OrderEnum;
 using WIDESEA_Common.TaskEnum;
 using WIDESEA_Core;
 using WIDESEA_Core.BaseRepository;
@@ -41,11 +42,13 @@
 using WIDESEA_Core.Enums;
 using WIDESEA_Core.Helper;
 using WIDESEA_Core.TaskEnum;
+using WIDESEA_DTO.Basic;
 using WIDESEA_DTO.Inbound;
 using WIDESEA_DTO.Stock;
 using WIDESEA_DTO.Task;
 using WIDESEA_IBasicRepository;
 using WIDESEA_IBasicService;
+using WIDESEA_IInboundRepository;
 using WIDESEA_IInboundService;
 using WIDESEA_IOutboundRepository;
 using WIDESEA_IOutboundService;
@@ -55,14 +58,27 @@
 using WIDESEA_ITaskInfoRepository;
 using WIDESEA_ITaskInfoService;
 using WIDESEA_Model.Models;
+using WIDESEA_Model.Models.Inbound;
 using WIDESEA_StockRepository;
 using WIDESEA_TaskInfoRepository;
 using static WIDESEA_Common.Authentication;
+using static WIDESEA_Common.HouseBackboundPassBack;
 using static WIDESEA_Common.HouseInboundPassBack;
 using static WIDESEA_Common.HouseoutboundPassBack;
 using static WIDESEA_Common.InventoryAllocate;
 using static WIDESEA_ITaskInfoService.ITaskService;
 using Parameter = WIDESEA_Common.Parameter;
+using WIDESEA_DTO.ERP;
+using WIDESEA_OutboundRepository;
+using System.ComponentModel.DataAnnotations;
+using System;
+using System.IO;
+using System.Net.Http;
+using System.Threading.Tasks;
+using Spire.Pdf;
+using WIDESEA_InboundRepository;
+using System.Drawing.Printing;
+using System;
 
 namespace WIDESEA_TaskInfoService
 {
@@ -89,9 +105,12 @@
         private readonly IPalletTypeInfoRepository _palletTypeInfoRepository;
         private readonly IOutboundOrderDetailRepository _outboundOrderDetailRepository;
         private readonly IStockInfoDetailRepository _stockInfoDetailRepository;
+        private readonly IReturnOrderRepository _returnOrderRepository;
+        private readonly IProductionRepository _productionRepository;
+        private readonly IInboundRepository _inboundRepository; 
         public ITaskRepository Repository => BaseDal;
 
-        public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IMaterielInfoService materielInfoService, IInboundOrderDetail_HtyService inboundOrderDetail_HtyService, IOutboundOrder_HtyService outboundOrder_HtyService, IOutboundOrderDetail_HtyService outboundOrderDetail_HtyService, IInboundOrder_HtyService inboundOrder_HtyService, IStockRepository stockRepository, IInboundOrderDetailService inboundOrderDetailService, IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, IRecordService recordService, IStockService stockService, ITask_HtyService taskHtyService, ILocationInfoService locationInfoService, IOutboundOrderDetailRepository outboundOrderDetailRepository, IBasicRepository basicRepository, IStockInfoDetailRepository stockInfoDetailRepository, IPalletTypeInfoRepository palletTypeInfoRepository) : base(BaseDal)
+        public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IMaterielInfoService materielInfoService, IInboundOrderDetail_HtyService inboundOrderDetail_HtyService, IOutboundOrder_HtyService outboundOrder_HtyService, IOutboundOrderDetail_HtyService outboundOrderDetail_HtyService, IInboundOrder_HtyService inboundOrder_HtyService, IStockRepository stockRepository, IInboundOrderDetailService inboundOrderDetailService, IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, IRecordService recordService, IStockService stockService, ITask_HtyService taskHtyService, ILocationInfoService locationInfoService, IOutboundOrderDetailRepository outboundOrderDetailRepository, IBasicRepository basicRepository, IStockInfoDetailRepository stockInfoDetailRepository, IPalletTypeInfoRepository palletTypeInfoRepository, IReturnOrderRepository returnOrderRepository, IProductionRepository productionRepository,IInboundRepository inboundRepository) : base(BaseDal)
         {
             _mapper = mapper;
             _stockRepository = stockRepository;
@@ -113,13 +132,18 @@
             _basicRepository = basicRepository;
             _stockInfoDetailRepository = stockInfoDetailRepository;
             _palletTypeInfoRepository = palletTypeInfoRepository;
+            _returnOrderRepository = returnOrderRepository;
+            _productionRepository = productionRepository;
+            _inboundRepository = inboundRepository;
         }
 
         public string ReceiveWMSTaskin = WIDESEA_Core.Helper.AppSettings.Configuration["ReceiveWMSTaskin"];
+        public string ReceiveWMSTaskreturn = WIDESEA_Core.Helper.AppSettings.Configuration["ReceiveWMSTaskreturn"];
         public string ReceiveWMSTaskout = WIDESEA_Core.Helper.AppSettings.Configuration["ReceiveWMSTaskout"];
         public string ReceiveWMSTaskAUT = WIDESEA_Core.Helper.AppSettings.Configuration["ReceiveWMSTaskAUT"];
         public string ReceiveWMSTaskAllocatein = WIDESEA_Core.Helper.AppSettings.Configuration["ReceiveWMSTaskAllocatein"];
-
+        public string ReceiveERPTaskout = WIDESEA_Core.Helper.AppSettings.Configuration["ReceiveERPTaskout"];
+        public string InMaterialWarehousingCallback = WIDESEA_Core.Helper.AppSettings.Configuration["InMaterialWarehousingCallback"];
 
         /// <summary>
         /// 浠诲姟淇℃伅鎺ㄩ�佽嚦WCS
@@ -140,6 +164,30 @@
                     return WebResponseContent.Instance.Error($"鏈壘鍒癢CSApi鍦板潃,璇锋鏌ラ厤缃枃浠�");
                 }
                 string response = HttpHelper.Post($"{url}/api/Task/ReceiveTask", taskDTOs.Serialize());
+
+                return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("杩斿洖閿欒");
+            }
+            catch (Exception ex)
+            {
+                return WebResponseContent.Instance.Error(ex.Message);
+            }
+        }
+
+        public WebResponseContent FeedBackWCSTaskCompleted(int taskNum)
+        {
+            try
+            {
+                Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
+                if (task == null)
+                {
+                    return WebResponseContent.Instance.Error("鏈壘鍒拌浠诲姟淇℃伅");
+                }
+                string url = AppSettings.app("WCS");
+                if (string.IsNullOrEmpty(url))
+                {
+                    return WebResponseContent.Instance.Error($"鏈壘鍒癢CSApi鍦板潃,璇锋鏌ラ厤缃枃浠�");
+                }
+                string response = HttpHelper.Get($"{url}/api/Task/RecWMSTaskCompleted?taskNum=" + taskNum);
 
                 return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("杩斿洖閿欒");
             }
@@ -381,7 +429,7 @@
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒拌浠诲姟");
                 }
-                if (task.TaskType != TaskTypeEnum.Inbound.ObjToInt())
+                if (task.TaskType.GetTaskTypeGroup() != TaskTypeGroup.InboundGroup)
                 {
                     return WebResponseContent.Instance.Error($"浠诲姟绫诲瀷閿欒");
                 }
@@ -421,7 +469,31 @@
                 Dt_InboundOrderDetail? inboundOrderDetail = null;
 
                 // 3. 澶勭悊鍏ュ簱閫昏緫
-                return ProcessInbound(task, dt_StockInfo, dt_LocationInfo);
+                if (task.TaskType == TaskTypeEnum.Inbound.ObjToInt())
+                {
+                    return ProcessInbound(task, dt_StockInfo, dt_LocationInfo);
+                }
+                if (task.TaskType == TaskTypeEnum.SurplusReturn.ObjToInt() || task.TaskType == TaskTypeEnum.ReverseIn.ObjToInt())
+                {
+                    return ReturnInbound(task, dt_StockInfo, dt_LocationInfo);
+                }
+                if(task.TaskType == TaskTypeEnum.InInventory.ObjToInt())
+                {
+                    int lastStatus = dt_LocationInfo.LocationStatus;
+                    dt_LocationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
+                    dt_StockInfo.StockStatus = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt();
+                    // 鏇存柊搴撳瓨鏄庣粏鐘舵��
+                    dt_StockInfo.Details.ForEach(x => x.Status = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt());
+                    _unitOfWorkManage.BeginTran();
+                    UpdateTaskStatus(task);
+                    UpdateLocationStatus(dt_LocationInfo, lastStatus);
+                    UpdateStockInfo(dt_StockInfo);
+                    AddRecords(task, dt_StockInfo, dt_LocationInfo, lastStatus);
+                    _unitOfWorkManage.CommitTran();
+                    return WebResponseContent.Instance.OK();
+
+                }
+                return WebResponseContent.Instance.OK();
             }
             catch (Exception ex)
             {
@@ -440,11 +512,12 @@
                 .Includes(x => x.Details)
                 .First();
 
-            if (inboundOrder == null) return WebResponseContent.Instance.Error("鏈壘鍒板叆搴撳崟淇℃伅");
-
+            if (task.TaskType == TaskTypeEnum.Inbound.ObjToInt() && inboundOrder == null)
+            {
+                return WebResponseContent.Instance.Error("鏈壘鍒板叆搴撳崟淇℃伅");
+            }
             Dt_InboundOrderDetail inboundOrderDetail = inboundOrder.Details
-                .FirstOrDefault(x => x.LinId == stockInfo.Details.FirstOrDefault()?.LinId);
-
+             .FirstOrDefault(x => x.LinId == stockInfo.Details.FirstOrDefault()?.LinId);
             //if (inboundOrder != null && stockInfo.StockStatus == StockStatusEmun.鍏ュ簱纭.ObjToInt())
             //{
             //鍏ュ簱鏁伴噺鍥炰紶
@@ -456,6 +529,29 @@
             //    return ProcessAllocateInbound(task, stockInfo, locationInfo, lastStatus, inboundOrder, inboundOrderDetail);
             //}
         }
+        private WebResponseContent ReturnInbound(Dt_Task task, Dt_StockInfo stockInfo, Dt_LocationInfo locationInfo)
+        {
+            int lastStatus = locationInfo.LocationStatus;
+            locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
+
+            Dt_ReturnOrder returnOrder = _returnOrderRepository.QueryFirst(x => x.OrderNo == stockInfo.Details.FirstOrDefault().OrderNo);
+            if (returnOrder == null)
+            {
+                return WebResponseContent.Instance.Error("鏈壘鍒板洖搴撳崟淇℃伅");
+            }
+            //if (inboundOrder != null && stockInfo.StockStatus == StockStatusEmun.鍏ュ簱纭.ObjToInt())
+            //{
+            //鍏ュ簱鏁伴噺鍥炰紶
+            return SurplusReturnInbound(task, stockInfo, locationInfo, lastStatus, returnOrder);
+            //}
+            //else
+            //{
+            //    //璋冩嫧鍑哄叆搴撲换鍔℃暟閲忓洖浼�
+            //    return ProcessAllocateInbound(task, stockInfo, locationInfo, lastStatus, inboundOrder, inboundOrderDetail);
+            //}
+        }
+
+
         //鍏朵粬鍏ュ簱
         private WebResponseContent ProcessNormalInbound(Dt_Task task, Dt_StockInfo stockInfo, Dt_LocationInfo locationInfo,
             int lastStatus, Dt_InboundOrder inboundOrder, Dt_InboundOrderDetail inboundOrderDetail)
@@ -487,16 +583,77 @@
                 UpdateInboundOrder(inboundOrder, inboundOrderDetail);
 
                 // 鍗曟嵁鏁伴噺鍏ㄩ儴涓婃灦瀹屾垚锛屽鐞哤MS鍥炰紶
-                if (inboundOrder.OrderStatus == InboundStatusEnum.鍏ュ簱瀹屾垚.ObjToInt() && inboundOrder.OrderType == 0)
+                if (inboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt() && inboundOrder.System.Equals("ERP"))
                 {
-                    var stockInfoDetail = stockInfo.Details.FirstOrDefault();
+                    FeedBackInboundERP(inboundOrder.UpperOrderNo, inboundOrderDetail.LinId);
+                }
+                if (inboundOrder.OrderStatus == InboundStatusEnum.鍏ュ簱瀹屾垚.ObjToInt() && inboundOrder.OrderType == 0 && inboundOrder.System.Equals("SMOM"))
+                {
                     SendInboundInfoToWMS(task, inboundOrder, stockInfo);
                 }
-                else if (inboundOrder.OrderStatus == InboundStatusEnum.鍏ュ簱瀹屾垚.ObjToInt() && inboundOrder.OrderType == 2)
+                else if (inboundOrder.OrderStatus == InboundStatusEnum.鍏ュ簱瀹屾垚.ObjToInt() && inboundOrder.OrderType == 2 && inboundOrder.System.Equals("SMOM"))
                 {
                     SendAllocateInfoToWMS(task, inboundOrder, stockInfo);
                 }
 
+                _unitOfWorkManage.CommitTran();
+                return WebResponseContent.Instance.OK();
+            }
+            catch
+            {
+                _unitOfWorkManage.RollbackTran();
+                throw;
+            }
+        }
+        //鍥炲簱閫昏緫澶勭悊骞朵笂鎶MS
+        private WebResponseContent SurplusReturnInbound(Dt_Task task, Dt_StockInfo stockInfo, Dt_LocationInfo locationInfo,
+            int lastStatus, Dt_ReturnOrder returnOrder)
+        {
+            returnOrder.OrderStatus = InOrderStatusEnum.鍏ュ簱瀹屾垚.ObjToInt();
+
+            if (task.TaskType == TaskTypeEnum.ReverseIn.ObjToInt())
+            {
+                foreach (var item in stockInfo.Details)
+                {
+                    item.StockQuantity = returnOrder.OrderQuantity;
+                    returnOrder.OverInQuantity = returnOrder.OrderQuantity;
+                }
+            }
+            else
+            {
+                foreach (var item in stockInfo.Details)
+                {
+                    returnOrder.OverInQuantity += item.StockQuantity;
+                }
+            }
+            ///鏇存柊搴撳瓨鐘舵��
+            stockInfo.StockStatus = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt();
+            // 鏇存柊搴撳瓨鏄庣粏鐘舵��
+            stockInfo.Details.ForEach(x => x.Status = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt());
+
+            try
+            {
+                _unitOfWorkManage.BeginTran();
+
+                // 鏇存柊浠诲姟鐘舵��
+                UpdateTaskStatus(task);
+
+                // 鏇存柊璐т綅鐘舵��
+                UpdateLocationStatus(locationInfo, lastStatus);
+
+                // 鏇存柊搴撳瓨淇℃伅
+                UpdateStockInfo(stockInfo);
+
+                // 娣诲姞璁板綍
+                AddRecords(task, stockInfo, locationInfo, lastStatus);
+
+                //鏇存柊鍥炲簱鍗�
+                _returnOrderRepository.UpdateData(returnOrder);
+
+                if (returnOrder.OrderType == OrderTypeEnum.鍙嶆嫞鍥炲簱鍗�.ObjToInt() && (returnOrder.LocationCode == null || returnOrder.LocationCode == ""))
+                {
+                    SurplusReturnInboundToWMS(task, returnOrder, stockInfo, locationInfo);
+                }
                 _unitOfWorkManage.CommitTran();
                 return WebResponseContent.Instance.OK();
             }
@@ -585,7 +742,8 @@
 
         private void UpdateTaskStatus(Dt_Task task)
         {
-            task.TaskStatus = InTaskStatusEnum.InFinish.ObjToInt();
+            task.TaskStatus = TaskStatusEnum.Finish.ObjToInt();
+            FeedBackWCSTaskCompleted(task.TaskNum);
             BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateType.浜哄伐瀹屾垚 : OperateType.鑷姩瀹屾垚);
         }
 
@@ -621,7 +779,7 @@
             }
         }
 
-        private void SendInboundInfoToWMS(Dt_Task task, Dt_InboundOrder inboundOrder, Dt_StockInfo stockInfo)
+        private WebResponseContent SendInboundInfoToWMS(Dt_Task task, Dt_InboundOrder inboundOrder, Dt_StockInfo stockInfo)
         {
 
 
@@ -640,33 +798,33 @@
                 ApiType = "AsnController",
                 Method = "AsrsGroudingAsn",
                 Parameters = new List<HouseInboundPassBack.data>
-    {
-        new HouseInboundPassBack.data
-        {
-            Value = new List<data.data1>
-            {
-                new data.data1
                 {
-                    AsnNo = inboundOrder.OrderNo,
-                    //InWarehouse = task.Roadway,
-                    TransactionCode = inboundOrder.TransactionCode,
-                    InoutType = inboundOrder.OrderType,
-                    OrderType = inboundOrder.InoutType,
-                    // 閬嶅巻鎵�鏈夊簱瀛樻槑缁嗭紝娣诲姞鍒� DetailList
-                    DetailList = StockInfos.Select(d => new data.data1.Inbound
+                    new HouseInboundPassBack.data
                     {
-                        LinId = d.Details.FirstOrDefault()?.LinId?? "",
-                        MaterielCode = d.Details.FirstOrDefault()?.MaterielCode?? "",
-                        OrderQuantity = d.Details.FirstOrDefault().StockQuantity,
-                        BatchNo = d.BatchNo,
-                        LPNNo = d.PalletCode,
-                        FinishQty = d.Details.FirstOrDefault().StockQuantity,
-                        LocationName = d.LocationCode
-                    }).ToList()
+                        Value = new List<data.data1>
+                        {
+                            new data.data1
+                            {
+                                AsnNo = inboundOrder.OrderNo,
+                                //InWarehouse = task.Roadway,
+                                TransactionCode = inboundOrder.TransactionCode,
+                                InoutType = inboundOrder.OrderType,
+                                OrderType = inboundOrder.InoutType,
+                                // 閬嶅巻鎵�鏈夊簱瀛樻槑缁嗭紝娣诲姞鍒� DetailList
+                                DetailList = StockInfos.Select(d => new data.data1.Inbound
+                                {
+                                    LinId = d.Details.FirstOrDefault()?.LinId?? "",
+                                    MaterielCode = d.Details.FirstOrDefault()?.MaterielCode?? "",
+                                    OrderQuantity = d.Details.FirstOrDefault().StockQuantity,
+                                    BatchNo = d.BatchNo,
+                                    LPNNo = d.PalletCode,
+                                    FinishQty = d.Details.FirstOrDefault().StockQuantity,
+                                    LocationName = d.LocationCode
+                                }).ToList()
+                            }
+                        }
+                    }
                 }
-            }
-        }
-    }
             };
 
             var authResult = AuthenticateWithWMS();
@@ -678,8 +836,80 @@
                 { "InvOrgId", authResult.InvOrgId }
             };
 
-                HttpHelper.Post<WebResponseContent>(ReceiveWMSTaskin, houseInboundPassBack, "绔嬪簱鍏ュ簱鏁伴噺鍥炰紶WMS");
+                var response = HttpHelper.Post<MomRequestContent>(ReceiveWMSTaskin, houseInboundPassBack, "绔嬪簱鍏ュ簱鏁伴噺鍥炰紶WMS");
+                // 鍒ゆ柇Success鐨勫��
+                if (response.Success)
+                {
+                    // 濡傛灉Success涓簍rue锛岃繑鍥為渶瑕佺殑鍊硷紙杩欓噷浠ヨ繑鍥炴暣涓搷搴斿璞′负渚嬶級
+                    return WebResponseContent.Instance.OK();
+                }
+                else
+                {
+                    // 濡傛灉Success涓篺alse锛屾姏鍑哄紓甯稿苟鍖呭惈閿欒淇℃伅
+                    throw new Exception($"鎿嶄綔澶辫触: {response.Message ?? "鏈彁渚涢敊璇俊鎭�"}");
+                }
+
             }
+            return WebResponseContent.Instance.OK();
+        }
+
+        private WebResponseContent SurplusReturnInboundToWMS(Dt_Task task, Dt_ReturnOrder returnOrder, Dt_StockInfo stockInfo, Dt_LocationInfo locationInfo)
+        {
+            List<Dt_StockInfo> StockInfos = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.WarehouseId == task.WarehouseId).Includes(x => x.Details).Where(x => x.Details.Any(v => v.OrderNo == returnOrder.OrderNo)).ToList();
+            Dt_Warehouse warehouse = _basicService.WarehouseService.Repository.QueryFirst(x => x.WarehouseId == task.WarehouseId);
+            if (StockInfos.Count == 0) throw new Exception("鏈壘鍒板簱瀛樹俊鎭�");
+            var houseReturnOrders = new HouseBackboundPassBack
+            {
+                ApiType = "ShippingOrderController",
+                Method = "returnShippingOrderUnPickingToAsrsCallback",
+                Parameters = new List<HouseBackboundPassBack.backdata>
+                {
+                   new HouseBackboundPassBack.backdata
+                    {
+                         Value= new List<backdata.backdata1>
+                        {
+                            new backdata.backdata1
+                            {
+                                OrderType = returnOrder.OrderType,
+                                MaterielCode = returnOrder.MaterielCode,
+                                MaterielName = returnOrder.MaterielName,
+                                MaterieSpec = returnOrder.MaterieSpec,
+                                BatchNo = returnOrder.BatchNo,
+                                OrderQuantity = returnOrder.OrderQuantity,
+                                Remark = returnOrder.Remark,
+                                LinId = returnOrder.LinId,
+                                LPNNo = returnOrder.LPNNo,
+                                LocationCode = locationInfo.LocationCode,
+                                WarehouseCode = returnOrder.WarehouseCode,
+                                System = returnOrder.System,
+                            }
+                        }
+                   }    
+                }
+            };
+            var authResult = AuthenticateWithWMS();
+            if (authResult.IsSuccess)
+            {
+                houseReturnOrders.Context = new Dictionary<string, string>
+            {
+                { "Ticket", authResult.Ticket },
+                { "InvOrgId", authResult.InvOrgId }
+            };
+                var response = HttpHelper.Post<MomRequestContent>(ReceiveWMSTaskreturn, houseReturnOrders, "鍙栨秷鍙戣揣鍚庣珛搴撳弽鎷e叆搴撳洖浼燱MS");
+                // 鍒ゆ柇Success鐨勫��
+                if (response.Success)
+                {
+                    // 濡傛灉Success涓簍rue锛岃繑鍥為渶瑕佺殑鍊硷紙杩欓噷浠ヨ繑鍥炴暣涓搷搴斿璞′负渚嬶級
+                    return WebResponseContent.Instance.OK();
+                }
+                else
+                {
+                    // 濡傛灉Success涓篺alse锛屾姏鍑哄紓甯稿苟鍖呭惈閿欒淇℃伅
+                    throw new Exception($"鎿嶄綔澶辫触: {response.Message ?? "鏈彁渚涢敊璇俊鎭�"}");
+                }
+                
+            }
+            return WebResponseContent.Instance.OK();
         }
 
         private void ProcessAllocateInboundOrder(Dt_InboundOrder inboundOrder, Dt_InboundOrderDetail inboundOrderDetail)
@@ -839,19 +1069,34 @@
                 if (!validationResult.Status) return validationResult;
 
                 int lastStatus = locationInfo.LocationStatus;
-                locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
-
-                Dt_OutboundOrderDetail outboundOrderDetails = _outboundService.OutboundOrderService.Db.Queryable<Dt_OutboundOrderDetail>()
-                    .Where(x => x.BatchNo == stockInfo.Details.FirstOrDefault().BatchNo)
-                    .First();
-                if (outboundOrderDetails == null) return WebResponseContent.Instance.Error("鏈壘鍒板嚭搴撳崟淇℃伅");
-
+                Dt_Task task1 = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
+                if (task1 == null)
+                {
+                    return WebResponseContent.Instance.Error("鏈壘鍒拌浠诲姟淇℃伅");
+                }
+                ///鐩樼偣鍑哄簱浠诲姟瀹屾垚閫昏緫
+                if ((task.TaskType == TaskTypeEnum.OutInventory.ObjToInt()))
+                {
+                    return OutInventoryCompleted(task, stockInfo, locationInfo);
+                }
                 Dt_OutboundOrder inboundOrder = _outboundService.OutboundOrderService.Db.Queryable<Dt_OutboundOrder>()
-                .Where(x => x.Id == outboundOrderDetails.OrderId)
+                .Where(x => x.OrderNo == task1.OrderNo)
                 .Includes(x => x.Details)
                 .First();
 
                 if (inboundOrder == null) return WebResponseContent.Instance.Error("鏈壘鍒板嚭搴撳崟淇℃伅");
+
+                Dt_OutboundOrderDetail outboundOrderDetails = _outboundService.OutboundOrderService.Db.Queryable<Dt_OutboundOrderDetail>()
+                .Where(x => x.OrderId == inboundOrder.Id && x.BatchNo == stockInfo.Details.FirstOrDefault().BatchNo)
+                .First();
+                if (outboundOrderDetails.LocationName != null && outboundOrderDetails.LocationName != "")
+                {
+                    outboundOrderDetails = _outboundService.OutboundOrderService.Db.Queryable<Dt_OutboundOrderDetail>()
+                .Where(x => x.OrderId == inboundOrder.Id && x.BatchNo == stockInfo.Details.FirstOrDefault().BatchNo && x.LocationName == stockInfo.LocationCode)
+                .First();
+                }
+                if (outboundOrderDetails == null) return WebResponseContent.Instance.Error("鏈壘鍒板嚭搴撳崟淇℃伅");
+
                 // 2. 澶勭悊鍑哄簱璁㈠崟璇︽儏
                 //var outboundOrderDetails = ProcessOutboundOrderDetails(outStockLockInfos);
 
@@ -888,7 +1133,7 @@
 
             if (stockInfo == null) return WebResponseContent.Instance.Error("鏈壘鍒板簱瀛樹俊鎭�");
             if (locationInfo == null) return WebResponseContent.Instance.Error("鏈壘鍒拌揣浣嶄俊鎭�");
-            if (outStockLockInfos == null || outStockLockInfos.Count == 0)
+            if ((outStockLockInfos == null || outStockLockInfos.Count == 0)&& task.TaskType != TaskTypeEnum.OutInventory.ObjToInt())
                 return WebResponseContent.Instance.Error("鏈壘鍒板嚭搴撹鎯呬俊鎭�");
 
             return WebResponseContent.Instance.OK();
@@ -916,7 +1161,7 @@
         //}
 
         private WebResponseContent ExecuteOutboundLogic(Dt_Task task, Dt_StockInfo stockInfo,
-            Dt_LocationInfo locationInfo, Dt_OutboundOrderDetail outboundOrderDetails,Dt_OutboundOrder inboundOrder)
+            Dt_LocationInfo locationInfo, Dt_OutboundOrderDetail outboundOrderDetails, Dt_OutboundOrder inboundOrder)
         {
             try
             {
@@ -927,11 +1172,17 @@
                 _outboundService.OutboundOrderDetailService.Repository.UpdateData(outboundOrderDetails);
 
                 // 鏇存柊搴撳瓨鐘舵��
-                DeleteAndMoveIntoHtStockStatus(stockInfo);
+                AddRetrueOrder(stockInfo, inboundOrder);
 
-                // 鏇存柊璐т綅鐘舵��
-                UpdateLocationStatus(locationInfo);
-
+                // 鍖哄垎鍗曟嵁鏁版嵁鏉ユ簮鏇存柊璐т綅鐘舵��
+                if (inboundOrder.System == null)
+                {
+                    return WebResponseContent.Instance.Error("鍑哄簱鍗曟暟鎹簮涓虹┖");
+                }
+                if (!inboundOrder.System.Equals("SMOM"))
+                {
+                    UpdateLocationStatus(locationInfo);
+                }
                 // 澶勭悊浠诲姟瀹屾垚
                 CompleteTask(task);
 
@@ -939,27 +1190,38 @@
                 AddStatusChangeRecord(task, stockInfo, locationInfo);
 
                 // 鏍规嵁璁㈠崟绫诲瀷澶勭悊涓嶅悓閫昏緫
-                var outDetail = _outboundService.OutboundOrderDetailService.Db.Queryable<Dt_OutboundOrderDetail>()
-                    .Where(x => x.BatchNo == outboundOrderDetails.BatchNo).First();
+
                 var outboundOrder = _outboundService.OutboundOrderService.Db.Queryable<Dt_OutboundOrder>()
-                    .Where(x => x.Id == outDetail.OrderId).Includes(x => x.Details).First();
+                    .Where(x => x.OrderNo == inboundOrder.OrderNo).First();
+                var outDetail = _outboundService.OutboundOrderDetailService.Db.Queryable<Dt_OutboundOrderDetail>()
+                    .Where(x => x.OrderId == outboundOrder.Id && x.BatchNo == outboundOrderDetails.BatchNo).First();
+
+                string path = "http://fr.mankun.com:8080/webroot/decision/view/report?viewlet=fr-report\\SMOM/Product/Produce/OutBoundDetileReport.cpt&op=write&format=pdf";
+                string fullPath = AppDomain.CurrentDomain.BaseDirectory;
+                var url = Path.Combine(fullPath, "wwwroot", "Reports");
+                string savePath = Path.Combine(url, "鏈鍑哄簱.pdf");
 
 
-                if (outboundOrder.OrderStatus == OutboundStatusEnum.鍑哄簱瀹屾垚.ObjToInt())
+                if (outboundOrderDetails.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt() && inboundOrder.System.Equals("ERP"))
+                {
+                    FeedBackOutERP(outboundOrder.OrderNo, outboundOrderDetails.LinId);
+                    //DownloadReport(path, savePath, outboundOrderDetails.Id);
+                    //printTest(savePath);
+                }
+                ///鍗曟嵁瀹屾垚鎺ㄩ�丼MOM绯荤粺
+                if (outboundOrder.OrderStatus == OutboundStatusEnum.鍑哄簱瀹屾垚.ObjToInt() && inboundOrder.System.Equals("SMOM"))
                 {
                     var stockInfoDetail = stockInfo.Details.FirstOrDefault();
-                    //ProcessNormalOutbound(task, stockInfo, outboundOrder, outDetail);
-                    SendNormalOutboundToWMS(task, outboundOrder, stockInfoDetail, outDetail);
+                    ProcessNormalOutbound(task, stockInfo, outboundOrder, outDetail);
+                    //DownloadReport(path, savePath, outboundOrderDetails.Id);
+                    //printTest(savePath);
+                    //SendNormalOutboundToWMS(task, outboundOrder, stockInfoDetail, outDetail);
                 }
 
                 if (outboundOrder.OrderType == 240) // 鐩樼偣鍑哄簱
                 {
                     // 鐩樼偣鍑哄簱鐗规畩澶勭悊閫昏緫
                 }
-                //else // 璋冩嫧鍑哄簱
-                //{
-                //    ProcessAllocateOutbound(task, stockInfo, outboundOrder, outDetail);
-                //}
 
                 _unitOfWorkManage.CommitTran();
                 return WebResponseContent.Instance.OK();
@@ -970,7 +1232,7 @@
                 throw;
             }
         }
-        private void UpdateOutboundOrderDetails(Dt_StockInfo stockInfo, Dt_OutboundOrder inboundOrder,ref Dt_OutboundOrderDetail inboundOrderDetail)
+        private void UpdateOutboundOrderDetails(Dt_StockInfo stockInfo, Dt_OutboundOrder inboundOrder, ref Dt_OutboundOrderDetail inboundOrderDetail)
         {
             int overCount = inboundOrder.Details.Count(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt());
             inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.BatchNo == stockInfo.Details.FirstOrDefault()?.BatchNo);
@@ -1013,7 +1275,8 @@
 
         private void CompleteTask(Dt_Task task)
         {
-            task.TaskStatus = OutTaskStatusEnum.OutFinish.ObjToInt();
+            task.TaskStatus = TaskStatusEnum.Finish.ObjToInt();
+            FeedBackWCSTaskCompleted(task.TaskNum);
             BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
         }
 
@@ -1055,7 +1318,7 @@
             //MoveOutboundDetailToHistory(outDetail);
 
             // 鍙戦�佸嚭搴撲俊鎭埌WMS
-            if (outboundOrder.OrderStatus == OutboundStatusEnum.鍑哄簱瀹屾垚.ObjToInt() && outboundOrder.OrderType == 0)
+            if (outboundOrder.OrderStatus == OutboundStatusEnum.鍑哄簱瀹屾垚.ObjToInt() && outboundOrder.OrderType == 1)
             {
                 SendNormalOutboundToWMS(task, outboundOrder, stockInfoDetail, outDetail);
             }
@@ -1120,21 +1383,21 @@
             _outboundService.OutboundOrderService.DeleteData(outDetail);
         }
 
-        private void SendNormalOutboundToWMS(Dt_Task task, Dt_OutboundOrder outboundOrder,
+        private WebResponseContent SendNormalOutboundToWMS(Dt_Task task, Dt_OutboundOrder outboundOrder,
             Dt_StockInfoDetail stockInfoDetail, Dt_OutboundOrderDetail outDetail)
+        {
+
+            //List<Dt_StockInfo> StockInfos = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.WarehouseId == task.WarehouseId).Includes(x => x.Details).Where(x => x.Details.Any(v => v.BatchNo == outDetail.BatchNo)).ToList();
+            List<Dt_OutStockLockInfo> outStockLockInfos = _outboundService.OutboundStockLockInfoService.Repository.QueryData(x => x.OrderNo == outboundOrder.OrderNo);
+
+            if (outStockLockInfos.Count == 0) throw new Exception("鏈壘鍒板簱瀛樹俊鎭�");
+
+            // 鏋勫缓鍥炰紶鏁版嵁锛屽皢鎵�鏈夊尮閰嶇殑搴撳瓨鏄庣粏鍔犲叆 DetailList
+            var passBack = new HouseoutboundPassBack
             {
-
-                //List<Dt_StockInfo> StockInfos = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.WarehouseId == task.WarehouseId).Includes(x => x.Details).Where(x => x.Details.Any(v => v.BatchNo == outDetail.BatchNo)).ToList();
-                List<Dt_OutStockLockInfo> outStockLockInfos = _outboundService.OutboundStockLockInfoService.Repository.QueryData(x => x.OrderNo == outboundOrder.OrderNo);
-
-                if (outStockLockInfos.Count == 0) throw new Exception("鏈壘鍒板簱瀛樹俊鎭�");
-
-                // 鏋勫缓鍥炰紶鏁版嵁锛屽皢鎵�鏈夊尮閰嶇殑搴撳瓨鏄庣粏鍔犲叆 DetailList
-                var passBack = new HouseoutboundPassBack
-                {
-                    ApiType = "InventoryAllocateController",
-                    Method = "AsrsFinishedStockCount",
-                    Parameters = new List<HouseoutboundPassBack.datas>
+                ApiType = "ShippingOrderController",
+                Method = "AsrsOutboundSO",
+                Parameters = new List<HouseoutboundPassBack.datas>
             {
             new HouseoutboundPassBack.datas
             {
@@ -1174,8 +1437,21 @@
             { "InvOrgId", authResult.InvOrgId }
         };
 
-                HttpHelper.Post<WebResponseContent>(ReceiveWMSTaskin, passBack, "绔嬪簱鍏ュ簱鏁伴噺鍥炰紶WMS");
+                var response = HttpHelper.Post<MomRequestContent>(ReceiveWMSTaskout, passBack, "绔嬪簱鍑哄簱鏁伴噺鍥炰紶WMS");
+                // 鍒ゆ柇Success鐨勫��
+                if (response.Success)
+                {
+                    // 濡傛灉Success涓簍rue锛岃繑鍥為渶瑕佺殑鍊硷紙杩欓噷浠ヨ繑鍥炴暣涓搷搴斿璞′负渚嬶級
+                    return WebResponseContent.Instance.OK();
+                }
+                else
+                {
+                    // 濡傛灉Success涓篺alse锛屾姏鍑哄紓甯稿苟鍖呭惈閿欒淇℃伅
+                    throw new Exception($"鎿嶄綔澶辫触: {response.Message ?? "鏈彁渚涢敊璇俊鎭�"}");
+                }
+
             }
+            return WebResponseContent.Instance.OK();
         }
 
         private void SendAllocateOutboundToWMS(Dt_Task task, Dt_OutboundOrder outboundOrder,
@@ -1243,525 +1519,803 @@
                 App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
         }
 
-        #endregion
-        #endregion
+        private void AddRetrueOrder(Dt_StockInfo stockInfo, Dt_OutboundOrder outboundOrder)
+        {
+            Dt_StockInfoDetail stockInfoDetail = _stockService.StockInfoDetailService.Db.Queryable<Dt_StockInfoDetail>()
+           .Where(x => x.StockId == stockInfo.Id)
+           .First();
+            if (stockInfoDetail == null)
+            {
+                throw new Exception("寤虹珛鍥炲簱鍗曟椂锛屾湭鎵惧埌璇ュ簱瀛樹俊鎭�");
+            }
+            if (outboundOrder.OrderType == OrderTypeEnum.鍙嶆嫞鍑哄簱鍗�.ObjToInt())
+            {
+                Dt_ReturnOrder returnOrder = _returnOrderRepository.QueryFirst(x => x.LPNNo == stockInfo.PalletCode && x.LocationCode == stockInfo.LocationCode && x.OrderStatus == InOrderStatusEnum.鏈紑濮�.ObjToInt());
+                if (returnOrder == null)
+                {
+                    throw new Exception("鍙嶆嫞鍑哄簱鍚庯紝鏈壘鍒板搴斿弽鎷e洖搴撳崟淇℃伅");
+                }
+                stockInfo.LocationCode = "";
+                stockInfo.StockStatus = StockStatusEmun.鍙嶆嫞鍏ュ簱.ObjToInt();
+                stockInfo.Remark = "鍙嶆嫞鍏ュ簱";
+                stockInfoDetail.OutboundQuantity = 0;
+                stockInfoDetail.StockQuantity += returnOrder.OrderQuantity;
+                stockInfoDetail.OrderNo = returnOrder.OrderNo;
+            }
+            else
+            {
+                decimal returnQuantity = stockInfoDetail.StockQuantity - stockInfoDetail.OutboundQuantity;
+                if (returnQuantity > 0)
+                {
+                    Dt_ReturnOrder returnOrder = new Dt_ReturnOrder
+                    {
+                        MaterielCode = stockInfoDetail.MaterielCode,
+                        MaterielName = stockInfoDetail.MaterielName,
+                        BatchNo = stockInfoDetail.BatchNo,
+                        OrderQuantity = returnQuantity,
+                        ReceiptQuantity = returnQuantity,
+                        OrderStatus = InOrderStatusEnum.鏈紑濮�.ObjToInt(),
+                        LinId = stockInfoDetail.LinId,
+                        LPNNo = stockInfo.PalletCode,
+                        Creater = "LK",
+                        CreateDate = DateTime.Now,
+                        OrderType = OrderTypeEnum.浣欐枡鍥炲簱鍗�.ObjToInt(),
+                        System = "WMS"
+                    };
+                    if (outboundOrder.System == "SMOM" && stockInfo.LocationCode != null)
+                    {
+                        returnOrder.LocationCode = stockInfo.LocationCode;
+                    }
+                    _unitOfWorkManage.BeginTran();
+                    _returnOrderRepository.AddData(returnOrder);
+                    stockInfo.LocationCode = "";
+                    stockInfo.StockStatus = StockStatusEmun.浣欐枡閫�搴�.ObjToInt();
+                    stockInfo.Remark = "浣欐枡閫�搴�";
+                    stockInfoDetail.OutboundQuantity = 0;
+                    stockInfoDetail.StockQuantity = returnQuantity;
+                    stockInfoDetail.OrderNo = returnOrder.OrderNo;
+                    _stockService.StockInfoService.Repository.UpdateData(stockInfo);
+                    _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetail);
+                    _unitOfWorkManage.CommitTran();
+                }
+                else
+                {
+                    DeleteAndMoveIntoHtStockStatus(stockInfo);
+                }
+            }
+
+        }
+        /// <summary>
+        /// 鍗曟嵁鏄庣粏鍑哄簱瀹屾垚鍥炶皟ERP(琛ㄥ崟鎻愪氦)
+        /// </summary>
+        /// <param name="outboundOrder"></param>
+        /// <param name="outboundOrderDetail"></param>
+        /// <returns></returns>
+        /// <exception cref="Exception"></exception>
+        public WebResponseContent FeedBackOutERP(string orderNO, string linId)
+        {
+            Dt_OutStockLockInfo outStockLockInfos = _outboundService.OutboundStockLockInfoService.Repository.QueryFirst(x => x.OrderNo == orderNO && x.LinId == linId);
+            if (outStockLockInfos == null)
+            {
+                return WebResponseContent.Instance.Error("鏈壘鍒板嚭搴撳簱瀛樹俊鎭�");
+            }
+            var postContent = new MultipartFormDataContent();
+            postContent.Headers.Add("ContentType", $"multipart/form-data");
+            postContent.Add(new StringContent(outStockLockInfos.LinId), "ids");
+            string result = string.Empty;
+            HttpClient client = null;
+            try
+            {
+                using (client = new HttpClient())
+                {
+                    HttpResponseMessage response = client.PostAsync(ReceiveERPTaskout, postContent)
+                        .ConfigureAwait(false).GetAwaiter().GetResult();
+
+                    // 纭繚鍝嶅簲鎴愬姛
+                    response.EnsureSuccessStatusCode();
+
+                    result = response.Content.ReadAsStringAsync()
+                        .ConfigureAwait(false).GetAwaiter().GetResult();
+                }
+
+                // 鍋囪ERP杩斿洖鎴愬姛鏃惰繑鍥炴垚鍔熷搷搴�
+                return WebResponseContent.Instance.OK(result);
+            }
+            catch (HttpRequestException ex)
+            {
+                // 澶勭悊HTTP璇锋眰鐩稿叧寮傚父
+                return WebResponseContent.Instance.Error($"HTTP璇锋眰閿欒: {ex.Message}");
+            }
+            catch (Exception ex)
+            {
+                // 澶勭悊鍏朵粬寮傚父
+                return WebResponseContent.Instance.Error($"澶勭悊澶辫触: {ex.Message}");
+            }
 
 
+        }
+
+        public WebResponseContent FeedBackInboundERP(string upperOrderNo, string linId)
+        {
+            if (upperOrderNo == null)
+            {
+                return WebResponseContent.Instance.Error("鏈壘鍒板叆搴撳崟淇℃伅");
+            }
+            List<FeedbackInboundOrderERP> feedbackInboundOrderERPs = new List<FeedbackInboundOrderERP>();
+
+            FeedbackInboundOrderERP feedbackInboundOrder = new FeedbackInboundOrderERP()
+            {
+                code = upperOrderNo,
+                itemId = linId,
+                success = true
+
+            };
+            feedbackInboundOrderERPs.Add(feedbackInboundOrder);
+            var response = HttpHelper.Post<WebResponseContent>(InMaterialWarehousingCallback, feedbackInboundOrderERPs, "鍏ュ簱鍗曞畬鎴愬洖浼燛RP");
+            // 鍒ゆ柇Success鐨勫��
+            if (response.Code == 0)
+            {
+                // 濡傛灉Success涓簍rue锛岃繑鍥為渶瑕佺殑鍊硷紙杩欓噷浠ヨ繑鍥炴暣涓搷搴斿璞′负渚嬶級
+                return WebResponseContent.Instance.OK();
+            }
+            else
+            {
+                // 濡傛灉Success涓篺alse锛屾姏鍑哄紓甯稿苟鍖呭惈閿欒淇℃伅
+                throw new Exception($"鎿嶄綔澶辫触: {response.Message ?? "鏈彁渚涢敊璇俊鎭�"}");
+            }
+        }
+        public string DownloadReport(string path, string savePath, int orderId)
+        {
+            // 鏋勫缓瀹屾暣 URL锛岋紙鎶ヨ〃浼犲弬锛�
+            string reportUrl = path + "&orderId=" + orderId;
+
+            try
+            {
+                // 纭繚淇濆瓨鐩綍瀛樺湪
+                string directory = Path.GetDirectoryName(savePath);
+                if (!Directory.Exists(directory))
+                {
+                    Directory.CreateDirectory(directory);
+                }
+
+                string[] files = Directory.GetFiles(directory);
+                // 鍒犻櫎姣忎釜鏂囦欢
+                foreach (string filePath in files)
+                {
+                    File.Delete(filePath);
+                }
+                // 浣跨敤 HttpClient 涓嬭浇鏂囦欢
+                using (var httpClient = new HttpClient())
+                {
+                    // 璁剧疆瓒呮椂鏃堕棿锛堝竼杞姤琛ㄧ敓鎴愬彲鑳介渶瑕佽緝闀挎椂闂达級
+                    httpClient.Timeout = TimeSpan.FromMinutes(5);
+
+                    // 鍙戦�� GET 璇锋眰锛堝悓姝ユ柟寮忥級
+                    using (var response = httpClient.GetAsync(reportUrl, HttpCompletionOption.ResponseHeadersRead).GetAwaiter().GetResult())
+                    {
+                        // 妫�鏌ュ搷搴旂姸鎬�
+                        response.EnsureSuccessStatusCode();
+
+                        // 鑾峰彇鍐呭娴侊紙鍚屾鏂瑰紡锛�
+                        using (var contentStream = response.Content.ReadAsStreamAsync().GetAwaiter().GetResult())
+                        {
+                            // 鍒涘缓鏂囦欢娴�
+                            using (var fileStream = new FileStream(savePath, FileMode.Create, FileAccess.Write, FileShare.None))
+                            {
+                                // 澶嶅埗鍐呭鍒版枃浠讹紙鍚屾鏂瑰紡锛�
+                                contentStream.CopyToAsync(fileStream).GetAwaiter().GetResult();
+                            }
+                        }
+                    }
+                }
+                return savePath;
+
+            }
+            catch (Exception ex)
+            {
+                throw new ValidationException(ex.Message);
+            }
+        }
+
+        public virtual void printTest(string fullPath)
+        {
+            Spire.Pdf.PdfDocument pdf = new PdfDocument();
+            //鏂囦欢鍦板潃
+            pdf.LoadFromFile(fullPath);
+            //鎸囧畾鎵撳嵃鏈轰綅缃�
+            string url = AppSettings.app("PrinterName");
+            pdf.PrintSettings.PrinterName = url;
+            //鎵ц鎵撳嵃
+            pdf.Print();
+            //鍐呭瓨閲婃斁
+            pdf.Dispose();
+
+        }
 
 
-
-        #region
-        //public WebResponseContent InboundTaskCompleted(int taskNum)
-        //{
-        //    try
-        //    {
-        //        Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
-        //        if (task == null)
-        //        {
-        //            return WebResponseContent.Instance.Error($"鏈壘鍒拌浠诲姟");
-        //        }
-        //        if (task.TaskType != TaskTypeEnum.Inbound.ObjToInt())
-        //        {
-        //            return WebResponseContent.Instance.Error($"浠诲姟绫诲瀷閿欒");
-        //        }
-        //        Dt_StockInfo dt_StockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == task.PalletCode).Includes(x => x.Details).First();
-        //        if (dt_StockInfo == null)
-        //        {
-        //            return WebResponseContent.Instance.Error($"鏈壘鍒版墭鐩樺搴旂殑缁勭洏淇℃伅");
-        //        }
-
-        //        if (!string.IsNullOrEmpty(dt_StockInfo.LocationCode))
-        //        {
-        //            return WebResponseContent.Instance.Error($"璇ユ墭鐩樺凡缁戝畾璐т綅");
-        //        }
-
-        //        if (dt_StockInfo.Details == null || dt_StockInfo.Details.Count == 0)
-        //        {
-        //            return WebResponseContent.Instance.Error($"鏈壘鍒拌鎵樼洏搴撳瓨鏄庣粏淇℃伅");
-        //        }
-        //        Dt_LocationInfo dt_LocationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
-        //        if (dt_LocationInfo == null)
-        //        {
-        //            return WebResponseContent.Instance.Error($"鏈壘鍒扮洰鏍囪揣浣嶄俊鎭�");
-        //        }
-
-        //        if (dt_LocationInfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt())
-        //        {
-        //            return WebResponseContent.Instance.Error($"璐т綅鐘舵�佷笉姝g‘");
-        //        }
-        //        int lastStatus = dt_LocationInfo.LocationStatus;
-        //        dt_LocationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
-        //        Dt_Warehouse warehouse = _basicService.WarehouseService.Repository.QueryFirst(x => x.WarehouseId == task.WarehouseId);
-
-        //        dt_StockInfo.LocationCode = dt_LocationInfo.LocationCode;
-
-
-        //        Dt_InboundOrder? inboundOrder = _inboundService.InbounOrderService.Db.Queryable<Dt_InboundOrder>().Where(x => x.InboundOrderNo == dt_StockInfo.Details.FirstOrDefault().OrderNo).Includes(x => x.Details).First();
-        //        Dt_InboundOrderDetail? inboundOrderDetail = null;
-        //        //鍒ゆ柇鍗曟嵁绫诲瀷鏄叆搴撹繕鏄皟鎷ㄥ叆搴撱�傘�傘�傚叆搴�
-        //        if (inboundOrder.OrderType == 0 && inboundOrder != null && dt_StockInfo.StockStatus == StockStatusEmun.鍏ュ簱纭.ObjToInt())
-        //        {
-        //            #region //鍒ゆ柇鍏ュ簱鍗曟嵁鏄庣粏鍙湁鏈�鍚庝竴鏉″畬鎴愭椂鍒犻櫎鍏ュ簱鍗�
-        //            //鏌ヨ鍘熷畬鎴愮殑鍏ュ簱鏄庣粏鏁伴噺
-        //            int overCount = inboundOrder.Details.Where(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()).ToList().Count;
-        //            //鏄庣粏id鏌ヨ
-        //            inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.LinId == dt_StockInfo.Details.FirstOrDefault()?.LinId);
-        //            foreach (var item in dt_StockInfo.Details)
-        //            {
-        //                if (inboundOrderDetail == null)
-        //                {
-        //                    continue;
-        //                }
-        //                inboundOrderDetail.OverInQuantity += item.StockQuantity;
-        //                if (inboundOrderDetail.OverInQuantity == inboundOrderDetail.OrderQuantity)
-        //                {
-        //                    inboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt();
-        //                    overCount += 1;
-        //                }
-        //                else if (inboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt())
-        //                {
-        //                    inboundOrderDetail.OrderDetailStatus = InboundStatusEnum.鍏ュ簱涓�.ObjToInt();
-        //                }
-        //            }
-        //            dt_StockInfo.Details.ForEach(x =>
-        //            {
-        //                x.Status = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt();
-        //            });
-
-        //            _unitOfWorkManage.BeginTran();
-        //            task.TaskStatus = InTaskStatusEnum.InFinish.ObjToInt();
-        //            BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateType.浜哄伐瀹屾垚 : OperateType.鑷姩瀹屾垚);
-
-        //            _basicService.LocationInfoService.Repository.UpdateData(dt_LocationInfo);
-        //            _stockRepository.StockInfoRepository.UpdateData(dt_StockInfo);
-        //            _stockRepository.StockInfoDetailRepository.UpdateData(dt_StockInfo.Details);
-        //            _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(dt_LocationInfo, lastStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum);
-        //            _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(dt_StockInfo, dt_StockInfo.Details, dt_StockInfo.Details.Sum(x => x.StockQuantity), dt_StockInfo.Details.Sum(x => x.StockQuantity), StockChangeType.Inbound, task.TaskNum);
-        //            if (inboundOrder != null)
-        //            {
-        //                _inboundService.InbounOrderService.UpdateData(inboundOrder);
-        //                _inboundService.InboundOrderDetailService.UpdateData(inboundOrderDetail);
-        //            }
-        //            _unitOfWorkManage.CommitTran();
-
-
-
-
-        //            if (inboundOrder.Details.Count == 1)
-        //            {
-        //                var stockInfoDetail = dt_StockInfo.Details.FirstOrDefault();
-
-        //                #region//鍏ュ簱淇℃伅杩斿洖涓婁綅WMS銆傘�傜珛搴撳叆搴撴暟閲忓洖浼�
-        //                HouseInboundPassBack houseInboundPassBack = new HouseInboundPassBack();
-        //                houseInboundPassBack.ApiType = "AsnController";
-        //                houseInboundPassBack.Method = "AsrsGroudingAsn";
-        //                data data = new data();
-        //                data.data1 data1 = new data.data1();
-        //                data1.AsnNo = task.OrderNo;
-        //                data1.InWarehouse = task.Roadway;
-        //                data1.TransactionCode = inboundOrder.TransactionCode;
-        //                data1.InoutType = inboundOrder.OrderType;
-        //                data1.OrderType = inboundOrder.InoutType;
-        //                data.data1.Inbound inbound = new data.data1.Inbound
-        //                {
-        //                    LinId = stockInfoDetail.LinId,
-        //                    MaterielCode = stockInfoDetail.MaterielCode,
-        //                    OrderQuantity = stockInfoDetail.StockQuantity,
-        //                    BatchNo = stockInfoDetail.BatchNo,
-        //                    FinishQty = stockInfoDetail.StockQuantity,
-        //                    LocationName = task.TargetAddress
-        //                };
-        //                data.Value.Add(data1);
-        //                data1.DetailList.Add(inbound);
-        //                houseInboundPassBack.Parameters.Add(data);
-        //                Authentication authentication = new Authentication()
-        //                {
-        //                    ApiType = "AuthenticationController",
-        //                    Parameters = new List<Parameter>
-        //        {
-        //             new Parameter { Value = "LKAdmin"},
-        //             new Parameter { Value = "LKAdmin"},
-        //        },
-        //                    Method = "Login",
-        //                };
-        //                var responses1 = HttpHelper.Post<WebResponseContent>(ReceiveWMSTaskAUT, authentication, "鐧诲綍WMS璐﹀彿");
-        //                var Ticket = responses1.Context["Ticket"].ToString();
-        //                var InvOrgId = responses1.Context["InvOrgId"].ToString();
-        //                if (Ticket != null)
-        //                {
-        //                    houseInboundPassBack.Context = new Dictionary<string, string>();
-        //                    houseInboundPassBack.Context.Add("Ticket", Ticket);
-        //                    houseInboundPassBack.Context.Add("InvOrgId", InvOrgId);
-        //                    var responses = HttpHelper.Post<WebResponseContent>(ReceiveWMSTaskin, houseInboundPassBack, "绔嬪簱鍏ュ簱鏁伴噺鍥炰紶WMS");
-        //                }
-        //                #endregion
-        //            }
-        //        }
-        //        else
-        //        {
-        //            #region //鍒ゆ柇璋冩嫧鍏ュ簱鍗曟嵁鏄庣粏鍙湁鏈�鍚庝竴鏉″畬鎴愭椂鍒犻櫎鍏ュ簱鍗曞苟涓�娆¤繑鍥炲叆搴撴槑缁嗕俊鎭�
-        //            if (inboundOrder.Details.Count == 1)
-        //            {
-        //                List<Dt_StockInfo> StockInfo = _stockService.StockInfoService.Repository.QueryData(x => x.BatchNo == inboundOrderDetail.BatchNo);
-        //                Dt_InboundOrder_Hty inboundOrder_Hty = new Dt_InboundOrder_Hty
-        //                {
-        //                    OrderStatus = inboundOrder.OrderStatus,
-        //                    CreateType = inboundOrder.CreateType,
-        //                    //SourceId = oldOutboundOrder.SourceId,
-        //                    UpperOrderNo = inboundOrder.UpperOrderNo,
-        //                    OrderNo = inboundOrder.OrderNo,
-        //                    //OutWareHouse = inboundOrder.OutWareHouse,
-        //                    TransactionCode = inboundOrder.TransactionCode,
-        //                    InoutType = inboundOrder.InoutType,
-        //                    OrderType = inboundOrder.OrderType,
-        //                    Creater = "WMS",
-        //                    CreateDate = DateTime.Now,
-        //                };
-        //                _inboundOrder_HtyService.AddData(inboundOrder_Hty);
-        //                _inboundService.InbounOrderService.DeleteData(inboundOrder);
-        //                Dt_InboundOrderDetail_Hty dt_InboundOrderDetail_HtyS = new Dt_InboundOrderDetail_Hty
-        //                {
-        //                    OrderId = inboundOrderDetail.OrderId,
-        //                    MaterielCode = inboundOrderDetail.MaterielCode,
-        //                    MaterielName = inboundOrderDetail.MaterielName,
-        //                    BatchNo = inboundOrderDetail.BatchNo,
-        //                    OrderQuantity = inboundOrderDetail.OrderQuantity,
-        //                    ReceiptQuantity = inboundOrderDetail.ReceiptQuantity,
-        //                    OverInQuantity = inboundOrderDetail.OverInQuantity,
-        //                    OrderDetailStatus = inboundOrderDetail.OrderDetailStatus,
-        //                    Creater = "WMS",
-        //                    CreateDate = DateTime.Now,
-        //                };
-        //                _inboundOrderDetail_HtyService.AddData(dt_InboundOrderDetail_HtyS);
-        //                _inboundService.InboundOrderDetailService.DeleteData(inboundOrderDetail);
-        //                #endregion
-        //                #region//璋冩嫧浠诲姟鏁伴噺鍥炰紶WMS
-        //                InventoryAllocate inventoryAllocate = new InventoryAllocate();
-        //                inventoryAllocate.ApiType = "InventoryAllocateController";
-        //                inventoryAllocate.Method = "AsrsFinishedStockCount";
-
-        //                Allocate allocate = new Allocate();
-
-        //                Allocate.data1 data1 = new Allocate.data1();
-        //                data1.No = task.OrderNo;
-        //                data1.InWarehouse = task.Roadway;
-        //                data1.TransactionCode = inboundOrder.TransactionCode;
-        //                data1.InoutType = inboundOrder.OrderType;
-        //                data1.OrderType = inboundOrder.InoutType;
-        //                foreach (var item in StockInfo)
-        //                {
-        //                    Dt_StockInfoDetail detail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.StockId == item.Id);
-        //                    Allocate.data1.Inventory inbound = new Allocate.data1.Inventory();
-        //                    inbound.LinId = detail.LinId;
-        //                    inbound.LPN_No = item.PalletCode;
-        //                    inbound.MaterielCode = detail.MaterielCode;
-        //                    inbound.OrderQuantity = detail.StockQuantity;
-        //                    inbound.BatchNo = detail.BatchNo;
-        //                    inbound.FinishQty = detail.StockQuantity;
-        //                    inbound.LocationName = item.LocationCode;
-        //                    data1.DetailList.Add(inbound);
-        //                }
-        //                allocate.Value.Add(data1);
-        //                inventoryAllocate.Parameters.Add(allocate);
-        //                Authentication authentication = new Authentication()
-        //                {
-        //                    ApiType = "AuthenticationController",
-        //                    Parameters = new List<Parameter>
-        //            {
-        //             new Parameter { Value = "LKAdmin"},
-        //             new Parameter { Value = "LKAdmin"},
-        //            },
-        //                    Method = "Login",
-        //                };
-        //                var responses1 = HttpHelper.Post<WebResponseContent>(ReceiveWMSTaskAUT, authentication, "鐧诲綍WMS璐﹀彿");
-        //                var Ticket = responses1.Context["Ticket"].ToString();
-        //                var InvOrgId = responses1.Context["InvOrgId"].ToString();
-        //                if (Ticket != null)
-        //                {
-        //                    inventoryAllocate.Context = new Dictionary<string, string>();
-        //                    inventoryAllocate.Context.Add("Ticket", Ticket);
-        //                    inventoryAllocate.Context.Add("InvOrgId", InvOrgId);
-        //                    var responses = HttpHelper.Post<WebResponseContent>(ReceiveWMSTaskAllocatein, inventoryAllocate, "璋冩嫧鍏ュ簱鏁伴噺鍥炰紶WMS");
-        //                }
-        //            }
-        //            #endregion
-        //            Dt_InboundOrderDetail_Hty dt_InboundOrderDetail_Hty = new Dt_InboundOrderDetail_Hty
-        //            {
-        //                OrderId = inboundOrderDetail.OrderId,
-        //                MaterielCode = inboundOrderDetail.MaterielCode,
-        //                MaterielName = inboundOrderDetail.MaterielName,
-        //                BatchNo = inboundOrderDetail.BatchNo,
-        //                OrderQuantity = inboundOrderDetail.OrderQuantity,
-        //                ReceiptQuantity = inboundOrderDetail.ReceiptQuantity,
-        //                OverInQuantity = inboundOrderDetail.OverInQuantity,
-        //                OrderDetailStatus = inboundOrderDetail.OrderDetailStatus,
-        //                Creater = "WMS",
-        //                CreateDate = DateTime.Now,
-        //            };
-        //            _inboundOrderDetail_HtyService.AddData(dt_InboundOrderDetail_Hty);
-        //            _inboundService.InboundOrderDetailService.DeleteData(inboundOrderDetail);
-        //        }
-        //        return WebResponseContent.Instance.OK();
-        //    }
-        //    catch (Exception ex)
-        //    {
-        //        _unitOfWorkManage.RollbackTran();
-        //        return WebResponseContent.Instance.Error(ex.Message);
-        //    }
-        //}
-        #endregion
-        #region
-        //public WebResponseContent OutboundTaskCompleted(int taskNum)
-        //{
-        //    try
-        //    {
-        //        Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
-        //        if (task == null)
-        //        {
-        //            return WebResponseContent.Instance.Error($"鏈壘鍒颁换鍔′俊鎭�");
-        //        }
-
-        //        Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);
-
-        //        Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress);
-        //        if (stockInfo == null)
-        //        {
-        //            return WebResponseContent.Instance.Error($"鏈壘鍒板簱瀛樹俊鎭�");
-        //        }
-        //        if (locationInfo == null)
-        //        {
-        //            return WebResponseContent.Instance.Error($"鏈壘鍒拌揣浣嶄俊鎭�");
-        //        }
-
-        //        List<Dt_OutStockLockInfo> outStockLockInfos = _outboundService.OutboundStockLockInfoService.Repository.QueryData(x => x.TaskNum == taskNum);
-        //        if (outStockLockInfos == null || outStockLockInfos.Count == 0)
-        //        {
-        //            return WebResponseContent.Instance.Error($"鏈壘鍒板嚭搴撹鎯呬俊鎭�");
-        //        }
-
-        //        List<Dt_OutboundOrderDetail> outboundOrderDetails = new List<Dt_OutboundOrderDetail>();
-        //        for (int i = 0; i < outStockLockInfos.Count; i++)
-        //        {
-        //            Dt_OutboundOrderDetail outboundOrderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.Id == outStockLockInfos[i].OrderDetailId);
-        //            if (outboundOrderDetail != null)
-        //            {
-        //                outboundOrderDetail.OverOutQuantity = outboundOrderDetail.LockQuantity;
-        //                if (outboundOrderDetail.LockQuantity == outboundOrderDetail.OrderQuantity)
-        //                {
-        //                    outboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt();
-        //                }
-        //                outboundOrderDetails.Add(outboundOrderDetail);
-        //            }
-        //        }
-
-        //        _unitOfWorkManage.BeginTran();
-        //        _outboundService.OutboundOrderDetailService.Repository.UpdateData(outboundOrderDetails);
-
-        //        stockInfo.LocationCode = locationInfo.LocationCode;
-        //        stockInfo.StockStatus = StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt();
-        //        _stockService.StockInfoService.Repository.UpdateData(stockInfo);
-
-        //        int beforeStatus = locationInfo.LocationStatus;
-        //        locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
-        //        _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
-        //        BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
-
-        //        _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Outbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum);
-        //        _unitOfWorkManage.CommitTran();
-        //        Dt_StockInfoDetail stockInfoDetail = _stockRepository.StockInfoDetailRepository.Db.Queryable<Dt_StockInfoDetail>().Where(x => x.StockId == stockInfo.Id).First();
-        //        Dt_OutboundOrderDetail outDetail = _outboundService.OutboundOrderDetailService.Db.Queryable<Dt_OutboundOrderDetail>().Where(x => x.LPNNo == stockInfo.PalletCode).First();
-        //        Dt_OutboundOrder outboundOrder = _outboundService.OutboundOrderService.Db.Queryable<Dt_OutboundOrder>().Where(x => x.Id == outDetail.OrderId).Includes(x => x.Details).First();
-        //        //鍒ゆ柇鍗曟嵁绫诲瀷鏄嚭搴撹繕鏄皟鎷ㄥ嚭搴撱�傘�傘�傚嚭搴�
-        //        if (outboundOrder.OrderType == 1)
-        //        {
-        //            #region //鍒ゆ柇鍑哄簱鍗曟嵁鏄庣粏鍙湁鏈�鍚庝竴鏉″畬鎴愭椂鍒犻櫎鍑哄簱鍗�
-        //            if (outboundOrder.Details.Count == 1)
-        //            {
-        //                Dt_OutboundOrder_Hty inboundOrder_Hty = new Dt_OutboundOrder_Hty
-        //                {
-        //                    OrderStatus = outboundOrder.OrderStatus,
-        //                    CreateType = outboundOrder.CreateType,
-        //                    //SourceId = oldOutboundOrder.SourceId,
-        //                    UpperOrderNo = outboundOrder.UpperOrderNo,
-        //                    OrderNo = outboundOrder.OrderNo,
-        //                    OutWareHouse = outboundOrder.OutWareHouse,
-        //                    TransactionCode = outboundOrder.TransactionCode,
-        //                    InoutType = outboundOrder.InoutType,
-        //                    OrderType = outboundOrder.OrderType,
-        //                    Creater = "WMS",
-        //                    CreateDate = DateTime.Now,
-        //                };
-        //                _outboundOrder_HtyService.AddData(inboundOrder_Hty);
-        //                _outboundService.OutboundOrderService.DeleteData(outboundOrder);
-        //            }
-        //            Dt_OutboundOrderDetail_Hty dt_InboundOrderDetail_Hty = new Dt_OutboundOrderDetail_Hty
-        //            {
-        //                OrderId = outDetail.OrderId,
-        //                MaterielCode = outDetail.MaterielCode,
-        //                MaterielName = outDetail.MaterielName,
-        //                BatchNo = outDetail.BatchNo,
-        //                OrderQuantity = outDetail.OrderQuantity,
-        //                //ReceiptQuantity = outDetail.ReceiptQuantity,
-        //                //OverInQuantity = outDetail.OverInQuantity,
-        //                OrderDetailStatus = outDetail.OrderDetailStatus,
-        //                Creater = "WMS",
-        //                CreateDate = DateTime.Now,
-        //            };
-        //            _outboundOrderDetail_HtyService.AddData(dt_InboundOrderDetail_Hty);
-        //            _outboundService.OutboundOrderService.DeleteData(outDetail);
-        //            #endregion
-        //            #region//鍑哄簱淇℃伅杩斿洖涓婁綅WMS銆傘�傘�傜珛搴撳嚭搴撴暟閲忓洖浼�
-        //            HouseoutboundPassBack houseInboundPassBack = new HouseoutboundPassBack();
-        //            houseInboundPassBack.ApiType = "ShippingOrderController";
-        //            houseInboundPassBack.Method = "AsrsOutboundSO";
-        //            datas datas = new datas();
-        //            datas.data1 data1 = new datas.data1();
-        //            data1.No = outboundOrder.OrderNo;
-        //            data1.OutWareHouse = task.Roadway;
-        //            data1.TransactionCode = outboundOrder.TransactionCode;
-        //            data1.InoutType = outboundOrder.OrderType;
-        //            data1.OrderType = outboundOrder.InoutType;
-
-        //            datas.data1.Inbound inbound = new datas.data1.Inbound();
-        //            inbound.LinId = outDetail.LinId;
-        //            inbound.LPN_No = task.PalletCode;
-        //            inbound.MaterielCode = stockInfoDetail.MaterielCode;
-        //            inbound.OrderQuantity = stockInfoDetail.OutboundQuantity;
-        //            inbound.BatchNo = stockInfoDetail.BatchNo;
-        //            inbound.FinishQty = stockInfoDetail.OutboundQuantity;
-        //            inbound.LocationName = task.SourceAddress;
-        //            datas.Value.Add(data1);
-        //            data1.DetailList.Add(inbound);
-        //            houseInboundPassBack.Parameters.Add(datas);
-        //            Authentication authentication = new Authentication()
-        //            {
-        //                ApiType = "AuthenticationController",
-        //                Parameters = new List<Parameter>
-        //            {
-        //             new Parameter { Value = "LKAdmin"},
-        //             new Parameter { Value = "LKAdmin"},
-        //            },
-        //                Method = "Login",
-        //            };
-        //            var responses1 = HttpHelper.Post<WebResponseContent>(ReceiveWMSTaskAUT, authentication, "鐧诲綍WMS璐﹀彿");
-        //            var Ticket = responses1.Context["Ticket"].ToString();
-        //            var InvOrgId = responses1.Context["InvOrgId"].ToString();
-        //            if (Ticket != null)
-        //            {
-        //                houseInboundPassBack.Context = new Dictionary<string, string>();
-        //                houseInboundPassBack.Context.Add("Ticket", Ticket);
-        //                houseInboundPassBack.Context.Add("InvOrgId", InvOrgId);
-        //                var responses = HttpHelper.Post<WebResponseContent>(ReceiveWMSTaskout, houseInboundPassBack, "绔嬪簱鍑哄簱鏁伴噺鍥炰紶WMS");
-        //            }
-        //            #endregion
-        //            //鍒犻櫎搴撳瓨淇℃伅
-        //            _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
-        //            _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(stockInfo.Details, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
-        //        }
-        //        else if (outboundOrder.OrderType == 240)
-        //        {
-        //            //鐩樼偣鍑哄簱浠诲姟瀹屾垚銆併�併�併�併�併�併�併�併�佷笉鑳藉垹闄ゅ簱瀛樼瓑閫昏緫
-        //        }
-        //        else
-        //        {
-
-        //            List<Dt_StockInfo> StockInfo = _stockService.StockInfoService.Repository.QueryData(x => x.BatchNo == outDetail.BatchNo);
-        //            if (outboundOrder.Details.Count == 1)
-        //            {
-        //                Dt_OutboundOrder_Hty inboundOrder_Hty = new Dt_OutboundOrder_Hty
-        //                {
-        //                    OrderStatus = outboundOrder.OrderStatus,
-        //                    CreateType = outboundOrder.CreateType,
-        //                    //SourceId = oldOutboundOrder.SourceId,
-        //                    UpperOrderNo = outboundOrder.UpperOrderNo,
-        //                    OrderNo = outboundOrder.OrderNo,
-        //                    OutWareHouse = outboundOrder.OutWareHouse,
-        //                    TransactionCode = outboundOrder.TransactionCode,
-        //                    InoutType = outboundOrder.InoutType,
-        //                    OrderType = outboundOrder.OrderType,
-        //                    Creater = "WMS",
-        //                    CreateDate = DateTime.Now,
-        //                };
-        //                _outboundOrder_HtyService.AddData(inboundOrder_Hty);
-        //                _outboundService.OutboundOrderService.DeleteData(outboundOrder);
-        //            }
-        //            Dt_OutboundOrderDetail_Hty dt_InboundOrderDetail_Hty = new Dt_OutboundOrderDetail_Hty
-        //            {
-        //                OrderId = outDetail.OrderId,
-        //                MaterielCode = outDetail.MaterielCode,
-        //                MaterielName = outDetail.MaterielName,
-        //                BatchNo = outDetail.BatchNo,
-        //                OrderQuantity = outDetail.OrderQuantity,
-        //                //ReceiptQuantity = outDetail.ReceiptQuantity,
-        //                //OverInQuantity = outDetail.OverInQuantity,
-        //                OrderDetailStatus = outDetail.OrderDetailStatus,
-        //                Creater = "WMS",
-        //                CreateDate = DateTime.Now,
-        //            };
-        //            _outboundOrderDetail_HtyService.AddData(dt_InboundOrderDetail_Hty);
-        //            _outboundService.OutboundOrderService.DeleteData(outDetail);
-
-        //            InventoryAllocate inventoryAllocate = new InventoryAllocate();
-        //            inventoryAllocate.ApiType = "InventoryAllocateController";
-        //            inventoryAllocate.Method = "AsrsFinishedStockCount";
-
-        //            Allocate allocate = new Allocate();
-
-        //            Allocate.data1 data1 = new Allocate.data1();
-        //            data1.No = outboundOrder.OrderNo;
-        //            data1.InWarehouse = task.Roadway;
-        //            data1.TransactionCode = outboundOrder.TransactionCode;
-        //            data1.InoutType = outboundOrder.OrderType;
-        //            data1.OrderType = outboundOrder.InoutType;
-
-        //            foreach (var item in StockInfo)
-        //            {
-        //                Dt_StockInfoDetail detail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.StockId == item.Id);
-        //                Allocate.data1.Inventory inbound = new Allocate.data1.Inventory();
-        //                inbound.LinId = outDetail.LinId;
-        //                inbound.LPN_No = item.PalletCode;
-        //                inbound.MaterielCode = detail.MaterielCode;
-        //                inbound.OrderQuantity = detail.OutboundQuantity;
-        //                inbound.BatchNo = detail.BatchNo;
-        //                inbound.FinishQty = detail.OutboundQuantity;
-        //                inbound.LocationName = task.SourceAddress;
-        //                data1.DetailList.Add(inbound);
-        //            }
-
-
-        //            allocate.Value.Add(data1);
-        //            inventoryAllocate.Parameters.Add(allocate);
-        //            Authentication authentication = new Authentication()
-        //            {
-        //                ApiType = "AuthenticationController",
-        //                Parameters = new List<Parameter>
-        //            {
-        //             new Parameter { Value = "LKAdmin"},
-        //             new Parameter { Value = "LKAdmin"},
-        //            },
-        //                Method = "Login",
-        //            };
-        //            var responses1 = HttpHelper.Post<WebResponseContent>(ReceiveWMSTaskAUT, authentication, "鐧诲綍WMS璐﹀彿");
-        //            var Ticket = responses1.Context["Ticket"].ToString();
-        //            var InvOrgId = responses1.Context["InvOrgId"].ToString();
-        //            if (Ticket != null)
-        //            {
-        //                inventoryAllocate.Context = new Dictionary<string, string>();
-        //                inventoryAllocate.Context.Add("Ticket", Ticket);
-        //                inventoryAllocate.Context.Add("InvOrgId", InvOrgId);
-        //                var responses = HttpHelper.Post<WebResponseContent>(ReceiveWMSTaskAllocatein, inventoryAllocate, "璋冩嫧鍑哄簱鏁伴噺鍥炰紶WMS");
-        //            }
-        //            _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
-        //            _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(stockInfo.Details, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
-        //        }
-        //        return WebResponseContent.Instance.OK();
-        //    }
-        //    catch (Exception ex)
-        //    {
-        //        _unitOfWorkManage.RollbackTran();
-        //        return WebResponseContent.Instance.Error(ex.Message);
-        //    }
-        //}
-        #endregion
+        /// <summary>
+        /// 鐩樼偣鍑哄簱瀹屾垚
+        /// </summary>
+        public WebResponseContent OutInventoryCompleted(Dt_Task task, Dt_StockInfo stockInfo, Dt_LocationInfo locationInfo)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                //鑾峰彇瀵瑰簲鐩樼偣鍗�
+                Dt_TakeStockOrder takeStockOrder = _inboundRepository.TakeStockOrderRepository.Db.Queryable<Dt_TakeStockOrder>().Where(x => x.OrderNo == task.OrderNo).Includes(x => x.Details).First();
+                if (takeStockOrder == null)
+                {
+                    return content.Error($"鐩樼偣鍗晎task.OrderNo}涓嶅瓨鍦�");
+                }
+                if (takeStockOrder.TakeStockStatus != TakeStockStatusEnum.鐩樼偣涓�.ObjToInt())
+                {
+                    return content.Error($"鐩樼偣鍗晎task.OrderNo}鐩樼偣宸插畬鎴愭垨鏈紑濮�");
+                }
+                if (stockInfo.StockStatus != StockStatusEmun.鍑哄簱閿佸畾.ObjToInt())
+                {
+                    return content.Error($"{stockInfo.PalletCode}搴撳瓨鐘舵�佷笉姝g‘");
+                }
+                if (locationInfo.LocationStatus != LocationStatusEnum.Lock.ObjToInt())
+                {
+                    return content.Error($"{locationInfo.LocationCode}璐т綅鐘舵�佷笉姝g‘");
+                }
+                //鏍规嵁浠诲姟鎵樼洏鏌ョ洏鐐规槑缁�
+                Dt_TakeStockOrderDetail? takeStockOrderDetail = takeStockOrder.Details.FirstOrDefault(x => x.TakePalletCode == stockInfo.PalletCode);
+                if (takeStockOrderDetail == null)
+                {
+                    return content.Error($"{stockInfo.PalletCode}鏈壘鍒板搴旂洏鐐规槑缁�");
+                }
+                if (takeStockOrderDetail.TakeDetalStatus != TakeStockDetailStatusEnum.鐩樼偣鍑哄簱涓�.ObjToInt())
+                {
+                    return content.Error($"{stockInfo.PalletCode}鐩樼偣鏄庣粏鐘舵�佷笉姝g‘");
+                }
+                takeStockOrderDetail.TakeDetalStatus = TakeStockDetailStatusEnum.鐩樼偣鍑哄簱瀹屾垚.ObjToInt();
+                stockInfo.StockStatus = StockStatusEmun.鐩樼偣鍑哄簱瀹屾垚.ObjToInt();
+                stockInfo.Details.ForEach(x =>
+                {
+                    x.Status = StockStatusEmun.鐩樼偣鍑哄簱瀹屾垚.ObjToInt();
+                });
+                stockInfo.LocationCode = "";
+                task.TaskStatus = TaskStatusEnum.Finish.ObjToInt();
+                int beforeStatus = locationInfo.LocationStatus;
+                locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
+                _unitOfWorkManage.BeginTran();
+                //璐т綅鍙樺姩璁板綍
+                _basicService.LocationInfoService.UpdateData(locationInfo);
+                _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, LocationStatusEnum.Free.ObjToInt(), LocationChangeType.OutboundCompleted.ObjToInt(), takeStockOrder?.OrderNo ?? "", task.TaskNum);
+                _inboundRepository.TakeStockOrderDetailRepository.UpdateData(takeStockOrderDetail);
+                _stockRepository.StockInfoRepository.UpdateData(stockInfo);
+                _stockRepository.StockInfoDetailRepository.UpdateData(stockInfo.Details);
+                BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
+                _unitOfWorkManage.CommitTran();
+                content.OK();
+            }
+            catch (Exception ex)
+            {
+                _unitOfWorkManage.RollbackTran();
+                content.Error(ex.Message);
+            }
+            return content;
+        }
     }
+    #endregion
+    #endregion
+
+
+
+
+
+    #region
+    //public WebResponseContent InboundTaskCompleted(int taskNum)
+    //{
+    //    try
+    //    {
+    //        Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
+    //        if (task == null)
+    //        {
+    //            return WebResponseContent.Instance.Error($"鏈壘鍒拌浠诲姟");
+    //        }
+    //        if (task.TaskType != TaskTypeEnum.Inbound.ObjToInt())
+    //        {
+    //            return WebResponseContent.Instance.Error($"浠诲姟绫诲瀷閿欒");
+    //        }
+    //        Dt_StockInfo dt_StockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == task.PalletCode).Includes(x => x.Details).First();
+    //        if (dt_StockInfo == null)
+    //        {
+    //            return WebResponseContent.Instance.Error($"鏈壘鍒版墭鐩樺搴旂殑缁勭洏淇℃伅");
+    //        }
+
+    //        if (!string.IsNullOrEmpty(dt_StockInfo.LocationCode))
+    //        {
+    //            return WebResponseContent.Instance.Error($"璇ユ墭鐩樺凡缁戝畾璐т綅");
+    //        }
+
+    //        if (dt_StockInfo.Details == null || dt_StockInfo.Details.Count == 0)
+    //        {
+    //            return WebResponseContent.Instance.Error($"鏈壘鍒拌鎵樼洏搴撳瓨鏄庣粏淇℃伅");
+    //        }
+    //        Dt_LocationInfo dt_LocationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
+    //        if (dt_LocationInfo == null)
+    //        {
+    //            return WebResponseContent.Instance.Error($"鏈壘鍒扮洰鏍囪揣浣嶄俊鎭�");
+    //        }
+
+    //        if (dt_LocationInfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt())
+    //        {
+    //            return WebResponseContent.Instance.Error($"璐т綅鐘舵�佷笉姝g‘");
+    //        }
+    //        int lastStatus = dt_LocationInfo.LocationStatus;
+    //        dt_LocationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
+    //        Dt_Warehouse warehouse = _basicService.WarehouseService.Repository.QueryFirst(x => x.WarehouseId == task.WarehouseId);
+
+    //        dt_StockInfo.LocationCode = dt_LocationInfo.LocationCode;
+
+
+    //        Dt_InboundOrder? inboundOrder = _inboundService.InbounOrderService.Db.Queryable<Dt_InboundOrder>().Where(x => x.InboundOrderNo == dt_StockInfo.Details.FirstOrDefault().OrderNo).Includes(x => x.Details).First();
+    //        Dt_InboundOrderDetail? inboundOrderDetail = null;
+    //        //鍒ゆ柇鍗曟嵁绫诲瀷鏄叆搴撹繕鏄皟鎷ㄥ叆搴撱�傘�傘�傚叆搴�
+    //        if (inboundOrder.OrderType == 0 && inboundOrder != null && dt_StockInfo.StockStatus == StockStatusEmun.鍏ュ簱纭.ObjToInt())
+    //        {
+    //            #region //鍒ゆ柇鍏ュ簱鍗曟嵁鏄庣粏鍙湁鏈�鍚庝竴鏉″畬鎴愭椂鍒犻櫎鍏ュ簱鍗�
+    //            //鏌ヨ鍘熷畬鎴愮殑鍏ュ簱鏄庣粏鏁伴噺
+    //            int overCount = inboundOrder.Details.Where(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()).ToList().Count;
+    //            //鏄庣粏id鏌ヨ
+    //            inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.LinId == dt_StockInfo.Details.FirstOrDefault()?.LinId);
+    //            foreach (var item in dt_StockInfo.Details)
+    //            {
+    //                if (inboundOrderDetail == null)
+    //                {
+    //                    continue;
+    //                }
+    //                inboundOrderDetail.OverInQuantity += item.StockQuantity;
+    //                if (inboundOrderDetail.OverInQuantity == inboundOrderDetail.OrderQuantity)
+    //                {
+    //                    inboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt();
+    //                    overCount += 1;
+    //                }
+    //                else if (inboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt())
+    //                {
+    //                    inboundOrderDetail.OrderDetailStatus = InboundStatusEnum.鍏ュ簱涓�.ObjToInt();
+    //                }
+    //            }
+    //            dt_StockInfo.Details.ForEach(x =>
+    //            {
+    //                x.Status = StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt();
+    //            });
+
+    //            _unitOfWorkManage.BeginTran();
+    //            task.TaskStatus = InTaskStatusEnum.InFinish.ObjToInt();
+    //            BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateType.浜哄伐瀹屾垚 : OperateType.鑷姩瀹屾垚);
+
+    //            _basicService.LocationInfoService.Repository.UpdateData(dt_LocationInfo);
+    //            _stockRepository.StockInfoRepository.UpdateData(dt_StockInfo);
+    //            _stockRepository.StockInfoDetailRepository.UpdateData(dt_StockInfo.Details);
+    //            _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(dt_LocationInfo, lastStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum);
+    //            _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(dt_StockInfo, dt_StockInfo.Details, dt_StockInfo.Details.Sum(x => x.StockQuantity), dt_StockInfo.Details.Sum(x => x.StockQuantity), StockChangeType.Inbound, task.TaskNum);
+    //            if (inboundOrder != null)
+    //            {
+    //                _inboundService.InbounOrderService.UpdateData(inboundOrder);
+    //                _inboundService.InboundOrderDetailService.UpdateData(inboundOrderDetail);
+    //            }
+    //            _unitOfWorkManage.CommitTran();
+
+
+
+
+    //            if (inboundOrder.Details.Count == 1)
+    //            {
+    //                var stockInfoDetail = dt_StockInfo.Details.FirstOrDefault();
+
+    //                #region//鍏ュ簱淇℃伅杩斿洖涓婁綅WMS銆傘�傜珛搴撳叆搴撴暟閲忓洖浼�
+    //                HouseInboundPassBack houseInboundPassBack = new HouseInboundPassBack();
+    //                houseInboundPassBack.ApiType = "AsnController";
+    //                houseInboundPassBack.Method = "AsrsGroudingAsn";
+    //                data data = new data();
+    //                data.data1 data1 = new data.data1();
+    //                data1.AsnNo = task.OrderNo;
+    //                data1.InWarehouse = task.Roadway;
+    //                data1.TransactionCode = inboundOrder.TransactionCode;
+    //                data1.InoutType = inboundOrder.OrderType;
+    //                data1.OrderType = inboundOrder.InoutType;
+    //                data.data1.Inbound inbound = new data.data1.Inbound
+    //                {
+    //                    LinId = stockInfoDetail.LinId,
+    //                    MaterielCode = stockInfoDetail.MaterielCode,
+    //                    OrderQuantity = stockInfoDetail.StockQuantity,
+    //                    BatchNo = stockInfoDetail.BatchNo,
+    //                    FinishQty = stockInfoDetail.StockQuantity,
+    //                    LocationName = task.TargetAddress
+    //                };
+    //                data.Value.Add(data1);
+    //                data1.DetailList.Add(inbound);
+    //                houseInboundPassBack.Parameters.Add(data);
+    //                Authentication authentication = new Authentication()
+    //                {
+    //                    ApiType = "AuthenticationController",
+    //                    Parameters = new List<Parameter>
+    //        {
+    //             new Parameter { Value = "LKAdmin"},
+    //             new Parameter { Value = "LKAdmin"},
+    //        },
+    //                    Method = "Login",
+    //                };
+    //                var responses1 = HttpHelper.Post<WebResponseContent>(ReceiveWMSTaskAUT, authentication, "鐧诲綍WMS璐﹀彿");
+    //                var Ticket = responses1.Context["Ticket"].ToString();
+    //                var InvOrgId = responses1.Context["InvOrgId"].ToString();
+    //                if (Ticket != null)
+    //                {
+    //                    houseInboundPassBack.Context = new Dictionary<string, string>();
+    //                    houseInboundPassBack.Context.Add("Ticket", Ticket);
+    //                    houseInboundPassBack.Context.Add("InvOrgId", InvOrgId);
+    //                    var responses = HttpHelper.Post<WebResponseContent>(ReceiveWMSTaskin, houseInboundPassBack, "绔嬪簱鍏ュ簱鏁伴噺鍥炰紶WMS");
+    //                }
+    //                #endregion
+    //            }
+    //        }
+    //        else
+    //        {
+    //            #region //鍒ゆ柇璋冩嫧鍏ュ簱鍗曟嵁鏄庣粏鍙湁鏈�鍚庝竴鏉″畬鎴愭椂鍒犻櫎鍏ュ簱鍗曞苟涓�娆¤繑鍥炲叆搴撴槑缁嗕俊鎭�
+    //            if (inboundOrder.Details.Count == 1)
+    //            {
+    //                List<Dt_StockInfo> StockInfo = _stockService.StockInfoService.Repository.QueryData(x => x.BatchNo == inboundOrderDetail.BatchNo);
+    //                Dt_InboundOrder_Hty inboundOrder_Hty = new Dt_InboundOrder_Hty
+    //                {
+    //                    OrderStatus = inboundOrder.OrderStatus,
+    //                    CreateType = inboundOrder.CreateType,
+    //                    //SourceId = oldOutboundOrder.SourceId,
+    //                    UpperOrderNo = inboundOrder.UpperOrderNo,
+    //                    OrderNo = inboundOrder.OrderNo,
+    //                    //OutWareHouse = inboundOrder.OutWareHouse,
+    //                    TransactionCode = inboundOrder.TransactionCode,
+    //                    InoutType = inboundOrder.InoutType,
+    //                    OrderType = inboundOrder.OrderType,
+    //                    Creater = "WMS",
+    //                    CreateDate = DateTime.Now,
+    //                };
+    //                _inboundOrder_HtyService.AddData(inboundOrder_Hty);
+    //                _inboundService.InbounOrderService.DeleteData(inboundOrder);
+    //                Dt_InboundOrderDetail_Hty dt_InboundOrderDetail_HtyS = new Dt_InboundOrderDetail_Hty
+    //                {
+    //                    OrderId = inboundOrderDetail.OrderId,
+    //                    MaterielCode = inboundOrderDetail.MaterielCode,
+    //                    MaterielName = inboundOrderDetail.MaterielName,
+    //                    BatchNo = inboundOrderDetail.BatchNo,
+    //                    OrderQuantity = inboundOrderDetail.OrderQuantity,
+    //                    ReceiptQuantity = inboundOrderDetail.ReceiptQuantity,
+    //                    OverInQuantity = inboundOrderDetail.OverInQuantity,
+    //                    OrderDetailStatus = inboundOrderDetail.OrderDetailStatus,
+    //                    Creater = "WMS",
+    //                    CreateDate = DateTime.Now,
+    //                };
+    //                _inboundOrderDetail_HtyService.AddData(dt_InboundOrderDetail_HtyS);
+    //                _inboundService.InboundOrderDetailService.DeleteData(inboundOrderDetail);
+    //                #endregion
+    //                #region//璋冩嫧浠诲姟鏁伴噺鍥炰紶WMS
+    //                InventoryAllocate inventoryAllocate = new InventoryAllocate();
+    //                inventoryAllocate.ApiType = "InventoryAllocateController";
+    //                inventoryAllocate.Method = "AsrsFinishedStockCount";
+
+    //                Allocate allocate = new Allocate();
+
+    //                Allocate.data1 data1 = new Allocate.data1();
+    //                data1.No = task.OrderNo;
+    //                data1.InWarehouse = task.Roadway;
+    //                data1.TransactionCode = inboundOrder.TransactionCode;
+    //                data1.InoutType = inboundOrder.OrderType;
+    //                data1.OrderType = inboundOrder.InoutType;
+    //                foreach (var item in StockInfo)
+    //                {
+    //                    Dt_StockInfoDetail detail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.StockId == item.Id);
+    //                    Allocate.data1.Inventory inbound = new Allocate.data1.Inventory();
+    //                    inbound.LinId = detail.LinId;
+    //                    inbound.LPN_No = item.PalletCode;
+    //                    inbound.MaterielCode = detail.MaterielCode;
+    //                    inbound.OrderQuantity = detail.StockQuantity;
+    //                    inbound.BatchNo = detail.BatchNo;
+    //                    inbound.FinishQty = detail.StockQuantity;
+    //                    inbound.LocationName = item.LocationCode;
+    //                    data1.DetailList.Add(inbound);
+    //                }
+    //                allocate.Value.Add(data1);
+    //                inventoryAllocate.Parameters.Add(allocate);
+    //                Authentication authentication = new Authentication()
+    //                {
+    //                    ApiType = "AuthenticationController",
+    //                    Parameters = new List<Parameter>
+    //            {
+    //             new Parameter { Value = "LKAdmin"},
+    //             new Parameter { Value = "LKAdmin"},
+    //            },
+    //                    Method = "Login",
+    //                };
+    //                var responses1 = HttpHelper.Post<WebResponseContent>(ReceiveWMSTaskAUT, authentication, "鐧诲綍WMS璐﹀彿");
+    //                var Ticket = responses1.Context["Ticket"].ToString();
+    //                var InvOrgId = responses1.Context["InvOrgId"].ToString();
+    //                if (Ticket != null)
+    //                {
+    //                    inventoryAllocate.Context = new Dictionary<string, string>();
+    //                    inventoryAllocate.Context.Add("Ticket", Ticket);
+    //                    inventoryAllocate.Context.Add("InvOrgId", InvOrgId);
+    //                    var responses = HttpHelper.Post<WebResponseContent>(ReceiveWMSTaskAllocatein, inventoryAllocate, "璋冩嫧鍏ュ簱鏁伴噺鍥炰紶WMS");
+    //                }
+    //            }
+    //            #endregion
+    //            Dt_InboundOrderDetail_Hty dt_InboundOrderDetail_Hty = new Dt_InboundOrderDetail_Hty
+    //            {
+    //                OrderId = inboundOrderDetail.OrderId,
+    //                MaterielCode = inboundOrderDetail.MaterielCode,
+    //                MaterielName = inboundOrderDetail.MaterielName,
+    //                BatchNo = inboundOrderDetail.BatchNo,
+    //                OrderQuantity = inboundOrderDetail.OrderQuantity,
+    //                ReceiptQuantity = inboundOrderDetail.ReceiptQuantity,
+    //                OverInQuantity = inboundOrderDetail.OverInQuantity,
+    //                OrderDetailStatus = inboundOrderDetail.OrderDetailStatus,
+    //                Creater = "WMS",
+    //                CreateDate = DateTime.Now,
+    //            };
+    //            _inboundOrderDetail_HtyService.AddData(dt_InboundOrderDetail_Hty);
+    //            _inboundService.InboundOrderDetailService.DeleteData(inboundOrderDetail);
+    //        }
+    //        return WebResponseContent.Instance.OK();
+    //    }
+    //    catch (Exception ex)
+    //    {
+    //        _unitOfWorkManage.RollbackTran();
+    //        return WebResponseContent.Instance.Error(ex.Message);
+    //    }
+    //}
+    #endregion
+    #region
+    //public WebResponseContent OutboundTaskCompleted(int taskNum)
+    //{
+    //    try
+    //    {
+    //        Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
+    //        if (task == null)
+    //        {
+    //            return WebResponseContent.Instance.Error($"鏈壘鍒颁换鍔′俊鎭�");
+    //        }
+
+    //        Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode);
+
+    //        Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress);
+    //        if (stockInfo == null)
+    //        {
+    //            return WebResponseContent.Instance.Error($"鏈壘鍒板簱瀛樹俊鎭�");
+    //        }
+    //        if (locationInfo == null)
+    //        {
+    //            return WebResponseContent.Instance.Error($"鏈壘鍒拌揣浣嶄俊鎭�");
+    //        }
+
+    //        List<Dt_OutStockLockInfo> outStockLockInfos = _outboundService.OutboundStockLockInfoService.Repository.QueryData(x => x.TaskNum == taskNum);
+    //        if (outStockLockInfos == null || outStockLockInfos.Count == 0)
+    //        {
+    //            return WebResponseContent.Instance.Error($"鏈壘鍒板嚭搴撹鎯呬俊鎭�");
+    //        }
+
+    //        List<Dt_OutboundOrderDetail> outboundOrderDetails = new List<Dt_OutboundOrderDetail>();
+    //        for (int i = 0; i < outStockLockInfos.Count; i++)
+    //        {
+    //            Dt_OutboundOrderDetail outboundOrderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.Id == outStockLockInfos[i].OrderDetailId);
+    //            if (outboundOrderDetail != null)
+    //            {
+    //                outboundOrderDetail.OverOutQuantity = outboundOrderDetail.LockQuantity;
+    //                if (outboundOrderDetail.LockQuantity == outboundOrderDetail.OrderQuantity)
+    //                {
+    //                    outboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt();
+    //                }
+    //                outboundOrderDetails.Add(outboundOrderDetail);
+    //            }
+    //        }
+
+    //        _unitOfWorkManage.BeginTran();
+    //        _outboundService.OutboundOrderDetailService.Repository.UpdateData(outboundOrderDetails);
+
+    //        stockInfo.LocationCode = locationInfo.LocationCode;
+    //        stockInfo.StockStatus = StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt();
+    //        _stockService.StockInfoService.Repository.UpdateData(stockInfo);
+
+    //        int beforeStatus = locationInfo.LocationStatus;
+    //        locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
+    //        _basicService.LocationInfoService.Repository.UpdateData(locationInfo);
+    //        BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
+
+    //        _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Outbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum);
+    //        _unitOfWorkManage.CommitTran();
+    //        Dt_StockInfoDetail stockInfoDetail = _stockRepository.StockInfoDetailRepository.Db.Queryable<Dt_StockInfoDetail>().Where(x => x.StockId == stockInfo.Id).First();
+    //        Dt_OutboundOrderDetail outDetail = _outboundService.OutboundOrderDetailService.Db.Queryable<Dt_OutboundOrderDetail>().Where(x => x.LPNNo == stockInfo.PalletCode).First();
+    //        Dt_OutboundOrder outboundOrder = _outboundService.OutboundOrderService.Db.Queryable<Dt_OutboundOrder>().Where(x => x.Id == outDetail.OrderId).Includes(x => x.Details).First();
+    //        //鍒ゆ柇鍗曟嵁绫诲瀷鏄嚭搴撹繕鏄皟鎷ㄥ嚭搴撱�傘�傘�傚嚭搴�
+    //        if (outboundOrder.OrderType == 1)
+    //        {
+    //            #region //鍒ゆ柇鍑哄簱鍗曟嵁鏄庣粏鍙湁鏈�鍚庝竴鏉″畬鎴愭椂鍒犻櫎鍑哄簱鍗�
+    //            if (outboundOrder.Details.Count == 1)
+    //            {
+    //                Dt_OutboundOrder_Hty inboundOrder_Hty = new Dt_OutboundOrder_Hty
+    //                {
+    //                    OrderStatus = outboundOrder.OrderStatus,
+    //                    CreateType = outboundOrder.CreateType,
+    //                    //SourceId = oldOutboundOrder.SourceId,
+    //                    UpperOrderNo = outboundOrder.UpperOrderNo,
+    //                    OrderNo = outboundOrder.OrderNo,
+    //                    OutWareHouse = outboundOrder.OutWareHouse,
+    //                    TransactionCode = outboundOrder.TransactionCode,
+    //                    InoutType = outboundOrder.InoutType,
+    //                    OrderType = outboundOrder.OrderType,
+    //                    Creater = "WMS",
+    //                    CreateDate = DateTime.Now,
+    //                };
+    //                _outboundOrder_HtyService.AddData(inboundOrder_Hty);
+    //                _outboundService.OutboundOrderService.DeleteData(outboundOrder);
+    //            }
+    //            Dt_OutboundOrderDetail_Hty dt_InboundOrderDetail_Hty = new Dt_OutboundOrderDetail_Hty
+    //            {
+    //                OrderId = outDetail.OrderId,
+    //                MaterielCode = outDetail.MaterielCode,
+    //                MaterielName = outDetail.MaterielName,
+    //                BatchNo = outDetail.BatchNo,
+    //                OrderQuantity = outDetail.OrderQuantity,
+    //                //ReceiptQuantity = outDetail.ReceiptQuantity,
+    //                //OverInQuantity = outDetail.OverInQuantity,
+    //                OrderDetailStatus = outDetail.OrderDetailStatus,
+    //                Creater = "WMS",
+    //                CreateDate = DateTime.Now,
+    //            };
+    //            _outboundOrderDetail_HtyService.AddData(dt_InboundOrderDetail_Hty);
+    //            _outboundService.OutboundOrderService.DeleteData(outDetail);
+    //            #endregion
+    //            #region//鍑哄簱淇℃伅杩斿洖涓婁綅WMS銆傘�傘�傜珛搴撳嚭搴撴暟閲忓洖浼�
+    //            HouseoutboundPassBack houseInboundPassBack = new HouseoutboundPassBack();
+    //            houseInboundPassBack.ApiType = "ShippingOrderController";
+    //            houseInboundPassBack.Method = "AsrsOutboundSO";
+    //            datas datas = new datas();
+    //            datas.data1 data1 = new datas.data1();
+    //            data1.No = outboundOrder.OrderNo;
+    //            data1.OutWareHouse = task.Roadway;
+    //            data1.TransactionCode = outboundOrder.TransactionCode;
+    //            data1.InoutType = outboundOrder.OrderType;
+    //            data1.OrderType = outboundOrder.InoutType;
+
+    //            datas.data1.Inbound inbound = new datas.data1.Inbound();
+    //            inbound.LinId = outDetail.LinId;
+    //            inbound.LPN_No = task.PalletCode;
+    //            inbound.MaterielCode = stockInfoDetail.MaterielCode;
+    //            inbound.OrderQuantity = stockInfoDetail.OutboundQuantity;
+    //            inbound.BatchNo = stockInfoDetail.BatchNo;
+    //            inbound.FinishQty = stockInfoDetail.OutboundQuantity;
+    //            inbound.LocationName = task.SourceAddress;
+    //            datas.Value.Add(data1);
+    //            data1.DetailList.Add(inbound);
+    //            houseInboundPassBack.Parameters.Add(datas);
+    //            Authentication authentication = new Authentication()
+    //            {
+    //                ApiType = "AuthenticationController",
+    //                Parameters = new List<Parameter>
+    //            {
+    //             new Parameter { Value = "LKAdmin"},
+    //             new Parameter { Value = "LKAdmin"},
+    //            },
+    //                Method = "Login",
+    //            };
+    //            var responses1 = HttpHelper.Post<WebResponseContent>(ReceiveWMSTaskAUT, authentication, "鐧诲綍WMS璐﹀彿");
+    //            var Ticket = responses1.Context["Ticket"].ToString();
+    //            var InvOrgId = responses1.Context["InvOrgId"].ToString();
+    //            if (Ticket != null)
+    //            {
+    //                houseInboundPassBack.Context = new Dictionary<string, string>();
+    //                houseInboundPassBack.Context.Add("Ticket", Ticket);
+    //                houseInboundPassBack.Context.Add("InvOrgId", InvOrgId);
+    //                var responses = HttpHelper.Post<WebResponseContent>(ReceiveWMSTaskout, houseInboundPassBack, "绔嬪簱鍑哄簱鏁伴噺鍥炰紶WMS");
+    //            }
+    //            #endregion
+    //            //鍒犻櫎搴撳瓨淇℃伅
+    //            _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
+    //            _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(stockInfo.Details, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
+    //        }
+    //        else if (outboundOrder.OrderType == 240)
+    //        {
+    //            //鐩樼偣鍑哄簱浠诲姟瀹屾垚銆併�併�併�併�併�併�併�併�佷笉鑳藉垹闄ゅ簱瀛樼瓑閫昏緫
+    //        }
+    //        else
+    //        {
+
+    //            List<Dt_StockInfo> StockInfo = _stockService.StockInfoService.Repository.QueryData(x => x.BatchNo == outDetail.BatchNo);
+    //            if (outboundOrder.Details.Count == 1)
+    //            {
+    //                Dt_OutboundOrder_Hty inboundOrder_Hty = new Dt_OutboundOrder_Hty
+    //                {
+    //                    OrderStatus = outboundOrder.OrderStatus,
+    //                    CreateType = outboundOrder.CreateType,
+    //                    //SourceId = oldOutboundOrder.SourceId,
+    //                    UpperOrderNo = outboundOrder.UpperOrderNo,
+    //                    OrderNo = outboundOrder.OrderNo,
+    //                    OutWareHouse = outboundOrder.OutWareHouse,
+    //                    TransactionCode = outboundOrder.TransactionCode,
+    //                    InoutType = outboundOrder.InoutType,
+    //                    OrderType = outboundOrder.OrderType,
+    //                    Creater = "WMS",
+    //                    CreateDate = DateTime.Now,
+    //                };
+    //                _outboundOrder_HtyService.AddData(inboundOrder_Hty);
+    //                _outboundService.OutboundOrderService.DeleteData(outboundOrder);
+    //            }
+    //            Dt_OutboundOrderDetail_Hty dt_InboundOrderDetail_Hty = new Dt_OutboundOrderDetail_Hty
+    //            {
+    //                OrderId = outDetail.OrderId,
+    //                MaterielCode = outDetail.MaterielCode,
+    //                MaterielName = outDetail.MaterielName,
+    //                BatchNo = outDetail.BatchNo,
+    //                OrderQuantity = outDetail.OrderQuantity,
+    //                //ReceiptQuantity = outDetail.ReceiptQuantity,
+    //                //OverInQuantity = outDetail.OverInQuantity,
+    //                OrderDetailStatus = outDetail.OrderDetailStatus,
+    //                Creater = "WMS",
+    //                CreateDate = DateTime.Now,
+    //            };
+    //            _outboundOrderDetail_HtyService.AddData(dt_InboundOrderDetail_Hty);
+    //            _outboundService.OutboundOrderService.DeleteData(outDetail);
+
+    //            InventoryAllocate inventoryAllocate = new InventoryAllocate();
+    //            inventoryAllocate.ApiType = "InventoryAllocateController";
+    //            inventoryAllocate.Method = "AsrsFinishedStockCount";
+
+    //            Allocate allocate = new Allocate();
+
+    //            Allocate.data1 data1 = new Allocate.data1();
+    //            data1.No = outboundOrder.OrderNo;
+    //            data1.InWarehouse = task.Roadway;
+    //            data1.TransactionCode = outboundOrder.TransactionCode;
+    //            data1.InoutType = outboundOrder.OrderType;
+    //            data1.OrderType = outboundOrder.InoutType;
+
+    //            foreach (var item in StockInfo)
+    //            {
+    //                Dt_StockInfoDetail detail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.StockId == item.Id);
+    //                Allocate.data1.Inventory inbound = new Allocate.data1.Inventory();
+    //                inbound.LinId = outDetail.LinId;
+    //                inbound.LPN_No = item.PalletCode;
+    //                inbound.MaterielCode = detail.MaterielCode;
+    //                inbound.OrderQuantity = detail.OutboundQuantity;
+    //                inbound.BatchNo = detail.BatchNo;
+    //                inbound.FinishQty = detail.OutboundQuantity;
+    //                inbound.LocationName = task.SourceAddress;
+    //                data1.DetailList.Add(inbound);
+    //            }
+
+
+    //            allocate.Value.Add(data1);
+    //            inventoryAllocate.Parameters.Add(allocate);
+    //            Authentication authentication = new Authentication()
+    //            {
+    //                ApiType = "AuthenticationController",
+    //                Parameters = new List<Parameter>
+    //            {
+    //             new Parameter { Value = "LKAdmin"},
+    //             new Parameter { Value = "LKAdmin"},
+    //            },
+    //                Method = "Login",
+    //            };
+    //            var responses1 = HttpHelper.Post<WebResponseContent>(ReceiveWMSTaskAUT, authentication, "鐧诲綍WMS璐﹀彿");
+    //            var Ticket = responses1.Context["Ticket"].ToString();
+    //            var InvOrgId = responses1.Context["InvOrgId"].ToString();
+    //            if (Ticket != null)
+    //            {
+    //                inventoryAllocate.Context = new Dictionary<string, string>();
+    //                inventoryAllocate.Context.Add("Ticket", Ticket);
+    //                inventoryAllocate.Context.Add("InvOrgId", InvOrgId);
+    //                var responses = HttpHelper.Post<WebResponseContent>(ReceiveWMSTaskAllocatein, inventoryAllocate, "璋冩嫧鍑哄簱鏁伴噺鍥炰紶WMS");
+    //            }
+    //            _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
+    //            _stockService.StockInfoDetailService.Repository.DeleteAndMoveIntoHty(stockInfo.Details, App.User.UserId == 0 ? OperateType.鑷姩瀹屾垚 : OperateType.浜哄伐瀹屾垚);
+    //        }
+    //        return WebResponseContent.Instance.OK();
+    //    }
+    //    catch (Exception ex)
+    //    {
+    //        _unitOfWorkManage.RollbackTran();
+    //        return WebResponseContent.Instance.Error(ex.Message);
+    //    }
+    //}
+    #endregion
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WIDESEA_TaskInfoService.csproj b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WIDESEA_TaskInfoService.csproj
index 5272e9b..54a0169 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WIDESEA_TaskInfoService.csproj
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WIDESEA_TaskInfoService.csproj
@@ -7,6 +7,12 @@
   </PropertyGroup>
 
   <ItemGroup>
+    <PackageReference Include="PdfiumViewer" Version="2.13.0" />
+    <PackageReference Include="PDFsharp" Version="6.2.2" />
+    <PackageReference Include="Spire.PDF" Version="11.9.8" />
+  </ItemGroup>
+
+  <ItemGroup>
     <ProjectReference Include="..\WIDESEA_IBasicService\WIDESEA_IBasicService.csproj" />
     <ProjectReference Include="..\WIDESEA_IInboundService\WIDESEA_IInboundService.csproj" />
     <ProjectReference Include="..\WIDESEA_IOutboundService\WIDESEA_IOutboundService.csproj" />
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs b/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs
index dee47fe..99915e6 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Basic/LocationInfoController.cs
@@ -58,5 +58,11 @@
             return Service.LocationDisableStatus(keys); ;
         }
 
+        [HttpPost, Route("LocationRelease"),AllowAnonymous]
+        public WebResponseContent LocationRelease([FromBody] List<string> locationCodes)
+        {
+            return Service.LocationRelease(locationCodes);
+        }
+
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs b/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs
index a5abbcc..a258c32 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs
@@ -2,6 +2,7 @@
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using WIDESEA_Common;
+using WIDESEA_Common.TaskEnum;
 using WIDESEA_Core;
 using WIDESEA_Core.BaseController;
 using WIDESEA_DTO.Inbound;
@@ -32,7 +33,7 @@
         /// </summary>
         /// <param name="orderAddDTO"></param>
         /// <returns></returns>
-        [HttpPost, Route("AddInboundOrders"), AllowAnonymous]
+        [HttpPost,HttpGet, Route("AddInboundOrders"), AllowAnonymous]
         public WebResponseContent AddInboundOrders([FromBody] HouseInbound orderAddDTO)
         {
             return Service.AddInboundOrders(orderAddDTO);
@@ -49,21 +50,50 @@
         /// </summary>
         /// <param name="name"></param>
         /// <returns></returns>
-        [HttpPost, Route("InventoryIn"), AllowAnonymous]
+        [HttpPost,HttpGet, Route("InventoryIn"), AllowAnonymous]
         public WebResponseContent InventoryIn([FromBody] string name)
         {
             return Service.InventoryIn(name);
         }   
         /// <summary>
-        /// 鍏ュ簱鍗曟嵁鍙栨秷
+        /// SMOM鎺ㄩ�佸叆搴撳崟鎹彇娑�
         /// </summary>
         /// <param name="houseCancelIn"></param>
         /// <returns></returns>
-        [HttpPost, Route("CancelIn"), AllowAnonymous]
+        [HttpPost,HttpGet, Route("CancelIn"), AllowAnonymous]
         public WebResponseContent CancelIn([FromBody] HouseCancelIn  houseCancelIn)
         {
             return Service.CancelIn(houseCancelIn);
         }
 
+        [HttpGet, HttpPost, Route("Save"), AllowAnonymous]
+        public WebResponseContent Save([FromBody] AddInboundOrderModel addInboundOrder)
+        {
+            return Service.Save(addInboundOrder);
+        }
+        
+        [HttpGet, HttpPost, Route("FeedbackInboundCanceERP"), AllowAnonymous]
+        public WebResponseContent FeedbackInboundCanceERP([FromBody] int[] keys)
+        {
+            return Service.FeedbackInboundCanceERP(keys);
+        }
+
+        [HttpGet, HttpPost, Route("ReceiveReturnOrder"), AllowAnonymous]
+        public WebResponseContent ReceiveReturnOrder([FromBody] List<HouseReturnOrder> houseReturnOrder)
+        {
+            return Service.ReceiveReturnOrder(houseReturnOrder);
+        }
+
+        [HttpGet, HttpPost, Route("GetMaterielCode"), AllowAnonymous]
+        public WebResponseContent GetMaterielCode(int warehouseId)
+        {
+            return Service.GetMaterielCode(warehouseId);
+        }
+
+        [HttpGet, HttpPost, Route("GetMaterielName"), AllowAnonymous]
+        public WebResponseContent GetMaterielName(int warehouseId, string materielCode)
+        {
+            return Service.GetMaterielName(warehouseId,materielCode);
+        }
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/ReturnOrderController.cs b/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/ReturnOrderController.cs
new file mode 100644
index 0000000..70fa367
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/ReturnOrderController.cs
@@ -0,0 +1,18 @@
+锘�
+using Microsoft.AspNetCore.Mvc;
+using WIDESEA_Core.BaseController;
+using WIDESEA_Core;
+using WIDESEA_IInboundService;
+using WIDESEA_Model.Models.Inbound;
+
+namespace WIDESEA_WMSServer.Controllers.Inbound
+{
+    [Route("api/ReturnOrder")]
+    [ApiController]
+    public class ReturnOrderController : ApiBaseController<IReturnOrderService, Dt_ReturnOrder>
+    {
+        public ReturnOrderController(IReturnOrderService service) : base(service)
+        {
+        }
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/TakeStockOrderController.cs b/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/TakeStockOrderController.cs
new file mode 100644
index 0000000..4451e41
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/TakeStockOrderController.cs
@@ -0,0 +1,54 @@
+锘縰sing Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using WIDESEA_Core;
+using WIDESEA_Core.BaseController;
+using WIDESEA_IInboundService;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_WMSServer.Controllers.Inbound
+{
+    /// <summary>
+    /// 鐩樼偣鍗�
+    /// </summary>
+    [Route("api/TakeStockOrder")]
+    [ApiController]
+    public class TakeStockOrderController : ApiBaseController<ITakeStockOrderService, Dt_TakeStockOrder>
+    {
+        public TakeStockOrderController(ITakeStockOrderService service) : base(service)
+        {
+        }
+        /// <summary>
+        /// 鑾峰彇瀵瑰簲浠撳簱鐩樼偣鍗�
+        /// </summary>
+        [HttpPost,HttpGet, Route("GetTakeStockOrders"), AllowAnonymous]
+        public WebResponseContent GetTakeStockOrders([FromBody] SaveModel saveModel)
+        {
+            return Service.GetTakeStockOrders(saveModel);
+        }
+        /// <summary>
+        /// 閫氳繃鐩樼偣鍗曞彿+妗嗗彿鑾峰彇鐩樼偣淇℃伅璇︽儏
+        /// </summary>
+        [HttpPost, Route("GetTakeDetailInfo"), AllowAnonymous]
+        public WebResponseContent GetTakeDetailInfo([FromBody] SaveModel saveModel)
+        {
+            return Service.GetTakeDetailInfo(saveModel);
+        }
+        /// <summary>
+        /// 鐩樼偣鎿嶄綔
+        /// </summary>
+        [HttpPost, Route("MatPicking"), AllowAnonymous]
+        public WebResponseContent MatPicking([FromBody] SaveModel saveModel)
+        {
+            return Service.MatPicking(saveModel);
+        }
+        /// <summary>
+        /// 鐩樼偣鍏抽棴
+        /// </summary>
+        [HttpPost, Route("DisEnableTakeOrder"), AllowAnonymous]
+        public WebResponseContent DisEnableTakeOrder(int id)
+        {
+            return Service.DisEnableTakeOrder(id);
+        }
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/TakeStockOrderDetailController.cs b/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/TakeStockOrderDetailController.cs
new file mode 100644
index 0000000..6639fc7
--- /dev/null
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/TakeStockOrderDetailController.cs
@@ -0,0 +1,22 @@
+锘縰sing Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using WIDESEA_Core;
+using WIDESEA_Core.BaseController;
+using WIDESEA_IInboundService;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_WMSServer.Controllers.Inbound
+{
+    /// <summary>
+    /// 鐩樼偣鏄庣粏鍗�
+    /// </summary>
+    [Route("api/TakeStockOrderDetail")]
+    [ApiController]
+    public class TakeStockOrderDetailController : ApiBaseController<ITakeStockOrderDetailService, Dt_TakeStockOrderDetail>
+    {
+        public TakeStockOrderDetailController(ITakeStockOrderDetailService service) : base(service)
+        {
+        }
+    }
+}
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderController.cs b/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderController.cs
index 01edc74..8fde075 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderController.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderController.cs
@@ -27,6 +27,42 @@
         {
             return Service.CancelOut(houseCancelOut);
         }
-        
+
+        [HttpPost, Route("Save"), AllowAnonymous]
+        public WebResponseContent Save([FromBody] OutboundOrderAddDTO orderAddDTO)
+        {
+            return Service.Save(orderAddDTO);
+        }
+        /// <summary>
+        /// 鍑哄簱鍗曞簱瀛樹骇鍝佺紪鍙锋煡璇�
+        /// </summary>
+        /// <param name="warehouseId"></param>
+        /// <returns></returns>
+        [HttpPost, HttpGet, Route("GetCodeByWarehouse"), AllowAnonymous]
+        public WebResponseContent GetCodeByWarehouse(int warehouseId)
+        {
+            return Service.GetCodeByWarehouse(warehouseId);
+        }
+        /// <summary>
+        /// 鎶ュ簾鍗曞簱瀛樼増鏈煡璇�
+        /// </summary>
+        /// <param name="warehouseId"></param>
+        /// <returns></returns>
+        [HttpPost, HttpGet, Route("GetVersionByCode"), AllowAnonymous]
+        public WebResponseContent GetVersionByCode(string materielCode, int warehouseId)
+        {
+            return Service.GetVersionByCode(materielCode, warehouseId);
+        }
+
+        /// <summary>
+        /// 鎶ュ簾鍗曞簱瀛樼増鏈煡璇�
+        /// </summary>
+        /// <param name="warehouseId"></param>
+        /// <returns></returns>
+        [HttpPost, HttpGet, Route("GetLotNoByCode"), AllowAnonymous]
+        public WebResponseContent GetLotNoByCode(string materielCode, int warehouseId)
+        {
+            return Service.GetLotNoByCode(materielCode, warehouseId);
+        }
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderDetailController.cs b/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderDetailController.cs
index a6582f4..a693284 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderDetailController.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderDetailController.cs
@@ -1,4 +1,5 @@
-锘縰sing Microsoft.AspNetCore.Http;
+锘縰sing Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using WIDESEA_Core;
 using WIDESEA_Core.BaseController;
@@ -39,5 +40,15 @@
         {
             return Service.RevokeLockOutboundStock(id);
         }
+        /// <summary>
+        /// 鍑哄簱鏄庣粏鍙栨秷鍥炶皟ERP
+        /// </summary>
+        /// <param name="keys"></param>
+        /// <returns></returns>
+        [HttpPost, Route("CancelOutFeedbackERP"), AllowAnonymous]
+        public WebResponseContent CancelOutFeedbackERP([FromBody] int[] keys)
+        {
+            return Service.CancelOutFeedbackERP(keys);
+        }
     }
 }
diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs b/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs
index f8a5b11..287f0e4 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs
@@ -175,5 +175,32 @@
         {
             return Service.UpdateTaskInfo(task);
         }
+
+        [HttpPost, Route("FeedBackInboundERP"), AllowAnonymous]
+        public WebResponseContent FeedBackInboundERP(string upperOrderNo,string linId)
+        {
+            return Service.FeedBackInboundERP(upperOrderNo , linId);
+        }
+
+        /// <summary>
+        /// 鍗曟嵁鏄庣粏鍑哄簱瀹屾垚鍥炶皟erp
+        /// </summary>
+        /// <param name="orderNO"></param>
+        /// <param name="linId"></param>
+        /// <returns></returns>
+        [HttpPost, Route("FeedBackOutERP"), AllowAnonymous]
+        public WebResponseContent FeedBackOutERP(string orderNO, string linId)
+        {
+            return Service.FeedBackOutERP(orderNO, linId);
+        }
+
+        /// <summary>
+        /// 閫夊畾搴撳瓨鐢熸垚鐩樼偣鍗曞嚭搴�
+        /// </summary>
+        [HttpPost, Route("TakeOutbound"), AllowAnonymous]
+        public WebResponseContent TakeOutbound([FromBody] List<StockViewDTO> stockViews)
+        {
+            return Service.TakeOutbound(stockViews);
+        }
     }
 }
diff --git "a/\345\220\211\345\256\211PDA/common/config.js" "b/\345\220\211\345\256\211PDA/common/config.js"
index 110cf2a..888f1cb 100644
--- "a/\345\220\211\345\256\211PDA/common/config.js"
+++ "b/\345\220\211\345\256\211PDA/common/config.js"
@@ -1,6 +1,6 @@
 let config = {
-	baseUrl: 'http://127.0.0.1:9290',
-	//baseUrl: 'http://10.168.1.226:9290',
+	//baseUrl: 'http://127.0.0.1:9290',
+	baseUrl: 'http://10.168.1.226:9290',
 	urls: [
 		'http://10.30.4.92:9283',
 		'http://10.30.4.92:9283'
diff --git "a/\345\220\211\345\256\211PDA/pages/stash/TakeStock.vue" "b/\345\220\211\345\256\211PDA/pages/stash/TakeStock.vue"
index 11187a4..95ca5c3 100644
--- "a/\345\220\211\345\256\211PDA/pages/stash/TakeStock.vue"
+++ "b/\345\220\211\345\256\211PDA/pages/stash/TakeStock.vue"
@@ -1,437 +1,272 @@
 <template>
-	<view>
-		<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem">
-		</uni-segmented-control>
-		<view class="content">
-			<view v-if="current === 0" class="headerstyle">
-				<view class="itemstyle">
-					<uni-forms label-width="120">
-						<uni-forms-item label="鎵樼洏鏉$爜">
-							<uni-easyinput type="text" :focus="!istrue" v-model="barcode" placeholder="璇锋壂鎻忔墭鐩樻潯鐮�"
-								ref='midInput' @confirm="inputChangebarcode()" />
-						</uni-forms-item>
-						<uni-forms-item label="瀹炵洏鏁伴噺">
-							<uni-easyinput type="number" v-model="num" placeholder="璇疯緭鍏ュ疄鐩樻暟閲�" ref='midInput' />
-						</uni-forms-item>
-						<uni-forms-item>
-							<button @click="picking" type="primary" style="margin-left: 0px;">鐩樼偣瀹屾垚</button>
-						</uni-forms-item>
-					</uni-forms>
-					<view class="uni-content" v-if="takeStockObj">
-						<view class="uni-title-sub uni-ellipsis-2">鐩樼偣鍗曞彿锛歿{orderNo}}</view>
-						<view class="uni-note">鐗╂枡缂栫爜锛歿{takeStockObj.materielCode}}</view>
-						<view class="uni-note">鐗╂枡鎵规锛歿{takeStockObj.batchNo}}</view>
-						<view class="uni-note">鐗╂枡鍚嶇О锛歿{takeStockObj.materielName}}</view>
-						<view class="uni-note">鐗╂枡瑙勬牸锛歿{takeStockObj.materielSpec}}</view>
-						<view class="uni-note">璐﹂潰鏁伴噺锛歿{takeStockObj.sysQty}}</view>
-					</view>
-				</view>
-			</view>
-			<view v-if="current === 1" class="headerstyle">
-				<view class="itemstyle">
-					<uni-forms label-width="120">
-						<uni-forms-item label="鎵樼洏鏉$爜">
-							<uni-easyinput type="text" :focus="!addressFocus" v-model="inboundBarcode"
-								placeholder="璇锋壂鎻忔墭鐩樻潯鐮�" ref='midInput' @confirm="inputChangebarcode3" />
-						</uni-forms-item>
-						<uni-forms-item label="鍦板潃鏉$爜">
-							<uni-easyinput type="text" v-model="address" :disabled="addressdisabled" placeholder="璇锋壂鎻忓湴鍧�鏉$爜" ref='midInput'
-								:focus="addressFocus" />
-						</uni-forms-item>
-						<uni-forms-item>
-							<button @click="inbound" type="primary" size="default" style="margin-top: 2%;">鍏ュ簱纭</button>
-						</uni-forms-item>
-					</uni-forms>
-				</view>
-				<view>
-					<uni-list>
-						<uni-list-item direction="column" v-if="inboundBarcode">
-							<template v-slot:body>
-								<view class="uni-list-box">
-									<view class="uni-content">
-										<view class="uni-title-sub uni-ellipsis-2">缁勭洏鎬绘暟閲忥細{{Summmary}}</view>
-									</view>
-								</view>
-							</template>
-						</uni-list-item>
-						<uni-list-item direction="column" v-for="(item,index) in stockInfoDetail" :key="index">
-							<template v-slot:body>
-								<view class="uni-list-box">
-									<view class="uni-content">
-										<view class="uni-title-sub uni-ellipsis-2">鐗╂枡缂栧彿锛歿{item.materielCode}}</view>
-										<view class="uni-note">鐗╂枡鍚嶇О锛歿{item.materielName}}</view>
-										<view class="uni-note">鐗╂枡鎵规锛歿{item.batchNo}}</view>
-										<view class="uni-note">缁勭洏鏁伴噺锛歿{item.stockQuantity}}</view>
-										<view class="uni-note">鐢熶骇鏃ユ湡锛歿{item.productionDate}}</view>
-										<view class="uni-note">鏈� 鏁� 鏈燂細{{item.effectiveDate}}</view>
-									</view>
-								</view>
-							</template>
-						</uni-list-item>
-					</uni-list>
-				</view>
-			</view>
-		</view>
-		<u-toast ref="uToast" />
-	</view>
+  <view>
+    <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem">
+    </uni-segmented-control>
+    <view class="content">
+      <view v-if="current === 0" class="headerstyle">
+        <view class="itemstyle">
+          <uni-forms label-width="120">
+            <uni-forms-item label="鎵樼洏鏉$爜">
+              <uni-easyinput type="text" :focus="!istrue" v-model="barcode" placeholder="璇锋壂鎻忔墭鐩樻潯鐮�"
+                ref='midInput' @confirm="inputChangebarcode" />
+            </uni-forms-item>
+            <uni-forms-item label="瀹炵洏鏁伴噺">
+              <uni-easyinput type="number" v-model="num" placeholder="璇疯緭鍏ュ疄鐩樻暟閲�" ref='midInput' />
+            </uni-forms-item>
+            <uni-forms-item>
+              <button @click="picking" type="primary" style="margin-left: 0px;">鐩樼偣瀹屾垚</button>
+            </uni-forms-item>
+          </uni-forms>
+          <view class="uni-content" v-if="takeStockObj">
+            <view class="uni-title-sub uni-ellipsis-2">鐩樼偣鍗曞彿锛歿{orderNo}}</view>
+            <view class="uni-note">鐗╂枡缂栫爜锛歿{takeStockObj.materielCode}}</view>
+            <view class="uni-note">鐗╂枡鎵规锛歿{takeStockObj.batchNo}}</view>
+            <view class="uni-note">鐗╂枡鍚嶇О锛歿{takeStockObj.materielName}}</view>
+            <view class="uni-note">鐗╂枡瑙勬牸锛歿{takeStockObj.materielSpec}}</view>
+            <view class="uni-note">璐﹂潰鏁伴噺锛歿{takeStockObj.sysQty}}</view>
+          </view>
+        </view>
+      </view>
+      <view v-if="current === 1" class="headerstyle">
+        <view class="itemstyle">
+          <uni-forms label-width="120">
+            <uni-forms-item label="鎵樼洏鏉$爜">
+              <uni-easyinput type="text" :focus="!addressFocus" v-model="inboundBarcode"
+                placeholder="璇锋壂鎻忔墭鐩樻潯鐮�" ref='midInput' @confirm="inputChangebarcode3" />
+            </uni-forms-item>
+            <uni-forms-item label="鍦板潃鏉$爜">
+              <uni-easyinput type="text" v-model="address" :disabled="addressdisabled" placeholder="璇锋壂鎻忓湴鍧�鏉$爜" ref='midInput'
+                :focus="addressFocus" />
+            </uni-forms-item>
+            <uni-forms-item>
+              <button @click="inbound" type="primary" size="default" style="margin-top: 2%;">鍏ュ簱纭</button>
+            </uni-forms-item>
+          </uni-forms>
+        </view>
+        <view>
+          <uni-list>
+            <uni-list-item direction="column" v-if="inboundBarcode">
+              <template v-slot:body>
+                <view class="uni-list-box">
+                  <view class="uni-content">
+                    <view class="uni-title-sub uni-ellipsis-2">缁勭洏鎬绘暟閲忥細{{Summmary}}</view>
+                  </view>
+                </view>
+              </template>
+            </uni-list-item>
+            <uni-list-item direction="column" v-for="(item,index) in stockInfoDetail" :key="index">
+              <template v-slot:body>
+                <view class="uni-list-box">
+                  <view class="uni-content">
+                    <view class="uni-title-sub uni-ellipsis-2">鐗╂枡缂栧彿锛歿{item.materielCode}}</view>
+                    <view class="uni-note">鐗╂枡鍚嶇О锛歿{item.materielName}}</view>
+                    <view class="uni-note">鐗╂枡鎵规锛歿{item.batchNo}}</view>
+                    <view class="uni-note">缁勭洏鏁伴噺锛歿{item.stockQuantity}}</view>
+                    <view class="uni-note">鐢熶骇鏃ユ湡锛歿{item.productionDate}}</view>
+                    <view class="uni-note">鏈� 鏁� 鏈燂細{{item.effectiveDate}}</view>
+                  </view>
+                </view>
+              </template>
+            </uni-list-item>
+          </uni-list>
+        </view>
+      </view>
+    </view>
+    <u-toast ref="uToast" />
+  </view>
 </template>
 
 <script>
-	// const SixUniTts = uni.requireNativePlugin("SmallSix-SixUniTts")
-	export default {
-		data() {
-			return {
-				items: ['鐩樼偣',  '鍏ュ簱'],//'鎷i�夌粍鐩�',
-				current: 0,
-				isPicking: false,
-				istrue: false,
-				barcode: '',
-				materialsns: "",
-				boxBarcodes: [],
-				sns: [],
-				barcodefocus: true,
-				totalNum: 0,
-				pickNum: 0,
-				num: null,
-				orderTotalNum: 0,
-				orderPickNum: 0,
-				orderNo: "",
-				matTotal: [],
-				istrue2: false,
-				barcode2: '',
-				Summmary:0,
-				innerboxcode: "",
-				takeStockObj:null,
-				sns2: [],
-				barcodefocus: true,
-				addressFocus: false,
-				inboundBarcode: "",
-				address: "",
-				addressdisabled: false,
-				warehouseId:"",
-				stockInfoDetail:[]
-			}
-		},
-		onLoad(res) {
-			this.barcodefocus = false;
-			this.istrue = false;
-			this.warehouseId = res.warehouseId;
-			this.orderNo=res.orderNo;
-			if (this.warehouseId == 3) { //鏉挎枡浠撳簱鍖篒D
-				this.address = "1011";
-				this.addressdisabled = true;
-			}
-		},
-		methods: {
-			onClickItem(e) {
-				this.focus = false;
-				this.addressFocus = false;
-				if (this.current !== e.currentIndex) {
-					this.current = e.currentIndex;
-				}
-			},
-			inbound() {
-				var postData = {
-					MainData: {
-						"barcode": this.inboundBarcode,
-						"startPoint": this.address,
-						"warehouseId": this.warehouseId
-					}
-				}
-				this.$u.post('/api/Task/RequestInboundTask', postData).then(res => {
-					if (res.status) {
-						this.inboundBarcode = "";
-						if (this.warehouseId !== 3) //鏉挎枡浠撳簱鍖篒D
-						{ 
-							this.address = "";
-						}
-						this.Summmary=0;
-						this.stockInfoDetail=[];
-						this.$refs.uToast.show({
-							title: "鎴愬姛",
-							type: "success"
-						})
-					} else {
-						this.$refs.uToast.show({
-							title: res.message,
-							type: "error"
-						})
-					}
-				}).catch(err => {
-					this.$refs.uToast.show({
-						title: err.message,
-						type: "error"
-					})
-				})
-			},
-			inputChangebarcode3() {
-				this.addressFocus = false;
-				this.$nextTick(function(x) {
-					if (this.inboundBarcode != '') {
-						this.addressFocus = true;
-					}
-				})
-				this.$nextTick(function(x) {
-									if (this.inboundBarcode != '') {
-										var postData = {
-											MainData: {
-												"barcode": this.inboundBarcode,
-												"warehouseId": this.warehouseId,
-											}
-										};
-										this.$u.post('/api/StockInfo/StockQueryData', postData).then(res => {
-											// this.stockInfo = [];
-											this.stockInfoDetail = [];
-											this.Summmary=0;
-											if (res.status) {
-												// this.stockInfo = res.data,
-												this.stockInfoDetail = res.data.details
-												//鑾峰彇鎬绘暟閲�
-												this.stockInfoDetail.forEach(item => {
-													this.Summmary += item.stockQuantity;
-												});
-											} else {
-												this.$refs.uToast.show({
-													// title: "鏈壘鍒版墭鐩樹俊鎭�",
-													title: res.message,
-													type: "error"
-												})
-											}
-										})
-									}
-								})
-			},
-			picking() {
-				if (this.barcode == "") {
-					this.$refs.uToast.show({
-						title: "璇锋壂鎻忔墭鐩樻潯鐮�",
-						type: "error"
-					})
-					return;
-				}
-				if(this.num==null || this.num==undefined){
-					this.$refs.uToast.show({
-						title: "鐩樼偣鏁伴噺涓嶈兘涓虹┖(鍙~0鈥旀湁鏁堟暟瀛楀��)",
-						type: "error"
-					})
-					return;
-				}
-				if(this.takeStockObj==null){
-					this.$refs.uToast.show({
-						title: "鐩樼偣淇℃伅涓虹┖",
-						type: "error"
-					})
-					return;
-				}
-				var params = {
-					MainData: {
-						"num": this.num,
-						"id": this.takeStockObj.id
-					}
-				}
-				this.$u.post('/api/TakeStockOrder/MatPicking', params).then(res => {
-					if (res.status) {
-						this.barcode="";
-						this.takeStockObj=null;
-						this.num=null;
-						this.$refs.uToast.show({
-							title: "鐩樼偣鎴愬姛",
-							type: "success"
-						})
-					} else {
-						this.$refs.uToast.show({
-							title: res.message,
-							type: "error"
-						})
-					}
-				})
-			},
-			inputChange(e) {
-				this.$nextTick(() => {
-					this.istrue = false;
-					var matInfo = this.materialsns.split('|');
-					if (matInfo.length == 7) {
-						var matObj = {
-							matCode: matInfo[1],
-							matProductionDate: matInfo[3],
-							matQty: matInfo[5],
-							orderNo: matInfo[6],
-							sn: this.materialsns,
-							isPicking: this.isPicking
-						}
-						var temp = this.boxBarcodes.find(x => x.orderNo == matObj.orderNo);
-						if (!temp) {
-							var tmp = this.matTotal.find(x => x.matCode == matObj.matCode);
-							if (!tmp) {
-								this.matTotal.push({
-									matCode: matObj.matCode,
-									matQuantity: parseInt(matObj.matQty)
-								})
-							} else {
-								tmp.matQuantity += parseInt(matObj.matQty);
-							}
-							this.sns.push({
-								innerboxcode: this.materialsns,
-								isSplit: this.isPicking
-							});
-							this.boxBarcodes.push(matObj);
-							this.isPicking = false;
-							setTimeout(this.updateFocus, 100);
-						} else {
-							this.$refs.uToast.show({
-								title: "鎵爜閲嶅",
-								type: "error"
-							})
-							setTimeout(this.updateFocus, 100);
-						}
-					} else {
-						this.$refs.uToast.show({
-							title: "鎵爜閿欒,璇锋壂鎻忔纭唴绠辩爜",
-							type: "error"
-						})
-						setTimeout(this.updateFocus, 100);
-					}
-				})
-			},
-			checkedClick() {
-				this.isPicking = !this.isPicking;
-				this.istrue = false;
-				this.$nextTick(function(x) {
-					if (this.barcode != '') {
-						this.istrue = true;
-					}
-				})
-			},
-			updateFocus() {
-				this.materialsns = '';
-				if (!this.istrue) {
-					this.istrue = true;
-				}
-			},
-			inputChangebarcode() {
-				this.istrue = false;
-				this.$nextTick(function(x) {
-					if (this.barcode != '') {
-						var postData = {
-							MainData: {
-								"orderNo": this.orderNo,
-								"takePalletCode": this.barcode
-							}
-						};
-						this.$u.post('/api/TakeStockOrder/GetTakeDetailInfo', postData).then(res => {
-							if (res.status) {
-								this.takeStockObj=null;
-								this.takeStockObj= res.data;
-							} else {
-								this.barcode="";
-								this.$refs.uToast.show({
-									title: res.message,
-									type: "error"
-								})
-							}
-						})
-						this.istrue = true;
-					}
-				})
-			},
-			deleteList(res) {
-				this.matTotal.map((item, index) => {
-					var temp = this.boxBarcodes.find(x => x.sn == res);
-					if (temp) {
-						if (item.matCode == temp.matCode) {
-							if (item.matQuantity - temp.matQty == 0) {
-								this.matTotal.splice(index, 1);
-							} else {
-								item.matQuantity -= temp.matQty;
-							}
-						}
-					}
-				})
-				this.sns.map((item, index) => {
-					if (item.innerboxcode == res) {
-						this.sns.splice(index, 1);
-					}
-				})
-				this.boxBarcodes.map((item, index) => {
-					if (item.sn == res) {
-						this.boxBarcodes.splice(index, 1);
-					}
-				})
-			},
-
-			submit() {
-				if (this.barcode2 == "") {
-					this.$refs.uToast.show({
-						title: "璇锋壂鎻忔墭鐩樻潯鐮�",
-						type: "error"
-					})
-					return;
-				}
-				if (this.innerboxcode == "") {
-					this.$refs.uToast.show({
-						title: "璇锋壂鎻忓唴绠辨爣绛�",
-						type: "error"
-					})
-					return;
-				}
-				this.$u.post('/api/StockOperate/PickingBoxing', {
-					MainData: {
-						"barcode": this.barcode2,
-						"innerboxcode": this.innerboxcode
-					},
-					DelKeys: this.sns2
-				}).then(res => {
-					if (res.status) {
-						uni.$showMsg('缁勭洏鎴愬姛!')
-						this.barcode2 = "";
-						this.innerboxcode = "";
-					} else {
-						this.$refs.uToast.show({
-							title: res.message,
-							type: "error"
-						})
-					}
-				}).catch(err => {
-					this.$refs.uToast.show({
-						title: err.message,
-						type: "error"
-					})
-				})
-			},
-			inputChange2(e) {
-
-			},
-			inputChangebarcode2() {
-				this.istrue2 = false;
-				this.$nextTick(function(x) {
-					if (this.barcode2 != '') {
-						this.istrue2 = true;
-					}
-				})
-			},
-		}
-	}
+export default {
+  data() {
+    return {
+      items: ['鐩樼偣'],
+      current: 0,
+      istrue: false,
+      barcode: '',
+      num: null,
+      orderNo: "",
+      takeStockObj: null,
+      addressFocus: false,
+      inboundBarcode: "",
+      address: "",
+      addressdisabled: false,
+      warehouseId: "",
+      Summmary: 0,
+      stockInfoDetail: []
+    }
+  },
+  onLoad(res) {
+    this.warehouseId = res.warehouseId;
+    this.orderNo = res.orderNo;
+    if (this.warehouseId == 3) {
+      this.address = "1011";
+      this.addressdisabled = true;
+    }
+  },
+  methods: {
+    onClickItem(e) {
+      this.focus = false;
+      this.addressFocus = false;
+      if (this.current !== e.currentIndex) {
+        this.current = e.currentIndex;
+      }
+    },
+    inbound() {
+      var postData = {
+        MainData: {
+          "barcode": this.inboundBarcode,
+          "startPoint": this.address,
+          "warehouseId": this.warehouseId
+        }
+      }
+      this.$u.post('/api/Task/RequestInboundTask', postData).then(res => {
+        if (res.status) {
+          this.inboundBarcode = "";
+          if (this.warehouseId !== 3) {
+            this.address = "";
+          }
+          this.Summmary = 0;
+          this.stockInfoDetail = [];
+          this.$refs.uToast.show({
+            title: "鎴愬姛",
+            type: "success"
+          })
+        } else {
+          this.$refs.uToast.show({
+            title: res.message,
+            type: "error"
+          })
+        }
+      }).catch(err => {
+        this.$refs.uToast.show({
+          title: err.message,
+          type: "error"
+        })
+      })
+    },
+    inputChangebarcode3() {
+      this.addressFocus = false;
+      setTimeout(() => {
+        if (this.inboundBarcode) {
+          this.addressFocus = true;
+          var postData = {
+            MainData: {
+              "barcode": this.inboundBarcode,
+              "warehouseId": this.warehouseId,
+            }
+          };
+          this.$u.post('/api/StockInfo/StockQueryData', postData).then(res => {
+            this.stockInfoDetail = [];
+            this.Summmary = 0;
+            if (res.status) {
+              this.stockInfoDetail = res.data.details
+              this.stockInfoDetail.forEach(item => {
+                this.Summmary += item.stockQuantity;
+              });
+            } else {
+              this.$refs.uToast.show({
+                title: res.message,
+                type: "error"
+              })
+            }
+          })
+        }
+      }, 1000);
+    },
+    picking() {
+      if (!this.barcode) {
+        this.$refs.uToast.show({
+          title: "璇锋壂鎻忔墭鐩樻潯鐮�",
+          type: "error"
+        })
+        return;
+      }
+      if (this.num == null || this.num == undefined) {
+        this.$refs.uToast.show({
+          title: "鐩樼偣鏁伴噺涓嶈兘涓虹┖(鍙~0鈥旀湁鏁堟暟瀛楀��)",
+          type: "error"
+        })
+        return;
+      }
+      if (!this.takeStockObj) {
+        this.$refs.uToast.show({
+          title: "鐩樼偣淇℃伅涓虹┖",
+          type: "error"
+        })
+        return;
+      }
+      var params = {
+        MainData: {
+          "num": this.num,
+          "id": this.takeStockObj.id
+        }
+      }
+      this.$u.post('/api/TakeStockOrder/MatPicking', params).then(res => {
+        if (res.status) {
+          this.barcode = "";
+          this.takeStockObj = null;
+          this.num = null;
+          this.$refs.uToast.show({
+            title: "鐩樼偣鎴愬姛",
+            type: "success"
+          })
+        } else {
+          this.$refs.uToast.show({
+            title: res.message,
+            type: "error"
+          })
+        }
+      })
+    },
+    inputChangebarcode() {
+      this.istrue = false;
+      setTimeout(() => {
+        if (this.barcode) {
+          this.istrue = true;
+          var postData = {
+            MainData: {
+              "orderNo": this.orderNo,
+              "takePalletCode": this.barcode
+            }
+          };
+          this.$u.post('/api/TakeStockOrder/GetTakeDetailInfo', postData).then(res => {
+            if (res.status) {
+              this.takeStockObj = res.data;
+            } else {
+              this.barcode = "";
+              this.$refs.uToast.show({
+                title: res.message,
+                type: "error"
+              })
+            }
+          })
+        }
+      }, 1000);
+    }
+  }
+}
 </script>
 
 <style lang="scss">
-	@import '@/common/uni-ui.scss';
+@import '@/common/uni-ui.scss';
 
-	.content {
-		display: flex;
-		height: 150px;
-	}
+.content {
+  display: flex;
+  height: 150px;
+}
 
-	.content-text {
-		font-size: 14px;
-		color: #666;
-	}
+.content-text {
+  font-size: 14px;
+  color: #666;
+}
 
-	.itemstyle {
-		margin-top: 20px;
-		margin-left: 5%;
-	}
+.itemstyle {
+  margin-top: 20px;
+  margin-left: 5%;
+}
 
-	.headerstyle {
-		width: 90%;
-	}
+.headerstyle {
+  width: 90%;
+}
 </style>
\ No newline at end of file
diff --git "a/\345\220\211\345\256\211PDA/pages/stash/boxing.vue" "b/\345\220\211\345\256\211PDA/pages/stash/boxing.vue"
index 06517fe..c7ce770 100644
--- "a/\345\220\211\345\256\211PDA/pages/stash/boxing.vue"
+++ "b/\345\220\211\345\256\211PDA/pages/stash/boxing.vue"
@@ -18,24 +18,11 @@
 							<uni-easyinput type="text" :placeholder="Testplaceholder" ref='midInput'
 								v-model="Initiallife" />
 						</uni-forms-item>
-						<!-- <uni-forms-item>
-							<checkbox checked="check">鏄惁婊$洏</checkbox>
-						</uni-forms-item> -->
 						<uni-forms-item>
 							<button @click="submit" type="primary" size="default" style="margin-top: 2%;">缁勭洏</button>
 						</uni-forms-item>
 					</uni-forms>
 					<uni-list>
-						<!-- <uni-list-item direction="column" v-for="item in matTotal" :key="item.matCode">
-							<template v-slot:body>
-								<view class="uni-list-box">
-									<view class="uni-content">
-										<view class="uni-title-sub uni-ellipsis-2">鐗╂枡缂栫爜锛歿{item.matCode}}</view>
-										<view class="uni-title-sub uni-ellipsis-2">鏁伴噺锛歿{item.matQuantity}}</view>
-									</view>
-								</view>
-							</template>
-						</uni-list-item> -->
 						<uni-list-item direction="column" v-for="(item,index) in matInfos" :key="index">
 							<template v-slot:body>
 								<view class="uni-list-box">
@@ -46,7 +33,17 @@
 										<view class="uni-title-sub uni-ellipsis-2">閲囪喘鍗曞彿锛歿{item.purchaseOrderNo}}</view>
 										<view class="uni-note">鐗╂枡缂栫爜锛歿{item.materielCode}}</view>
 										<view class="uni-note">鎵规鍙凤細{{item.lotNo}}</view>
-										<view class="uni-note">鏁伴噺锛歿{item.quantity}}</view>
+										<!-- 鏁伴噺缂栬緫妗� -->
+										<view class="uni-note" style="display: flex; align-items: center; gap: 10rpx;">
+											鏁伴噺锛�
+											<uni-easyinput 
+												type="number" 
+												min="1" 
+												style="width: 150rpx; display: inline-block;"
+												v-model="item.editableQuantity" 
+												@input="handleQuantityChange(item)"
+											/>
+										</view>
 										<view class="uni-note">鐢熶骇鏃ユ湡锛歿{item.productionDate}}</view>
 										<view class="uni-note">鏈夋晥鏈燂細{{item.effectiveDate}}</view>
 									</view>
@@ -122,7 +119,17 @@
 										<view class="uni-title-sub uni-ellipsis-2">閲囪喘鍗曞彿锛歿{item.purchaseOrderNo}}</view>
 										<view class="uni-note">鐗╂枡缂栫爜锛歿{item.materielCode}}</view>
 										<view class="uni-note">鎵规鍙凤細{{item.lotNo}}</view>
-										<view class="uni-note">鏁伴噺锛歿{item.quantity}}</view>
+										<!-- 鏁伴噺缂栬緫妗� -->
+										<view class="uni-note" style="display: flex; align-items: center; gap: 10rpx;">
+											鏁伴噺锛�
+											<uni-easyinput 
+												type="number" 
+												min="1" 
+												style="width: 150rpx; display: inline-block;"
+												v-model="item.editableQuantity" 
+												@input="handlePkQuantityChange(item)"
+											/>
+										</view>
 										<view class="uni-note">鐢熶骇鏃ユ湡锛歿{item.productionDate}}</view>
 										<view class="uni-note">鏈夋晥鏈燂細{{item.effectiveDate}}</view>
 									</view>
@@ -205,10 +212,17 @@
 			this.getData();
 		},
 		methods: {
-			// voiceSpeech(src) {
-			// 	innerAudioContext.src = src; // '../../static/success.mp3';
-			// 	innerAudioContext.play();
-			// },
+			// 缁勭洏椤垫暟閲忓彉鏇存牎楠�
+			handleQuantityChange(item) {
+				// 纭繚鏁伴噺涓烘鏁存暟
+				item.editableQuantity = item.editableQuantity ? Math.max(1, parseInt(item.editableQuantity)) : 1;
+			},
+
+			// 鍏ュ钩搴撻〉鏁伴噺鍙樻洿鏍¢獙
+			handlePkQuantityChange(item) {
+				item.editableQuantity = item.editableQuantity ? Math.max(1, parseInt(item.editableQuantity)) : 1;
+			},
+			
 			//wms鍏ュ钩搴�
 			pksubmit() {
 				if (this.pkmatInfos.length == 0) {
@@ -218,9 +232,14 @@
 					})
 					return;
 				}
-				this.$u.post('/api/InboundOrder/WMSInPinKu?warehouseId=' + this.warehouseId, this
-					.pksns).then(res => {
-					debugger
+				
+				// 鍑嗗鎻愪氦鏁版嵁锛屽寘鍚紪杈戝悗鐨勬暟閲�
+				const submitData = this.pkmatInfos.map(item => ({
+					serialNumber: item.serialNumber,
+					quantity: item.editableQuantity
+				}));
+				
+				this.$u.post('/api/InboundOrder/WMSInPinKu?warehouseId=' + this.warehouseId, submitData).then(res => {
 					if (res.status) {
 						this.$refs.uToast.show({
 							title: "鍏ュ簱鎴愬姛",
@@ -237,45 +256,49 @@
 					}
 				})
 			},
+			
 			pksnInput() {
 				this.$nextTick(() => {
-					if (this.pkmaterSn != "") {
+					if (!this.pkmaterSn) return;
+
+					// 寤惰繜100ms纭繚鎵爜瀹屾垚
+					setTimeout(() => {
 						this.focus = false;
-						var matSn = this.pkmaterSn;
-						setTimeout(() => {
+
+						// 鏍¢獙鍐呯鐮佸畬鏁存��
+						const requiredFields = ['M:', 'BS:', 'DM:', 'DE:', 'Q:', 'PO:', 'DN:'];
+						const hasAllFields = requiredFields.every(field => this.pkmaterSn.includes(field));
+						if (!hasAllFields) {
+							this.$refs.uToast.show({
+								title: "鍐呯鐮佷笉瀹屾暣锛岃閲嶆柊鎵弿",
+								type: "error"
+							});
 							this.pkmaterSn = "";
-						}, 10);
+							return;
+						}
+
+						const matSn = this.pkmaterSn;
+						this.pkmaterSn = "";
+
 						this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => {
 							if (res.status) {
-								this.pksns.push(res.data.serialNumber);
-								this.pkmatInfos.push(res.data);
-								if (!res.status) {
-									this.$refs.uToast.show({
-										title: res.message,
-										type: "error"
-									})
-									// setTimeout(() => {
-									// 	this.voiceSpeech('../../static/fail.mp3');
-									// }, 100);
-									return;
-								}
-								// setTimeout(() => {
-								// 	this.voiceSpeech('../../static/success.mp3');
-								// }, 100);
-								return;
+								// 鏂板鍙紪杈戞暟閲忓瓧娈�
+								const tempData = res.data;
+								tempData.editableQuantity = tempData.quantity;
+								
+								this.pksns.push(tempData.serialNumber);
+								this.pkmatInfos.push(tempData);
 							} else {
 								this.$refs.uToast.show({
 									title: res.message,
 									type: "error"
 								})
-								// setTimeout(() => {
-								// 	this.voiceSpeech('../../static/fail.mp3');
-								// }, 100);
 							}
 						})
-					}
+					}, 100);
 				})
 			},
+			
 			//瑙g洏
 			releasebox() {
 				if (this.value.length == 0) {
@@ -315,6 +338,7 @@
 					}
 				})
 			},
+			
 			releaseboxInput() {
 				this.$nextTick(() => {
 					if (this.value.length == 0) {
@@ -361,7 +385,6 @@
 			},
 
 			updateFocus() {
-				debugger
 				this.$nextTick(() => {
 					this.materSn = '';
 					if (!this.focus) {
@@ -369,13 +392,14 @@
 					}
 				});
 			},
+			
 			barcodeFocus() {
-				debugger
 				this.barcode = '';
 				if (this.focus) {
 					this.focus = false;
 				}
 			},
+			
 			getData() {
 				var postData = {
 					MainData: {
@@ -391,6 +415,7 @@
 					}
 				})
 			},
+			
 			onClickItem(e) {
 				this.focus = false;
 				this.addressFocus = false;
@@ -401,77 +426,75 @@
 					}
 				}
 			},
+			
 			barcodeInput() {
 				this.$nextTick(function(x) {
 					if (this.barcode.length > 0) {
-						// if (this.barcode.substring(0, 1) == 'A' || this.barcode.substring(0, 2) == 'TP') {
 						this.focus = true;
-						// } else {
-						// 	this.$refs.uToast.show({
-						// 		title: "鎵爜閿欒,璇锋壂鎻忔墭鐩樼爜",
-						// 		type: "error"
-						// 	})
-						// }
 					}
 				})
 			},
+			
 			snInput() {
 				this.$nextTick(() => {
-					if (this.warehouseId == 6 || this.warehouseId == 2 || this.warehouseId == 3) {
-						if (this.sns.length > 0) {
-							this.sns = [];
-						}
-					}
-					if (this.materSn != "") {
+					if (!this.materSn) return;
+
+					// 寤惰繜100ms纭繚鎵爜瀹屾垚
+					setTimeout(() => {
 						this.focus = false;
+						
+						// 浠撳簱11鐨勭壒娈婂鐞�
 						if(this.warehouseId==11){
 							this.materSn=this.materSn.replace(/,SC.*/, '');
 						}
-						if (this.materSn.split(',').length != 6) {
+						
+						// 鏍¢獙鍐呯鐮佸畬鏁存��
+						const requiredFields = ['M:', 'BS:', 'DM:', 'DE:', 'Q:', 'PO:', 'DN:'];
+						const hasAllFields = requiredFields.every(field => this.materSn.includes(field));
+						if (!hasAllFields) {
+							this.$refs.uToast.show({
+								title: "鍐呯鐮佷笉瀹屾暣锛岃閲嶆柊鎵弿",
+								type: "error"
+							});
 							this.materSn = "";
 							return;
 						}
-						var matSn = this.materSn;
-						//setTimeout(() => {
+
+						// 浠撳簱鐗瑰畾閫昏緫
+						if (this.warehouseId == 6 || this.warehouseId == 2 || this.warehouseId == 3) {
+							if (this.sns.length > 0) {
+								this.sns = [];
+							}
+						}
+
+						const matSn = this.materSn;
 						this.materSn = "";
-						//}, 10);
+
 						this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => {
 							this.Testcheck = false;
 							if (res.status) {
-								this.sns.push(res.data.serialNumber);
-								if (this.warehouseId == 6 || this.warehouseId == 2 || this.warehouseId ==
-									3) {
+								// 鏂板鍙紪杈戞暟閲忓瓧娈�
+								const tempData = res.data;
+								tempData.editableQuantity = tempData.quantity;
+								
+								this.sns.push(tempData.serialNumber);
+								if (this.warehouseId == 6 || this.warehouseId == 2 || this.warehouseId == 3) {
 									if (this.matInfos.length > 0) {
 										this.matInfos = [];
 									}
 								}
-								this.matInfos.push(res.data);
-								if (!res.status) {
-									this.$refs.uToast.show({
-										title: res.message,
-										type: "error"
-									})
-									// setTimeout(() => {
-									// 	this.voiceSpeech('../../static/fail.mp3');
-									// }, 100);
-									return;
-								}
-								// setTimeout(() => {
-								// 	this.voiceSpeech('../../static/success.mp3');
-								// }, 100);
+								this.matInfos.push(tempData);
 							} else {
 								this.$refs.uToast.show({
 									title: res.message,
 									type: "error"
 								})
-								// setTimeout(() => {
-								// 	this.voiceSpeech('../../static/fail.mp3');
-								// }, 100);
 							}
 						})
-					}
+					}, 100);
 				})
 			},
+			
 			inbound() {
 				if (this.inboundBarcode == "") {
 					this.$refs.uToast.show({
@@ -521,6 +544,7 @@
 					})
 				})
 			},
+			
 			inputChangebarcode() {
 				this.addressFocus = false;
 				this.$nextTick(function(x) {
@@ -537,18 +561,16 @@
 							}
 						};
 						this.$u.post('/api/StockInfo/StockQueryData', postData).then(res => {
-							// this.stockInfo = [];
 							this.stockInfoDetail = [];
 							if (res.status) {
-								// this.stockInfo = res.data,
 								this.stockInfoDetail = res.data.details
 								//鑾峰彇鎬绘暟閲�
+								this.Summmary = 0;
 								this.stockInfoDetail.forEach(item => {
 									this.Summmary += item.stockQuantity;
 								});
 							} else {
 								this.$refs.uToast.show({
-									// title: "鏈壘鍒版墭鐩樹俊鎭�",
 									title: res.message,
 									type: "error"
 								})
@@ -557,10 +579,17 @@
 					}
 				})
 			},
+			
 			deleteList(res) {
 				this.matInfos.splice(res, 1);
 				this.sns.splice(res, 1);
 			},
+			
+			pkdeleteList(res) {
+				this.pkmatInfos.splice(res, 1);
+				this.pksns.splice(res, 1);
+			},
+			
 			submit() {
 				if (this.barcode == "") {
 					this.$refs.uToast.show({
@@ -593,16 +622,27 @@
 						return;
 					}
 				}
+				
+				// 鍑嗗鎻愪氦鏁版嵁锛屽寘鍚紪杈戝悗鐨勬暟閲�
+				const submitSns = this.matInfos.map(item => ({
+					serialNumber: item.serialNumber,
+					quantity: item.editableQuantity
+				}));
+				
 				if (this.warehouseId == 2) { //娌瑰ⅷ浠撳簱鍖篒D
-					this.sn = this.sns[0];
-					for (var i = 0; i < this.Initiallife - 1; i++) {
-						this.sns.push(this.sn);
+					// 鐗规畩澶勭悊淇濇寔涓嶅彉锛屼絾浣跨敤缂栬緫鍚庣殑鏁伴噺
+					const firstItem = this.matInfos[0];
+					for (var i = 0; i < firstItem.editableQuantity - 1; i++) {
+						submitSns.push({
+							serialNumber: firstItem.serialNumber,
+							quantity: 1
+						});
 					}
 				}
-				let url = 'palletCode=' + this.barcode + '&initiallife=' + this.Initiallife + '&warehouseId=' + this
-					.warehouseId;
+				
+				let url = 'palletCode=' + this.barcode + '&initiallife=' + this.Initiallife + '&warehouseId=' + this.warehouseId;
 
-				this.$u.post('/api/InboundOrder/ManualMaterielGroup?' + url, this.sns).then(res => {
+				this.$u.post('/api/InboundOrder/ManualMaterielGroup?' + url, submitSns).then(res => {
 					this.Testcheck = false;
 					if (res.status) {
 						this.$refs.uToast.show({
@@ -647,4 +687,4 @@
 	.headerstyle {
 		width: 90%;
 	}
-</style>
\ No newline at end of file
+</style>
diff --git "a/\345\220\211\345\256\211PDA/pages/stash/raworderboxing.vue" "b/\345\220\211\345\256\211PDA/pages/stash/raworderboxing.vue"
index 5e9afbe..7b52fb5 100644
--- "a/\345\220\211\345\256\211PDA/pages/stash/raworderboxing.vue"
+++ "b/\345\220\211\345\256\211PDA/pages/stash/raworderboxing.vue"
@@ -22,9 +22,6 @@
 								v-model="Initiallife" />
 						</uni-forms-item>
 
-						<!-- <uni-forms-item>
-							<checkbox checked="check">鏄惁婊$洏</checkbox>
-						</uni-forms-item> -->
 						<uni-forms-item>
 							<view style="display: flex;justify-content: space-around;margin-top: 2%;">
 								<button @click="reset" type="default" size="default"
@@ -34,16 +31,6 @@
 						</uni-forms-item>
 					</uni-forms>
 					<uni-list>
-						<!-- <uni-list-item direction="column" v-for="item in matTotal" :key="item.matCode">
-							<template v-slot:body>
-								<view class="uni-list-box">
-									<view class="uni-content">
-										<view class="uni-title-sub uni-ellipsis-2">鐗╂枡缂栫爜锛歿{item.matCode}}</view>
-										<view class="uni-title-sub uni-ellipsis-2">鏁伴噺锛歿{item.matQuantity}}</view>
-									</view>
-								</view>
-							</template>
-						</uni-list-item> -->
 						<uni-list-item direction="column" v-for="(item,index) in matInfos" :key="index">
 							<template v-slot:body>
 								<view class="uni-list-box">
@@ -54,7 +41,17 @@
 										<view class="uni-title-sub uni-ellipsis-2">閲囪喘鍗曞彿锛歿{item.purchaseOrderNo}}</view>
 										<view class="uni-note">鐗╂枡缂栫爜锛歿{item.materielCode}}</view>
 										<view class="uni-note">鎵规鍙凤細{{item.lotNo}}</view>
-										<view class="uni-note">鏁伴噺锛歿{item.quantity}}</view>
+										<!-- 鐩存帴缂栬緫Q鍊煎搴旂殑quantity瀛楁 -->
+										<view class="uni-note" style="display: flex; align-items: center; gap: 10rpx;">
+											鏁伴噺锛�
+											<uni-easyinput 
+												type="number" 
+												min="1" 
+												style="width: 150rpx; display: inline-block;"
+												v-model="item.quantity" 
+												@input="handleQuantityChange(item)"
+											/>
+										</view>
 										<view class="uni-note">鐢熶骇鏃ユ湡锛歿{item.productionDate}}</view>
 										<view class="uni-note">鏈夋晥鏈燂細{{item.effectiveDate}}</view>
 										<view class="uni-note">浜よ揣鍗曞彿锛歿{item.deliveryNote}}</view>
@@ -92,8 +89,6 @@
 										<view style="font-size: 18px;">鍗曟嵁鍙凤細{{orderNo}}</view>
 										<view style="font-size: 18px;">鐗╂枡缂栫爜锛歿{item.materielCode}}</view>
 										<view>鐗╂枡鍚嶇О锛歿{item.materielName}}</view>
-										<!-- <view>鐗╂枡瑙勬牸锛歿{item.materielSpec}}</view> -->
-										<!-- <view style="font-size: 18px;">鐗╂枡鍚嶇О锛歿{item.matName}}</view> -->
 										<view style="font-size: 18px;">鏁伴噺锛歿{item.orderQuantity}}</view>
 										<view style="font-size: 18px;">缁勭洏鏁伴噺锛歿{item.receiptQuantity}}</view>
 									</view>
@@ -132,7 +127,17 @@
 										<view class="uni-title-sub uni-ellipsis-2">閲囪喘鍗曞彿锛歿{item.purchaseOrderNo}}</view>
 										<view class="uni-note">鐗╂枡缂栫爜锛歿{item.materielCode}}</view>
 										<view class="uni-note">鎵规鍙凤細{{item.lotNo}}</view>
-										<view class="uni-note">鏁伴噺锛歿{item.quantity}}</view>
+										<!-- 鐩存帴缂栬緫Q鍊煎搴旂殑quantity瀛楁 -->
+										<view class="uni-note" style="display: flex; align-items: center; gap: 10rpx;">
+											鏁伴噺锛�
+											<uni-easyinput 
+												type="number" 
+												min="1" 
+												style="width: 150rpx; display: inline-block;"
+												v-model="item.quantity" 
+												@input="handlePkQuantityChange(item)"
+											/>
+										</view>
 										<view class="uni-note">鐢熶骇鏃ユ湡锛歿{item.productionDate}}</view>
 										<view class="uni-note">鏈夋晥鏈燂細{{item.effectiveDate}}</view>
 										<view class="uni-note">浜よ揣鍗曞彿锛歿{item.deliveryNote}}</view>
@@ -153,7 +158,7 @@
 	export default {
 		data() {
 			return {
-				items: ['缁勭洏', '鍏ュ簱', '鍗曟嵁淇℃伅'], //, '瑙g洏'
+				items: ['缁勭洏', '鍏ュ簱', '鍗曟嵁淇℃伅'],
 				current: 0,
 				matTotal: [],
 				matInfos: [],
@@ -212,12 +217,17 @@
 			this.getData();
 		},
 		methods: {
-			// voiceSpeech(src) {
-			// 	innerAudioContext.src = src; // '../../static/success.mp3';
-			// 	innerAudioContext.play();
-			// },
+			// 缁勭洏椤垫暟閲忕紪杈戞牎楠岋紙鐩存帴淇敼鍘熺敓quantity瀛楁锛�
+			handleQuantityChange(item) {
+				item.quantity = item.quantity ? Math.max(1, parseInt(item.quantity)) : 1;
+			},
+
+			// 鍏ュ钩搴撻〉鏁伴噺缂栬緫鏍¢獙锛堢洿鎺ヤ慨鏀瑰師鐢焣uantity瀛楁锛�
+			handlePkQuantityChange(item) {
+				item.quantity = item.quantity ? Math.max(1, parseInt(item.quantity)) : 1;
+			},
+
 			updateFocus() {
-				debugger
 				this.$nextTick(() => {
 					this.materSn = '';
 					if (!this.focus) {
@@ -225,13 +235,14 @@
 					}
 				});
 			},
+			
 			barcodeFocus() {
-				debugger
 				this.barcode = '';
 				if (this.focus) {
 					this.focus = false;
 				}
 			},
+			
 			getData() {
 				var postData = {
 					MainData: {
@@ -247,6 +258,7 @@
 					}
 				})
 			},
+			
 			onClickItem(e) {
 				this.focus = false;
 				this.addressFocus = false;
@@ -257,108 +269,127 @@
 					}
 				}
 			},
+			
 			barcodeInput() {
 				this.$nextTick(function(x) {
 					if (this.barcode.length > 0) {
-						// if (this.barcode.substring(0, 1) == 'A' || this.barcode.substring(0, 2) == 'TP') {
 						this.focus = true;
-						// } else {
-						// 	this.$refs.uToast.show({
-						// 		title: "鎵爜閿欒,璇锋壂鎻忔墭鐩樼爜",
-						// 		type: "error"
-						// 	})
-						// }
 					}
 				})
 			},
+			
+			// 缁勭洏椤靛唴绠辩爜瑙f瀽锛堢洿鎺ユ搷浣滃師鐢焣uantity瀛楁锛�
 			snInput() {
 				this.$nextTick(() => {
-					if (this.materSn != "") {
+					if (!this.materSn) return;
+
+					// 寤惰繜100ms纭繚鎵爜瀹屾垚
+					setTimeout(() => {
 						this.focus = false;
-						var matSn = this.materSn;
+						let matSn = this.materSn.trim();
+
+						// 浠撳簱11鐨勭壒娈婂鐞�
 						if (this.warehouseId == 11) {
 							matSn = matSn.replace(/,SC.*/, '');
 						}
-						//鏌ヨmatSn鏄惁瀛樺湪瀛楃
-						if(matSn.indexOf("PO")>0){
-							this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => {
-								this.Testcheck = false;
-								if (res.status) {
-									this.sns.push(res.data.serialNumber);
-							
-									this.matInfos.push(res.data);
-									if (res.message) {
-										this.$refs.uToast.show({
-											title: res.message,
-											type: "error"
-										})
-										// setTimeout(() => {
-										// 	this.voiceSpeech('../../static/fail.mp3');
-										// }, 100);
-										return;
-									}
-									// setTimeout(() => {
-									// 	this.voiceSpeech('../../static/success.mp3');
-									// }, 100);
-								} else {
+
+						// 鏍¢獙鍐呯鐮佸畬鏁存��
+						const requiredFields = ['M:', 'BS:', 'DM:', 'DE:', 'Q:', 'PO:', 'DN:'];
+						const hasAllFields = requiredFields.every(field => matSn.includes(field));
+						if (!hasAllFields) {
+							this.$refs.uToast.show({
+								title: "鍐呯鐮佷笉瀹屾暣锛岃閲嶆柊鎵弿",
+								type: "error"
+							});
+							this.materSn = "";
+							return;
+						}
+
+						// 鏍¢獙PO瀛楁瀛樺湪鎬�
+						if (matSn.indexOf("PO") <= 0) {
+							this.$refs.uToast.show({
+								title: "鍐呯鐮佹牸寮忛敊璇紙鏃燩O鏍囪瘑锛�",
+								type: "error"
+							});
+							this.materSn = "";
+							return;
+						}
+
+						// 瑙f瀽鍐呯鐮侊紙鐩存帴浣跨敤杩斿洖鐨剄uantity浣滀负Q鍊硷級
+						this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => {
+							this.Testcheck = false;
+							if (res.status) {
+								this.sns.push(res.data.serialNumber);
+								this.matInfos.push(res.data);
+
+								if (res.message) {
 									this.$refs.uToast.show({
 										title: res.message,
-										type: "error"
-									})
-									// setTimeout(() => {
-									// 	this.voiceSpeech('../../static/fail.mp3');
-									// }, 100);
+										type: "warning"
+									});
 								}
-							})
-						}
-						setTimeout(() => {
-							this.materSn = "";
-						}, 100);
-					}
+							} else {
+								this.$refs.uToast.show({
+									title: res.message,
+									type: "error"
+								});
+							}
+						});
+
+						this.materSn = "";
+					}, 1000);
 				})
 			},
+			
+			// 鍏ュ钩搴撻〉鍐呯鐮佽В鏋愶紙鐩存帴鎿嶄綔鍘熺敓quantity瀛楁锛�
 			pksnInput() {
 				this.$nextTick(() => {
-					if (this.pkmaterSn != "") {
-						
-						var matSn = this.pkmaterSn;
-						
-						if(matSn.indexOf("PO")>0){
-							this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => {
-								if (res.status) {
-									this.pksns.push(res.data.serialNumber);
-									this.pkmatInfos.push(res.data);
-									if (!res.status) {
-										this.$refs.uToast.show({
-											title: res.message,
-											type: "error"
-										})
-										// setTimeout(() => {
-										// 	this.voiceSpeech('../../static/fail.mp3');
-										// }, 100);
-										return;
-									}
-									// setTimeout(() => {
-									// 	this.voiceSpeech('../../static/success.mp3');
-									// }, 100);
-									return;
-								} else {
-									this.$refs.uToast.show({
-										title: res.message,
-										type: "error"
-									})
-									// setTimeout(() => {
-									// 	this.voiceSpeech('../../static/fail.mp3');
-									// }, 100);
-								}
-							})
-						}
-						setTimeout(() => {
+					if (!this.pkmaterSn) return;
+
+					// 寤惰繜100ms纭繚鎵爜瀹屾垚
+					setTimeout(() => {
+						let matSn = this.pkmaterSn.trim();
+
+						// 鏍¢獙鍐呯鐮佸畬鏁存��
+						const requiredFields = ['M:', 'BS:', 'DM:', 'DE:', 'Q:', 'PO:', 'DN:'];
+						const hasAllFields = requiredFields.every(field => matSn.includes(field));
+						if (!hasAllFields) {
+							this.$refs.uToast.show({
+								title: "鍐呯鐮佷笉瀹屾暣锛岃閲嶆柊鎵弿",
+								type: "error"
+							});
 							this.pkmaterSn = "";
-						}, 100);
-					}
+							return;
+						}
+
+						// 鏍¢獙PO瀛楁瀛樺湪鎬�
+						if (matSn.indexOf("PO") <= 0) {
+							this.$refs.uToast.show({
+								title: "鍐呯鐮佹牸寮忛敊璇紙鏃燩O鏍囪瘑锛�",
+								type: "error"
+							});
+							this.pkmaterSn = "";
+							return;
+						}
+
+						// 瑙f瀽鍐呯鐮侊紙鐩存帴浣跨敤杩斿洖鐨剄uantity浣滀负Q鍊硷級
+						this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => {
+							if (res.status) {
+								this.pksns.push(res.data.serialNumber);
+								this.pkmatInfos.push(res.data);
+							} else {
+								this.$refs.uToast.show({
+									title: res.message,
+									type: "error"
+								});
+							}
+						});
+
+						this.pkmaterSn = "";
+					}, 100);
 				})
 			},
+			
 			inbound() {
 				if (this.inboundBarcode == "") {
 					this.$refs.uToast.show({
@@ -405,6 +436,7 @@
 					})
 				})
 			},
+			
 			inputChangebarcode() {
 				this.addressFocus = false;
 				this.$nextTick(function(x) {
@@ -413,29 +445,34 @@
 					}
 				})
 			},
+			
 			deleteList(res) {
 				this.matInfos.splice(res, 1);
 				this.sns.splice(res, 1);
 			},
+			
 			pkdeleteList(res) {
 				this.pkmatInfos.splice(res, 1);
 				this.pksns.splice(res, 1);
 			},
+			
 			reset() {
 				this.barcode = "";
 				this.matInfos = [];
 				this.sns = [];
 				this.materSn = "";
-				if (this.warehouseId = !6) {
+				if (this.warehouseId != 6) {
 					this.Initiallife = 0;
 				}
 			},
+			
 			resetInPk() {
 				this.pkmaterSn = "";
 				this.pkfocus = false;
 				this.pkmatInfos = [];
 				this.pksns = [];
 			},
+			
 			pksubmit() {
 				if (this.pkmatInfos.length == 0) {
 					this.$refs.uToast.show({
@@ -444,24 +481,32 @@
 					})
 					return;
 				}
-				this.$u.post('/api/InboundOrder/InPinKu?warehouseId=' + this.warehouseId + "&orderNo=" + this.orderNo, this
-					.pksns).then(res => {
-					if (res.status) {
-						this.$refs.uToast.show({
-							title: "鍏ュ簱鎴愬姛",
-							type: "success"
-						})
-						this.pkfocus = false;
-						this.pkmatInfos = [];
-						this.pksns = [];
-					} else {
-						this.$refs.uToast.show({
-							title: res.message,
-							type: "error"
-						})
-					}
-				})
+				
+				// 鐩存帴浣跨敤淇敼鍚庣殑quantity锛堝搴擰鍊硷級鎻愪氦
+				const submitData = this.pkmatInfos.map(item => ({
+					serialNumber: item.serialNumber,
+					quantity: item.quantity
+				}));
+				
+				this.$u.post('/api/InboundOrder/InPinKu?warehouseId=' + this.warehouseId + "&orderNo=" + this.orderNo, submitData)
+					.then(res => {
+						if (res.status) {
+							this.$refs.uToast.show({
+								title: "鍏ュ簱鎴愬姛",
+								type: "success"
+							})
+							this.pkfocus = false;
+							this.pkmatInfos = [];
+							this.pksns = [];
+						} else {
+							this.$refs.uToast.show({
+								title: res.message,
+								type: "error"
+							})
+						}
+					})
 			},
+			
 			submit() {
 				if (this.barcode == "") {
 					this.$refs.uToast.show({
@@ -494,21 +539,29 @@
 						return;
 					}
 				}
-				if (this.warehouseId == 2) { //娌瑰ⅷ浠撳簱鍖篒D
-					this.sn = this.sns[0];
+				
+				// 鐩存帴浣跨敤淇敼鍚庣殑quantity锛堝搴擰鍊硷級鎻愪氦
+				let submitSns = this.matInfos.map(item => ({
+					serialNumber: item.serialNumber,
+					quantity: item.quantity
+				}));
+				
+				// 娌瑰ⅷ浠撳簱鐗规畩澶勭悊
+				if (this.warehouseId == 2) {
+					const firstItem = submitSns[0];
 					for (var i = 0; i < this.Initiallife - 1; i++) {
-						this.sns.push(this.sn);
+						submitSns.push({...firstItem});
 					}
 				}
+				
 				this.$u.post('/api/InboundOrder/MaterielGroup', {
 					MainData: {
 						"palletCode": this.barcode,
 						"orderNo": this.orderNo,
 						"initiallife": this.Initiallife,
-						// "isFull": this.check
 						"warehouseId": this.warehouseId
 					},
-					DelKeys: this.sns
+					DelKeys: submitSns
 				}).then(res => {
 					this.Testcheck = false;
 					if (res.status) {
@@ -521,7 +574,7 @@
 						this.matInfos = [];
 						this.sns = [];
 						this.matTotal = [];
-						if (this.warehouseId != 6) { //娴嬭瘯鏋朵粨搴撳尯ID
+						if (this.warehouseId != 6) {
 							this.Initiallife = "";
 						}
 					} else {
@@ -557,4 +610,5 @@
 	.headerstyle {
 		width: 90%;
 	}
-</style>
\ No newline at end of file
+</style>
+    
\ No newline at end of file

--
Gitblit v1.9.3