From 4420517bbbffea48cabe7a7dcdf2e1c4b440fc85 Mon Sep 17 00:00:00 2001
From: GWY <guweiyi@prec-tech.com>
Date: 星期一, 30 五月 2022 16:15:26 +0800
Subject: [PATCH] 两个LS特殊条件在说明的增减
---
force-app/main/default/classes/SearchContactController.cls | 38 ++++++++++++++++++++++++++++----------
1 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/force-app/main/default/classes/SearchContactController.cls b/force-app/main/default/classes/SearchContactController.cls
index c2f9efa..c934058 100644
--- a/force-app/main/default/classes/SearchContactController.cls
+++ b/force-app/main/default/classes/SearchContactController.cls
@@ -33,16 +33,28 @@
//1. Query Contact by accountId
List<Contact> conList = new List<Contact>();
system.debug('Account Id from Front-end:'+accountId);
- if(checkNullString(accountId)&&checkNullString(searchKeyWord)){
- conList = new List<Contact>();
- }else{
- if(checkNullString(accountId)){
- 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!='']);
- }
+ // if(checkNullString(accountId)&&checkNullString(searchKeyWord)){
+ // conList = new List<Contact>();
+ // }else{
+ // if(checkNullString(accountId)){
+ // 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!='']);
+ // }
- }
+ // }
+ if(String.isNotBlank(accountId) && String.isNotEmpty(accountId)){
+ String accountIdStr = '';
+ String[] accountIds = accountId.split(',');
+ List<String> accountIdList = new List<String>();
+ for(String s : accountIds){
+ accountIdList.add(s);
+ }
+ conList = new List<Contact>([select Id,AWS_Data_Id__c from Contact where AccountId in:accountIdList and AWS_Data_Id__c!='']);
+ System.debug('conList:'+conList);
+ } else{
+ conList = new List<Contact>();
+ }
//2. Prepare the Contact Info
Map<String,Contact> awsIdToContactMap = new Map<String,Contact>();
List<String> conAWSIds = new List<String>();
@@ -65,7 +77,13 @@
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]);
+ String accountIdStr = '';
+ String[] accountIds = accountId.split(',');
+ List<String> accountIdList = new List<String>();
+ for(String s : accountIds){
+ accountIdList.add(s);
+ }
+ conListTemp = new List<Contact>([select Id,AWS_Data_Id__c,Account.Name from Contact where AccountId in:accountIdList and AWS_Data_Id__c in:awsDataIds]);
}else {
conListTemp = new List<Contact>([select Id,AWS_Data_Id__c,Account.Name from Contact where AWS_Data_Id__c in:awsDataIds]);
}
--
Gitblit v1.9.1