| | |
| | | |
| | | // } |
| | | @AuraEnabled |
| | | public static Map<String,List<OptionTemplete>> addOptions(List<String> idList){ |
| | | public static Map<String,Object> 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<String,List<OptionTemplete>> optionMap = new Map<String,List<OptionTemplete>>(); |
| | | Map<String,Object> allMap = new Map<String,Object>(); |
| | | Map<String,List<MultiYearWarranty__c>> priceMap = new Map<String,List<MultiYearWarranty__c>>(); |
| | | for(String id: idList){ |
| | | List<OptionTemplete> optionTempleteList = new List<OptionTemplete>(); |
| | | optionTempleteList.add(new OptionTemplete('0年','')); |
| | |
| | | optionMap.put(id,optionTempleteList); |
| | | } |
| | | } |
| | | return optionMap; |
| | | allMap.put('optionMap',optionMap); |
| | | List<MultiYearWarranty__c> muList = [select Id,ProductName__c from MultiYearWarranty__c where ProductName__c in:idList]; |
| | | for(String id: idList){ |
| | | List<MultiYearWarranty__c> muList1 = new List<MultiYearWarranty__c>(); |
| | | for(MultiYearWarranty__c mu : muList){ |
| | | if(mu.ProductName__c == id){ |
| | | muList1.add(mu); |
| | | } |
| | | } |
| | | priceMap.put(id,muList1); |
| | | } |
| | | allMap.put('priceMap',priceMap); |
| | | return allMap; |
| | | } |
| | | // chenjingwu 20240409 end |
| | | // DB202311242191 【报价单】报价单合同金额更新和生成新报价单规则确认和修改 fy start |
| | |
| | | // chenjingwu sp主机类型 20240318 end |
| | | // chenjingwu 3+2多年保 20240401 start |
| | | public String Learning_Community; |
| | | public Decimal exPrice; |
| | | // public List<Map<String, String>> Learning_CommunityOptions = new List<Map<String, String>>(); |
| | | public List<OptionTemplete> Learning_CommunityOptions; |
| | | public List<MultiYearWarranty__c> multiYearWarrantyList; |
| | |
| | | } |
| | | this.multiYearWarrantyList = [select Id,MultiOneYearWarrantyPrice__c,AmountWithheld__c,AgeLimit__c from MultiYearWarranty__c where ProductName__c =: qli.PricebookEntry.Product2Id]; |
| | | Integer period = this.multiYearWarrantyList.size(); |
| | | if(qli.ExtendedWarrantyPeriod__c != null && qli.ExtendedWarrantyPeriod__c != 0){ |
| | | for(MultiYearWarranty__c mu: this.multiYearWarrantyList){ |
| | | if(mu.AgeLimit__c == qli.ExtendedWarrantyPeriod__c){ |
| | | this.exPrice = mu.MultiOneYearWarrantyPrice__c; |
| | | } |
| | | } |
| | | } |
| | | if(period > 0){ |
| | | List<OptionTemplete> optionTempleteList = new List<OptionTemplete>(); |
| | | optionTempleteList.add(new OptionTemplete('0年','')); |