| | |
| | | using System.Text.RegularExpressions; |
| | | using WIDESEA_DTO.Agv; |
| | | using WIDESEA_External.Model; |
| | | using WIDESEAWCS_Common; |
| | | using WIDESEAWCS_Common.APIEnum; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | var task = _taskRepository.QueryFirst(x => agvUpdateDTO.ContainerCode==x.PalletCode) ?? throw new Exception($"æªæ¾å°æç®±ã{agvUpdateDTO.ContainerCode}ãä»»å¡"); |
| | | var task = _taskRepository.QueryFirst(x => (agvUpdateDTO.ContainerCode ?? "")==x.PalletCode); |
| | | switch (agvUpdateDTO.MissionStatus) |
| | | { |
| | | case nameof(AGVStatusEnum.PICKER_RECEIVE): |
| | | if (task == null) throw new Exception($"æªæ¾å°æç®±ã{agvUpdateDTO.ContainerCode}ãä»»å¡"); |
| | | _taskService.UpdateTask(task, TaskStatusEnum.AGV_TakeFinish); |
| | | break; |
| | | case nameof(AGVStatusEnum.PICKER_SEND): |
| | | //WebResponseContent responseContent = _taskService.AgvTaskFlow(task.PalletCode); |
| | | //if (!responseContent.Status) throw new Exception($"{responseContent.Message}"); |
| | | if (task == null) throw new Exception($"æªæ¾å°æç®±ã{agvUpdateDTO.ContainerCode}ãä»»å¡"); |
| | | _taskService.TaskCompleted(task.TaskNum); |
| | | break; |
| | | case nameof(AGVStatusEnum.WAITFEEDBACK): |
| | | //AGVæ¾è¡ |
| | | List<Dt_StationManger> stationMangers = _stationMangerRepository.QueryData(x=>x.StationType==StationTypeEnum.StationType_OnlyInbound.ObjToInt()); |
| | | if (!stationMangers.Select(x=>x.StationCode).Contains(agvUpdateDTO.CurrentPosition)) |
| | | { |
| | | WebResponseContent responseContent = _taskService.AgvTaskFlow(agvUpdateDTO.MissionCode); |
| | | if (!responseContent.Status) throw new Exception($"{responseContent.Message}"); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |