From d292487812b280e7f484a5cdf6e8a994baa486fd Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期三, 03 十二月 2025 14:02:06 +0800
Subject: [PATCH] 1

---
 项目代码/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/v17/DocumentLayout.backup.json                         |   26 ++----------
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_ProductionOutboundOrderService.cs                   |    7 +++
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs                           |   47 +++++++++++++++++++++--
 项目代码/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/v17/DocumentLayout.backup.json                         |    2 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_AllocateOutboundOrderService.cs                     |    6 +++
 项目代码/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-wal |    0 
 /dev/null                                                                                               |    0 
 项目代码/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-wal      |    0 
 项目代码/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db          |    0 
 项目代码/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-shm      |    0 
 项目代码/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db     |    0 
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs                          |    4 +
 项目代码/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-shm |    0 
 13 files changed, 65 insertions(+), 27 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/v17/DocumentLayout.backup.json" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/v17/DocumentLayout.backup.json"
index 05cc938..37072f8 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/v17/DocumentLayout.backup.json"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/v17/DocumentLayout.backup.json"
@@ -140,7 +140,7 @@
               "RelativeDocumentMoniker": "WIDESEAWCS_Tasks\\AGV\\CommonAGVJob.cs",
               "ToolTip": "E:\\GET\\DuiDuoJiLiKu\\\u9879\u76EE\u4EE3\u7801\\WCS\\WIDESEAWCS_Server\\WIDESEAWCS_Tasks\\AGV\\CommonAGVJob.cs",
               "RelativeToolTip": "WIDESEAWCS_Tasks\\AGV\\CommonAGVJob.cs",
-              "ViewState": "AgIAAJ0AAAAAAAAAAAAIwLoAAAAZAAAAAAAAAA==",
+              "ViewState": "AgIAAG0AAAAAAAAAAAAIwNUAAAARAAAAAAAAAA==",
               "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
               "WhenOpened": "2025-10-09T05:11:29.775Z",
               "EditorCaption": ""
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db"
index 560f217..d332569 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db"
Binary files differ
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-shm" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-shm"
index a2725c1..e9c3cd2 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-shm"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-shm"
Binary files differ
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-wal" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-wal"
index 429f682..a2af90c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-wal"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/CodeChunks.db-wal"
Binary files differ
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db"
index 457d3a1..913e462 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db"
Binary files differ
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-shm" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-shm"
index 07f3a28..6067a7c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-shm"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-shm"
Binary files differ
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-wal" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-wal"
index 9af6f02..605dab1 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-wal"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.1231.31060/SemanticSymbols.db-wal"
Binary files differ
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/v17/DocumentLayout.backup.json" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/v17/DocumentLayout.backup.json"
index fc453d1..e82a6a4 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/v17/DocumentLayout.backup.json"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/v17/DocumentLayout.backup.json"
@@ -19,10 +19,6 @@
       "RelativeMoniker": "D:0:0:{D81A65B5-47D1-40C1-8FDE-7D24FF003F51}|WIDESEA_WMSServer\\WIDESEA_WMSServer.csproj|solutionrelative:widesea_wmsserver\\controllers\\task\\taskcontroller.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
     },
     {
-      "AbsoluteMoniker": "D:0:0:{986CA639-B3B4-4D4F-B12B-3D8FBA48B2B1}|WIDESEA_IStorageTaskService\\WIDESEA_IStorageTaskServices.csproj|e:\\get\\duiduojiliku\\\u9879\u76EE\u4EE3\u7801\\wms\\widesea_wmsserver\\widesea_istoragetaskservice\\task\\idt_taskservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
-      "RelativeMoniker": "D:0:0:{986CA639-B3B4-4D4F-B12B-3D8FBA48B2B1}|WIDESEA_IStorageTaskService\\WIDESEA_IStorageTaskServices.csproj|solutionrelative:widesea_istoragetaskservice\\task\\idt_taskservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
-    },
-    {
       "AbsoluteMoniker": "D:0:0:{929DF936-042C-4EEC-8722-A831FC2F0AEA}|WIDESEA_DTO\\WIDESEA_DTO.csproj|e:\\get\\duiduojiliku\\\u9879\u76EE\u4EE3\u7801\\wms\\widesea_wmsserver\\widesea_dto\\basic\\requesttaskdto.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
       "RelativeMoniker": "D:0:0:{929DF936-042C-4EEC-8722-A831FC2F0AEA}|WIDESEA_DTO\\WIDESEA_DTO.csproj|solutionrelative:widesea_dto\\basic\\requesttaskdto.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
     },
@@ -46,7 +42,7 @@
       "DocumentGroups": [
         {
           "DockedWidth": 200,
-          "SelectedChildIndex": 5,
+          "SelectedChildIndex": 4,
           "Children": [
             {
               "$type": "Document",
@@ -90,18 +86,6 @@
             {
               "$type": "Document",
               "DocumentIndex": 4,
-              "Title": "IDt_TaskService.cs",
-              "DocumentMoniker": "E:\\GET\\DuiDuoJiLiKu\\\u9879\u76EE\u4EE3\u7801\\WMS\\WIDESEA_WMSServer\\WIDESEA_IStorageTaskService\\Task\\IDt_TaskService.cs",
-              "RelativeDocumentMoniker": "WIDESEA_IStorageTaskService\\Task\\IDt_TaskService.cs",
-              "ToolTip": "E:\\GET\\DuiDuoJiLiKu\\\u9879\u76EE\u4EE3\u7801\\WMS\\WIDESEA_WMSServer\\WIDESEA_IStorageTaskService\\Task\\IDt_TaskService.cs",
-              "RelativeToolTip": "WIDESEA_IStorageTaskService\\Task\\IDt_TaskService.cs",
-              "ViewState": "AgIAAFYAAAAAAAAAAAAswGYAAABeAAAAAAAAAA==",
-              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
-              "WhenOpened": "2025-11-29T08:44:47.025Z"
-            },
-            {
-              "$type": "Document",
-              "DocumentIndex": 5,
               "Title": "RequestTaskDto.cs",
               "DocumentMoniker": "E:\\GET\\DuiDuoJiLiKu\\\u9879\u76EE\u4EE3\u7801\\WMS\\WIDESEA_WMSServer\\WIDESEA_DTO\\Basic\\RequestTaskDto.cs",
               "RelativeDocumentMoniker": "WIDESEA_DTO\\Basic\\RequestTaskDto.cs",
@@ -119,14 +103,14 @@
               "RelativeDocumentMoniker": "WIDESEA_StorageTaskServices\\Task\\Dt_TaskService.cs",
               "ToolTip": "E:\\GET\\DuiDuoJiLiKu\\\u9879\u76EE\u4EE3\u7801\\WMS\\WIDESEA_WMSServer\\WIDESEA_StorageTaskServices\\Task\\Dt_TaskService.cs",
               "RelativeToolTip": "WIDESEA_StorageTaskServices\\Task\\Dt_TaskService.cs",
-              "ViewState": "AgIAAPUCAAAAAAAAAAAswAcDAAAjAAAAAAAAAA==",
+              "ViewState": "AgIAAEoJAAAAAAAAAAAUwFoJAAAmAAAAAAAAAA==",
               "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
               "WhenOpened": "2025-11-25T03:32:15.952Z",
               "EditorCaption": ""
             },
             {
               "$type": "Document",
-              "DocumentIndex": 6,
+              "DocumentIndex": 5,
               "Title": "appsettings.json",
               "DocumentMoniker": "E:\\GET\\DuiDuoJiLiKu\\\u9879\u76EE\u4EE3\u7801\\WMS\\WIDESEA_WMSServer\\WIDESEA_WMSServer\\appsettings.json",
               "RelativeDocumentMoniker": "WIDESEA_WMSServer\\appsettings.json",
@@ -138,7 +122,7 @@
             },
             {
               "$type": "Document",
-              "DocumentIndex": 8,
+              "DocumentIndex": 7,
               "Title": "InboundOrderController.cs",
               "DocumentMoniker": "E:\\GET\\DuiDuoJiLiKu\\\u9879\u76EE\u4EE3\u7801\\WMS\\WIDESEA_WMSServer\\WIDESEA_WMSServer\\Controllers\\Order\\InboundOrderController.cs",
               "RelativeDocumentMoniker": "WIDESEA_WMSServer\\Controllers\\Order\\InboundOrderController.cs",
@@ -150,7 +134,7 @@
             },
             {
               "$type": "Document",
-              "DocumentIndex": 7,
+              "DocumentIndex": 6,
               "Title": "Dt_InboundOrderService.cs",
               "DocumentMoniker": "E:\\GET\\DuiDuoJiLiKu\\\u9879\u76EE\u4EE3\u7801\\WMS\\WIDESEA_WMSServer\\WIDESEA_OrderServices\\Dt_InboundOrderService.cs",
               "RelativeDocumentMoniker": "WIDESEA_OrderServices\\Dt_InboundOrderService.cs",
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs"
index d6f2d2a..984e0de 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_IStorageTaskService/Task/IDt_TaskService.cs"
@@ -107,7 +107,7 @@
     Task<WebResponseContent> HandAllocateOutBoundTaskAsync(List<DtStockInfoDetail> details);
 
 
-    (List<DtLocationStatusChangeRecord>, List<DtLocationInfo>) GetlcoationState(Dt_Task task, StatusChangeTypeEnum StatusChangeTypeEnum);
+    (List<DtLocationStatusChangeRecord>, List<DtLocationInfo>) GetlcoationState(Dt_Task task, StatusChangeTypeEnum StatusChangeTypeEnum,DtLocationInfo location);
 
 
     /// <summary>
@@ -166,6 +166,8 @@
 
     (List<DtLocationStatusChangeRecord>, List<DtLocationInfo>) UpdateLocationStatus(string locationCode, LocationEnum locationStatus, int taskNum, int StatusChangeType);
 
+    (DtLocationStatusChangeRecord, DtLocationInfo) UpdateEndLocationStatus(string locationCode, LocationEnum locationStatus, int taskNum, StatusChangeTypeEnum StatusChangeType);
+
     (DtLocationStatusChangeRecord, DtLocationInfo) UpdateLocationStatus(string locationCode, LocationEnum locationStatus, int taskNum, StatusChangeTypeEnum StatusChangeType);
 
     bool LocationIsOutBound(DtLocationInfo location);
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_AllocateOutboundOrderService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_AllocateOutboundOrderService.cs"
index 3cc3179..78e9eaf 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_AllocateOutboundOrderService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_AllocateOutboundOrderService.cs"
@@ -229,6 +229,12 @@
                             var result1 = _taskService.UpdateLocationStatus(item.SourceAddress, LocationEnum.InStockDisable, item.TaskNum.Value,(int)StatusChangeTypeEnum.AutomaticOutbound);
                             locationStatusChangeRecords.AddRange(result1.Item1);
                             locations.AddRange(result1.Item2);
+                            var result2 = _taskService.UpdateEndLocationStatus(item.TargetAddress, LocationEnum.Lock, item.TaskNum.Value, StatusChangeTypeEnum.AutomaticOutbound);
+                            if (result2.Item1 != null && result2.Item2 != null)
+                            {
+                                locationStatusChangeRecords.AddRange(result2.Item1);
+                                locations.AddRange(result2.Item2);
+                            }
                         }
                         outboundOrder.OrderStatus = (int)OrderStateEmun.寮�濮�;
                         await _unitOfWorkManage.UseTranAsync(async () =>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_ProductionOutboundOrderService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_ProductionOutboundOrderService.cs"
index fe1cbe1..d0471b1 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_ProductionOutboundOrderService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_OrderServices/Dt_ProductionOutboundOrderService.cs"
@@ -210,6 +210,13 @@
                         {
                             taskDTOs.Add(CreateTaskDTO(item));
                             var result1 = _taskService.UpdateLocationStatus(item.SourceAddress, LocationEnum.InStockDisable, item.TaskNum.Value, (int)StatusChangeTypeEnum.AutomaticOutbound);
+                            var result2 = _taskService.UpdateEndLocationStatus(item.TargetAddress, LocationEnum.Lock, item.TaskNum.Value, StatusChangeTypeEnum.AutomaticOutbound);
+                            if (result2.Item1 != null && result2.Item2 != null)
+                            {
+                                locationStatusChangeRecords.AddRange(result2.Item1);
+                                locations.AddRange(result2.Item2);
+                            }
+
                             locationStatusChangeRecords.AddRange(result1.Item1);
                             locations.AddRange(result1.Item2);
                         }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs"
index a6376fd..52dad88 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs"
@@ -520,6 +520,12 @@
 
             await _unitOfWorkManage.UseTranAsync(async () =>
             {
+                if (taskDto.AreaId == 3 || taskDto.AreaId == 7)
+                {
+                    var result2 = UpdateLocationStatus(taskNew.TargetAddress, LocationEnum.Lock, taskNew.TaskNum.Value, (int)StatusChangeTypeEnum.AutomaticInbound);
+                    await _locationStatusChangeRecordRepository.AddDataAsync(result2.Item1);
+                    await _locationRepository.UpdateDataAsync(result2.Item2);
+                }
                 await _locationStatusChangeRecordRepository.AddDataAsync(result.Item1);
                 await _locationRepository.UpdateDataAsync(result.Item2);
                 BaseDal.AddData(taskNew);
@@ -658,7 +664,7 @@
             });
 
             var taskDto = CreateListTaskDTO(taskNew);
-            var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound);
+            var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound, location);
             await _unitOfWorkManage.UseTranAsync(async () =>
             {
                 await BaseDal.AddDataAsync(taskNew);
@@ -733,7 +739,7 @@
             stock.StockInfoDetails = details;
 
             var taskDto = CreateListTaskDTO(taskNew);
-            var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound);
+            var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound, stock.LocationInfo);
             await _unitOfWorkManage.UseTranAsync(async () =>
             {
                 await BaseDal.AddDataAsync(taskNew);
@@ -816,7 +822,7 @@
             stock.StockInfoDetails = details;
 
             var taskDto = CreateListTaskDTO(taskNew);
-            var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound);
+            var result = GetlcoationState(taskNew, StatusChangeTypeEnum.AutomaticOutbound, stock.LocationInfo);
             await _unitOfWorkManage.UseTranAsync(async () =>
             {
                 await BaseDal.AddDataAsync(taskNew);
@@ -833,13 +839,20 @@
         }
     }
 
-    public (List<DtLocationStatusChangeRecord>,List<DtLocationInfo>) GetlcoationState(Dt_Task task, StatusChangeTypeEnum StatusChangeTypeEnum)
+    public (List<DtLocationStatusChangeRecord>,List<DtLocationInfo>) GetlcoationState(Dt_Task task, StatusChangeTypeEnum StatusChangeTypeEnum, DtLocationInfo location)
     {
         List<DtLocationStatusChangeRecord> locationStatusChangeRecords = new List<DtLocationStatusChangeRecord>();
         List<DtLocationInfo> locations = new List<DtLocationInfo>();
         var result = UpdateLocationStatus(task.SourceAddress, LocationEnum.InStockDisable, task.TaskNum.Value, (int)StatusChangeTypeEnum);
         locationStatusChangeRecords.AddRange(result.Item1);
         locations.AddRange(result.Item2);
+
+        if(location.AreaId ==3|| location.AreaId == 7)
+        {
+            var result2 = UpdateLocationStatus(task.TargetAddress, LocationEnum.Lock, task.TaskNum.Value, (int)StatusChangeTypeEnum);
+            locationStatusChangeRecords.AddRange(result2.Item1);
+            locations.AddRange(result2.Item2);
+        }
 
         return (locationStatusChangeRecords,locations);
     }
@@ -1988,6 +2001,32 @@
         return (changeRecordDto, locations);
     }
 
+    public (DtLocationStatusChangeRecord, DtLocationInfo) UpdateEndLocationStatus(string locationCode, LocationEnum locationStatus, int taskNum, StatusChangeTypeEnum StatusChangeType)
+    {
+        var location = _locationRepository.QueryFirst(x => x.LocationCode == locationCode);
+
+        if (location != null && (location.AreaId == 3 || location.AreaId == 7))
+        {
+            int Beforelocation = location.LocationStatus;
+
+            location.LocationStatus = (int)locationStatus;
+
+            DtLocationStatusChangeRecord dtLocationStatusChangeRecord = new DtLocationStatusChangeRecord()
+            {
+                ChangeType = (int)StatusChangeType,
+                LocationCode = locationCode,
+                LocationId = location.Id,
+                Creater = "System",
+                TaskNum = taskNum,
+                AfterStatus = location.LocationStatus,
+                BeforeStatus = Beforelocation,
+            };
+
+            return (dtLocationStatusChangeRecord, location);
+        }
+        return (null, null);
+    }
+
     public (DtLocationStatusChangeRecord, DtLocationInfo) UpdateLocationStatus(string locationCode, LocationEnum locationStatus, int taskNum, StatusChangeTypeEnum StatusChangeType)
     {
         var location = _locationRepository.QueryFirst(x => x.LocationCode == locationCode);
diff --git "a/\351\241\271\347\233\256\350\265\204\346\226\231/\351\200\232\344\277\241\345\215\217\350\256\256/~$\346\217\220\345\215\207\346\234\272\351\200\232\350\256\257\345\215\217\350\256\2562025.7.22\346\226\260\347\250\213\345\272\217\344\275\277\347\224\250\357\274\201\0501\051.xlsx" "b/\351\241\271\347\233\256\350\265\204\346\226\231/\351\200\232\344\277\241\345\215\217\350\256\256/~$\346\217\220\345\215\207\346\234\272\351\200\232\350\256\257\345\215\217\350\256\2562025.7.22\346\226\260\347\250\213\345\272\217\344\275\277\347\224\250\357\274\201\0501\051.xlsx"
deleted file mode 100644
index 1e0c8b3..0000000
--- "a/\351\241\271\347\233\256\350\265\204\346\226\231/\351\200\232\344\277\241\345\215\217\350\256\256/~$\346\217\220\345\215\207\346\234\272\351\200\232\350\256\257\345\215\217\350\256\2562025.7.22\346\226\260\347\250\213\345\272\217\344\275\277\347\224\250\357\274\201\0501\051.xlsx"
+++ /dev/null
Binary files differ

--
Gitblit v1.9.3