1
dengjunjie
2025-01-10 96e6dc957aee5d20218ac8127a28db6a7e6ba6de
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ÓÍÄ«²Ö/StackerCraneJob_YM.cs
@@ -77,12 +77,9 @@
                                    if (sendFlag)
                                    {
                                        commonStackerCrane.LastTaskType = task.TaskType;
                                        int oldState = task.TaskState;
                                        task.TaskState = TaskStatusEnum.SC_Executing.ObjToInt();
                                        task.ExceptionMessage = "";
                                        task.Dispatchertime = DateTime.Now;
                                        _taskRepository.UpdateData(task);
                                        _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"系统自动流程,任务状态从【{oldState}】转到【{task.TaskState}】");
                                        task.ExceptionMessage = "";
                                        _taskService.UpdateTask(task, TaskStatusEnum.SC_Executing);
                                    }
                                }
                            }
@@ -113,7 +110,7 @@
                {
                    if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5)
                    {
                        WriteInfo(commonStackerCrane.DeviceName, $"读取到任务完成信号,{e.TaskNum}");
                        WriteDebug(commonStackerCrane.DeviceName, $"读取到任务完成信号,{e.TaskNum}");
                        Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == e.TaskNum);
                        if (task != null)
                        {
@@ -121,7 +118,7 @@
                        }
                        else
                        {
                            WriteInfo(commonStackerCrane.DeviceName, $"读取到任务完成信号,未找到对应的任务信息,{e.TaskNum}");
                            WriteError(commonStackerCrane.DeviceName, $"读取到任务完成信号,未找到对应的任务信息,{e.TaskNum}");
                        }
                        commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5);
                    }
@@ -130,7 +127,6 @@
            catch (Exception ex)
            {
                WriteError(commonStackerCrane?.DeviceCode ?? nameof(StackerCraneJob_YM), ex.Message, ex);
            }
        }
@@ -249,7 +245,7 @@
                else
                {
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"入库任务起点错误,起点:【{task.CurrentAddress}】");
                    WriteInfo(task.DeviceCode, $"入库任务起点错误,起点:【{task.CurrentAddress}】");
                    WriteError(task.DeviceCode, $"入库任务起点错误,起点:【{task.CurrentAddress}】");
                    return null;
                }
@@ -264,7 +260,7 @@
                {
                    //数据配置错误
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"入库任务终点错误,终点:【{task.NextAddress}】");
                    WriteInfo(task.DeviceCode, $"入库任务终点错误,终点:【{task.NextAddress}】");
                    WriteError(task.DeviceCode, $"入库任务终点错误,终点:【{task.NextAddress}】");
                    return null;
                }
            }
@@ -282,7 +278,7 @@
                {
                    //数据配置错误
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"出库任务终点错误,终点:【{task.NextAddress}】");
                    WriteInfo(task.DeviceCode, $"出库任务终点错误,终点:【{task.NextAddress}】");
                    WriteError(task.DeviceCode, $"出库任务终点错误,终点:【{task.NextAddress}】");
                    return null;
                }
@@ -297,7 +293,7 @@
                {
                    //数据配置错误
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"出库任务起点错误,起点:【{task.CurrentAddress}】");
                    WriteInfo(task.DeviceCode, $"出库任务起点错误,起点:【{task.CurrentAddress}】");
                    WriteError(task.DeviceCode, $"出库任务起点错误,起点:【{task.CurrentAddress}】");
                    return null;
                }
            }
@@ -314,7 +310,7 @@
                {
                    //数据配置错误
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"移库任务终点错误,终点:【{task.NextAddress}】");
                    WriteInfo(task.DeviceCode, $"移库任务终点错误,终点:【{task.NextAddress}】");
                    WriteError(task.DeviceCode, $"移库任务终点错误,终点:【{task.NextAddress}】");
                    return null;
                }
                string[] sourceCodes = task.CurrentAddress.Split("-");
@@ -328,7 +324,7 @@
                {
                    //数据配置错误
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"移库任务起点错误,起点:【{task.CurrentAddress}】");
                    WriteInfo(task.DeviceCode, $"移库任务起点错误,起点:【{task.CurrentAddress}】");
                    WriteError(task.DeviceCode, $"移库任务起点错误,起点:【{task.CurrentAddress}】");
                    return null;
                }
            }