1
yangpeixing
2025-12-04 63e1ee997a5318e628b992f969bdac2fec6dbf14
项目代码/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
{
@@ -50,9 +53,31 @@
        }
        [HttpPost, HttpGet, Route("SendAgvTask"),AllowAnonymous]
        public Task<WebResponseContent> SendAgvTask(string modelProcessCode, int taskNum)
        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);
            }
        }
    }
}