/*#region << 版 本 注 释 >>
|
----------------------------------------------------------------
|
*命名空间:WIDESEAWCS_Tasks.ConveyorLineJob
|
* 创建者:胡童庆
|
* 创建时间:2024/8/2 16:13:36
|
* 版本:V1.0.0
|
* 描述:
|
*
|
* ----------------------------------------------------------------
|
* 修改人:
|
* 修改时间:
|
* 版本:V1.0.1
|
* 修改说明:
|
*
|
*----------------------------------------------------------------
|
#endregion << 版 本 注 释 >>*/
|
|
using AutoMapper;
|
using Newtonsoft.Json;
|
using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
|
using OfficeOpenXml.FormulaParsing.Excel.Functions.Math;
|
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
|
using OfficeOpenXml.Packaging.Ionic.Zip;
|
using Quartz;
|
using SqlSugar;
|
using StackExchange.Profiling.Internal;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Reflection;
|
using System.Reflection.Metadata;
|
using System.Text;
|
using System.Threading.Tasks;
|
using WIDESEA_Common.Log;
|
using WIDESEAWCS_Common.TaskEnum;
|
using WIDESEAWCS_Communicator;
|
using WIDESEAWCS_Core;
|
using WIDESEAWCS_Core.Helper;
|
using WIDESEAWCS_ISystemServices;
|
using WIDESEAWCS_ITaskInfoService;
|
using WIDESEAWCS_Model.Models;
|
using WIDESEAWCS_Model.Models.System;
|
using WIDESEAWCS_QuartzJob;
|
using WIDESEAWCS_QuartzJob.DeviceBase;
|
using WIDESEAWCS_QuartzJob.DTO;
|
using WIDESEAWCS_QuartzJob.Models;
|
using WIDESEAWCS_QuartzJob.Service;
|
using WIDESEAWCS_Tasks.ConveyorLineJob;
|
using WIDESEAWCS_Tasks.StackerCraneJob;
|
using static Microsoft.IO.RecyclableMemoryStreamManager;
|
|
namespace WIDESEAWCS_Tasks
|
{
|
[DisallowConcurrentExecution]
|
public class CommonConveyorLineJob : IJob
|
{
|
private readonly ITaskService _taskService;
|
private readonly ITaskExecuteDetailService _taskExecuteDetailService;
|
private readonly IRouterService _routerService;
|
private readonly IMapper _mapper;
|
private readonly IDt_PlatformStationService _PlatformStationService;
|
|
public CommonConveyorLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, IDt_PlatformStationService dt_PlatformStation)
|
{
|
_taskService = taskService;
|
_taskExecuteDetailService = taskExecuteDetailService;
|
_routerService = routerService;
|
_mapper = mapper;
|
_PlatformStationService = dt_PlatformStation;
|
}
|
|
public Task Execute(IJobExecutionContext context)
|
{
|
try
|
{
|
CommonConveyorLine conveyorLine = (CommonConveyorLine)context.JobDetail.JobDataMap.Get("JobParams");
|
if (conveyorLine != null)
|
{
|
|
/*List<Dt_PlatformStation> childDeviceCodes = _PlatformStationService.getStatiomList(conveyorLine.DeviceCode);
|
foreach (Dt_PlatformStation childDeviceCode in childDeviceCodes)
|
{
|
ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(childDeviceCode.Station_code);
|
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);
|
}*/
|
}
|
|
}
|
catch (Exception ex)
|
{
|
Console.Out.WriteLine(nameof(CommonConveyorLineJob) + ":" + ex.ToString());
|
}
|
/*finally
|
{
|
Console.Out.WriteLine(DateTime.Now);
|
}*/
|
return Task.CompletedTask;
|
}
|
|
|
|
}
|
}
|