高章伟
2022-02-18 8b5f4c6c281cfa548f92de52c8021e37aa81901e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
global class BeforeSSOpportunitySchedule implements Schedulable {
    global void execute(SchedulableContext sc) {
        /*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);
        System.debug('mon1stDate=' + mon1stDate);
        System.debug('today=' + toDate);
        System.debug('workdays=' + workdays);
        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 BeforeSSOpportunityBatch(), 100);
        }*/
 
        //7号运行8号不运行  ==直接写死 2021年10月7号执行 update by rentx 
        /*String todayStr = Datetime.now().format('yyyy/MM/dd');
        if (todayStr == '2021/10/07') {
            Id execBTId = Database.executeBatch(new BeforeSSOpportunityBatch(), 100);
        }*/
        //每月1号运行 SWAG-C7ZC4L rentx start
        String todayStr = Datetime.now().format('yyyy/MM/dd');
        // if (todayStr == '2021/10/07') {
        if (todayStr.endsWith('01')) {
            Id execBTId = Database.executeBatch(new BeforeSSOpportunityBatch(), 100);
        }
        //每月1号运行 SWAG-C7ZC4L rentx end
        
  }
}