From 58ea16c937b02b54aca5a955546f930670a46e18 Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期五, 19 四月 2024 11:57:08 +0800
Subject: [PATCH] 1234
---
force-app/main/default/classes/MaintenanceProductDataController.cls | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/force-app/main/default/classes/MaintenanceProductDataController.cls b/force-app/main/default/classes/MaintenanceProductDataController.cls
index 3f57509..69887b3 100644
--- a/force-app/main/default/classes/MaintenanceProductDataController.cls
+++ b/force-app/main/default/classes/MaintenanceProductDataController.cls
@@ -52,6 +52,7 @@
// chenjingwu 3+2澶氬勾淇濅慨 start
public List<MultiYearWarranty__c> muList { get; set; }
public Map<String,List<MultiYearWarranty__c>> muMap { get; set; }
+ public Map<String,Integer> muCountMap {get; set; }
// chenjingwu 3+2澶氬勾淇濅慨 end
/*****************鐢婚潰琛ㄧずBean******************/
@@ -868,7 +869,12 @@
}
}
// chenjingwu 3+2澶氬勾淇濅慨 20240417 start
+ muCountMap = new Map<String,Integer>();
muList = [select Id,AgeLimit__c,MultiOneYearWarrantyPrice__c,AmountWithheld__c,ProductName__c from MultiYearWarranty__c where ProductName__c in: idList order By ProductName__c];
+ for(AggregateResult objAgr: [select ProductName__c,COUNT(Id) total from MultiYearWarranty__c where ProductName__c in:idList group by ProductName__c]){
+ muCountMap.put((String)objAgr.get('ProductName__c'), (Integer)objAgr.get('total'));
+ }
+ muMap = new Map<String,List<MultiYearWarranty__c>>();
for(String id: idList){
List<MultiYearWarranty__c> mus = new List<MultiYearWarranty__c>();
for(MultiYearWarranty__c mu: muList){
@@ -876,7 +882,7 @@
mus.add(mu);
}
}
- mus.add(new MultiYearWarranty__c({ProductName__c = id}));
+ mus.add(new MultiYearWarranty__c(ProductName__c = id));
muMap.put(id,mus);
}
// chenjingwu 3+2澶氬勾淇濅慨 20240417 end
@@ -892,6 +898,7 @@
}
}
}catch(Exception e){
+ System.debug('chenjingwu==>' + e.getMessage());
ApexPages.addMessages(e);
Database.rollback(sp);
return null;
--
Gitblit v1.9.1