global class ContactInstructCountNSetNullSchedulable implements Schedulable {
|
|
//每年的4月10号Batch执行(0 5(分钟,若是20直接写20,前面0不变) 19-23(对应小时,若执行一次直接写成19-19 10(日) 4(月) ? 2015-2055(年份区间) ))
|
//* system.schedule('ContactInstructCountNSetNullSchedulable','0 5 19-23 10 4 ? 2015-2055', new ContactInstructCountNSetNullSchedulable());
|
global void execute(SchedulableContext sc) {
|
|
Date today = Date.today();
|
//Date mon1stDate = Date.newInstance(today.year(), today.month(), 1);
|
Date inexecutionDateStart = Date.newInstance(today.year(), 4, 2);
|
Date inexecutionDateEnd = Date.newInstance(today.year(), 4, 10);
|
Boolean inexecutionDateFlag = (inexecutionDateStart <= today) && (today <= inexecutionDateEnd);
|
if(!inexecutionDateFlag){
|
|
// 2021-03-03 mzy WLIG-BYHD79 SFDC环境batch合并调查
|
//Id execBTId = Database.executebatch(new ContactInstructCountNSetNullBatch(),100);
|
Id execBTId = Database.executebatch(new ContactInstructCountNSetNullBatch(true,true),100);
|
|
} else {
|
system.debug('我不符合被执行的条件,跳过---->'+inexecutionDateFlag);
|
}
|
|
}
|
}
|