From 11b3b4b866a284a6b3b2f34c70a46a33ad402e0e Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期三, 11 三月 2026 17:57:29 +0800
Subject: [PATCH] 优化出入库任务状态回传WMS

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs"
index ca5fdbb..d65db14 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs"
@@ -78,6 +78,10 @@
                         case "outbin":
                             TaskFromCompleted(task, deviceTypeEnum);
                             break;
+                        case "start":
+                            task.TaskState = (int)TaskStatusEnum.Takeing;
+                            TaskFeedback(task, 1);
+                            break;
                         default:
                             task.TaskState = ReturnTaskStatus(hIKROBOT.extra.values.method, deviceTypeEnum);
                             BaseDal.UpdateData(task);
@@ -96,7 +100,8 @@
                         if (task.TaskType == (int)TaskTypeEnum.CPInbound && task.TaskState == (int)TaskStatusEnum.Execut)
                         {
                             task.TaskState = (int)TaskStatusEnum.WaiCheckShape;
-                            BaseDal.UpdateData(task);//缁欒川妫�闂ㄥ啓鍏ュ惎鍔ㄤ俊鍙�
+                            //BaseDal.UpdateData(task);//缁欒川妫�闂ㄥ啓鍏ュ惎鍔ㄤ俊鍙�
+                            TaskFeedback(task, 4);
                             var device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "F1") as OtherDevice ?? throw new Exception("鏈壘鍒�1妤艰川妫�闂ㄨ澶囦俊鎭�");
                             device.SetValue(QualityInspectionCommandEnum.StartqualityInspection, true, task.SourceAddress);
                         }
@@ -356,8 +361,12 @@
                     boundCompleteFeedback.custStatus = "";
                     string response = HttpHelper.Post(apiInfo.ApiAddress, boundCompleteFeedback.Serialize());
                     agvContent = response.DeserializeObject<WMSReturn>();
-                    content.Data = agvContent;
-                    if (agvContent.code != 0) dt_Task.ExceptionMessage = agvContent.msg;
+                    content.OK(data: agvContent);
+                    if (agvContent.code != 200)
+                    {
+                        dt_Task.ExceptionMessage = agvContent.message;
+                        content.Error(agvContent.message);
+                    }
                 }
             }
             catch (Exception ex)
@@ -367,7 +376,7 @@
             finally
             {
                 _trackloginfoService.AddTrackLog(boundCompleteFeedback, content, "鍑哄叆搴撲换鍔$姸鎬佸弽棣圵MS", "", "");
-                if (agvContent != null && agvContent.code == 0 && Status == 2)
+                if (agvContent != null && agvContent.code == 200 && Status == 2)
                     BaseDal.DeleteAndMoveIntoHty(dt_Task, OperateTypeEnum.鑷姩瀹屾垚);
                 else
                     BaseDal.UpdateData(dt_Task);

--
Gitblit v1.9.3