| | |
| | | { |
| | | public partial class TaskJob |
| | | { |
| | | |
| | | #region ä¸ååå车å
¥åºä»»å¡ |
| | | /// <summary> |
| | | /// ä¸ååå车æ°å»ºå
¥åºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="tasks"></param> |
| | | public void SendRGVInTask(List<Dt_Task> tasks) |
| | | public void SendRGVNewInTask(List<Dt_Task> tasks) |
| | | { |
| | | FOURBOTnewMovePodTask fOURBOTnewMovePodTask = new(); |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(FOURBOTnewMovePodTask)) ?? throw new Exception("æªæ¾å°åå车任å¡ä¸åæ¥å£é
置信æ¯ï¼è¯·æ£æ¥æ¥å£é
ç½®"); |
| | | int i = 0; |
| | | foreach (var task in tasks) |
| | | { |
| | | i++; |
| | | fOURBOTnewMovePodTask = new() |
| | | { |
| | | priority = task.Grade, |
| | | podID = task.PalletCode, |
| | | desExt = new |
| | | { |
| | | unload = 0//æ¯å¦æ¾ä¸å®¹å¨,0å¦1æ¯ |
| | | }, |
| | | desStationCodes = task.SourceAddress, |
| | | desType = 5 |
| | | }; |
| | | fOURBOTnewMovePodTask.requestID += i; |
| | | try |
| | | { |
| | | string response = HttpHelper.Post(apiInfo.ApiAddress, fOURBOTnewMovePodTask.Serialize()); |
| | | FOURBOTReturn fOURBOTReturn = response.DeserializeObject<FOURBOTReturn>(); |
| | | content.Data = fOURBOTReturn; |
| | | if (fOURBOTReturn.returnCode != 0) throw new Exception(fOURBOTReturn.returnUserMsg); |
| | | |
| | | string dataJson = fOURBOTReturn.data.ToString(); |
| | | FOURBOTnewMovePodTaskResponseData? fOURBO = JsonConvert.DeserializeObject<FOURBOTnewMovePodTaskResponseData>(dataJson); |
| | | if (fOURBO == null || fOURBO.taskID == 0) |
| | | { |
| | | throw new Exception($"æªè·åå°åå车è¿åçä»»å¡IDï¼è¿åæ°æ®ï¼{response}"); |
| | | } |
| | | //FOURBOTnewMovePodTaskResponseData fOURBO = fOURBOTReturn.data as FOURBOTnewMovePodTaskResponseData ?? throw new Exception("æªè·åå°åå车è¿åçä»»å¡ID"); |
| | | task.RGVTaskId = fOURBO.taskID; |
| | | task.ExceptionMessage = ""; |
| | | task.TaskState = (int)TaskStatusEnum.Execut; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | task.ExceptionMessage = ex.Message; |
| | | } |
| | | } |
| | | _taskService.UpdateData(tasks); |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | _trackloginfoService.AddTrackLog(fOURBOTnewMovePodTask, content, "ä¸ååå车æ°å»ºå
¥åºä»»å¡", "", ""); |
| | | } |
| | | } |
| | | |
| | | #region |
| | | /// <summary> |
| | | /// ä¸ååå车å¤å½¢æ£æµä»»å¡ |
| | | /// </summary> |
| | | /// <param name="tasks"></param> |
| | | public void SendRGVCheckShapeTask(List<Dt_Task> tasks) |
| | | { |
| | | FOURBOTnewMovePodTask fOURBOTnewMovePodTask = new(); |
| | | WebResponseContent content = new WebResponseContent(); |