global class OppShipmentsForecastSchedule implements Schedulable {
|
|
global void execute(SchedulableContext sc) {
|
//xinhonglu
|
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
//每月第一个工作日触发
|
// Date toDate = Date.today();
|
// Date yesterDate = toDate.addDays(-1);
|
// Date mon1stDate = Date.newInstance(toDate.year(), toDate.month(), 1);
|
// //每月到今天的工作日
|
// Integer workdays = UpdateUserTextColBatch.getOlympusWorkDayCount(mon1stDate, toDate);
|
// //每月到昨天的工作日
|
// Integer workdays1 = UpdateUserTextColBatch.getOlympusWorkDayCount(mon1stDate, yesterDate);
|
|
// //Integer Soakup_NotExecute_Day = Integer.valueOf(System.Label.Soakup_NotExecute_Day);
|
// Integer OSFBacth_Execute_Day = Integer.valueOf(System.Label.OSFBacth_Execute_Day);
|
// if (workdays1 != OSFBacth_Execute_Day && workdays == OSFBacth_Execute_Day) {
|
// Id execBTId = database.executebatch(new Opportunity_Shipments_ForecastBatch(), 100);
|
// }
|
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
//SWAG-C7ZC4L 【委托】【紧急重要】预测相关拍照报表拍照时间修改 XinHongLu 20211029
|
Date toDate = Date.today();
|
Date mon1stDate = Date.newInstance(toDate.year(), toDate.month(), 1);//每月第一天
|
// 由每月第一个工作日触发接口,变为每月第一天触发接口
|
if (toDate == mon1stDate) {
|
Id execBTId = database.executebatch(new Opportunity_Shipments_ForecastBatch(), 100);
|
}
|
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
}
|
|
}
|