高章伟
2023-03-03 d8dc84a3d56df839895f1c417a4d9cbee763d262
force-app/main/default/classes/SearchContactController.cls
@@ -32,9 +32,12 @@
            conList = new List<Contact>();
        }else{
            if(checkNullString(accountId)){
                conList = new List<Contact>([select Id,AWS_Data_Id__c,Account.Name from Contact where AWS_Data_Id__c!='']);
                conList = new List<Contact>();
            }else {
                conList = new List<Contact>([select Id,AWS_Data_Id__c,Account.Name from Contact  where AccountId=:accountId and AWS_Data_Id__c!='']);
                //2022-5-12 yjk 将科室匹配改为医院匹配查询联系人 statt
                Account act = [select id,Hospital__c from Account where id = :accountId];
                conList = new List<Contact>([select Id,AWS_Data_Id__c,Account.Name from Contact  where    Account.Hospital__c=:act.Hospital__c and AWS_Data_Id__c!='']);
                //2022-5-12 yjk 将科室匹配改为医院匹配查询联系人 end
            }
            
        }    
@@ -60,7 +63,10 @@
            List<String> awsDataIds = (List<String>) JSON.deserialize(awsContactIds, List<String>.class);
            List<Contact> conListTemp = new List<Contact>();
            if(!checkNullString(accountId)){
                conListTemp = new List<Contact>([select Id,AWS_Data_Id__c,Account.Name from Contact where AccountId=:accountId and AWS_Data_Id__c in:awsDataIds]);
                //2022-5-12 yjk 将科室匹配改为医院匹配查询联系人 statt
                Account act = [select id,Hospital__c from Account where id = :accountId];
                conListTemp = new List<Contact>([select Id,AWS_Data_Id__c,Account.Name from Contact where Account.Hospital__c=:act.Hospital__c and AWS_Data_Id__c in:awsDataIds]);
                //2022-5-12 yjk 将科室匹配改为医院匹配查询联系人 end
            }else {
                conListTemp = new List<Contact>([select Id,AWS_Data_Id__c,Account.Name from Contact where AWS_Data_Id__c in:awsDataIds]);
            }
@@ -89,7 +95,7 @@
    public static Response searchContactsNoPI(String contactName) {
        Response resp = new Response();
        resp.status = 'fail';
        List<Contact> conListTemp = new List<Contact>([select Id,Name,Account.Name,Phone,Email from Contact where Name like :contactName]);
        List<Contact> conListTemp = new List<Contact>([select Id,Name,Account.Name,Phone,Email,MobilePhone from Contact where Name like :contactName]);
        if(conListTemp.size() > 0){
            resp.status = 'success';
            resp.message = JSON.serialize(conListTemp);