From a89f1faab22c204627d49d6731be9c94d8160184 Mon Sep 17 00:00:00 2001
From: duyongjia <adu_555@163.com>
Date: 星期五, 22 十一月 2024 11:23:47 +0800
Subject: [PATCH] 优化修改提交

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs |  355 +++++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 224 insertions(+), 131 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
index 1f79946..2d2c8a0 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
@@ -1,4 +1,6 @@
-锘縰sing Microsoft.AspNetCore.Components.Routing;
+锘縰sing HslCommunication;
+using Microsoft.AspNetCore.Components.Routing;
+using Newtonsoft.Json;
 using Quartz;
 using System;
 using System.Collections.Generic;
@@ -6,41 +8,53 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using WIDESEAWCS_Common.ServiceLog;
 using WIDESEAWCS_Common.TaskEnum;
+using WIDESEAWCS_Communicator;
 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("澶у爢鍨涙満杩愯鏃ュ織", "寮�濮嬫椂闂�" + DateTime.Now);
+            WriteDebug("澶у爢鍨涙満杩愯鏃ュ織", $"澶у爢鍨涙満浠诲姟鎵ц涓�...");
+            //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)
@@ -51,20 +65,35 @@
                     if (commonStackerCrane.StackerCraneAutoStatusValue == StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneStatusValue == StackerCraneStatus.Normal)
                     {
                         commonStackerCrane.CheckStackerCraneTaskCompleted();//闃叉浠诲姟瀹屾垚浜嬩欢鐩戞祴瓒呮椂锛屽啀鎵嬪姩瑙﹀彂涓�娆�
-
+                        
                         if (commonStackerCrane.StackerCraneWorkStatusValue == StackerCraneWorkStatus.Standby)
                         {
                             Dt_Task? task = GetTask(commonStackerCrane);
                             if (task != null)
                             {
+                                WriteDebug("澶у爢鍨涙満杩愯鏃ュ織", $"澶у爢鍨涙満浠诲姟鍙穥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, $"鍫嗗灈鏈哄嚭搴撴墽琛屼腑");
+                                        }
+                                    }
+                                    else
+                                    {
+                                        _taskService.UpdateTaskExceptionMessage(task.TaskNum, "鍫嗗灈鏈烘墽琛屼换鍔″懡浠ゅけ璐ワ紒");
+                                        WriteDebug(nameof(CommonStackerCraneJob), "鍫嗗灈鏈烘墽琛屼换鍔″懡浠ゅけ璐ワ紒");
                                     }
                                 }
                             }
@@ -74,8 +103,171 @@
             }
             catch (Exception ex)
             {
-                Console.WriteLine(nameof(CommonStackerCraneJob) + ":" + ex.ToString());
+                WriteError(nameof(CommonStackerCraneJob), "澶у爢鍨涙満鎵ц浠诲姟寮傚父锛�",ex);
             }
+
+
+            //鏌ヨ鎻愬崌鏈�/缁勭珛鏈轰俊鍙�
+            //Task.Run(delegate
+            //{
+                try
+                {
+                    if (commonStackerCrane != null)
+                    {
+                       
+                        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杩涘叆锛屽洖浼燱MS
+                            {
+                                MESSendCMD sendcmd = new MESSendCMD { cmd = 2001, task_id = task1001.TaskNum, status = 6 };
+                                MESResponse res = ApiInvoke.SendTaskCMD(sendcmd);
+                                if (res != null && res.code != 0)
+                                {
+                                    WriteDebug(nameof(CommonStackerCraneJob), $"鎻愬崌鏈烘彁鍗囧畬鎴愶紝鍥炰紶WMS澶辫触锛佷换鍔″彿{task1001.TaskNum}");
+                                }
+                            }
+                        }
+                        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");
+                                //鍐欏叆鎻愬崌淇℃伅
+                                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");
+                                //鍐欏叆鎻愬崌淇℃伅
+                                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锛屽垯琛ㄧず鎻愬崌瀹屾垚锛屽洖浼燱MS
+                            {
+                                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)
+                                        {
+                                            //婧愬湴鍧�锛堟殏瀛樹綅锛夊搴旂殑鐩爣鍦板潃锛堢粍绔嬫満锛塴ocation.Remark 
+                                            if (!string.IsNullOrEmpty(location.Remark))
+                                            {
+                                                //鏍规嵁鐩爣鍦板潃鏌ヨ缁勭珛鏈虹珯鐐逛俊鎭紝鑾峰彇鍐欏叆鏁磋溅瀹屾垚鐨凞B鍧� 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), "鏌ヨ鎴栧啓鍏LC鐘舵�佸け璐ワ紒", ex);
+                }
+            WriteDebug("澶у爢鍨涙満杩愯鏃ュ織", "缁撴潫鏃堕棿" + DateTime.Now);
+            //});
             return Task.CompletedTask;
         }
 
@@ -106,47 +298,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 +347,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;
         }
+
+
     }
 }

--
Gitblit v1.9.3