From 63e1ee997a5318e628b992f969bdac2fec6dbf14 Mon Sep 17 00:00:00 2001
From: yangpeixing <yangpeixing@hnkhzn.com>
Date: 星期四, 04 十二月 2025 14:39:00 +0800
Subject: [PATCH] 1

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs |   46 ++++++++++++++++++++++++++++++++--------------
 1 files changed, 32 insertions(+), 14 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs"
index d2293fa..c3b59f9 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs"
@@ -1,11 +1,14 @@
 锘縰sing Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
+using System.Linq;
 using WIDESEAWCS_Core;
 using WIDESEAWCS_Core.BaseController;
 using WIDESEAWCS_DTO.TaskInfo;
 using WIDESEAWCS_ITaskInfoService;
 using WIDESEAWCS_Model.Models;
+using WIDESEAWCS_QuartzJob;
+using WIDESEAWCS_Tasks.ElevatorJob;
 
 namespace WIDESEAWCS_WCSServer.Controllers.Task
 {
@@ -25,26 +28,13 @@
             return Service.ReceiveWMSTask(taskDTOs);
         }
 
-        [HttpPost, Route("ReceiveByWMSTask"), AllowAnonymous]
-        public WebResponseContent ReceiveByWMSTask([FromBody] WMSTaskDTO taskDTOs)
-        {
-            return Service.ReceiveByWMSTask(taskDTOs);
-        }
-
-        [HttpPost, Route("ReceiveByWMSGWTask"), AllowAnonymous]
-        public WebResponseContent ReceiveByWMSGWTask([FromBody] WMSTaskDTO taskDTOs)
-        {
-            return Service.ReceiveByWMSGWTask(taskDTOs);
-        }
-
-
         [HttpPost, HttpGet, Route("UpdateTaskExceptionMessage")]
         public WebResponseContent UpdateTaskExceptionMessage(int taskNum, string message)
         {
             return Service.UpdateTaskExceptionMessage(taskNum, message);
         }
 
-        [HttpPost, HttpGet, Route("UpdateTaskStatusToNext")]
+        [HttpPost, HttpGet, Route("UpdateTaskStatusToNext") ,AllowAnonymous]
         public WebResponseContent UpdateTaskStatusToNext(int taskNum)
         {
             return Service.UpdateTaskStatusToNext(taskNum);
@@ -61,5 +51,33 @@
         {
             return Service.RollbackTaskStatusToLast(taskNum);
         }
+
+        [HttpPost, HttpGet, Route("SendAgvTask"),AllowAnonymous]
+        public WebResponseContent SendAgvTask(string modelProcessCode, int taskNum)
+        {
+            return Service.SendAgvTask(modelProcessCode, taskNum);
+        }
+
+        [HttpPost, HttpGet, Route("elevator"), AllowAnonymous]
+        public WebResponseContent initialzationElevator()
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                CommonElevator? commonElevator = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "TSJ1") as CommonElevator;
+                if(commonElevator != null)
+                {
+                    commonElevator.SetValue<ElevatorDBName, short>(ElevatorDBName.StopElevator, 1);
+                    Thread.Sleep(1000);
+                    commonElevator.SetValue<ElevatorDBName, short>(ElevatorDBName.StopElevator, 0);
+                    return content.OK("鎻愬崌鏈哄垵濮嬪寲鎴愬姛");
+                }
+                return content.Error("澶辫触");
+            }
+            catch(Exception ex)
+            {
+                return content.Error(ex.Message);
+            }
+        }
     }
 }

--
Gitblit v1.9.3