From c105d45d688045fddae6733776d7291482825011 Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期二, 23 四月 2024 09:54:13 +0800
Subject: [PATCH] 123

---
 force-app/main/default/classes/MaintenanceProductDataController.cls |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/force-app/main/default/classes/MaintenanceProductDataController.cls b/force-app/main/default/classes/MaintenanceProductDataController.cls
index 5e3a986..2f12c3c 100644
--- a/force-app/main/default/classes/MaintenanceProductDataController.cls
+++ b/force-app/main/default/classes/MaintenanceProductDataController.cls
@@ -869,9 +869,10 @@
                     }
                 }
                 // chenjingwu 3+2澶氬勾淇濅慨 20240417 start 
-                muList = [select Id,AgeLimit__c,MultiOneYearWarrantyPrice__c,AmountWithheld__c,ProductName__c from MultiYearWarranty__c where ProductName__c in: idList order By ProductName__c];
+                muCountMap = new Map<String,Integer>();
+                muList = [select Id,AgeLimit__c,MultiOneYearWarrantyPrice__c,AmountWithheld__c,ProductName__r.Name,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'));
+                    muCountMap.put((String)objAgr.get('ProductName__c'), (Integer)objAgr.get('total') + 1);
                   }
                   muMap = new Map<String,List<MultiYearWarranty__c>>();
                 for(String id: idList){
@@ -881,9 +882,13 @@
                             mus.add(mu);
                         }
                     }
-                    mus.add(new MultiYearWarranty__c(ProductName__c = id));
+                    mus.add(new MultiYearWarranty__c(ProductName__r = id,ProductName__c = id));
                     muMap.put(id,mus);
                 }
+                System.debug('chenjingwu=>' + muCountMap);
+                System.debug('chenjingwu=>' + muMap);
+                System.debug('chenjingwu=>' + mpdDetailsRecordsView);
+                
                 // chenjingwu 3+2澶氬勾淇濅慨   20240417 end
                 if(isWarning){
                     return null;

--
Gitblit v1.9.1