wangxinhui
2026-01-12 541572199581a80979ec3b62245eb522542a7b15
ÏîÄ¿´úÂë/WCSServices/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs
@@ -65,7 +65,15 @@
                        break;
                    case nameof(AGVStatusEnum.PICKER_SEND):
                        if (task == null) throw new Exception($"未找到料箱【{agvUpdateDTO.ContainerCode}】任务");
                        _taskService.TaskCompleted(task.TaskNum);
                        Dt_StationManger? stationManger = _stationMangerRepository.QueryFirst(x=>x.PickStationCode==task.NextAddress);
                        if (task.IsCancel>0 && stationManger!=null && stationManger.StationCode!= agvUpdateDTO.CurrentPosition)
                        {
                            _taskService.TaskCancelCompleted(task.TaskNum);
                        }
                        else
                        {
                            _taskService.TaskCompleted(task.TaskNum);
                        }
                        break;
                    case nameof(AGVStatusEnum.WAITFEEDBACK):
                        //AGV放行
@@ -141,26 +149,28 @@
                if (stationManger.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt())
                {
                    commonConveyorLine.Communicator.Write("21", (short)256);
                    commonConveyorLine.Communicator.Write("21", new byte[] { 1, 0 });
                }
                else
                {
                    commonConveyorLine.Communicator.Write("23", (short)256);
                    commonConveyorLine.Communicator.Write("23", new byte[] { 1, 0 });
                }
                content.OK();
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("数据写入,地址:【23】,写入的数据:【256】") || ex.Message.Contains("数据写入,地址:【21】,写入的数据:【256】"))
                {
                    content.OK();
                }
                else
                {
                    content.Error(ex.Message);
                }
                content.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// AGV作业完成
        /// </summary>
        /// <returns></returns>
        [HttpPost, HttpGet, Route("AgvSearchStatus"), AllowAnonymous]
        public void AgvSearchStatus()
        {
            _taskService.AgvSearchStatus();
        }
    }
}