From ec47f5ab5923a315bf22e0df5af7371e9668589e Mon Sep 17 00:00:00 2001
From: 张宇恒 <bxyun0@163.com>
Date: 星期五, 23 十二月 2022 11:16:18 +0800
Subject: [PATCH] 修理接口推送触发条件新加故障描述修理内容等
---
force-app/main/default/classes/PIHelper.cls | 41 +++++++++++++++++++++++++++--------------
1 files changed, 27 insertions(+), 14 deletions(-)
diff --git a/force-app/main/default/classes/PIHelper.cls b/force-app/main/default/classes/PIHelper.cls
index 4ca1f33..340ec54 100644
--- a/force-app/main/default/classes/PIHelper.cls
+++ b/force-app/main/default/classes/PIHelper.cls
@@ -102,16 +102,20 @@
}
// Use this log method
public static void saveTransLog(String module,String awsDataId,String sfId, String transId,String content,String status,String respMsg){
- Transaction_Log__c traLog = new Transaction_Log__c();
- traLog.AWS_Data_Id__c = awsDataId;
- traLog.SFRecordId__c = sfId;
- traLog.Module__c = 'Upsert SF ' + module;
- traLog.TransId__c = transId;
- traLog.Request__c = content;
- traLog.Status__c = status;
- traLog.Response__c = respMsg;
- traLog.Interface_URL__c = traLog.Module__c;
- insert traLog;
+ try{
+ Transaction_Log__c traLog = new Transaction_Log__c();
+ traLog.AWS_Data_Id__c = awsDataId;
+ traLog.SFRecordId__c = sfId;
+ traLog.Module__c = 'Upsert SF ' + module;
+ traLog.TransId__c = transId;
+ traLog.Request__c = content;
+ traLog.Status__c = status;
+ traLog.Response__c = respMsg;
+ traLog.Interface_URL__c = traLog.Module__c;
+ insert traLog;
+ }catch(Exception e){
+ system.debug('Exception from insert log:'+e.getMessage());
+ }
}
//save qianlima log method add sushanhu 20220324
// model 0 涓烘枃浠� 1涓烘暟鎹�
@@ -142,8 +146,10 @@
public static PIIntegration getPIIntegrationInfo(String sobjectType){
PIIntegration piIntegration = new PIIntegration();
//鏌ヨurl
- PI_Policy_Configuration__c config = [SELECT Full_New_URL__c,Full_Search_URL__c,Full_Update_URL__c,Full_Undelete_URL__c,Full_Read_URL__c,Full_Delete_URL__c,Full_View_Unified_Contact_URL__c,TransactionURL__c FROM PI_Policy_Configuration__c WHERE Sobject_Type__c =:sobjectType];
- System.debug('config = ' + config);
+ System.debug('thhsobjectType = ' + sobjectType);
+ PI_Policy_Configuration__c config = [SELECT Full_New_URL__c,Full_New_Encrypt_URL__c,Full_Update_Encrypt_URL__c,Full_Search_URL__c,Full_Update_URL__c,Full_Undelete_URL__c,Full_Read_URL__c,Full_Delete_URL__c,Full_View_Unified_Contact_URL__c,TransactionURL__c FROM PI_Policy_Configuration__c WHERE Sobject_Type__c =:sobjectType];
+ // PI_Policy_Configuration__c config = [SELECT Full_New_URL__c,Full_Search_URL__c,Full_Update_URL__c,Full_Undelete_URL__c,Full_Read_URL__c,Full_Delete_URL__c,Full_View_Unified_Contact_URL__c,TransactionURL__c,Full_New_Encrypt_URL__c FROM PI_Policy_Configuration__c WHERE Sobject_Type__c =:sobjectType];
+ System.debug('thhconfig = ' + config);
//鑾峰彇appid鍜宎ppsecret
AWS_Integration_Info__mdt awsConfiguration = [SELECT App_Id__c,Max_Query_Number__c,Token_URL__c,App_Secret__c,Host_URL__c FROM AWS_Integration_Info__mdt WHERE DeveloperName = 'AWS_Default_Configuration'];
@@ -173,6 +179,9 @@
token = (String)results.get('object');
System.debug('token = ' + token);
}catch(Exception e){
+ system.debug(e.getMessage());
+ system.debug(e.getStackTraceString());
+
Transaction_Log__c traLog = new Transaction_Log__c();
traLog.Module__c = 'Get Token';
traLog.Status__c = 'fail';
@@ -184,9 +193,9 @@
//Insert Get Token Log
//鑾峰彇鏁忔劅瀛楁
- piIntegration.PIDetails = [select id,PI_Policy_Configuration__r.Full_New_URL__c, Enable_Encrypt__c, SF_Field_API_Name__c,SF_Field_Encrypted_API__c, AWS_Field_API__c,AWS_Encrypted_Field_API__c,Field_Type__c from PI_Field_Policy_Detail__c where PI_Policy_Configuration_Name__c =:sobjectType and Enable_Encrypt__c=true];
+ piIntegration.PIDetails = [select id,PI_Policy_Configuration__r.Full_New_URL__c,PI_Policy_Configuration__r.Full_New_Encrypt_URL__c,PI_Policy_Configuration__r.Full_Update_Encrypt_URL__c, Enable_Encrypt__c, SF_Field_API_Name__c,SF_Field_Encrypted_API__c, AWS_Field_API__c,AWS_Encrypted_Field_API__c,Field_Type__c from PI_Field_Policy_Detail__c where PI_Policy_Configuration_Name__c =:sobjectType and Enable_Encrypt__c=true];
if(displayByOrderNumberObject.contains(sobjectType)){
- piIntegration.PIDetails = [select id,PI_Policy_Configuration__r.Full_New_URL__c, Enable_Encrypt__c, SF_Field_API_Name__c,SF_Field_Encrypted_API__c, AWS_Field_API__c,AWS_Encrypted_Field_API__c,Field_Type__c from PI_Field_Policy_Detail__c where PI_Policy_Configuration_Name__c =:sobjectType and Enable_Encrypt__c=true order by Order_Number__c];
+ piIntegration.PIDetails = [select id,PI_Policy_Configuration__r.Full_New_URL__c,PI_Policy_Configuration__r.Full_New_Encrypt_URL__c,PI_Policy_Configuration__r.Full_Update_Encrypt_URL__c, Enable_Encrypt__c, SF_Field_API_Name__c,SF_Field_Encrypted_API__c, AWS_Field_API__c,AWS_Encrypted_Field_API__c,Field_Type__c from PI_Field_Policy_Detail__c where PI_Policy_Configuration_Name__c =:sobjectType and Enable_Encrypt__c=true order by Order_Number__c];
}
List<String> vLookUpFields = new List<String>();
List<String> PIFields = new List<String>();
@@ -208,6 +217,8 @@
piIntegration.deleteUrl = config.Full_Delete_URL__c;
piIntegration.undeleteUrl = config.Full_Undelete_URL__c;
piIntegration.viewUnifiedContactUrl = config.Full_View_Unified_Contact_URL__c;
+ piIntegration.newEncryptUrl = config.Full_New_Encrypt_URL__c;
+ piIntegration.updateEncryptUrl = config.Full_Update_Encrypt_URL__c;
piIntegration.transactionURL = config.TransactionURL__c;
piIntegration.hostUrl = awsConfiguration.Host_URL__c;
piIntegration.searchUrl = config.Full_Search_URL__c;
@@ -230,6 +241,8 @@
public String deleteUrl{set;get;}
public String undeleteUrl{set;get;}
public String viewUnifiedContactUrl{set;get;}
+ public String newEncryptUrl{set;get;}
+ public String updateEncryptUrl{set;get;}
public String hostUrl{set;get;}
public String token{set;get;}
public String awsAppId{set;get;}
--
Gitblit v1.9.1