From 7ff298c6834275b63b612af49651673689a39660 Mon Sep 17 00:00:00 2001 From: hutongqing <hutongqing@hnkhzn.com> Date: 星期三, 27 十一月 2024 11:33:18 +0800 Subject: [PATCH] 更新 --- WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs | 34 +++++++++++++++++++--------------- 1 files changed, 19 insertions(+), 15 deletions(-) diff --git a/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs b/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs index d46c554..a4b4314 100644 --- a/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs +++ b/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs @@ -36,7 +36,7 @@ namespace WIDESEAWCS_Tasks { [DisallowConcurrentExecution] - public class CommonConveyorLineJob : IJob + public class CommonConveyorLineJob : JobBase, IJob { private readonly ITaskService _taskService; private readonly ITaskExecuteDetailService _taskExecuteDetailService; @@ -59,29 +59,32 @@ CommonConveyorLine conveyorLine = (CommonConveyorLine)context.JobDetail.JobDataMap.Get("JobParams"); if (conveyorLine != null) { + //bool result = conveyorLine.Communicator.Write("DB1.0", "AAABBB"); + //string testVal = conveyorLine.Communicator.Read<string>("DB1.0"); + List<string> childDeviceCodes = _routerService.QueryAllPositions(conveyorLine.DeviceCode); List<Task> tasks = new List<Task>(); foreach (string childDeviceCode in childDeviceCodes) { //Task task = Task.Run(() => //{ - ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(childDeviceCode); - if (command != null) + ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(childDeviceCode); + if (command != null) + { + DeviceProtocolDetailDTO? deviceProtocolDetail = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.ProtocalDetailValue == command.InteractiveSignal.ToString() && x.DeviceProParamName == nameof(ConveyorLineTaskCommand.InteractiveSignal)); + if (deviceProtocolDetail != null) { - DeviceProtocolDetailDTO? deviceProtocolDetail = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.ProtocalDetailValue == command.InteractiveSignal.ToString() && x.DeviceProParamName == nameof(ConveyorLineTaskCommand.InteractiveSignal)); - if (deviceProtocolDetail != null) + MethodInfo? method = GetType().GetMethod(deviceProtocolDetail.ProtocolDetailType); + if (method != null) { - MethodInfo? method = GetType().GetMethod(deviceProtocolDetail.ProtocolDetailType); - if (method != null) - { - method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode }); - } - else - { - //todo 鏈壘鍒版柟娉曟椂 - } + method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode }); + } + else + { + //todo 鏈壘鍒版柟娉曟椂 } } + } //}); //tasks.Add(task); } @@ -96,6 +99,7 @@ } finally { + WriteDebug("CommonConveyorLineJob", "test"); //Console.Out.WriteLine(DateTime.Now); } return Task.CompletedTask; @@ -107,7 +111,7 @@ /// <param name="conveyorLine">杈撻�佺嚎瀹炰緥瀵硅薄</param> /// <param name="command">璇诲彇鐨勮姹備俊鎭�</param> /// <param name="childDeviceCode">瀛愯澶囩紪鍙�</param> - public void RequestInbound(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command,string childDeviceCode) + public void RequestInbound(CommonConveyorLine conveyorLine, ConveyorLineTaskCommand command, string childDeviceCode) { if (_taskService.RequestWMSTask(command.Barcode, childDeviceCode).Status) { -- Gitblit v1.9.3