MaterialSyncJob.cs 861 Bytes
using System;
using System.Threading.Tasks;
using Hh.Mes.Service.QuartzJobService;
using Newtonsoft.Json.Linq;

namespace Quartz.Job
{
    /// <summary>
    /// 命名空间Quartz.Job 保持一致
    /// </summary>
    [PersistJobDataAfterExecution]
    [DisallowConcurrentExecution]
    public class MaterialSyncJob : IJob
    {
        public Task Execute(IJobExecutionContext context)
        {
            JobContainer jobContainer = null;
            try
            {
                jobContainer = new JobContainer(context);
                new MaterialSyncJobService().Execute();
            }
            catch (Exception ex)
            {
                jobContainer.ExceptionInfo = ex.Message;
                jobContainer.LoggerJob();
            }
            jobContainer.UpdateJob();
            return Task.CompletedTask;
        }
    }
}