From 88724eca51a5863f20ee0a552af741aeebf4e8f2 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期三, 11 二月 2026 17:31:45 +0800
Subject: [PATCH] 添加堆垛机配置并重构任务

---
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotJob.cs |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotJob.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotJob.cs
index d780e0b..b63717b 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotJob.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotJob.cs
@@ -134,7 +134,6 @@
         /// <returns></returns>
         private async Task<string?> _TcpSocket_MessageReceived(string message, bool isJson, TcpClient client, RobotSocketState state)
         {
-            WebResponseContent content = new WebResponseContent();
             string messageLower = message.ToLowerInvariant();
 
             if (await IsSimpleCommandAsync(messageLower, state))
@@ -178,10 +177,8 @@
                             state.LastPickPositions = positions;
 
                             var result = await HttpRequestHelper.HTTPPostAsync(nameof(Category.WMS), stockDTO.ToJsonString(), state.CurrentTask?.RobotTaskType == 2 ? nameof(ConfigKey.ChangePalletAsync) : nameof(ConfigKey.SplitPalletAsync));
-                            WebResponseContent? contentNullable = JsonConvert.DeserializeObject<WebResponseContent>(result);
-                            content = contentNullable ?? new WebResponseContent();
 
-                            if (content.Status)
+                            if (result.Status)
                             {
                                 state.CurrentAction = "PickFinished";
                             }
@@ -210,10 +207,8 @@
                                         .ToList()
                                 };
                                 var result = await HttpRequestHelper.HTTPPostAsync(nameof(Category.WMS), stockDTO.ToJsonString(), nameof(ConfigKey.GroupPalletAsync));
-                                WebResponseContent? contentNullable = JsonConvert.DeserializeObject<WebResponseContent>(result);
-                                content = contentNullable ?? new WebResponseContent();
 
-                                if (content.Status)
+                                if (result.Status)
                                 {
                                     state.CurrentAction = "PutFinished";
                                 }
@@ -339,18 +334,14 @@
             };
 
             var result = await HttpRequestHelper.HTTPPostAsync(nameof(Category.WMS), taskDto.ToJsonString(), nameof(ConfigKey.CreateTaskInboundAsync));
-            WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result) ?? new WebResponseContent();
-            if (!content.Status)
+            if (!result.Status)
             {
                 return;
             }
 
-            WMSTaskDTO taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(content.Data.ToString() ?? string.Empty) ?? new WMSTaskDTO();
-            content = _taskService.ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO });
-            if (!content.Status)
-            {
-                return;
-            }
+            WMSTaskDTO taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(result.Data.ToString() ?? string.Empty) ?? new WMSTaskDTO();
+            var content = _taskService.ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO });
+            if (!content.Status) return;
 
             var taskInfo = _taskService.QueryByTaskNum(taskDTO.TaskNum);
 

--
Gitblit v1.9.3