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.RunAsync(), "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("CreateGetUploadRecord", 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 }); //上传考勤记录 RecurringJob.AddOrUpdate("SyncOriginCardInfo", s => s.RunAsync(), "0/20 * * * * ?", new RecurringJobOptions { TimeZone = TimeZoneInfo.Local }); //处理重复下发任务 RecurringJob.AddOrUpdate("CancelDuplicationTask", s => s.RunAsync(), "0/15 * * * * ?", new RecurringJobOptions { TimeZone = TimeZoneInfo.Local }); RecurringJob.AddOrUpdate("TempCreateUser", s => s.RunAsync(), "0 0 5 * * ?", new RecurringJobOptions { TimeZone = TimeZoneInfo.Local }); //删除前三天前的日志 RecurringJob.AddOrUpdate("DelApiLogTask", s => s.RunAsync(), "0 0 2 * * *", new RecurringJobOptions { TimeZone = TimeZoneInfo.Local }); } }