public without sharing class RepairSoUpdHandler extends Oly_TriggerHandler {
|
private Map<Id, RepairSubOrder__c> newMap;
|
private Map<Id, RepairSubOrder__c> oldMap;
|
private List<RepairSubOrder__c> newList;
|
private List<RepairSubOrder__c> oldList;
|
public RepairSoUpdHandler() {
|
this.newMap = (Map<Id, RepairSubOrder__c>) Trigger.newMap;
|
this.oldMap = (Map<Id, RepairSubOrder__c>) Trigger.oldMap;
|
this.newList = (List<RepairSubOrder__c>) Trigger.new;
|
this.oldList = (List<RepairSubOrder__c>) Trigger.old;
|
}
|
protected override void afterUpdate() {
|
RepairSoUpdate();
|
}
|
public void RepairSoUpdate() {
|
List<RepairSubOrder__c> repairSoList = new List<RepairSubOrder__c>();
|
List<String> repairSoIdList = new List<String>();
|
for (RepairSubOrder__c nObj : newList) {
|
RepairSubOrder__c oObj = oldMap.get(nObj.Id);
|
if (nObj.Status__c != oObj.Status__c && nObj.Status__c != '已转修理') {
|
repairSoIdList.add(nObj.Id);
|
}
|
}
|
if (repairSoIdList.size() > 0) {
|
System.debug('NFM613S====' + repairSoIdList);
|
BatchIF_Log__c iflog = new BatchIF_Log__c();
|
iflog.Type__c = 'NFM613';
|
iflog.Log__c = 'callout start\n';
|
System.debug('NFM613S===RepairSoUpdate===callout start' + repairSoIdList);
|
insert iflog;
|
NFM613Controller.callout(iflog.Id, repairSoIdList);
|
}
|
}
|
}
|