From 39368ecce1a87b67057d050ed913ab3ccb6bb3fd Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期一, 14 十月 2024 15:31:36 +0800
Subject: [PATCH] 1

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs |   48 ++++++++++++++++--------------------------------
 1 files changed, 16 insertions(+), 32 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
index 3d151de..80dcab3 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
@@ -22,7 +22,6 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Reflection;
-using System.Reflection.Metadata;
 using System.Text;
 using System.Threading.Tasks;
 using WIDESEAWCS_Core;
@@ -33,7 +32,6 @@
 using WIDESEAWCS_QuartzJob.ConveyorLine.Enum;
 using WIDESEAWCS_QuartzJob.DTO;
 using WIDESEAWCS_QuartzJob.Service;
-using WIDESEAWCS_Tasks.ConveyorLineExtend;
 using WIDESEAWCS_Tasks.ConveyorLineJob;
 
 namespace WIDESEAWCS_Tasks
@@ -69,7 +67,7 @@
                         //Task task = Task.Run(() =>
                         //{
                         ConveyorLineTaskCommandR command = conveyorLine.ReadCustomer<ConveyorLineTaskCommandR>(childDeviceCode);
-                        if (command != null && command.ConveyorLineStatus == (ushort)ConveyorLineStatus.Stored)
+                        if (command != null && command.Status == (ushort)ConveyorLineStatus.Stored)
                         {
                             switch (childDeviceCode)
                             {
@@ -84,27 +82,12 @@
                                     break;
                                 case "108":
                                     ConveyorLineOutFinish(conveyorLine, command, childDeviceCode);
-                                    break; 
+                                    break;
                                 default:
                                     RequestInNextAddress(conveyorLine, command, childDeviceCode);
                                     RequestOutNextAddress(conveyorLine, command, childDeviceCode);
                                     break;
                             }
-                            #region 鏍规嵁涓嶅悓鐨勫�艰皟鐢ㄥ搴旂殑鏂规硶
-                            //DeviceProtocolDetailDTO? deviceProtocolDetail = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.ProtocalDetailValue == command.ConveyorLineStatus.ToString() && x.DeviceProParamName == nameof(ConveyorLineTaskCommandR.ConveyorLineStatus));
-                            //if (deviceProtocolDetail != null)
-                            //{
-                            //    MethodInfo? method = GetType().GetMethod(deviceProtocolDetail.ProtocolDetailType);
-                            //    if (method != null)
-                            //    {
-                            //        method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode });
-                            //    }
-                            //    else
-                            //    {
-                            //        //todo 鏈壘鍒版柟娉曟椂
-                            //    }
-                            //}
-                            #endregion
                         }
                         //});
                         //tasks.Add(task);
@@ -133,12 +116,13 @@
         /// <param name="childDeviceCode">瀛愯澶囩紪鍙�</param>
         public void RequestInbound(CommonConveyorLine conveyorLine, ConveyorLineTaskCommandR command, string childDeviceCode)
         {
-            if (_taskService.RequestWMSTask(command.ConveyorLineBarcode, childDeviceCode).Status)
+            if (_taskService.RequestWMSTask(command.Barcode, childDeviceCode).Status)
             {
                 Dt_Task task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode);
                 if (task != null)
                 {
                     ConveyorLineTaskCommandW taskCommand = _mapper.Map<ConveyorLineTaskCommandW>(task);
+                    
                     conveyorLine.SendCommand(taskCommand, childDeviceCode);
 
                     _taskService.UpdateTaskStatusToNext(task);
@@ -154,16 +138,16 @@
         /// <param name="childDeviceCode">瀛愯澶囩紪鍙�</param>
         public void RequestInNextAddress(CommonConveyorLine conveyorLine, ConveyorLineTaskCommandR command, string childDeviceCode)
         {
-            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.WriteConveyorLineTaskNum, childDeviceCode);
+            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
             if (task != null)
             {
                 Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress);
-                if (newTask != null)
-                {
-                    ConveyorLineTaskCommandW taskCommand = _mapper.Map<ConveyorLineTaskCommandW>(newTask);
-                    //taskCommand.ConveyorLineStatus = command.ConveyorLineStatus;
-                    conveyorLine.SendCommand(taskCommand, childDeviceCode);
-                }
+                //if (newTask != null)
+                //{
+                //    ConveyorLineTaskCommandW taskCommand = _mapper.Map<ConveyorLineTaskCommandW>(newTask);
+                    
+                //    conveyorLine.SendCommand(taskCommand, childDeviceCode);
+                //}
             }
         }
 
@@ -175,7 +159,7 @@
         /// <param name="childDeviceCode">瀛愯澶囩紪鍙�</param>
         public void ConveyorLineInFinish(CommonConveyorLine conveyorLine, ConveyorLineTaskCommandR command, string childDeviceCode)
         {
-            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.WriteConveyorLineTaskNum, childDeviceCode);
+            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
             if (task != null)
             {
                 conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, 0, childDeviceCode);
@@ -196,7 +180,7 @@
             if (task != null)
             {
                 ConveyorLineTaskCommandW taskCommand = _mapper.Map<ConveyorLineTaskCommandW>(task);
-                //taskCommand.ConveyorLineStatus = command.ConveyorLineStatus;
+                
                 conveyorLine.SendCommand(taskCommand, childDeviceCode);
 
                 _taskService.UpdateTaskStatusToNext(task);
@@ -211,14 +195,14 @@
         /// <param name="childDeviceCode">瀛愯澶囩紪鍙�</param>
         public void RequestOutNextAddress(CommonConveyorLine conveyorLine, ConveyorLineTaskCommandR command, string childDeviceCode)
         {
-            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.WriteConveyorLineTaskNum, childDeviceCode);
+            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
             if (task != null)
             {
                 Dt_Task? newTask = _taskService.UpdatePosition(task.TaskNum, task.CurrentAddress);
                 if (newTask != null)
                 {
                     ConveyorLineTaskCommandW taskCommand = _mapper.Map<ConveyorLineTaskCommandW>(newTask);
-                    //taskCommand.ConveyorLineStatus = command.ConveyorLineStatus;
+                    
                     conveyorLine.SendCommand(taskCommand, childDeviceCode);
                 }
             }
@@ -232,7 +216,7 @@
         /// <param name="childDeviceCode">瀛愯澶囩紪鍙�</param>
         public void ConveyorLineOutFinish(CommonConveyorLine conveyorLine, ConveyorLineTaskCommandR command, string childDeviceCode)
         {
-            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.WriteConveyorLineTaskNum, childDeviceCode);
+            Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
             if (task != null)
             {
                 conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, 0, childDeviceCode);

--
Gitblit v1.9.3