From 89051aef8a2c1a85d457914cf6317fe70e0e321c Mon Sep 17 00:00:00 2001 From: hutongqing <hutongqing@hnkhzn.com> Date: 星期日, 29 十二月 2024 04:33:10 +0800 Subject: [PATCH] 1 --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGVController.cs | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGVController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGVController.cs" index 0cf13a6..9b15909 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGVController.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/AGVController.cs" @@ -46,12 +46,18 @@ if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt()) { var content = TakeRequest(task.CurrentAddress); - if (!content.Status) throw new Exception(content.Message); + if (!content.Status) + { + throw new Exception(content.Message); + } } else { var content = PutRequest(task.NextAddress, task.PalletType); - if (!content.Status) throw new Exception(content.Message); + if (!content.Status) + { + throw new Exception(content.Message); + } } task.TaskState = TaskStatusEnum.AGV_WaitToExecute.ObjToInt(); var up = _taskRepository.UpdateData(task); @@ -92,6 +98,7 @@ if (!content.Status) throw new Exception(content.Message); task.TaskState = TaskStatusEnum.AGV_Finish.ObjToInt(); var up = _taskRepository.DeleteAndMoveIntoHty(task, OperateTypeEnum.鑷姩瀹屾垚); + _taskService.TaskCompleted(task.TaskNum); agvResponseContent.Code = up ? "0" : "1"; agvResponseContent.Message = up ? "鎴愬姛" : "澶辫触"; return agvResponseContent; @@ -100,8 +107,10 @@ case "end"://鍏ュ簱鏍规嵁杩欎釜淇″彿鍒ゆ柇鏀捐揣瀹屾垚 if (task.TaskType != TaskTypeEnum.Outbound.ObjToInt()) { - var content = PutFinish(task.CurrentAddress); + var content = PutFinish(task.NextAddress); if (!content.Status) throw new Exception(content.Message); + task.CurrentAddress = task.NextAddress; + task.NextAddress = ""; task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); var up = _taskRepository.UpdateData(task); agvResponseContent.Code = up ? "0" : "1"; @@ -134,7 +143,7 @@ /// <param name="code"></param> /// <param name="palletType"></param> /// <returns></returns> - //[HttpPost, HttpGet, Route("PutRequest"), AllowAnonymous] + [HttpPost, HttpGet, Route("PutRequest"), AllowAnonymous] public WebResponseContent PutRequest(string code, int palletType) { try @@ -160,7 +169,6 @@ else { otherDevice.SetValue(GroundStationDBName.W_PutRequest, true, stationManger.StationCode); - otherDevice.SetValue(GroundStationDBName.W_PutPalletType, (short)palletType, stationManger.StationCode); Thread.Sleep(1000); canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanPut, stationManger.StationCode); if (canPut) @@ -185,6 +193,7 @@ /// </summary> /// <param name="code"></param> /// <returns></returns> + [HttpPost, HttpGet, Route("PutFinish"), AllowAnonymous] public WebResponseContent PutFinish(string code) { try @@ -217,6 +226,7 @@ /// </summary> /// <param name="code"></param> /// <returns></returns> + [HttpPost, HttpGet, Route("TakeRequest"), AllowAnonymous] public WebResponseContent TakeRequest(string code) { try @@ -266,6 +276,7 @@ /// </summary> /// <param name="code"></param> /// <returns></returns> + [HttpPost, HttpGet, Route("TakeFinish"), AllowAnonymous] public WebResponseContent TakeFinish(string code) { try -- Gitblit v1.9.3