| | |
| | | global class rollupToRepairBatch implements Database.Batchable<sObject>, Database.Stateful { |
| | | |
| | | public String query; |
| | | |
| | | global Integer totalCount = 0; // 总件数 |
| | |
| | | if (raList != null && raList.size() > 0) { |
| | | for (Rental_Apply__c ra : raList) { |
| | | if (updateRepairMap.containsKey(ra.Repair__c)) { |
| | | System.debug('zheli01'+ra.Request_approval_day__c+'~'+ra.Cancel_Reason__c); |
| | | Repair__c rep = updateRepairMap.get(ra.Repair__c); |
| | | if (ra.Request_approval_day__c != null && |
| | | ( |
| | |
| | | |
| | | |
| | | } |
| | | updateRepairMap.put(ra.Repair__c,rep); |
| | | } |
| | | } |
| | | } |
| | |
| | | updateRepairMap.remove(newRepair.id); |
| | | } |
| | | } |
| | | |
| | | // 更新发生变化的修理 |
| | | Database.SaveResult[] updateRepairResult = Database.update(updateRepairMap.values(), false); |
| | | for (Database.SaveResult lsrChild : updateRepairResult ) { |