diff --git a/WCS.BLL/Manager/AGVManager.cs b/WCS.BLL/Manager/AGVManager.cs index a03bace..8d55cd4 100644 --- a/WCS.BLL/Manager/AGVManager.cs +++ b/WCS.BLL/Manager/AGVManager.cs @@ -68,7 +68,8 @@ namespace WCS.BLL.Manager { var shelf = DbHelp.db.Queryable() .Where(t => t.ShelfCode == tasks[i].ShelfCode) - .Where(t => t.CurrentLocationId == tasks[i].StratLocationId && t.DestinationLocationId == tasks[i].EndLocationId) + .Where(t => t.CurrentTaskCode == tasks[i].TaskCode) + .Where(t => t.DestinationLocationId == tasks[i].EndLocationId) .First(); if (shelf != null) { diff --git a/WCS.WebApi/Controllers/AgvCallbackServiceController.cs b/WCS.WebApi/Controllers/AgvCallbackServiceController.cs index cf4637a..eb6bd44 100644 --- a/WCS.WebApi/Controllers/AgvCallbackServiceController.cs +++ b/WCS.WebApi/Controllers/AgvCallbackServiceController.cs @@ -89,6 +89,20 @@ namespace WCS.WebApi.Controllers DbHelp.db.Updateable(shelf).ExecuteCommand(); } + if (shelf != null && request.method == "cancel" && shelf.TransStatus == TransStatusEnum.运输中) + { + + //shelf.CurrentLocationId = 0; + //shelf.CurrentLocaiotnCode = string.Empty; + + shelf.DestinationLocationId = 0; + shelf.DestinationLocaiotnCode = string.Empty; + shelf.TransStatus = TransStatusEnum.静止; + shelf.CurrentTaskCode = string.Empty; + + DbHelp.db.Updateable(shelf).ExecuteCommand(); + } + if (shelf != null && request.method == "end" && shelf.TransStatus == TransStatusEnum.运输中) { task.TaskStatus = TaskStatusEnum.已结束;