| | |
| | | // 判断任务类型是否为出库任务 |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | if ((task.Roadway == "2000" || task.Roadway == "1529" )&& ( task.TaskType == (int)TaskOutboundTypeEnum.OutTray|| task.TaskType == (int)TaskOutboundTypeEnum.InToOut)) |
| | | if ((task.Roadway == "2000"||task.Roadway == "1529" )&& ( task.TaskType == (int)TaskOutboundTypeEnum.OutTray|| task.TaskType == (int)TaskOutboundTypeEnum.InToOut)) |
| | | { |
| | | // 设置任务状态为出库新建 |
| | | //task.TaskState = (int)TaskOutStatusEnum.SC_OutFinish; |
| | |
| | | { |
| | | return BaseDal.QueryFirst(x => x.TaskNum == taskNum && x.NextAddress == nextAddress && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting) && x.PalletCode == Barcode, TaskOrderBy); |
| | | } |
| | | /// <summary> |
| | | /// 根据托盘号、下一地址查询输送线执行中的任务 |
| | | /// </summary> |
| | | /// <param name="taskNum">任务号</param> |
| | | /// <param name="nextAddress">下一地址</param> |
| | | /// <returns></returns> |
| | | public Dt_Task QueryExecutingConveyorLineTask(string nextAddress, string Barcode) |
| | | { |
| | | return BaseDal.QueryFirst(x => (x.NextAddress == nextAddress || x.TargetAddress == nextAddress) && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting) && x.PalletCode == Barcode, TaskOrderBy); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 根据任务号、当前地址查询输送线完成的任务 |
| | |
| | | BaseDal.DeleteData(task); |
| | | _taskHtyRepository.AddData(task_Hty); |
| | | } |
| | | if(task.Roadway== "2000" && task.TaskState == (int)TaskOutStatusEnum.SC_OutFinish) |
| | | if(task.Roadway=="1326"&& task.TaskState == (int)TaskOutStatusEnum.SC_OutFinish) |
| | | { |
| | | task.TaskState = (int)TaskOutStatusEnum.Line_OutExecuting; |
| | | } |
| | |
| | | var wmsIpAddress = wmsBase + completeTask; |
| | | |
| | | var result = HttpHelper.GetAsync(wmsIpAddress, keys).Result; |
| | | QuartzLogger.WriteLogToFile($"Info_任务完成", $"任务完成,任务号:【{taskNum}】返回参数【{JsonConvert.SerializeObject(result)}】{Environment.NewLine}{Environment.NewLine}"); |
| | | |
| | | if(result != null) |
| | | content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | if (!content.Data.IsNullOrEmpty()) |
| | | { |
| | | content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | if (!content.Data.IsNullOrEmpty()) |
| | | if (content.Data.ToString() == "NG") |
| | | { |
| | | if (content.Data.ToString() == "NG") |
| | | { |
| | | task.Remark = "NG"; |
| | | //BaseDal.UpdateData(task); |
| | | //_taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"堆垛机出库完成,MOM返回NG"); |
| | | } |
| | | task.Remark = "NG"; |
| | | //BaseDal.UpdateData(task); |
| | | //_taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"堆垛机出库完成,MOM返回NG"); |
| | | } |
| | | task.ExceptionMessage += " " + content.Message; |
| | | } |
| | | task.ExceptionMessage += " " + content.Message; |
| | | |
| | | #endregion WMS同步任务完成 |
| | | |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup && task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting) |
| | |
| | | return wcsBasez + address; |
| | | } |
| | | |
| | | public WebResponseContent Delete(Dt_Task task) |
| | | { |
| | | var taskHty = task.Adapt<Dt_Task_Hty>(); |
| | | taskHty.Creater = App.User.UserName != null ? App.User.UserName : "System"; |
| | | _taskHtyRepository.AddData(taskHty); |
| | | return base.DeleteData(task); |
| | | } |
| | | |
| | | #region 重写方法 |
| | | |
| | | public override WebResponseContent DeleteData(object[] key) |