高章伟
2022-02-24 2aa8da8af66aa8ae00f25831aed6bb0364176e7b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
global class AccountDailyUpdateBatchSchedule  implements Schedulable {
    global void execute(SchedulableContext sc) {
        //MyBatchClass b = new MyBatchClass();
        //database.executebatch(b);
        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 SSBacth_Execute_Day = Integer.valueOf(System.Label.SSBacth_Execute_Day);
        if (workdays1 == SSBacth_Execute_Day || workdays != SSBacth_Execute_Day) {
            Id execBTId = Database.executeBatch(new AccountDailyUpdateBatch('1.华北'),4);
            execBTId = Database.executeBatch(new AccountDailyUpdateBatch('2.东北'),4);
            execBTId = Database.executeBatch(new AccountDailyUpdateBatch('3.西北'),4);
            execBTId = Database.executeBatch(new AccountDailyUpdateBatch('4.西南'),4);
            execBTId = Database.executeBatch(new AccountDailyUpdateBatch('5.华东'),3);
            execBTId = Database.executeBatch(new AccountDailyUpdateBatch('6.华南'),4);
        }
    }
}