Li Jun
2022-03-14 c961a1a85fdf279ae6ae31af51e66847ae514a0a
force-app/main/default/classes/PIHelper.cls
@@ -8,6 +8,7 @@
 * 
 * */
global without sharing class PIHelper {
    public static Set<String> displayByOrderNumberObject = new set<String>{'Report__c'};
    public static String getObjectKeyPrefix(String objName){
        try{
            schema.sObjectType sObjType = Schema.getGlobalDescribe().get(objName);
@@ -119,7 +120,7 @@
        System.debug('config = ' + config);
        //获取appid和appsecret
        AWS_Integration_Info__mdt awsConfiguration = [SELECT App_Id__c,Token_URL__c,App_Secret__c,Host_URL__c FROM AWS_Integration_Info__mdt  WHERE DeveloperName = 'AWS_Default_Configuration'];
        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'];
        if (awsConfiguration == null) {
            System.debug('AWS_Integration_Info__mdt没配置');
            return null;
@@ -157,6 +158,9 @@
        //获取敏感字段
        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];
        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];
        }
        List<String> vLookUpFields = new List<String>();
        List<String> PIFields = new List<String>();
        for (PI_Field_Policy_Detail__c PIDetail : piIntegration.PIDetails) {
@@ -170,6 +174,7 @@
        System.debug('PIFields = ' + PIFields.toString());
        //填充数据
        piIntegration.maxQueryNumber = Integer.valueof(awsConfiguration.Max_Query_Number__c);
        piIntegration.newUrl = config.Full_New_URL__c;
        piIntegration.updateUrl = config.Full_Update_URL__c;
        piIntegration.queryUrl = config.Full_Read_URL__c;
@@ -189,6 +194,7 @@
        return piIntegration;
    }
    global class PIIntegration{
        public Integer maxQueryNumber{set;get;}
        public String sobjectPrefix{set;get;}
        public String searchUrl{set;get;}
        public String newUrl{set;get;}