using Dlhis.ScheduledTask.CommonJobs; using Dlhis.ScheduledTask.SyncSapInfo.Job; using Dlhis.ScheduledTask.TaskAssignment.Job; using Hangfire; using Kurisu.AspNetCore.Startup; namespace Dlhis.ScheduledTask.Packs; public class JobPack : BaseAppPack { public override int Order => 999; public override bool IsBeforeUseRouting { get; } public override void Invoke(IServiceProvider serviceProvider) { RecurringJob.AddOrUpdate("SyncSap", s => s.SyncOrgInfo(), "0 0 2 * * ?", new RecurringJobOptions { TimeZone = TimeZoneInfo.Local }); RecurringJob.AddOrUpdate("SyncPerson", s => s.RunAsync(), "0 0 3 * * ?", new RecurringJobOptions { TimeZone = TimeZoneInfo.Local }); //创建设备同步时间任务 RecurringJob.AddOrUpdate("SyncServerDateTime", s => s.RunAsync(), "0 0 0/1 * * ?", new RecurringJobOptions { TimeZone = TimeZoneInfo.Local }); //创建设备获取考勤的任务 RecurringJob.AddOrUpdate("CreateGetAttendance", s => s.RunAsync(), "0 0/1 * * * ?", new RecurringJobOptions { TimeZone = TimeZoneInfo.Local }); //创建系统默认分组 RecurringJob.AddOrUpdate("CreateDefinitelyGroup", s => s.RunAsync(), "0 0 5 * * ?", new RecurringJobOptions { TimeZone = TimeZoneInfo.Local }); //心跳 RecurringJob.AddOrUpdate("Heartbeat", s => s.RunAsync(), "0/10 * * * * ?", new RecurringJobOptions { TimeZone = TimeZoneInfo.Local }); } }