diff --git a/HKCardOUT/Bootstrapper.cs b/HKCardOUT/Bootstrapper.cs index 300c9c6..074a015 100644 --- a/HKCardOUT/Bootstrapper.cs +++ b/HKCardOUT/Bootstrapper.cs @@ -6,6 +6,8 @@ using System.Windows.Threading; using System.Windows; using Microsoft.Extensions.Configuration; using HKCardOUT.Helper; +using HKCardOUT.QuartzUtil.Job; +using HKCardOUT.QuartzUtil; namespace HKCardOUT { @@ -30,6 +32,8 @@ namespace HKCardOUT { var configer = (new ConfigurationBuilder()).AddJsonFile("options.json").Build(); DataBus.ConnectionString = configer.GetConnectionString("Sqlite"); + DataBus.Cron = configer["Cron"]; + DataBus.SaasRoute = configer["SaasRoute"]; base.Configure(); } @@ -55,6 +59,13 @@ namespace HKCardOUT /// protected override void OnLaunch() { + QuartzCoreFactory.QuartzCore().AddJob(new QuartzMap + { + JobDetail = "定时推送订单", + Cron = DataBus.Cron, + JobName = "订单", + JobGroup = "订单" + }); base.OnLaunch(); } diff --git a/HKCardOUT/Helper/DataBus.cs b/HKCardOUT/Helper/DataBus.cs index 4b0e545..f5a618d 100644 --- a/HKCardOUT/Helper/DataBus.cs +++ b/HKCardOUT/Helper/DataBus.cs @@ -20,5 +20,7 @@ namespace HKCardOUT.Helper _ConnectionString = SyncStatic.CreateFile(Path.Combine(SyncStatic.CreateDir(Route), value)); } } + public static string Cron { get; set; } + public static string SaasRoute { get; set; } } } diff --git a/HKCardOUT/options.json b/HKCardOUT/options.json index b32804d..4b872b7 100644 --- a/HKCardOUT/options.json +++ b/HKCardOUT/options.json @@ -1,6 +1,6 @@ { "SaasRoute": "", - "Cron": "", + "Cron": "0 0 11,15 * * ? ", "ConnectionStrings": { "Sqlite": "HKSQL.db3" }