| | |
| | | } |
| | | } |
| | | } |
| | | private readonly static object lockerCompleted = new object(); |
| | | /// <summary> |
| | | /// ä»»å¡å®æ |
| | | /// </summary> |
| | |
| | | { |
| | | try |
| | | { |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); |
| | | if (task != null) |
| | | lock (lockerCompleted) |
| | | { |
| | | task.TaskState = TaskStatusEnum.Finish.ObjToInt(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User?.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); |
| | | if (task != null) |
| | | { |
| | | task.TaskState = TaskStatusEnum.Finish.ObjToInt(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User?.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | } |
| | | string? url = apiInfos.FirstOrDefault(x => x.ApiCode == APIEnum.FeedBackWMSTaskCompleted.ToString())?.ApiAddress; |
| | | if (string.IsNullOrEmpty(url)) |
| | | { |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"æªæ¾å°WMSä»»å¡å®ææ¥å£,è¯·æ£æ¥æ¥å£é
ç½®"); |
| | | UpdateTaskExceptionMessage(taskNum, $"æªæ¾å°WMSä»»å¡å®ææ¥å£,è¯·æ£æ¥æ¥å£é
ç½®"); |
| | | return WebResponseContent.Instance.Error($"{taskNum},æªæ¾å°WMSä»»å¡å®ææ¥å£,è¯·æ£æ¥æ¥å£é
ç½®"); |
| | | } |
| | | string responseStr = HttpHelper.Get(url + "?taskNum=" + taskNum); |
| | | WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(responseStr) ?? WebResponseContent.Instance.Error($"{taskNum},æªæ¥æ¶å°ä»»å¡å®æè¿åå¼"); |
| | | return content; |
| | | } |
| | | string? url = apiInfos.FirstOrDefault(x => x.ApiCode == APIEnum.FeedBackWMSTaskCompleted.ToString())?.ApiAddress; |
| | | if (string.IsNullOrEmpty(url)) |
| | | { |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"æªæ¾å°WMSä»»å¡å®ææ¥å£,è¯·æ£æ¥æ¥å£é
ç½®"); |
| | | UpdateTaskExceptionMessage(taskNum, $"æªæ¾å°WMSä»»å¡å®ææ¥å£,è¯·æ£æ¥æ¥å£é
ç½®"); |
| | | return WebResponseContent.Instance.Error($"{taskNum},æªæ¾å°WMSä»»å¡å®ææ¥å£,è¯·æ£æ¥æ¥å£é
ç½®"); |
| | | } |
| | | string responseStr = HttpHelper.Get(url + "?taskNum=" + taskNum); |
| | | WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(responseStr) ?? WebResponseContent.Instance.Error($"{taskNum},æªæ¥æ¶å°ä»»å¡å®æè¿åå¼"); |
| | | return content; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | else if(task.TaskState == (int)TaskStatusEnum.AGV_Executing) |
| | | { |
| | | task.TaskState = TaskStatusEnum.AGV_Execute.ObjToInt(); |
| | | |
| | | }else if(task.TaskState == (int)TaskStatusEnum.AGV_Exception) |
| | | { |
| | | task.TaskState = TaskStatusEnum.AGV_Execute.ObjToInt(); |
| | | task.Remark = ""; |
| | | } |
| | | else |
| | | { |
| | |
| | | //å
¥åº |
| | | if (taskTypeGroup == TaskTypeGroup.InboundGroup) |
| | | { |
| | | if (router.NextPosi == "AGV" && router.StartPosi=="AGV") |
| | | if (router.NextPosi == "AGV" && router.StartPosi=="AGV") //å车AGVæ¬è¿å
¥åº |
| | | { |
| | | task.CurrentAddress = item.SourceAddress; |
| | | task.NextAddress = item.TargetAddress; |
| | |
| | | } |
| | | else |
| | | { |
| | | //æåç åä»»å¡çæ |
| | | if (taskTypeGroup == TaskTypeGroup.InboundGroup && !task.Roadway.Contains("YL")) |
| | | if (taskTypeGroup == TaskTypeGroup.InboundGroup && !task.Roadway.Contains("YL")) //æåç åä»»å¡çæ |
| | | { |
| | | task.CurrentAddress = router.StartPosi; |
| | | task.NextAddress = ""; |
| | |
| | | if (routers.Count == 1) |
| | | { |
| | | task.NextAddress = router.NextPosi; |
| | | task.DeviceCode = router.ChildPosi; |
| | | if (task.Roadway.Contains("StackPlate")) |
| | | task.DeviceCode = router.ChildPosiDeviceCode; |
| | | else |
| | | task.DeviceCode = router.ChildPosi; |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°WMSApiå°å"); |
| | | } |
| | | string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTaskSimple?stationCode={sourceAddress}&palletCode={palletCode}"); |
| | | string responseStr = HttpHelper.Get($"{address}/api/Task/DeviceRequestInboundTaskSimple?stationCode={sourceAddress}"); |
| | | WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr) ?? throw new Exception("ç»æè¿å为空"); |
| | | if (responseContent != null && responseContent.Status && responseContent.Data != null) |
| | | if (responseContent.Status && responseContent.Data != null) |
| | | { |
| | | WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.ToString()); |
| | | if (taskDTO != null) |
| | |
| | | } |
| | | |
| | | return ""; |
| | | } |
| | | /// <summary> |
| | | /// åWMSæåå
¥åºæ«ç è¯·æ±æ´æ°æ¡ç |
| | | /// </summary> |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception"></exception> |
| | | public WebResponseContent RequestInBoundPalletCode(int taskNum,string barCode) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | string address = AppSettings.Get("WMSApiAddress"); |
| | | if (string.IsNullOrEmpty(address)) throw new Exception("æªæ¾å°WMSApiå°å"); |
| | | string responseStr = HttpHelper.Get($"{address}/api/Task/InBoundPalletCode?taskNum={taskNum}&barCode={barCode}"); |
| | | WebResponseContent responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr) ?? throw new Exception("æªæ¶å°è¿ååæ°"); |
| | | if (!responseContent.Status) |
| | | { |
| | | return responseContent; |
| | | } |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | |
| | | } |
| | | /// <summary> |
| | | /// åWMSç³è¯·åºåºAGVç»ç¹ |
| | |
| | | nextStatus = TaskStatusEnum.SC_Executing; |
| | | } |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) |
| | | { |
| | | task.TaskState = (int)TaskStatusEnum.SC_Executing; |
| | | nextStatus = TaskStatusEnum.SC_Executing; |
| | | } |
| | | else |
| | | { |
| | | throw new Exception($"ä»»å¡ç±»åé误,æªæ¾å°è¯¥ä»»å¡ç±»å,ä»»å¡å·:ã{task.TaskNum}ã,ä»»å¡ç±»å:ã{task.TaskType}ã"); |