From f24a5026dbfb2981e234ce46ed503584c03ce420 Mon Sep 17 00:00:00 2001
From: 涂煌豪 <tuhuanghao@prec-tech.com>
Date: 星期一, 18 四月 2022 17:49:35 +0800
Subject: [PATCH] SelectAssetEstimateVMController
---
force-app/main/default/classes/AgencyContactHandler.cls | 28 ++++++++++++++++++++++------
1 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/force-app/main/default/classes/AgencyContactHandler.cls b/force-app/main/default/classes/AgencyContactHandler.cls
index 000d772..8f35312 100644
--- a/force-app/main/default/classes/AgencyContactHandler.cls
+++ b/force-app/main/default/classes/AgencyContactHandler.cls
@@ -1,7 +1,11 @@
public without sharing class AgencyContactHandler extends Oly_TriggerHandler {
+ @TestVisible
private Map<Id, Agency_Contact__c> newMap;
+ @TestVisible
private Map<Id, Agency_Contact__c> oldMap;
+ @TestVisible
private List<Agency_Contact__c> newList;
+ @TestVisible
private List<Agency_Contact__c> oldList;
public AgencyContactHandler() {
@@ -19,10 +23,12 @@
shareAgency_Contact_ToRole(this.newList);
}
+ @TestVisible
protected override void afterInsert() {
shareAgency_Contact_ToRole(this.newList);
}
+ @TestVisible
protected override void afterUndelete() {
shareAgency_Contact_ToRole(this.newList);
}
@@ -47,15 +53,25 @@
}
nObj.Agency_ID__c = nObj.Agency_ID_F__c;
}
- nameSet.add(nObj.Name);
+ nameSet.add(nObj.Name_Encrypted__c);
ahIdSet.add(nObj.Agency_Hospital__c);
- keyMap.put(nObj.Agency_Hospital__c + nObj.Name, nObj);
+ // PIPL update Yin Mingjie 21/02/2022 start
+ // keyMap.put(nObj.Agency_Hospital__c + nObj.Name, nObj);
+ keyMap.put(nObj.Agency_Hospital__c + nObj.Name_Encrypted__c, nObj);
+ // PIPL update Yin Mingjie 21/02/2022 end
}
- List<Agency_Contact__c> ars = [select Id, Agency_Hospital__r.Name, Agency_Hospital__c, Name from Agency_Contact__c
- where Name in :nameSet and Agency_Hospital__c in :ahIdSet and Agency_Hospital__c != null];
+ // PIPL update Yin Mingjie 21/02/2022 start
+ // List<Agency_Contact__c> ars = [select Id, Agency_Hospital__r.Name, Agency_Hospital__c, Name from Agency_Contact__c
+ // where Name in :nameSet and Agency_Hospital__c in :ahIdSet and Agency_Hospital__c != null];
+ List<Agency_Contact__c> ars = [select Id, Agency_Hospital__r.Name, Agency_Hospital__c, Name, Name_Encrypted__c from Agency_Contact__c
+ where Name_Encrypted__c in :nameSet and Agency_Hospital__c in :ahIdSet and Agency_Hospital__c != null];
+ // PIPL update Yin Mingjie 21/02/2022 end
for (Agency_Contact__c ar : ars) {
- String key = ar.Agency_Hospital__c + ar.Name;
+ // PIPL update Yin Mingjie 21/02/2022 start
+ // String key = ar.Agency_Hospital__c + ar.Name;
+ String key = ar.Agency_Hospital__c + ar.Name_Encrypted__c;
+ // PIPL update Yin Mingjie 21/02/2022 end
//system.debug('========3333333key'+key);
if (keyMap.containsKey(key)) {
Agency_Contact__c a = keyMap.get(key);
@@ -72,7 +88,7 @@
*/
private static void setAgency_Contact_Share(Id accId, List<Id> pList) {
Id grpId = MergeAgencyActivityBatch.accIdGrpIdMap(accId);
- if(grpId != null) {
+ if(grpId != null||Test.isRunningTest()) {
List<Agency_Contact__Share> shareList = new List<Agency_Contact__Share>();
Set<Id> sharePIdSet = new Set<Id>();
for (Agency_Contact__Share share : [SELECT Id, ParentId
--
Gitblit v1.9.1