|
|
@@ -42,6 +42,17 @@ namespace wispro.sp.api
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 初始化定时任务
|
|
|
+ InitScheduledJobs().Wait();
|
|
|
+
|
|
|
+ host.Run();
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 初始化所有定时任务
|
|
|
+ /// </summary>
|
|
|
+ private static async System.Threading.Tasks.Task InitScheduledJobs()
|
|
|
+ {
|
|
|
#region 每月获取绩效数据Job
|
|
|
JobKey jobKey = new JobKey("ImportReportData");
|
|
|
var trigger = TriggerBuilder.Create()
|
|
|
@@ -49,8 +60,7 @@ namespace wispro.sp.api
|
|
|
.WithSchedule(CronScheduleBuilder.CronSchedule(utility.ConfigHelper.GetSectionValue("IPEasySetting:ScheduleSetting")).WithMisfireHandlingInstructionDoNothing())
|
|
|
.Build();
|
|
|
|
|
|
-
|
|
|
- _ = QuartzUtil.Add(typeof(ImportReportJob), jobKey, trigger);
|
|
|
+ await QuartzUtil.Add(typeof(ImportReportJob), jobKey, trigger);
|
|
|
#endregion
|
|
|
|
|
|
#region 每月获取绩效数据Job
|
|
|
@@ -60,8 +70,7 @@ namespace wispro.sp.api
|
|
|
.WithSchedule(CronScheduleBuilder.CronSchedule(utility.ConfigHelper.GetSectionValue("ImportProjectScheduleSetting")).WithMisfireHandlingInstructionDoNothing())
|
|
|
.Build();
|
|
|
|
|
|
-
|
|
|
- _ = QuartzUtil.Add(typeof(ImportProjectInfoJob), jobProject, triggerProject);
|
|
|
+ await QuartzUtil.Add(typeof(ImportProjectInfoJob), jobProject, triggerProject);
|
|
|
#endregion
|
|
|
|
|
|
#region 每天更新绩效数据
|
|
|
@@ -71,9 +80,9 @@ namespace wispro.sp.api
|
|
|
.WithSchedule(CronScheduleBuilder.CronSchedule(utility.ConfigHelper.GetSectionValue("UpdateScheduleSetting")).WithMisfireHandlingInstructionDoNothing())
|
|
|
.Build();
|
|
|
|
|
|
-
|
|
|
- _ = QuartzUtil.Add(typeof(BatchUpdateJXDataJob), jobKey1, trigger1);
|
|
|
+ await QuartzUtil.Add(typeof(BatchUpdateJXDataJob), jobKey1, trigger1);
|
|
|
#endregion
|
|
|
+
|
|
|
#region 疑似绩效数据通知
|
|
|
JobKey jobKey2 = new JobKey("InvalidData");
|
|
|
var trigger2 = TriggerBuilder.Create()
|
|
|
@@ -81,8 +90,7 @@ namespace wispro.sp.api
|
|
|
.WithSchedule(CronScheduleBuilder.CronSchedule(utility.ConfigHelper.GetSectionValue("InvalidDataScheduleSetting")).WithMisfireHandlingInstructionDoNothing())
|
|
|
.Build();
|
|
|
|
|
|
-
|
|
|
- _ = QuartzUtil.Add(typeof(InvalidDataMessageJob), jobKey2, trigger2);
|
|
|
+ await QuartzUtil.Add(typeof(InvalidDataMessageJob), jobKey2, trigger2);
|
|
|
#endregion
|
|
|
|
|
|
#region 通知代理人反馈
|
|
|
@@ -92,7 +100,7 @@ namespace wispro.sp.api
|
|
|
.WithSchedule(CronScheduleBuilder.CronSchedule(utility.ConfigHelper.GetSectionValue("AgentMessageScheduleSetting")).WithMisfireHandlingInstructionDoNothing())
|
|
|
.Build();
|
|
|
|
|
|
- _ = QuartzUtil.Add(typeof(AgentMessageJob), jobKey3, trigger3);
|
|
|
+ await QuartzUtil.Add(typeof(AgentMessageJob), jobKey3, trigger3);
|
|
|
#endregion
|
|
|
|
|
|
#region 每天计算绩效数据
|
|
|
@@ -102,10 +110,8 @@ namespace wispro.sp.api
|
|
|
.WithSchedule(CronScheduleBuilder.CronSchedule("0 30 5 * * ?").WithMisfireHandlingInstructionDoNothing())
|
|
|
.Build();
|
|
|
|
|
|
- _ = QuartzUtil.Add(typeof(CalJXJob), jobCalJX, triggerCalJX);
|
|
|
+ await QuartzUtil.Add(typeof(CalJXJob), jobCalJX, triggerCalJX);
|
|
|
#endregion
|
|
|
-
|
|
|
- host.Run();
|
|
|
}
|
|
|
|
|
|
public static IHostBuilder CreateHostBuilder(string[] args) =>
|