From f49fa4b5027cfdc27b429985d023e8002abcca2e Mon Sep 17 00:00:00 2001
From: huanghongfeng <huanghongfeng@hnkhzn.com>
Date: 星期三, 05 十一月 2025 23:54:12 +0800
Subject: [PATCH] 1

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs |   55 +++++++++++--------------------------------------------
 1 files changed, 11 insertions(+), 44 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
index 6a7a5e1..5c96cff 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -244,11 +244,11 @@
                         WriteLog.GetLog("PLC鏃ュ織鍑哄簱鏃ュ織").Write($"绌烘墭鍑哄簱澶辫触锛岃鎯咃細{content.Message}", "闇�瑕佺┖鎵�");
                     }
                 }
-                return content = WebResponseContent.Instance.Error();
+                return content;
             }
             catch (Exception ex)
             {
-                return content = WebResponseContent.Instance.Error(ex.Message);
+                return content.Error(ex.Message);
             }
         }
 
@@ -598,19 +598,6 @@
             {
                 Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum);
                 if (task == null) return WebResponseContent.Instance.Error($"鏈壘鍒拌浠诲姟淇℃伅,浠诲姟鍙�:銆恵taskNum}銆�");
-
-                if(task.TaskType == (int)TaskRelocationTypeEnum.Relocation)
-                {
-                    if (task.TaskState != (int)TaskOutStatusEnum.ResRestNet)
-                    {
-                        return content = WebResponseContent.Instance.Error($"璇ヤ换鍔$姸鎬佷笉鍙烦杞埌涓嬩竴姝�,浠诲姟鍙�:銆恵task.TaskNum}銆�,浠诲姟鐘舵��:銆恵task.TaskState}銆�");
-                    }
-                    task.TaskState = (int)TaskOutStatusEnum.ResRest;    //涓嬪彂绉诲簱浠诲姟
-                    task.ModifyDate = DateTime.Now;
-                    task.Modifier = "System";
-                    BaseDal.UpdateData(task);
-                }
-
                 return UpdateTaskStatusToNext(task);
             }
             catch (Exception ex)
@@ -638,13 +625,10 @@
                         return content = WebResponseContent.Instance.Error($"璇ヤ换鍔$姸鎬佷笉鍙烦杞埌涓嬩竴姝�,浠诲姟鍙�:銆恵task.TaskNum}銆�,浠诲姟鐘舵��:銆恵task.TaskState}銆�");
                     }
 
-                    int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskOutStatusEnum>();
+                    //int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskOutStatusEnum>();
 
-                    task.TaskState = nextStatus;
-                    if (task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting)
-                    {
-                        task.Dispatchertime = DateTime.Now;
-                    }
+                    task.TaskState = (int)TaskOutStatusEnum.SC_OutExecuting;
+                    task.Dispatchertime = DateTime.Now;
                 }
                 else if (task.TaskType == (int)TaskInboundTypeEnum.Inbound)
                 {
@@ -653,34 +637,17 @@
                         return content = WebResponseContent.Instance.Error($"璇ヤ换鍔$姸鎬佷笉鍙烦杞埌涓嬩竴姝�,浠诲姟鍙�:銆恵task.TaskNum}銆�,浠诲姟鐘舵��:銆恵task.TaskState}銆�");
                     }
 
-                    int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskInStatusEnum>();
-                    task.TaskState = nextStatus;
-                    if (task.TaskState == (int)TaskInStatusEnum.SC_InExecuting)
-                    {
-                        task.Dispatchertime = DateTime.Now;
-                    }
-                    if (task.TaskState == (int)TaskRelocationTypeEnum.Relocation)
-                    {
-                        Random random = new Random();
-                        task.CurrentAddress = task.NextAddress;
-                        task.NextAddress = $"{random.Next(1, 100).ToString().PadLeft(3, '0')}-{random.Next(1, 100).ToString().PadLeft(3, '0')}-{random.Next(1, 100).ToString().PadLeft(3, '0')}";
-                        task.TargetAddress = task.NextAddress;
-                    }
+                    //int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskInStatusEnum>();
+                    task.TaskState = (int)TaskInStatusEnum.SC_InExecuting;
+                    task.Dispatchertime = DateTime.Now;
                 }
-                else if (task.TaskType == (int)TaskInboundTypeEnum.Inbound)
+                else if (task.TaskType == (int)TaskRelocationTypeEnum.Relocation)
                 {
-                    if (task.TaskState <= (int)TaskRelocationStatusEnum.SC_RelocationFinish)
+                    if (task.TaskState != (int)TaskOutStatusEnum.ResRestNet)
                     {
-                        
                         return content = WebResponseContent.Instance.Error($"璇ヤ换鍔$姸鎬佷笉鍙烦杞埌涓嬩竴姝�,浠诲姟鍙�:銆恵task.TaskNum}銆�,浠诲姟鐘舵��:銆恵task.TaskState}銆�");
                     }
-
-                    int nextStatus = (int)TaskRelocationStatusEnum.SC_RelocationExecuting;
-                    task.TaskState = nextStatus;
-                    if (task.TaskState == (int)TaskRelocationStatusEnum.SC_RelocationExecuting)
-                    {
-                        task.Dispatchertime = DateTime.Now;
-                    }
+                    task.TaskState = (int)TaskOutStatusEnum.ResRest;    //涓嬪彂绉诲簱浠诲姟
                 }
                 else
                 {

--
Gitblit v1.9.3