// public with sharing class QISToPDFBatch implements Database.Batchable<SObject>, Database.Stateful {
|
public with sharing class QISToPDFBatch implements Database.Batchable<SObject>, Database.AllowsCallouts {
|
public String iflog_Id;
|
public BatchIF_Log__c rowDataSFDC;
|
public List<String> repairIds;
|
public String statu;
|
|
public QISToPDFBatch(String iflog_Id,BatchIF_Log__c rowDataSFDC, List<String> repairIds,String statu) {
|
ids = repairIds;
|
this.iflog_Id = iflog_Id;
|
this.rowDataSFDC = rowDataSFDC;
|
this.repairIds = repairIds;
|
this.statu = statu;
|
}
|
public List<String> ids;
|
|
public QISToPDFBatch(List<String> argsIds) {
|
ids = new List<String>();
|
ids = argsIds;
|
}
|
|
public Database.QueryLocator start(Database.BatchableContext BC) {
|
String staSql = 'select id,name,GeneratedPDFField__c,problem_detail_photo__c,Photo_1__c,Photo_2__c,Photo_3__c,Photo_4__c,';
|
staSql += 'Photo_OSH_1__c,Photo_OSH_2__c,Photo_OSH_3__c,Photo_OSH_4__c';
|
staSql += ' from QIS_Report__c where GeneratedPDFField__c = null';
|
|
System.debug('ids.size()'+ids.size());
|
|
if (ids.size() > 0) {
|
staSql += ' and id in :ids';
|
}
|
System.debug('staSQL'+staSql);
|
return Database.getQueryLocator(staSql);
|
}
|
|
public void execute(Database.BatchableContext BC, List<QIS_Report__c> qis) {
|
System.debug('QISToPDFBatch的excute 执行了.............');
|
RepairAndQISToPDFController.generateAttachment(qis);
|
}
|
|
|
public void finish(Database.BatchableContext BC) {
|
System.debug('finish');
|
NFM401Controller.callout(null, null, repairIds, statu);
|
// NFM401Controller.sendToETQ(iflog_Id,rowDataSFDC,repairIds,statu);
|
// System.debug('0000000---------------------nfm401controller1.sendToETQ执行了');
|
}
|
}
|