duyongjia
2024-12-03 14aaca9a2e1da2849d602487a52094ee26bbe30a
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -1,80 +1,338 @@
using Microsoft.AspNetCore.Components.Routing;
using HslCommunication;
using Microsoft.AspNetCore.Components.Routing;
using Newtonsoft.Json;
using Quartz;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection.Metadata;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using WIDESEAWCS_Common.LocationEnum;
using WIDESEAWCS_Common.ServiceLog;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Communicator;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_IBasicRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.DeviceBase;
using WIDESEAWCS_QuartzJob.DTO;
using WIDESEAWCS_QuartzJob.Models;
using WIDESEAWCS_QuartzJob.Service;
using WIDESEAWCS_QuartzJob.StackerCrane;
using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
using WIDESEAWCS_TaskInfoService;
using WIDESEAWCS_Tasks.StackerCraneJob;
namespace WIDESEAWCS_Tasks
{
    [DisallowConcurrentExecution]
    public class CommonStackerCraneJob : IJob
    public class CommonStackerCraneJob : JobBase, IJob
    {
        private readonly ITaskService _taskService;
        private readonly ITaskExecuteDetailService _taskExecuteDetailService;
        private readonly ITaskRepository _taskRepository;
        private readonly IRouterService _routerService;
        private readonly ILocationInfoRepository _locationInfoRepository;
        public CommonStackerCraneJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService)
        public CommonStackerCraneJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService,  ILocationInfoRepository locationInfoRepository)
        {
            _taskService = taskService;
            _taskExecuteDetailService = taskExecuteDetailService;
            _taskRepository = taskRepository;
            _routerService = routerService;
            _locationInfoRepository = locationInfoRepository;
        }
        public Task Execute(IJobExecutionContext context)
        {
             WriteDebug("线程统计日志", "线程数" + ThreadPool.ThreadCount);
             //CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams");
             CommonStackerCrane commonStackerCrane = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "SC01") as CommonStackerCrane;
            try
            {
                CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams");
            {
                if (commonStackerCrane != null)
                {
                    if (!commonStackerCrane.IsEventSubscribed)
                    {
                        commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//订阅任务完成事件
                    }
                   //WriteDebug("大堆垛机运行日志", $"大堆垛机任务执行中...");
                    //if (!commonStackerCrane.IsEventSubscribed)
                    //{
                    //    commonStackerCrane.StackerCraneTaskCompletedEventHandler += CommonStackerCrane_StackerCraneTaskCompletedEventHandler;//订阅任务完成事件
                    //}
                    if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal)
                    {
                        commonStackerCrane.CheckStackerCraneTaskCompleted();//防止任务完成事件监测超时,再手动触发一次
                       // commonStackerCrane.CheckStackerCraneTaskCompleted();//防止任务完成事件监测超时,再手动触发一次
                        if (commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby)
                        {
                            Dt_Task? task = GetTask(commonStackerCrane);
                            if (task != null)
                            {
                                WriteDebug(nameof(CommonStackerCraneJob), $"大堆垛机任务号{task.TaskNum}");
                                StackerCraneTaskCommand? stackerCraneTaskCommand = ConvertToStackerCraneTaskCommand(task);
                                if (stackerCraneTaskCommand != null)
                                {
                                    bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand);
                                    if (sendFlag)
                                    {
                                        commonStackerCrane.LastTaskType = task.TaskType;
                                        _taskService.UpdateTaskStatusToNext(task.TaskNum);
                                        if (task.TaskType == (int)TaskInboundTypeEnum.Inbound)
                                        {
                                            _taskService.UpdateTaskStatus(task.TaskId, (int)TaskInStatusEnum.SC_InExecuting);
                                            _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"堆垛机入库执行中");
                                        }
                                        else if(task.TaskType == (int)TaskOutboundTypeEnum.OutInventory|| task.TaskType == (int)TaskOutboundTypeEnum.OutPick|| task.TaskType == (int)TaskRelocationTypeEnum.Relocation)
                                        {
                                            _taskService.UpdateTaskStatus(task.TaskId, (int)TaskOutStatusEnum.SC_OutExecuting);
                                            _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"堆垛机出库执行中");
                                        }
                                        //空车出库命令发送成功后,回传 status=1,
                                        if (task.TaskType == (int)TaskOutboundTypeEnum.OutPick)
                                        {
                                            Dt_LocationInfo srcLocation = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.SourceAddress);
                                            srcLocation.LocationStatus = (int)LocationStatusEnum.Free;
                                            _locationInfoRepository.UpdateData(srcLocation);
                                            MESSendCMD sendcmd = new MESSendCMD { cmd = 201, task_id = task.TaskNum, status = 1 };
                                            MESResponse res = ApiInvoke.SendTaskCMD(sendcmd);
                                            WriteDebug(nameof(CommonStackerCraneJob), $"堆垛机回传Status:1,用于生成出库任务,任务号{task.TaskNum}");
                                        }
                                    }
                                    else
                                    {
                                        _taskService.UpdateTaskExceptionMessage(task.TaskNum, "堆垛机执行任务命令失败!");
                                        WriteDebug(nameof(CommonStackerCraneJob), "堆垛机执行任务命令失败!");
                                    }
                                }
                            }
                        }
                    }
                }
                else
                {
                    WriteDebug(nameof(DoubleStackerCraneJob), "未查询到当前可以执行上料任务的大堆垛机!");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(nameof(CommonStackerCraneJob) + ":" + ex.ToString());
                WriteError(nameof(CommonStackerCraneJob), "大堆垛机执行任务异常!",ex);
            }
            try
            {
                if (commonStackerCrane != null)
                {
                    //读取大堆垛机任务号和任务完成确认状态(因为封装的事件经常不触发,所以加个直接读的逻辑,以免出现堆垛机一直接处于等待wcs确认)
                    byte IsOver = commonStackerCrane.Communicator.Read<byte>("DB106.22");
                    int tasknum = commonStackerCrane.Communicator.Read<int>("DB106.18");
                    WriteDebug(nameof(CommonStackerCraneJob), $"大堆垛机SC01任务号堆垛机任务号:{tasknum}状态:{IsOver}");
                    if (IsOver == 6)
                    {
                        if (commonStackerCrane.GetValue<StackerCraneDBName, short>(StackerCraneDBName.WorkType) != 5)
                        {
                            _taskService.StackCraneTaskCompleted(tasknum);
                            Console.Out.WriteLine("TaskCompleted" + tasknum);
                            bool issuccess = commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5);
                            if(issuccess)
                            {
                                WriteDebug(nameof(CommonStackerCraneJob), $"大堆垛机SC01任务号堆垛机任务号:{tasknum},回写5成功");
                                //查询当前任务号,是不是出库(正常库位-->暂存位)
                                Dt_Task tasktemp = _taskService.QueryStackerCraneTaskByRelotion(tasknum);
                                if (tasktemp != null&&!string.IsNullOrEmpty(tasktemp.Remark.Trim()))
                                {
                                    //根据任务目标地址确定写入PLC位置 Depth
                                    Dt_LocationInfo location = _locationInfoRepository.QueryFirst(x => x.LocationCode == tasktemp.TargetAddress);
                                    if (commonStackerCrane != null && location != null)
                                    {
                                        bool issuccess2 = commonStackerCrane.Communicator.Write<short>("DB28." + location.Depth + ".0", 9);
                                        if (issuccess2)
                                        {
                                            ServiceLogger.WriteDebug("TaskService", $"原料出库后写入标识成功!");
                                        }
                                        else
                                        {
                                            ServiceLogger.WriteDebug("TaskService", $"原料出库后写入标识失败!");
                                        }
                                    }
                                }
                            }
                            else
                            {
                                WriteDebug(nameof(CommonStackerCraneJob), $"大堆垛机SC01任务号堆垛机任务号:{tasknum},回写5失败");
                            }
                        }
                    }
                    //提升机交互
                    Dt_Task? task1001 = _taskService.QueryStackerCraneTaskByAGVRequest("SC01");
                    if (task1001 != null)
                    {
                        //读取提升机信号,确定是否可以进入
                        int IsAllow = 0;
                        if (task1001.SourceAddress == "SC01-002-000-001")//WMS 1001站点
                        {
                            IsAllow = commonStackerCrane.Communicator.Read<short>("DB2.0.0");
                        }
                        else if (task1001.SourceAddress == "SC01-002-000-002")//WMS 1002站点
                        {
                            IsAllow = commonStackerCrane.Communicator.Read<short>("DB2.8.0");
                        }
                        if (IsAllow == 1)//如果为1,则允计AGV进入,回传WMS
                        {
                            MESSendCMD sendcmd = new MESSendCMD { cmd = 2001, task_id = task1001.TaskNum, status = 6 };
                            MESResponse res = ApiInvoke.SendTaskCMD(sendcmd);
                        }
                    }
                    Dt_Task? task3001 = _taskService.QueryStackerCraneTaskByAGVPutFinish("SC01");
                    if (task3001 != null)
                    {
                        int IsFinish = 0;
                        int IsWriteOne = 0;
                        int IsWriteTwo = 0;
                        if (task3001.SourceAddress == "SC01-002-000-001")//WMS 1001站点
                        {
                            //提升机是否处于就绪状态
                            int IsReady = commonStackerCrane.Communicator.Read<short>("DB2.0.0");
                            WriteDebug(nameof(CommonStackerCraneJob), $"提升机状态:{IsReady}任务号:{task3001.TaskNum}");
                            //写入提升信息
                            IsWriteOne = commonStackerCrane.Communicator.Read<short>("DB1.0.0");
                            if (IsWriteOne == 0 && IsReady == 1)
                            {
                                commonStackerCrane.Communicator.Write<short>("DB1.0.0", 1);
                            }
                            //读取提升机信号,确定是否提升完成
                            IsFinish = commonStackerCrane.Communicator.Read<short>("DB2.2.0");
                        }
                        else if (task3001.SourceAddress == "SC01-002-000-002")//WMS 1002站点
                        {
                            //提升机是否处于就绪状态
                            int IsReady = commonStackerCrane.Communicator.Read<short>("DB2.0.0");
                            WriteDebug(nameof(CommonStackerCraneJob), $"提升机状态:{IsReady}任务号:{task3001.TaskNum}");
                            //写入提升信息
                            IsWriteTwo = commonStackerCrane.Communicator.Read<short>("DB1.6.0");
                            if (IsWriteTwo == 0 && IsReady == 1)
                            {
                                commonStackerCrane.Communicator.Write<short>("DB1.6.0", 1);
                            }
                            //读取提升机信号,确定是否提升完成
                            IsFinish = commonStackerCrane.Communicator.Read<short>("DB2.10.0");
                        }
                        if (IsFinish == 1)//如果为1,则表示提升完成,回传WMS
                        {
                            MESSendCMD sendcmd = new MESSendCMD { cmd = 2002, task_id = task3001.TaskNum, status = 6 };
                            MESResponse res = ApiInvoke.SendTaskCMD(sendcmd);
                            string inparam = JsonConvert.SerializeObject(sendcmd);
                            WriteDebug(nameof(CommonStackerCraneJob), $"提升机提升完成,回传WMS,入参:{inparam}");
                            if (res != null && res.code != 0)
                            {
                                WriteDebug(nameof(CommonStackerCraneJob), $"提升机提升完成,回传WMS失败!任务号{task3001.TaskNum}");
                            }
                        }
                    }
                    //小堆垛机出库完成任务
                    Dt_Task? taskSmall = _taskService.QueryStackerCraneFinishTask();
                    if (taskSmall != null)
                    {
                        //根据任务源地址确定写入PLC位置 Depth
                        Dt_LocationInfo location = _locationInfoRepository.QueryFirst(x => x.LocationCode == taskSmall.SourceAddress);
                        if (location != null)
                        {
                            string[] Levels = taskSmall.Remark.Split("-");
                            if (Levels.Length == 2)
                            {
                                if (!string.IsNullOrEmpty(Levels[0]) && !string.IsNullOrEmpty(Levels[1]))
                                {
                                    int level = Convert.ToInt16(Levels[0]) - Convert.ToInt16(Levels[1]);
                                    //剩余层数写入
                                    bool issuccess = commonStackerCrane.Communicator.Write<short>("DB28." + location.Depth + ".0", Convert.ToInt16(level));
                                    WriteDebug(nameof(CommonStackerCraneJob), $"剩余层数信号写入{level}-任务号{taskSmall.TaskNum}");
                                    //如果当前提取层数等于总层数,则表示料车所有的层数取完
                                    if (level == 0)
                                    {
                                        //源地址(暂存位)对应的目标地址(组立机)location.Remark
                                        if (!string.IsNullOrEmpty(location.Remark))
                                        {
                                            //根据目标地址查询组立机站点信息,获取写入整车完成的DB块 Depth
                                            Dt_LocationInfo location2 = _locationInfoRepository.QueryFirst(x => x.LocationCode == location.Remark);
                                            //整车完成写入层数
                                            int sn = 0;
                                            if (taskSmall.SourceAddress == "SC01-001-006-001" || taskSmall.SourceAddress == "SC01-001-012-001" || taskSmall.SourceAddress == "SC01-001-018-001" || taskSmall.SourceAddress == "SC01-001-022-001" || taskSmall.SourceAddress == "SC01-001-026-001")
                                            {
                                                sn = 1;
                                            }
                                            else if (taskSmall.SourceAddress == "SC01-001-007-001" || taskSmall.SourceAddress == "SC01-001-013-001" || taskSmall.SourceAddress == "SC01-001-019-001" || taskSmall.SourceAddress == "SC01-001-023-001" || taskSmall.SourceAddress == "SC01-001-027-001")
                                            {
                                                sn = 2;
                                            }
                                            else
                                            {
                                                sn = 3;
                                            }
                                            bool issuccess2 = commonStackerCrane.Communicator.Write<short>("DB28." + location2.Depth + ".0", Convert.ToInt16(sn));
                                            if (issuccess2 && issuccess)
                                            {
                                                _taskService.UpdateTaskStatus(taskSmall.TaskId, (int)TaskOutStatusEnum.OutFinish);
                                                _taskExecuteDetailService.AddTaskExecuteDetail(taskSmall.TaskId, $"出库任务完成");
                                            }
                                            else
                                            {
                                                WriteDebug(nameof(CommonStackerCraneJob), $"整车完成信号写入失败!任务号{taskSmall.TaskNum}");
                                            }
                                        }
                                    }
                                    else
                                    {
                                        if (issuccess)
                                        {
                                            _taskService.UpdateTaskStatus(taskSmall.TaskId, (int)TaskOutStatusEnum.OutFinish);
                                            _taskExecuteDetailService.AddTaskExecuteDetail(taskSmall.TaskId, $"出库任务完成");
                                        }
                                        else
                                        {
                                            WriteDebug(nameof(CommonStackerCraneJob), $"剩余层数信号写入失败!任务号{taskSmall.TaskNum}");
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                WriteError(nameof(CommonStackerCraneJob), "执行异常!", ex);
            }
            return Task.CompletedTask;
        }
@@ -93,7 +351,11 @@
                {
                    Console.Out.WriteLine("TaskCompleted" + e.TaskNum);
                    _taskService.StackCraneTaskCompleted(e.TaskNum);
                    commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5);
                    bool issuccess=commonStackerCrane.SetValue(StackerCraneDBName.WorkType, 5);
                    if (issuccess)
                    {
                        WriteDebug(nameof(CommonStackerCraneJob), $"任务号写入任务完成确认值5成功{e.TaskNum}");
                    }
                }
            }
        }
@@ -106,47 +368,7 @@
        private Dt_Task? GetTask(CommonStackerCrane commonStackerCrane)
        {
            Dt_Task task;
            if (commonStackerCrane.LastTaskType == null)
            {
                task = _taskService.QueryStackerCraneTask(commonStackerCrane.DeviceCode);
            }
            else
            {
                if (commonStackerCrane.LastTaskType.GetValueOrDefault().GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
                {
                    task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
                    if (task == null)
                    {
                        task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode);
                    }
                }
                else
                {
                    task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode);
                }
            }
            if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
            {
                if (OutTaskStationIsOccupied(task) != null)
                {
                    return task;
                }
                else
                {
                    List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress).Select(x => x.ChildPosi).ToList();
                    List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes);
                    foreach (var item in tasks)
                    {
                        if (OutTaskStationIsOccupied(task) != null)
                        {
                            return task;
                        }
                    }
                    task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);
                }
            }
            task = _taskService.QueryStackerCraneTask(commonStackerCrane.DeviceCode);
            return task;
        }
@@ -195,94 +417,35 @@
            stackerCraneTaskCommand.TaskNum = task.TaskNum;
            stackerCraneTaskCommand.WorkType = 1;
            stackerCraneTaskCommand.TrayType = 0;
            if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//判断是否是入库任务
            string[] SourceCodes = task.SourceAddress.Split("-");
            if (SourceCodes.Length == 4)
            {
                List<Dt_Router> routers = _routerService.QueryNextRoutes(task.CurrentAddress, task.Roadway);
                if (routers.Count > 0)
                {
                    stackerCraneTaskCommand.StartRow = Convert.ToInt16(routers.FirstOrDefault().SrmRow);
                    stackerCraneTaskCommand.StartColumn = Convert.ToInt16(routers.FirstOrDefault().SrmColumn);
                    stackerCraneTaskCommand.StartLayer = Convert.ToInt16(routers.FirstOrDefault().SrmLayer);
                    string[] targetCodes = task.NextAddress.Split("-");
                    if (targetCodes.Length == 3)
                    {
                        stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]);
                        stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]);
                        stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]);
                    }
                    else
                    {
                        //数据配置错误
                        _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"入库任务终点错误,起点:【{task.NextAddress}】");
                        return null;
                    }
                }
                else
                {
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到站台【{task.NextAddress}】信息,无法获取对应的堆垛机取货站台信息");
                    return null;
                }
                stackerCraneTaskCommand.StartRow = Convert.ToInt16(SourceCodes[1]);
                stackerCraneTaskCommand.StartColumn = Convert.ToInt16(SourceCodes[2]);
                stackerCraneTaskCommand.StartLayer = Convert.ToInt16(SourceCodes[3]);
            }
            else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
            else
            {
                List<Dt_Router> routers = _routerService.QueryNextRoutes(task.Roadway, task.TargetAddress);
                if (routers.Count > 0)
                {
                    stackerCraneTaskCommand.EndRow = Convert.ToInt16(routers.FirstOrDefault().SrmRow);
                    stackerCraneTaskCommand.EndColumn = Convert.ToInt16(routers.FirstOrDefault().SrmColumn);
                    stackerCraneTaskCommand.EndLayer = Convert.ToInt16(routers.FirstOrDefault().SrmLayer);
                    string[] sourceCodes = task.CurrentAddress.Split("-");
                    if (sourceCodes.Length == 3)
                    {
                        stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]);
                        stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]);
                        stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]);
                    }
                    else
                    {
                        //数据配置错误
                        _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"出库任务起点错误,起点:【{task.CurrentAddress}】");
                        return null;
                    }
                }
                else
                {
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"未找到站台【{task.NextAddress}】信息,无法获取对应的堆垛机放货站台信息");
                    return null;
                }
                //数据配置错误
                _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"任务源地址配置错误!");
                return null;
            }
            else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup)
            string[] targetCodes = task.TargetAddress.Split("-");
            if (targetCodes.Length == 4)
            {
                string[] targetCodes = task.NextAddress.Split("-");
                if (targetCodes.Length == 3)
                {
                    stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]);
                    stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]);
                    stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]);
                }
                else
                {
                    //数据配置错误
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"移库任务终点错误,起点:【{task.NextAddress}】");
                    return null;
                }
                string[] sourceCodes = task.CurrentAddress.Split("-");
                if (sourceCodes.Length == 3)
                {
                    stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]);
                    stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]);
                    stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]);
                }
                else
                {
                    //数据配置错误
                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"移库任务起点错误,起点:【{task.CurrentAddress}】");
                    return null;
                }
                stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[1]);
                stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[2]);
                stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[3]);
            }
            else
            {
                //数据配置错误
                _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"任务目标地址配置错误");
                return null;
            }
            return stackerCraneTaskCommand;
        }
    }
}