dengjunjie
2024-11-20 0d2f7d905975c1f5d39f70689760b070cef31349
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -15,7 +15,6 @@
using System.Threading.Tasks;
using WIDESEAWCS_Common.StackerCraneEnum;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Common.WMSInfo;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_IShuttleCar;
@@ -31,12 +30,11 @@
using WIDESEAWCS_TaskInfoService;
using WIDESEAWCS_Tasks.ConveyorLineJob;
using WIDESEAWCS_Tasks.StackerCraneJob;
using static WIDESEAWCS_Common.WMSInfo.RequestWMS;
namespace WIDESEAWCS_Tasks
{
    [DisallowConcurrentExecution]
    public partial class CommonStackerCraneJob : IJob
    public partial class CommonStackerCraneJob : JobBase, IJob
    {
        private readonly ITaskService _taskService;
        private readonly ITaskExecuteDetailService _taskExecuteDetailService;
@@ -104,9 +102,13 @@
                                        }
                                        else
                                        {
                                            task.ShuttleCarCode = ShuttleCar?.ShuttleCarCode;
                                            _taskService.UpdateData(task);
                                            SendTask(commonStackerCrane, task);//下发堆垛机任务
                                        }
                                    }
                                    else
                                        SendTask(commonStackerCrane, task);//下发堆垛机任务
                                }
                            }
@@ -135,7 +137,7 @@
                {
                    if (commonStackerCrane.SetValue(StackerCraneDBName.CommandSend, sendFlag))
                    {
                        commonStackerCrane.LastTaskType = task.TaskType;
                        if (task.TaskType != (int)TaskOtherTypeEnum.RelocationCar) commonStackerCrane.LastTaskType = task.TaskType;
                        _taskService.UpdateTaskStatusToNext(task.TaskNum);
                    }
                }
@@ -169,9 +171,12 @@
        {
            if (commonStackerCrane != null)
            {
                //if (_taskService.GetTaskInfo(commonStackerCrane.CurrentTaskNum) != null)
                //{
                Console.Out.WriteLine($"堆垛机任务完成:[{commonStackerCrane.CurrentTaskNum}];{DateTime.Now}");
                var Status = _taskService.StackCraneTaskCompleted(commonStackerCrane.CurrentTaskNum).Status;///需修改!!!!!!!!!!!!!!
                var Status = _taskService.StackCraneTaskCompleted(commonStackerCrane.CurrentTaskNum).Status;
                commonStackerCrane.SetValue(StackerCraneDBName.ConfirmComplete, Status);
                //}
            }
        }
        /// <summary>
@@ -226,7 +231,7 @@
                    task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
                }
            }
            if (task != null && task.TargetAddress != "SC01") return task;//入库任务判断是否已分配货位,WMS判断货位状态是否允许放货
            if (task != null && !string.IsNullOrEmpty(task.TargetAddress)) return task;//入库任务判断是否已分配货位,WMS判断货位状态是否允许放货
            return task;
        }
@@ -330,7 +335,7 @@
                    return null;
                }
            }
            else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
            else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup || task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OtherGroup)
            {
                string[] targetCodes = task.NextAddress.Split("-");
                if (targetCodes.Length == 3)