| | |
| | | exmpdDetailsRecordsMap = new Map<String,List<ExMpdDetailsInfo>>(); |
| | | muCountMap = new Map<String,Integer>(); |
| | | List<Maintenance_Product_Data_Details__c> exDetailList = [select Id,MultiYearWarranty__c,MultiYearWarranty__r.AgeLimit__c,MultiYearWarranty__r.MultiOneYearWarrantyPrice__c,MultiYearWarranty__r.AmountWithheld__c,AgeLimit__c,AgeLimit_Old__c,MultiOneYearWarrantyPrice__c,MultiOneYearWarrantyPrice_Old__c,AmountWithheld__c,AmountWithheld_Old__c,ProductsID__c,ProductsID__r.Name from Maintenance_Product_Data_Details__c where ProductsID__c in:idList and RecordTypeId = '012C50000000jefIAA']; |
| | | for(String id: idList){ |
| | | List<ExMpdDetailsInfo> exList = new List<ExMpdDetailsInfo>(); |
| | | for(Maintenance_Product_Data_Details__c mpdd: exDetailList){ |
| | | if(id == mpdd.ProductsID__c){ |
| | | exList.add(new ExMpdDetailsInfo(mpdd)); |
| | | if(exDetailList.size() > 0){ |
| | | for(String id: idList){ |
| | | List<ExMpdDetailsInfo> exList = new List<ExMpdDetailsInfo>(); |
| | | for(Maintenance_Product_Data_Details__c mpdd: exDetailList){ |
| | | if(id == mpdd.ProductsID__c){ |
| | | exList.add(new ExMpdDetailsInfo(mpdd)); |
| | | } |
| | | } |
| | | exList.add(new ExMpdDetailsInfo()); |
| | | muCountMap.put(id,exList.size()); |
| | | exmpdDetailsRecordsMap.put(id,exList); |
| | | } |
| | | exList.add(new ExMpdDetailsInfo()); |
| | | muCountMap.put(id,exList.size()); |
| | | exmpdDetailsRecordsMap.put(id,exList); |
| | | } |
| | | System.debug('chenjingwu=>' + idList); |
| | | System.debug('chenjingwu=>' + muCountMap); |
| | |
| | | //更新 |
| | | mpd_Name = [SELECT id,Name FROM Maintenance_Product_Data__c WHERE id =:id]; |
| | | } |
| | | List<Maintenance_Product_Data_Details__c> mpdd_Name = [SELECT id,Name FROM Maintenance_Product_Data_Details__c where Maintenance_Product_Data__c =:id order by Name desc Limit 1 ]; |
| | | String str = '%ex%'; |
| | | List<Maintenance_Product_Data_Details__c> mpdd_Name = [SELECT id,Name FROM Maintenance_Product_Data_Details__c where Maintenance_Product_Data__c =:id and NOT Name like:str order by Name desc Limit 1 ]; |
| | | if(mpdd_Name.size()>0){ |
| | | String[] nameI= mpdd_Name[0].Name.split('-'); |
| | | i = Integer.valueOf(nameI[1])+1; |
| | |
| | | InsAfterDel.MultiYearWarranty__c = ex.mpdrdd.MultiYearWarranty__c; |
| | | InsAfterDel.MultiOneYearWarrantyPrice__c = ex.mpdrdd.MultiOneYearWarrantyPrice__c; |
| | | InsAfterDel.AmountWithheld__c = ex.mpdrdd.AmountWithheld__c; |
| | | InsAfterDel.ProductsID__c = ex.mpdrdd.ProductName__c; |
| | | InsAfterDel.ProductsID__c = ex.mpdrdd.ProductsID__c; |
| | | |
| | | InsAfterDel.AgeLimit_Old__c = ex.Prod.AgeLimit__c; |
| | | InsAfterDel.MultiOneYearWarrantyPrice_Old__c = ex.Prod.MultiOneYearWarrantyPrice__c; |