buli
2022-05-14 ead4df22dca33a867279471821ca675f91dec760
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
34
35
36
37
38
39
40
global class LogAutoSendBatchProduct implements Database.Batchable<sObject> {
 
      global LogAutoSendBatchProduct() {}
 
 
          global Database.QueryLocator start(Database.BatchableContext BC) {
        Integer max_cnt = Integer.valueOf(System.Label.batch_retry_max_cnt);
 
        return Database.getQueryLocator(
            [SELECT Id, Name, Log__c, ErrorLog__c, Log2__c, Log3__c, Log4__c, Log5__c, Log6__c,
                    Log7__c, Log8__c, Log9__c, Log10__c, Log11__c, Log12__c, MessageGroupNumber__c,Type__c,
                    retry_cnt__c
               FROM BatchIF_Log__c
              WHERE RowDataFlg__c = true
                AND retry_cnt__c != null AND retry_cnt__c > 0 AND retry_cnt__c < :max_cnt AND (Type__c = 'SBG004' OR Type__c = 'SBG005')]
        );
    }
 
    global void execute(Database.BatchableContext BC, List<BatchIF_Log__c> rowDataList) {
        String strType_c = null;
        for (BatchIF_Log__c rowData:rowDataList){
            strType_c= String.valueOf(rowData.get('Type__c'));
            if (strType_c == 'SBG004'){
                // SBG004WebService.execute(BC,rowDataList);
                SBG004Rest.main(rowData.Id);
            }
            if (strType_c == 'SBG005'){
                // SBG005WebService.execute(BC,rowDataList);
                SBG005Rest.main(rowData.Id);
            }
            
        }
    }
 
    global void finish(Database.BatchableContext BC) {
        // 今回はやることないです
    }
 
      
}