1
2
3
4
5
6
7
8
9
10
global with sharing class ASPPriceYearBatchSchedule implements Schedulable{
    //每年一月一日 跑上年4-12月的ASP价格
    global void execute(SchedulableContext sc){
        Date today = Date.today();
        String todayStr = Datetime.now().format('yyyy/MM/dd');
        if (todayStr.endsWith('01/01')) {
            Id batjobId = Database.executeBatch(new ASPPriceYearBatch2(today), 200);
        }
    }
}