using OASystem.API.OAMethodLib.Quartz.Business;
using Quartz;
namespace OASystem.API.OAMethodLib.Quartz.Jobs
{
///
/// 任务指派
/// 定时器
///
public class TaskJob : IJob
{
private readonly ILogger _logger;
public TaskJob(ILogger logger)
{
_logger = logger;
}
public Task Execute(IJobExecutionContext context)
{
_logger.LogInformation("调用任务状态变更Function " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
try
{
//在此处编写任务业务代码
TaskAssignment.PostTaskUpdateStatus();
}
catch (Exception ex)
{
_logger.LogInformation($"调用任务状态变更Function ErrorMsg:{ex.Message} " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
}
return Task.CompletedTask;
}
}
}