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/NewAndEditUserFaultInfoController.cls | 43 ++++++++++++++++++++++++++++++++++++++++---
1 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/force-app/main/default/classes/NewAndEditUserFaultInfoController.cls b/force-app/main/default/classes/NewAndEditUserFaultInfoController.cls
index 44991ad..85135d6 100644
--- a/force-app/main/default/classes/NewAndEditUserFaultInfoController.cls
+++ b/force-app/main/default/classes/NewAndEditUserFaultInfoController.cls
@@ -11,23 +11,60 @@
public String PIPL_Input_Account_Error_Msg{set;get;}
public String contactId{set;get;}//For Lookup field
public String staticResourceContact {get; set;}
+ public String contactAWSDataId{set;get;}
+ public String contactName{set;get;}
+ public String endUserDAWSDataId{set;get;}
+ public String endUserDName{set;get;}
public NewAndEditUserFaultInfoController(ApexPages.StandardController controller){
List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('User_FaultInfo__c').getDescribe().fields.getMap().keyset());
// Add fields to controller. This is to avoid the SOQL error in visualforce page
if(!Test.isRunningTest()){
controller.addFields(fieldList); // contact lookup
+ LookUpOverrideFields.add('UFContact__c');
+ LookUpOverrideFields.add('CONTACT__c');
}
- LookUpOverrideFields.add('CONTACT__c');
Init(controller.getRecord());
//娣诲姞椤�
PIPL_Input_Account_Error_Msg = label.PIPL_Input_Account_Error_Msg;
+ //contact淇℃伅锛堟悳绱㈡煡璇uery url鐢級
+ staticResourceContact = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact'));
SObject obj = controller.getRecord();
+ system.debug('obj.id=='+obj.id);
if(obj.Id == null){
//鍒濆鍖栧姞杞藉��
obj.put('OwnerId', UserInfo.getUserId());
+ } else {
+ User_FaultInfo__c userFaultInfo = [select CONTACT__c, UFContact__c from User_FaultInfo__c where id=:obj.Id];
+ System.debug('userFaultInfo: ' + userFaultInfo);
+ if (userFaultInfo.CONTACT__c != null) {
+ List<Contact> contact = [select AWS_Data_Id__c,Name from Contact where id=:userFaultInfo.CONTACT__c];
+ System.debug('contact: ' + contact);
+ if(contact.size()>0){
+ if (contact[0].AWS_Data_Id__c != null && contact[0].AWS_Data_Id__c != '') {
+ contactAWSDataId = contact[0].AWS_Data_Id__c;
+ }else {
+ contactName = contact[0].Name;
+ }
+ }
+ }else {
+ contactAWSDataId = '鏃�';
+ contactName = '鏃�';
+ }
+ if (userFaultInfo.UFContact__c != null) {
+ List<Contact> contact = [select AWS_Data_Id__c,Name from Contact where id=:userFaultInfo.UFContact__c];
+ System.debug('contacts: ' + contact);
+ if(contact.size()>0){
+ if (contact[0].AWS_Data_Id__c != null && contact[0].AWS_Data_Id__c != '') {
+ endUserDAWSDataId = contact[0].AWS_Data_Id__c;
+ }else {
+ endUserDName = contact[0].Name;
+ }
+ }
+ }else {
+ endUserDAWSDataId = '鏃�';
+ endUserDName = '鏃�';
+ }
}
- //contact淇℃伅锛堟悳绱㈡煡璇uery url鐢級
- staticResourceContact = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact'));
}
--
Gitblit v1.9.1