From f127c76b19f5316032d4bed127a1dde710c48d74 Mon Sep 17 00:00:00 2001 From: Li Jun <buli@deloitte.com.cn> Date: 星期四, 24 三月 2022 10:10:36 +0800 Subject: [PATCH] PIPLFunctionFixBug0324 --- force-app/main/default/classes/ContactTriggerHandler.cls | 28 ++++++++++++++++++++++------ 1 files changed, 22 insertions(+), 6 deletions(-) diff --git a/force-app/main/default/classes/ContactTriggerHandler.cls b/force-app/main/default/classes/ContactTriggerHandler.cls index bc9b7b3..f5f46f9 100644 --- a/force-app/main/default/classes/ContactTriggerHandler.cls +++ b/force-app/main/default/classes/ContactTriggerHandler.cls @@ -284,7 +284,8 @@ } // 鏂板鑱旂郴浜烘椂锛� if (accountIdSet.size() > 0) { - List<Contact> contactList = [SELECT Id,AccountId,FullName__c,LastName,FirstName,Account.Name,CManageCode__c,IsFromSPO__c + List<Contact> contactList = [SELECT Id,AccountId,FullName__c,LastName,FirstName,Account.Name,CManageCode__c,IsFromSPO__c, + LastName_Encrypted__c// 20220314 PI鏀归�� by Bright FROM Contact WHERE IsFromSPO__c = false AND AccountId IN:accountIdSet]; if ( contactList.size() > 0) { @@ -293,6 +294,10 @@ String lastNameStr = String.isNotBlank(contact.LastName) ? contact.LastName:''; String firstNameStr = String.isNotBlank(contact.FirstName) ? contact.FirstName:''; String contactFullName = lastNameStr + firstNameStr; + contactFullName = contact.LastName_Encrypted__c;// 20220314 PI鏀归�� by Bright + if(string.isBlank(contactFullName)){ + continue; + } String accountId = String.valueOf(contact.AccountId).SubString(0,15); Map<String,Contact> contactFullNameMap = new Map<String,Contact>(); if (accountContactMap.containsKey(accountId)) { @@ -315,7 +320,7 @@ String lastNameStr = String.isNotBlank(contactnew.LastName) ? contactnew.LastName:''; String firstNameStr = String.isNotBlank(contactnew.FirstName) ? contactnew.FirstName:''; String contactFullName = lastNameStr + firstNameStr; - + contactFullName = contactnew.LastName_Encrypted__c;// 20220314 PI鏀归�� by Bright if (contactFullNameMap.containsKey(contactFullName)) { String accountName = contactFullNameMap.get(contactFullName).Account.Name; String cManageCode = contactFullNameMap.get(contactFullName).CManageCode__c; @@ -371,7 +376,7 @@ // 鍖婚櫌 瀹㈡埛浜哄憳 缁熶竴骞冲彴缂栫爜鏈夊�� 鍙戦�� PO if ('01210000000QfWdAAK'.equals(local.RecordTypeId) && String.isNotBlank(local.UnifiedI_Contact_ID__c)) { if (!NFM606_IdMap.containsKey(local.Id)) { - if(UserInfo.getUserId().equals(System.Label.interfaceUserID)){ + if(UserInfo.getProfileId().equals(System.Label.ProfileId_SystemAdmin)){ interfaceUserUpsertContact.add(local.Id); } else { contactIdList.add(local.Id); @@ -382,7 +387,7 @@ // 缁忛攢鍟� 瀹㈡埛浜哄憳 鎵嬫満鍙风爜鏈夊�� 鍙戦�� PO if ('01210000000QfWiAAK'.equals(local.RecordTypeId) && String.isNotBlank(local.MobilePhone)) { if (!NFM606_IdMap.containsKey(local.Id)) { - if(UserInfo.getUserId().equals(System.Label.interfaceUserID)){ + if(UserInfo.getProfileId().equals(System.Label.ProfileId_SystemAdmin)){ interfaceUserUpsertContact.add(local.Id); } else { contactIdList.add(local.Id); @@ -398,10 +403,21 @@ if(!System.Test.isRunningTest()){ // NFM606Controller.executeNotFuture('', contactIdList); if (contactIdList.size() > 0) { - NFM606Controller.callout('', contactIdList); + // NFM606Controller.callout('', contactIdList); + //娣诲姞future 鍒ゆ柇 add for pipl sushanhu 20220317 start + if (!(System.isFuture()||System.isBatch())) { + NFM606Controller.callout('', contactIdList); + } + //娣诲姞future 鍒ゆ柇 add for pipl sushanhu 20220317 end } if (interfaceUserUpsertContact.size() > 0) { - NFM606Controller.executeNotFuture('', interfaceUserUpsertContact); + // NFM606Controller.executeNotFuture('', interfaceUserUpsertContact); + //娣诲姞future 鍒ゆ柇 add for pipl sushanhu 20220316 start + if (!(System.isFuture()||System.isBatch())) { + NFM606Controller.executeNotFuture('', interfaceUserUpsertContact); + } + //娣诲姞future 鍒ゆ柇 add for pipl sushanhu 20220316 end + } } -- Gitblit v1.9.1