| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Net.NetworkInformation; |
| | | using System.Reflection.Metadata; |
| | | using System.Text; |
| | | using System.Text.Json; |
| | |
| | | else if (task.TaskType == (int)TaskTypeEnum.CPInbound && task.TaskState == (int)TaskStatusEnum.Puting) |
| | | { |
| | | TaskCompleted(task, deviceTypeEnum); |
| | | } |
| | | else if (task.TaskType == (int)TaskTypeEnum.CPInbound && !string.IsNullOrEmpty(task.ExceptionMessage)) |
| | | { |
| | | ErrorTaskFeedback(task, !task.ExceptionMessage.Contains("夿£å¤±è´¥")); |
| | | } |
| | | else if (task.TaskType == (int)TaskTypeEnum.CPOutbound || task.TaskType == (int)TaskTypeEnum.CPMoveInventory)//åºåºãç§»åºå®æ |
| | | { |
| | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | #endregion |
| | | #region 失败任å¡ä¸æ¥WMSå¹¶å é¤ä»»å¡ |
| | | public WebResponseContent ErrorTaskFeedback(Dt_Task dt_Task, bool Del) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | WMSInOutBoundCompleteFeedback boundCompleteFeedback = new WMSInOutBoundCompleteFeedback(); |
| | | WMSReturn agvContent = null; |
| | | try |
| | | { |
| | | Dt_ApiInfo? apiInfo = _apiInfoService.Repository.QueryFirst(x => x.ApiCode == nameof(WMSInOutBoundCompleteFeedback)); |
| | | if (apiInfo == null) dt_Task.ExceptionMessage = "æªæ¾å°åºå
¥åºå®æåé¦WMSæ¥å£é
置信æ¯ï¼è¯·æ£æ¥æ¥å£é
ç½®"; |
| | | else |
| | | { |
| | | boundCompleteFeedback.taskCode = dt_Task.WMSTaskNum; |
| | | boundCompleteFeedback.containerCode = dt_Task.PalletCode; |
| | | boundCompleteFeedback.fromStationCode = dt_Task.SourceAddress; |
| | | boundCompleteFeedback.toLocationCode = dt_Task.TargetAddress; |
| | | boundCompleteFeedback.status = 3; |
| | | boundCompleteFeedback.custStatus = ""; |
| | | boundCompleteFeedback.memo = dt_Task.ExceptionMessage; |
| | | string response = HttpHelper.Post(apiInfo.ApiAddress, boundCompleteFeedback.Serialize()); |
| | | agvContent = response.DeserializeObject<WMSReturn>(); |
| | | content.OK(data: agvContent); |
| | | if (agvContent.code != 200) |
| | | { |
| | | dt_Task.ExceptionMessage = agvContent.message; |
| | | content.Error(agvContent.message); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | dt_Task.ExceptionMessage = ex.Message; |
| | | content.Error(ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | _trackloginfoService.AddTrackLog(boundCompleteFeedback, content, "åºå
¥åºä»»å¡ç¶æåé¦WMS", "", ""); |
| | | if (agvContent != null && agvContent.code == 200 && Del) BaseDal.DeleteAndMoveIntoHty(dt_Task, OperateTypeEnum.èªå¨å é¤); |
| | | else BaseDal.UpdateData(dt_Task); |
| | | } |
| | | return content; |
| | | } |
| | | #endregion |
| | | } |
| | | } |