From 0a4224dbd27287ee2c79f832149e5222914d7ad4 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期日, 22 十二月 2024 13:35:06 +0800
Subject: [PATCH] 更新代码
---
代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs | 44 +++++++++++++-------------------------------
1 files changed, 13 insertions(+), 31 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 67bdf60..e66cafa 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"
@@ -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;
@@ -53,40 +53,22 @@
public Task Execute(IJobExecutionContext context)
{
- Console.Out.WriteLine(DateTime.Now);
+ //Console.Out.WriteLine(DateTime.Now);
try
{
CommonConveyorLine conveyorLine = (CommonConveyorLine)context.JobDetail.JobDataMap.Get("JobParams");
if (conveyorLine != null)
{
- List<string> childDeviceCodes = _routerService.QueryAllPositions(conveyorLine.DeviceCode);
- List<Task> tasks = new List<Task>();
+ List<string> childDeviceCodes = new List<string>();
+
foreach (string childDeviceCode in childDeviceCodes)
{
- //Task task = Task.Run(() =>
- //{
- 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)
- {
- MethodInfo? method = GetType().GetMethod(deviceProtocolDetail.ProtocolDetailType);
- if (method != null)
- {
- method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode });
- }
- else
- {
- //todo 鏈壘鍒版柟娉曟椂
- }
- }
- }
- //});
- //tasks.Add(task);
+ R_ConveyorLineInfo command = conveyorLine.ReadCustomer<R_ConveyorLineInfo>(childDeviceCode);
+ if (command != null)
+ {
+
+ }
}
-
- Task.WaitAll(tasks.ToArray());
}
}
@@ -96,7 +78,7 @@
}
finally
{
- Console.Out.WriteLine(DateTime.Now);
+ //Console.Out.WriteLine(DateTime.Now);
}
return Task.CompletedTask;
}
@@ -107,7 +89,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)
{
@@ -155,7 +137,7 @@
Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
if (task != null)
{
- conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, 0, childDeviceCode);
+ //conveyorLine.SetValue(R_ConveyorLineDBName.WriteInteractiveSignal, 0, childDeviceCode);
WebResponseContent content = _taskService.UpdateTaskStatusToNext(task);
Console.Out.WriteLine(content.Serialize());
}
@@ -212,7 +194,7 @@
Dt_Task task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
if (task != null)
{
- conveyorLine.SetValue(ConveyorLineDBName.WriteInteractiveSignal, 0, childDeviceCode);
+ //conveyorLine.SetValue(R_ConveyorLineDBName.WriteInteractiveSignal, 0, childDeviceCode);
WebResponseContent content = _taskService.UpdateTaskStatusToNext(task);
Console.Out.WriteLine(content.Serialize());
}
--
Gitblit v1.9.3