You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
2.1 KiB
53 lines
2.1 KiB
using ATS.NonCustodial.Application.Contracts.Interfaces.Admins.AppDictionaries; |
|
using ATS.NonCustodial.Application.Contracts.Interfaces.Business.PunchRecordServices; |
|
using ATS.NonCustodial.Shared.Helpers; |
|
using Quartz; |
|
|
|
namespace ATS.NonCustodial.Admin.QuartzJobs.Jobs |
|
{ |
|
/// <summary> |
|
/// 定时检查谁没有打卡 |
|
/// </summary> |
|
/// Author:mxg |
|
/// CreatedTimed:2022-06-29 05:04 PM |
|
[PersistJobDataAfterExecution] //下一次执行可以本次的结果 |
|
[DisallowConcurrentExecution] //不让任务在同一段时间内执行,5s,但是5s没有执行完,然后等执行完,在来执行 |
|
public class PunchRecordJob : BaseJobs.BaseJobs, IJob |
|
{ |
|
#region Private |
|
|
|
private readonly IAppPunchRecordService _appPunchRecordService; |
|
private readonly IAppDictionaryService _appDictionaryService; |
|
|
|
/// <summary> |
|
/// |
|
/// </summary> |
|
/// <param name="appPunchRecordService"></param> |
|
/// <param name="appDictionaryService"></param> |
|
public PunchRecordJob(IAppPunchRecordService appPunchRecordService, IAppDictionaryService appDictionaryService) |
|
{ |
|
_appPunchRecordService = appPunchRecordService; |
|
_appDictionaryService = appDictionaryService; |
|
} |
|
|
|
#endregion Private |
|
|
|
/// <summary> |
|
/// 执行打卡情况job |
|
/// </summary> |
|
/// <param name="context"></param> |
|
/// <returns></returns> |
|
/// <remarks> |
|
/// 2、未打卡,新增字典自动计划检查打卡时间的执行时间间隔,以分钟为单位,设置1分钟表明计划1分钟一次执行 |
|
/// 检查应打卡时间范围内,被监管人距离上一次打卡时间是否大于案件设置的打卡间隔时间,如果是则触发未打卡预警 |
|
/// </remarks> |
|
public async Task Execute(IJobExecutionContext context) |
|
{ |
|
ConsoleHelper.WriteWarningLine("job start……"); |
|
|
|
await _appPunchRecordService.CheckPunchRecordForJob(); |
|
|
|
ConsoleHelper.WriteWarningLine("job end……"); |
|
} |
|
} |
|
} |