liuyn
2024-03-11 a87f1c3df03078814ee97ad0c8ac200a232419e9
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
31
32
33
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);
        }
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    }
 
}