From f7ec7a32e8cddcb976093c826e3a0d1ed61fb335 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期日, 12 四月 2026 13:09:43 +0800
Subject: [PATCH] feat(任务服务): 扩展任务更新接口以支持地址信息

---
 Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_WCS.cs |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_WCS.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_WCS.cs
index ed7108a..3ff0a10 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_WCS.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_WCS.cs
@@ -567,18 +567,20 @@
         /// <param name="taskId"></param>
         /// <param name="newStatus"></param>
         /// <returns></returns>
-        public async Task<WebResponseContent> UpdateTaskByStatusAsync(int taskId, int newStatus)
+        public async Task<WebResponseContent> UpdateTaskByStatusAsync(UpdateTaskDto taskDto)
         {
             try
             {
-                var tasks = await BaseDal.QueryFirstAsync(s => s.TaskNum == taskId);
-                if (tasks == null)
+                var taskInfo = await BaseDal.QueryFirstAsync(s => s.TaskNum == taskDto.Id);
+                if (taskInfo == null)
                     return WebResponseContent.Instance.Error("鏈壘鍒板搴旂殑浠诲姟");
 
-                tasks.TaskStatus = newStatus;
-                await BaseDal.UpdateDataAsync(tasks);
+                taskInfo.TaskStatus = taskDto.NewStatus;
+                taskInfo.NextAddress = taskDto.NextAddress;
+                taskInfo.CurrentAddress = taskDto.CurrentAddress;
+                await BaseDal.UpdateDataAsync(taskInfo);
 
-                return WebResponseContent.Instance.OK("淇敼鎴愬姛", tasks);
+                return WebResponseContent.Instance.OK("淇敼鎴愬姛", taskInfo);
             }
             catch (Exception ex)
             {
@@ -930,7 +932,7 @@
                     }
                 };
 
-                await _unitOfWorkManage.BeginTranAsync(async () =>
+               return await _unitOfWorkManage.BeginTranAsync(async () =>
                 {
                     // 4. 淇濆瓨鍒版暟鎹簱
                     var result = await BaseDal.AddDataAsync(task) > 0;

--
Gitblit v1.9.3