| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | ServiceLogger.WriteDebug("ReceiveTask", $"任塿¥æ¶é误,é误信æ¯:{ex.Message}"); |
| | | ServiceLogger.WriteDebug("ReceiveTask", $"任塿¥æ¶é误,é误信æ¯:{ex.StackTrace}"); |
| | | content = WebResponseContent.Instance.Error($"任塿¥æ¶é误,é误信æ¯:{ex.Message}"); |
| | | } |
| | | return content; |
| | |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | //任塿§è¡å¤±è´¥ï¼è´§ä½ç¶æè¿å |
| | | ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"大å åæºæ§è¡åºåºä»»å¡å¤±è´¥ï¼,ä»»å¡å·:ã{taskNum}ã,失败信æ¯:ã{ex.Message}ã"); |
| | | content = WebResponseContent.Instance.Error($"大å åæºæ§è¡åºåºä»»å¡å¤±è´¥ï¼,ä»»å¡å·:ã{taskNum}ã,失败信æ¯:ã{ex.Message}ã"); |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | Dt_LocationInfo srcLocation = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.SourceAddress); |
| | | //Dt_LocationInfo srcLocation = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.SourceAddress); |
| | | //srcLocation.LocationStatus = (int)LocationStatusEnum.Free; |
| | | |
| | | |
| | |
| | | MESResponse res = ApiInvoke.SendTaskCMD(sendcmd); |
| | | if (res != null && res.code != 0) |
| | | { |
| | | ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"å°å åæºå®æåºåºä»»å¡ååä¼ MES失败ï¼,ä»»å¡å·:ã{taskNum}ã,失败信æ¯:ã{res.message}ã"); |
| | | content = WebResponseContent.Instance.Error($"å°å åæºå®æåºåºä»»å¡ååä¼ MES失败ï¼,ä»»å¡å·:ã{taskNum}ã,失败信æ¯:ã{res.message}ã"); |
| | | } |
| | | else |
| | | { |
| | | //夿æ¯å¦å®æçæåä¸å±ï¼èªå¨çæç©ºè½¦åºåºä»»å¡ |
| | | string[] Levels = task.Remark.Split("-"); |
| | | if (Levels.Length == 2) |
| | | { |
| | | if (!string.IsNullOrEmpty(Levels[0])&& !string.IsNullOrEmpty(Levels[1])) |
| | | { |
| | | //妿å½åæå屿°çäºæ»å±æï¼å表示æè½¦ææç屿°åå® |
| | | if(Convert.ToInt16(Levels[0])== Convert.ToInt16(Levels[1])) |
| | | { |
| | | string[] SourceCodes = task.SourceAddress.Split("-"); |
| | | string startPlan = ""; |
| | | if (SourceCodes.Length == 4) |
| | | { |
| | | startPlan= "101"+ SourceCodes[2].Substring(1,2); |
| | | } |
| | | DeliveryPlan send = new DeliveryPlan { startPlan = startPlan, isQuit = false, CarId = task.PalletCode }; |
| | | string inparam2 = JsonConvert.SerializeObject(send); |
| | | ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"å°å åæºæ§è¡åºåºä»»å¡åä¼ MESå
¥å{inparam2}"); |
| | | ApiInvoke.DeliveryPlanCMD(send);//åè°MESæ¥å£çæç©ºè½¦åºåºä»»å¡ |
| | | //ææç屿°é½åå®ï¼éè¦ææåä½ç¶ææ¹ä¸ºç©ºé²ç¶æ |
| | | srcLocation.LocationStatus = (int)LocationStatusEnum.Free; |
| | | _locationInfoRepository.UpdateData(srcLocation); |
| | | } |
| | | //else |
| | | //{ |
| | | // //夿æ¯å¦å®æçæåä¸å±ï¼èªå¨çæç©ºè½¦åºåºä»»å¡ |
| | | // string[] Levels = task.Remark.Split("-"); |
| | | // if (Levels.Length == 2) |
| | | // { |
| | | // if (!string.IsNullOrEmpty(Levels[0])&& !string.IsNullOrEmpty(Levels[1])) |
| | | // { |
| | | // //妿å½åæå屿°çäºæ»å±æï¼å表示æè½¦ææç屿°åå® |
| | | // if(Convert.ToInt16(Levels[0])== Convert.ToInt16(Levels[1])) |
| | | // { |
| | | // string[] SourceCodes = task.SourceAddress.Split("-"); |
| | | // string startPlan = ""; |
| | | // if (SourceCodes.Length == 4) |
| | | // { |
| | | // startPlan = "101" + SourceCodes[2].Substring(1, 2); |
| | | // } |
| | | // DeliveryPlan send = new DeliveryPlan { startPlan = startPlan, isQuit = false, CarId = task.PalletCode }; |
| | | // string inparam2 = JsonConvert.SerializeObject(send); |
| | | // ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"å°å åæºæ§è¡åºåºä»»å¡åä¼ MESå
¥å{inparam2}"); |
| | | // ApiInvoke.DeliveryPlanCMD(send);//åè°MESæ¥å£çæç©ºè½¦åºåºä»»å¡ |
| | | // ææç屿°é½åå®ï¼éè¦ææåä½ç¶ææ¹ä¸ºç©ºé²ç¶æ |
| | | // srcLocation.LocationStatus = (int)LocationStatusEnum.Free; |
| | | // _locationInfoRepository.UpdateData(srcLocation); |
| | | // } |
| | | |
| | | } |
| | | // } |
| | | |
| | | } |
| | | } |
| | | // } |
| | | //} |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"å°å åæºæ§è¡åºåºä»»å¡å¤±è´¥ï¼,ä»»å¡å·:ã{taskNum}ã,失败信æ¯:ã{ex.Message}ã"); |
| | | ServiceLogger.WriteDebug("StackCraneTaskCompleted", $"å°å åæºæ§è¡åºåºä»»å¡å¤±è´¥ï¼,ä»»å¡å·:ã{taskNum}ã,失败信æ¯:ã{ex.StackTrace}ã"); |
| | | content = WebResponseContent.Instance.Error($"å°å åæºæ§è¡åºåºä»»å¡å¤±è´¥ï¼,ä»»å¡å·:ã{taskNum}ã,失败信æ¯:ã{ex.Message}ã"); |
| | | } |
| | | |
| | |
| | | return content; |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ¢å¤æèµ·ä»»å¡ |
| | | /// </summary> |