|
|
@ -0,0 +1,30 @@ |
|
|
|
|
|
|
|
using Tiobon.Core.IServices; |
|
|
|
|
|
|
|
using Quartz; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|
|
|
/// 这里要注意下,命名空间和程序集是一样的,不然反射不到 |
|
|
|
|
|
|
|
/// </summary> |
|
|
|
|
|
|
|
namespace Tiobon.Core.Tasks; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class Job_StaffIn_Quartz : JobBase, IJob |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
private readonly IGhre_StudyRuleServices _ghre_StudyRuleServices; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Job_StaffIn_Quartz(IGhre_StudyRuleServices ghre_StudyRuleServices, ITasksQzServices tasksQzServices, ITasksLogServices tasksLogServices) |
|
|
|
|
|
|
|
: base(tasksQzServices, tasksLogServices) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
_ghre_StudyRuleServices = ghre_StudyRuleServices; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public async Task Execute(IJobExecutionContext context) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var executeLog = await ExecuteJob(context, async () => await Run(context)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public async Task Run(IJobExecutionContext context) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Console.WriteLine($"Job_StaffIn_Quartz 执行 {DateTime.Now.ToShortTimeString()}"); |
|
|
|
|
|
|
|
await _ghre_StudyRuleServices.StaffIn(); |
|
|
|
|
|
|
|
// 也可以通过数据库配置,获取传递过来的参数 |
|
|
|
|
|
|
|
JobDataMap data = context.JobDetail.JobDataMap; |
|
|
|
|
|
|
|
//int jobId = data.GetInt("JobParam"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |