| | |
| | | |
| | | // } |
| | | @AuraEnabled |
| | | public static Map<Map<String,List<OptionTemplete>>> addOptions(List<String> idList){ |
| | | public static Map<String,List<OptionTemplete>> addOptions(List<String> idList){ |
| | | Map<String,Integer> intList = new Map<String,Integer>(); |
| | | for(AggregateResult objAgr: [select ProductName__c,COUNT(Id) total from MultiYearWarranty__c where ProductName__c in:idList group by ProductName__c]){ |
| | | intList.put((String)objAgr.get('ProductName__c'), (Integer)objAgr.get('total')); |
| | | } |
| | | Map<Map<String,List<OptionTemplete>>> optionMap = new Map<Map<String,List<OptionTemplete>>>(); |
| | | Map<String,List<OptionTemplete>> optionMap = new Map<String,List<OptionTemplete>>(); |
| | | for(String id: idList){ |
| | | List<OptionTemplete> optionTempleteList = new List<OptionTemplete>(); |
| | | optionTempleteList.add(new OptionTemplete('0年','')); |
| | | if(intList.containsKey(id)){ |
| | | for(Integer j = 0;j < intList.get(qe.pageObject.PricebookEntry.Product2Id);j++){ |
| | | for(Integer j = 0;j < intList.get(id);j++){ |
| | | optionTempleteList.add(new OptionTemplete((j + 1) + '年',(j + 1) + '')); |
| | | } |
| | | optionMap.put(id,optionTempleteList); |