diff --git a/Tiobon.Core.IServices/Ghre/IGhre_StudyRuleServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_StudyRuleServices.cs index 55c2de63..3dbee79e 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_StudyRuleServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_StudyRuleServices.cs @@ -8,5 +8,6 @@ namespace Tiobon.Core.IServices /// public interface IGhre_StudyRuleServices :IBaseServices { + Task StaffIn(); } } \ No newline at end of file diff --git a/Tiobon.Core.Services/Ghre/Ghre_StudyRuleServices.cs b/Tiobon.Core.Services/Ghre/Ghre_StudyRuleServices.cs index 2c9651a7..eb83b8a2 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_StudyRuleServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_StudyRuleServices.cs @@ -37,7 +37,6 @@ public class Ghre_StudyRuleServices : BaseServices> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true) { if (string.IsNullOrWhiteSpace(filter.orderBy)) @@ -466,4 +465,18 @@ public class Ghre_StudyRuleServices : BaseServices() + .Where(x => x.Indate != null && x.Indate.Value.Date == dt.Date) + .Select(x => new + { + x.StaffID, + x.StaffEname, + x.Indate, + x.OutDate + }).ToListAsync(); + } } \ No newline at end of file diff --git a/Tiobon.Core.Tasks/QuartzNet/Jobs/Job_StaffIn_Quartz.cs b/Tiobon.Core.Tasks/QuartzNet/Jobs/Job_StaffIn_Quartz.cs new file mode 100644 index 00000000..6c203fa6 --- /dev/null +++ b/Tiobon.Core.Tasks/QuartzNet/Jobs/Job_StaffIn_Quartz.cs @@ -0,0 +1,30 @@ +using Tiobon.Core.IServices; +using Quartz; + +/// +/// 这里要注意下,命名空间和程序集是一样的,不然反射不到 +/// +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"); + } +}