dengjunjie
昨天 28a788d3fca51fb4fd2f668b90fa95e87c2633a1
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/TestJob.cs
@@ -11,22 +11,31 @@
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.LocationEnum;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Communicator;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_IBasicInfoService;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.DeviceBase;
using WIDESEAWCS_QuartzJob.DTO;
using WIDESEAWCS_QuartzJob.StackerCrane.Enum;
using WIDESEAWCS_TaskInfoService;
namespace WIDESEAWCS_Tasks
{
    [DisallowConcurrentExecution]
    public class TestJob : JobBase, IJob
    public partial class TestJob : JobBase, IJob
    {
        private readonly ITaskService _taskService;
        public TestJob(ITaskService taskService)
        private readonly IStationMangerService _stationMangerService;
        public TestJob(ITaskService taskService, IStationMangerService stationMangerService)
        {
            _taskService = taskService;//注入
            _stationMangerService = stationMangerService;
        }
        public Task Execute(IJobExecutionContext context)
@@ -36,16 +45,20 @@
            if (flag && value != null)
            {
                OtherDevice device = (OtherDevice)value;
                //Example
                //device.GetValue  è¯»å–
                //device.SetValue  å†™å…¥
                // _taskService.Repository ä»“储层,进行数据库访问-
                try
                {
                    //Example
                    //device.GetValue  è¯»å–
                    //device.SetValue  å†™å…¥
                    // _taskService.Repository ä»“储层,进行数据库访问
                    SXCTasks(device);
                    WriteInfo(device.DeviceName, "infoLog");
                    KHTasks(device);
                    WriteDebug(device.DeviceName, "debugLog");
                    //WriteInfo(device.DeviceName, "infoLog");
                    //WriteDebug(device.DeviceName, "debugLog");
                }
                catch (Exception ex)
                {
@@ -56,8 +69,6 @@
            {
                WriteError(nameof(TestJob), "参数错误,未传递设备参数或设备类型错误");
            }
            return Task.CompletedTask;
        }
    }