From fe6e4884fc9316df52e1180146891c5498f364f4 Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期一, 02 三月 2026 16:28:23 +0800
Subject: [PATCH] 优化

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/KLSTaskExtend.cs             |    2 +-
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/WMSReturnMethod.cs              |   23 +++++++++++++++++++++++
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskMethods.cs          |    7 ++++---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/WMS/WMSController.cs |   20 ++++++--------------
 4 files changed, 34 insertions(+), 18 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/WMSReturnMethod.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/WMSReturnMethod.cs"
new file mode 100644
index 0000000..5ec3e9e
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/WMS/WMSReturnMethod.cs"
@@ -0,0 +1,23 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEAWCS_Core;
+
+namespace WIDESEAWCS_DTO.WMS
+{
+    public class WMSReturnMethod
+    {
+
+        public static WMSReturn ReturnWMS(WebResponseContent content, int successCode = 0, int failCode = 404)
+        {
+            return new WMSReturn
+            {
+                code = content.Status ? successCode : failCode,
+                msg = content.Message ?? (content.Status ? "鎿嶄綔鎴愬姛" : "鎿嶄綔澶辫触"),
+                data = content.Status ? content.Data : null
+            };
+        }
+    }
+}
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/WMS/WMSController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/WMS/WMSController.cs"
index 0675f11..1edd6ad 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/WMS/WMSController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/WMS/WMSController.cs"
@@ -23,15 +23,7 @@
         }
 
 
-        public WMSReturn ReturnWMS(WebResponseContent content, int successCode = 0, int failCode = 404)
-        {
-            return new WMSReturn
-            {
-                code = content.Status ? successCode : failCode,
-                msg = content.Message ?? (content.Status ? "鎿嶄綔鎴愬姛" : "鎿嶄綔澶辫触"),
-                data = content.Status ? content.Data : null
-            };
-        }
+     
 
 
         /// <summary>
@@ -43,7 +35,7 @@
         public WMSReturn ReceiveWMSTask([FromBody] List<WMSTasksDTO> taskDTOs)
         {
             WebResponseContent content = _taskService.ReceiveWMSTask(taskDTOs);
-            return ReturnWMS(content);
+            return WMSReturnMethod.ReturnWMS(content);
         }
 
         /// <summary>
@@ -55,7 +47,7 @@
         public WMSReturn CancelWMSTask([FromBody] WMSCancelTask wMSCancelTask)
         {
             WebResponseContent content = _taskService.CancelWMSTask(wMSCancelTask);
-            return ReturnWMS(content);
+            return WMSReturnMethod.ReturnWMS(content);
         }
 
         /// <summary>
@@ -67,7 +59,7 @@
         public WMSReturn UpdateWMSTaskPriority([FromBody] WMSUpdateTaskPriority updateTaskPriority)
         {
             WebResponseContent content = _taskService.UpdateWMSTaskPriority(updateTaskPriority);
-            return ReturnWMS(content);
+            return WMSReturnMethod.ReturnWMS(content);
         }
 
         /// <summary>
@@ -79,7 +71,7 @@
         public WMSReturn ModifyWMSLayoutZone([FromBody] WMSUpdateLocationArea wMSUpdateLocationArea)
         {
             WebResponseContent content = _taskService.ModifyWMSLayoutZone(wMSUpdateLocationArea);
-            return ReturnWMS(content);
+            return WMSReturnMethod.ReturnWMS(content);
         }
 
         /// <summary>
@@ -91,7 +83,7 @@
         public WMSReturn LocationInquiry(string AreaCode)
         {
             WebResponseContent content = _taskService.LocationInquiry(AreaCode);
-            return ReturnWMS(content);
+            return WMSReturnMethod.ReturnWMS(content);
         }
     }
 }
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 be32c60..c2cec70 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"
@@ -39,7 +39,7 @@
             {
                 if (deviceTypeEnum == DeviceTypeEnum.GALAXIS)
                 {
-                    //GALAXISUpdateTaskStatus? gALAXIS = TaskDTO.Serialize().DeserializeObject<GALAXISUpdateTaskStatus>();
+                     gALAXIS = TaskDTO.Serialize().DeserializeObject<GALAXISUpdateTaskStatus>();
                     if (gALAXIS == null) throw new Exception("鍙傛暟杞崲澶辫触锛�");
                     var task = BaseDal.QueryFirst(x => x.WMSTaskNum == gALAXIS.taskId);
                     if (task == null) throw new Exception($"鏈壘鍒颁换鍔�,浠诲姟缂栧彿銆恵gALAXIS.taskId}銆�");
@@ -65,11 +65,12 @@
                 {
 
                 }
-                return WebResponseContent.Instance.OK();
+                //return WebResponseContent.Instance.OK();
+               return content.OK();
             }
             catch (Exception ex)
             {
-                return WebResponseContent.Instance.Error(ex.Message);
+                return content.Error(ex.Message);
             }
             finally
             {
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/KLSTaskExtend.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/KLSTaskExtend.cs"
index 510a784..adeaac1 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/KLSTaskExtend.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/Task/KLSTaskExtend.cs"
@@ -30,7 +30,7 @@
                     GALAXISTask gALAXISTask = new GALAXISTask()
                     {
                         taskId = task.WMSTaskNum,
-                        taskType = task.TaskType == (int)TaskTypeEnum.MLInbound ? 0 : 1,
+                        taskType = task.TaskType == (int)TaskTypeEnum.MLInbound ? 2 : 1,
                         barCode = task.PalletCode,
                         endNode = task.TargetAddress,
                         startNode = task.SourceAddress,

--
Gitblit v1.9.3