From 9b197b7fac92278fb591ea8f4942c7d5687cb5ce Mon Sep 17 00:00:00 2001
From: 李金换 <lijinhuan@prec-tech.com>
Date: 星期一, 28 三月 2022 18:01:22 +0800
Subject: [PATCH] LJPH-C8FB4P【委托】配合PBI设备覆盖率的数据准备0328
---
force-app/main/default/classes/SearchVisitorController.cls | 62 +++++++++++++++++++++++++++----
1 files changed, 54 insertions(+), 8 deletions(-)
diff --git a/force-app/main/default/classes/SearchVisitorController.cls b/force-app/main/default/classes/SearchVisitorController.cls
index f40ef4c..eeadfef 100644
--- a/force-app/main/default/classes/SearchVisitorController.cls
+++ b/force-app/main/default/classes/SearchVisitorController.cls
@@ -5,6 +5,7 @@
public List<Contact> cl {get;set;}
public List<AddContactWrapper> acwl {get;set;}
public String index {get; set;}
+ public String awsContactIds{set;get;}//Add By Li Jun 20220214 for PIPL
public String id1 {get;set;}
public String hId1 {get;set;}
public String idVa1 {get;set;}
@@ -24,6 +25,14 @@
public User u {get;set;}
public Account a {get;set;}
+
+
+ //Add By Li Jun 20220217 Start
+ public String staticResource {get; set;}
+ public String contactAWSIds {set;get;}
+ public String contactsInfo {set;get;}
+ public String awsDataIdArray {set;get;}
+ //Add By Li Jun 20220217 End
public SearchVisitorController(){
this.id1 = Apexpages.currentPage().getParameters().get('id1');
@@ -161,10 +170,42 @@
}*/
serContact();
+
+ //Add By Li Jun for PIPL 20220217 Start
+ //1. Query Contact by accountId
+ List<Contact> conList = new List<Contact>();
+ system.debug('Account Id from Front-end:'+a.Id);
+ String accountId = a.Id;
+ PIHelper.PIIntegration contactPIIntegration = PIHelper.getPIIntegrationInfo('Contact');
+ if(String.isNotBlank(accountId) && String.isNotEmpty(accountId)){
+ conList = new List<Contact>([select Id,AWS_Data_Id__c from Contact where AccountId=:accountId and AWS_Data_Id__c!='' limit :contactPIIntegration.maxQueryNumber]);
+ }
+ //2. Prepare the Contact Info
+ List<String> conAWSIds = new List<String>();
+ system.debug('Contact Size:'+conList.size());
+ for(Contact con:conList){
+ conAWSIds.add(con.AWS_Data_Id__c);
+ }
+ contactAWSIds = JSON.serialize(conAWSIds);
+ staticResource = JSON.serialize(contactPIIntegration);
+ //Add By Li Jun for PIPL 20220217 End
+ }
+ //Add by Li Jun for PIPL 202202117 Start
+ public PageReference clearLineInfoList() {
+ scwl = new List<SltContactWrapper>();
+ return null;
}
-
+ //Add by Li Jun for PIPL 202202117 End
public PageReference serContact(){
- System.debug('===== serContact start =====');
+ System.debug('===== serContact start ====='+awsContactIds);
+ //Add By Li Jun for PIPL 20220218 Start
+ Set<String> awsContactSet = new Set<String>();
+ if(String.isNotBlank(awsContactIds)&&String.isNotEmpty(awsContactIds)){
+ List<String> awsDataIds = (List<String>) JSON.deserialize(awsContactIds, List<String>.class);
+ awsContactSet = new Set<String>(awsDataIds);
+ }
+ System.debug('===== serContact start ====='+awsContactSet);
+ //Add By Li Jun for PIPL 20220218 End
String searchHospital = 'Select Hospital__c, Department_Class__c,Is_Active__c From Account Where Id = \'' + vp + '\' ';
Account a = Database.query(searchHospital);
if(a.Is_Active__c == '鐒″姽'){
@@ -172,16 +213,20 @@
return null;
}
- String searchSql = 'Select id, name,Ignore_Same_Name__c, Account.Name, Type__c, Doctor_Division1__c, MyDr_Flg__c, phone, Supplement__c, MyDr__c, Select_Flg__c,Delete_Reason__c, Please_Delete__c, Please_Delete_applier__c, FirstName, LastName, Search_LastName__c, Account_Visitor_Search__c From Contact ';
+ String searchSql = 'Select id, name,Ignore_Same_Name__c,AWS_Data_Id__c, Account.Name, Type__c, Doctor_Division1__c, MyDr_Flg__c, phone, Supplement__c, MyDr__c, Select_Flg__c,Delete_Reason__c, Please_Delete__c, Please_Delete_applier__c, FirstName, LastName, Search_LastName__c, Account_Visitor_Search__c From Contact ';
String whereStr = 'Where Account.ParentId =\'' + a.Department_Class__c + '\' and Account.Is_Active__c != \'鐒″姽\' ' + ' and Isactive__c != \'鏃犳晥(閫�浼�)\' and Isactive__c != \'鏃犳晥(閲嶅)\'';
String whereSql = '';
- if(sc.Search_LastName__c != null && sc.Search_LastName__c != ''){
- whereSql += 'and LastName like ' + '\'%' + sc.Search_LastName__c + '%\' ';
+ //Commented by Li Jun 20220214 for PIPL
+ if(awsContactSet.size()>0){
+ whereSql += 'and AWS_Data_Id__c in: awsContactSet ';
}
+ // if(sc.Search_LastName__c != null && sc.Search_LastName__c != ''){
+ // whereSql += 'and LastName like ' + '\'%' + sc.Search_LastName__c + '%\' ';
+ // }
- if(sc.Search_FirstName__c != null && sc.Search_FirstName__c != ''){
- whereSql += 'and FirstName like ' + '\'%' + sc.Search_FirstName__c + '%\' ';
- }
+ // if(sc.Search_FirstName__c != null && sc.Search_FirstName__c != ''){
+ // whereSql += 'and FirstName like ' + '\'%' + sc.Search_FirstName__c + '%\' ';
+ // }
if(sc.Type__c != null && sc.Type__c != ''){
whereSql += 'and Type__c = \'' + sc.Type__c + '\' ';
@@ -202,6 +247,7 @@
System.debug('searchSql:'+searchSql);
cl = Database.query(searchSql);
+ System.debug('Query Result from SF:'+JSON.serialize(cl));
Integer i = 0;
scwl = new List<SltContactWrapper>();
--
Gitblit v1.9.1