| | |
| | | for (Integer i=0;i<column_Old.size();i++) { |
| | | mpdsoql += ',' + column_Old[i]; |
| | | } |
| | | mpdsoql += ' from Maintenance_Product_Data_Details__c where Maintenance_Product_Data__c = \''+id+'\''; |
| | | mpdsoql += ' from Maintenance_Product_Data_Details__c where RecordTypeId != \'012C50000000jefIAA\' and Maintenance_Product_Data__c = \''+id+'\''; |
| | | // 選択済みの明细を取得 |
| | | mpdDetailsSelected = Database.query(mpdsoql); |
| | | for (Maintenance_Product_Data_Details__c mpdd1 : mpdDetailsSelected) { |
| | |
| | | // chenjingwu 3+2多年保修 20240417 start |
| | | exmpdDetailsRecordsMap = new Map<String,List<ExMpdDetailsInfo>>(); |
| | | muCountMap = new Map<String,Integer>(); |
| | | List<Maintenance_Product_Data_Details__c> exDetailList = [select Id,MultiYearWarranty__c,AgeLimit__c,AgeLimit_Old__c,MultiOneYearWarrantyPrice__c,MultiOneYearWarrantyPrice_Old__c,AmountWithheld__c,AmountWithheld_Old__c,ProductsID__c from Maintenance_Product_Data_Details__c where ProductsID__c in:idList and RecordTypeId = '012C50000000jefIAA']; |
| | | 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']; |
| | | if(exDetailList.size() > 0){ |
| | | for(String id: idList){ |
| | | List<ExMpdDetailsInfo> exList = new List<ExMpdDetailsInfo>(); |
| | |
| | | exmpdDetailsRecordsMap.put(id,exList); |
| | | } |
| | | } |
| | | System.debug('chenjingwu=>' + idList); |
| | | System.debug('chenjingwu=>' + muCountMap); |
| | | System.debug('chenjingwu=>' + exmpdDetailsRecordsMap); |
| | | System.debug('chenjingwu=>' + mpdDetailsRecords); |
| | | // chenjingwu 3+2多年保修 20240417 end |
| | | } |
| | | } |
| | |
| | | //更新 |
| | | 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 str1 = '%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:str1 order by Name desc Limit 1 ]; |
| | | if(mpdd_Name.size()>0){ |
| | | String[] nameI= mpdd_Name[0].Name.split('-'); |
| | | i = Integer.valueOf(nameI[1])+1; |
| | |
| | | insmpdd.MultiYearWarranty__c = mu.Id; |
| | | insmpdd.MultiOneYearWarrantyPrice__c = mu.MultiOneYearWarrantyPrice__c; |
| | | insmpdd.AmountWithheld__c = mu.AmountWithheld__c; |
| | | insmpdd.ProductsID__c = mu.ProductName__c; |
| | | |
| | | |
| | | insmpdd.AgeLimit_Old__c = mu.AgeLimit__c; |
| | |
| | | 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.ProductsID__c; |
| | | |
| | | InsAfterDel.AgeLimit_Old__c = ex.Prod.AgeLimit__c; |
| | | InsAfterDel.MultiOneYearWarrantyPrice_Old__c = ex.Prod.MultiOneYearWarrantyPrice__c; |