| | |
| | | global class AgencyHospitalLinkBatch implements Database.Batchable<sObject> { |
| | | public String query; |
| | | private BatchIF_Log__c iflog; |
| | | |
| | | Boolean IsNeedExecute = false; // 2021-03-10 mzy WLIG-BYHD79 SFDC环境batch合并调查 是否符合执行条件 |
| | | |
| | | global AgencyHospitalLinkBatch() { |
| | | this.query = query; |
| | | iflog = new BatchIF_Log__c(); |
| | |
| | | iflog.ErrorLog__c = ''; |
| | | insert iflog; |
| | | } |
| | | |
| | | // 2021-03-10 mzy WLIG-BYHD79 SFDC环境batch合并调查 start |
| | | global AgencyHospitalLinkBatch(Boolean NeedExecute) { |
| | | this.query = query; |
| | | iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = 'AgencyHospitalLinkUpdateError'; |
| | | iflog.Log__c = 'AgencyHospitalLinkBatch start\n'; |
| | | iflog.ErrorLog__c = ''; |
| | | insert iflog; |
| | | this.IsNeedExecute = NeedExecute; |
| | | } |
| | | // 2021-03-10 mzy WLIG-BYHD79 SFDC环境batch合并调查 end |
| | | |
| | | global Database.QueryLocator start(Database.BatchableContext bc) { |
| | | //sql语句 |
| | |
| | | iflog.ErrorLog__c = tmp; |
| | | } |
| | | update iflog; |
| | | |
| | | //2021-03-10 mzy WLIG-BYHD79 SFDC环境batch合并调查 start |
| | | if(!Test.isRunningTest() &&IsNeedExecute==true){ |
| | | //batch里调用下一个batch时,希望跟原有的Schedule里面传的条数保持一致 |
| | | Id execBTId = Database.executebatch(new Sfdc2SapDealersContractBatch(true),200); |
| | | } |
| | | //2021-03-10 mzy WLIG-BYHD79 SFDC环境batch合并调查 end |
| | | } |
| | | } |