From f250fe4befac5c9bacaa6eae9fa87738a70663dd Mon Sep 17 00:00:00 2001
From: duyongjia <adu_555@163.com>
Date: 星期三, 15 一月 2025 08:45:54 +0800
Subject: [PATCH] 增加AGV重置按钮

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 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 e634901..c03a10b 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"
@@ -1149,6 +1149,26 @@
         }
 
         /// <summary>
+        /// 鍏佽閲嶇疆
+        /// </summary>
+        /// <param name="taskNum"></param>
+        /// <returns></returns>
+        public WebResponseContent AGVResetTask()
+        {
+            WebResponseContent content = new WebResponseContent();
+            Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == "1");
+            if (task != null)
+            {
+                UpdateTaskAllowIn(task.TaskNum, 0);
+            }
+            else
+            {
+                return WebResponseContent.Instance.Error($"鐩墠鏄厑璁GV杩涘叆鐘舵�侊紝鏃犻渶閲嶇疆锛�");
+            }
+            return content.Error("閲嶇疆鎴愬姛锛�");
+        }
+
+        /// <summary>
         /// 浠诲姟鍙栨秷
         /// </summary>
         /// <param name="taskid"></param>
@@ -1162,6 +1182,12 @@
                 Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == taskNum);
                 if (task == null) return WebResponseContent.Instance.Error($"鏈壘鍒拌浠诲姟淇℃伅,浠诲姟鍙�:銆恵taskNum}銆�");
 
+                //鍙栨秷浠诲姟鏃讹紝閲嶇疆鏄惁鍏佽杩涘叆
+                if (task.CurrentAddress == "1")
+                {
+                    UpdateTaskAllowIn(task.TaskNum, 0);
+                }
+
                 Dt_LocationInfo locationsrc = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.SourceAddress.ToString());
                 Dt_LocationInfo locationdsc = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.TargetAddress.ToString());
                 bool isBack = false;

--
Gitblit v1.9.3