| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection.Metadata; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_DTO; |
| | | using WIDESEAWCS_Model.Models; |
| | |
| | | #region ä¸åå¯ä¹å£«AGVä»»å¡ |
| | | public void SendGALAXISTask(List<Dt_Task> tasks) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); // å建ååºå¯¹è±¡ |
| | | GALAXISTaskInfo gALAXISTaskInfo = new(); |
| | | try |
| | | { |
| | |
| | | Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(GALAXISTaskInfo)) ?? throw new Exception("æªæ¾å°å¯ä¹å£«AGVä»»å¡ä¸åæ¥å£é
置信æ¯ï¼è¯·æ£æ¥æ¥å£é
ç½®"); |
| | | string response = HttpHelper.Post(apiInfo.ApiAddress, gALAXISTaskInfo.Serialize()); |
| | | GALAXISReturn agvContent = response.DeserializeObject<GALAXISReturn>(); |
| | | content.Data = agvContent; |
| | | if (agvContent.success) |
| | | { |
| | | if (agvContent.data.returnStatus != 0) throw new Exception(agvContent.data.returnInfo); |
| | |
| | | { |
| | | task.TaskState = (int)TaskStatusEnum.Execut; |
| | | }); |
| | | content.OK(); |
| | | _taskService.UpdateData(tasks); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | WriteError(nameof(TaskJob), ex.Message, ex); |
| | | content.Error(ex.Message); |
| | | //WriteError(nameof(TaskJob), ex.Message, ex); |
| | | } |
| | | finally |
| | | { |
| | | _trackloginfoService.AddTrackLog(gALAXISTaskInfo.Serialize(), content, "ä¸åå¯ä¹å£«AGVä»»å¡","",""); |
| | | //dt_trackloginfoService.Instance.AddTrackLog(outTaskInfo, content, "æ¥æ¶å®èªWMSåºåºä»»å¡ä¸å", "", $"{msg},åæ´ç»æ:{content.Status}"); |
| | | } |
| | | } |
| | | #endregion |