From d8dc84a3d56df839895f1c417a4d9cbee763d262 Mon Sep 17 00:00:00 2001
From: 高章伟 <gaozhangwei@prec-tech.com>
Date: 星期五, 03 三月 2023 14:50:59 +0800
Subject: [PATCH] gzw 测试环境代码更新
---
force-app/main/default/classes/NewAndEditContactController.cls | 81 ++++++++++++++++++++++++++++++++++++++--
1 files changed, 77 insertions(+), 4 deletions(-)
diff --git a/force-app/main/default/classes/NewAndEditContactController.cls b/force-app/main/default/classes/NewAndEditContactController.cls
index b87b107..a3c6101 100644
--- a/force-app/main/default/classes/NewAndEditContactController.cls
+++ b/force-app/main/default/classes/NewAndEditContactController.cls
@@ -1,16 +1,19 @@
global class NewAndEditContactController extends NewAndEditBaseController
{
public String unifiedIContactID{set;get;}
+ public String staticResourceContactV2 {get; set;}
+
public NewAndEditContactController(ApexPages.StandardController controller) {
-
List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Contact').getDescribe().fields.getMap().keyset());
// Add fields to controller. This is to avoid the SOQL error in visualforce page
- controller.addFields(fieldList);
+ if (!Test.isRunningTest()) {
+ controller.addFields(fieldList);
+ }
Init(controller.getRecord());
String contactId = controller.getRecord().Id;
if(contactId != null){
- Contact c = [select UnifiedI_Contact_ID__c from Contact where Id =:contactId ];
+ Contact c = [select id,UnifiedI_Contact_ID__c from Contact where Id =:contactId ];
system.debug('Contact c = '+c);
unifiedIContactID = c.UnifiedI_Contact_ID__c;
}else{
@@ -21,7 +24,11 @@
}
}
system.debug('controller.getRecord()='+controller.getRecord());
-
+ //zhj MEBG鏂版柟妗堟敼閫� 2022-11-24 start
+ PIHelper.PIIntegration piIntegration = PIHelper.getPIIntegrationInfo('contactV2');
+ staticResourceContactV2 = JSON.serialize(piIntegration);
+ System.debug('staticResourceContactV2 = ' + staticResourceContactV2);
+ //zhj MEBG鏂版柟妗堟敼閫� 2022-11-24 end
}
PageReference RedirectStandardPage(){
@@ -72,4 +79,70 @@
global static Response saveContact(String leadJson,String transId,Boolean isNew) {
return save(new Contact(),leadJson,transId,isNew);
}
+
+ //zhj MEBG鏂版柟妗堟敼閫� 2022-11-24 start
+ @RemoteAction
+ global static ResponseV2 searchContactByAccountId(String accountId,String RecordTypeId,String Isactive) {
+ System.debug('accountId = ' + accountId);
+ ResponseV2 res = new ResponseV2();
+ try{
+ Account account = [select Id,Name from Account where Id = :accountId];
+ List<Contact> contactList = [select id,AWS_Data_Id__c, CManageCode__c,Name from Contact where AccountId = :account.Id];
+ Map<String,String> dataIdManageCodeMap = new Map<String,String>();
+ for(Contact contact : contactList){
+ dataIdManageCodeMap.put(contact.AWS_Data_Id__c,contact.CManageCode__c);
+ }
+ res.dataIdManageCodeMap = dataIdManageCodeMap;
+ res.accountName = account.Name;
+ res.contactList = contactList;
+
+ ID DoctorRecordTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Doctor').getRecordTypeId();
+ Map<String,String> accMap= new Map<String,String>();
+ List<Account> accList=[select ID,Is_Active__c,Is_Active_Formula__c from Account where ID =:accountId];
+ if(accList.size()>0){
+ for(Account acc:accList){
+ if (String.isNotBlank(acc.Is_Active__c)){
+ String subId = acc.Id;
+ accMap.put(subId.substring(0,15), acc.Is_Active__c);
+ continue;
+ }
+ if (String.isNotBlank(acc.Is_Active_Formula__c)){
+ String subId = acc.Id;
+ accMap.put(subId.substring(0,15), acc.Is_Active_Formula__c);
+ }
+ }
+ }
+ System.debug('accMap= ' + accMap);
+ //濡傛灉鏄疍octor璁板綍绫诲瀷鐨勯渶瑕佽繘琛屽鍚�+鎵嬫満鍙峰垽鏂�
+ if(DoctorRecordTypeId.equals(RecordTypeId)){
+ res.isNameMobileVerif = true;
+ }
+ System.debug('Isactive= ' + Isactive);
+ System.debug('DoctorRecordTypeId.equals(RecordTypeId) = ' + DoctorRecordTypeId.equals(RecordTypeId));
+ System.debug('accMap.get(accountId) = ' + accMap.get(accountId));
+ if (('鏈夋晥'.equals(Isactive) || '鏈夊姽'.equals(Isactive))
+ && ('鏈夊姽'.equals(accMap.get(accountId)) || '鏈夋晥'.equals(accMap.get(accountId))) && (DoctorRecordTypeId.equals(RecordTypeId))) {
+ res.isMobileVerif = true;
+ }else {
+ res.isMobileVerif = false;
+ }
+ res.status = 'success';
+ return res;
+ }catch(Exception e){
+ res.message = e.getMessage() + '';
+ res.status = 'fail';
+ return res;
+ }
+ }
+
+ global class ResponseV2{
+ public List<Contact> contactList{set;get;}
+ public String accountName{set;get;}
+ public Map<String,String> dataIdManageCodeMap{set;get;}
+ public Boolean isMobileVerif;
+ public Boolean isNameMobileVerif;
+ public String message{set;get;}
+ public String status{set;get;}
+ }
+ //zhj MEBG鏂版柟妗堟敼閫� 2022-11-24 end
}
\ No newline at end of file
--
Gitblit v1.9.1