| | |
| | | insert traLog; |
| | | } |
| | | // confirm tx transaction |
| | | |
| | | public static void confirmTrans(String module,Integer isSuccess, String sfRecordId ,String transId ,String token,String transUrl,List<idList> idList){ |
| | | @future(callout =true) |
| | | public static void confirmTrans(String module,Integer isSuccess, String sfRecordId ,String transId ,String token,String transUrl,String idList){ |
| | | Boolean result =false; |
| | | Transaction_Log__c traLog = new Transaction_Log__c(); |
| | | traLog.Module__c = 'Confirm Transaction '+module; |
| | |
| | | TransactionRequestBody requestBody =new TransactionRequestBody(); |
| | | requestBody.isSuccess=isSuccess; |
| | | requestBody.sfRecordId=sfRecordId; |
| | | requestBody.idList=idList; |
| | | // requestBody.idList=idList; |
| | | requestBody.idList=(List < idList >)JSON.deserialize(idList,List < idList > .class); |
| | | requestBody.txId =transId; |
| | | request.setBody(JSON.serialize(requestBody)); |
| | | traLog.Request__c =JSON.serialize(requestBody); |
| | | system.debug('request---'+request.tostring()); |
| | | HttpResponse response = http.send(request); |
| | | system.debug('confirm result--'+response.getBody()); |
| | |
| | | traLog.Interface_URL__c = traLog.Module__c; |
| | | insert traLog; |
| | | } |
| | | //save qianlima log method add sushanhu 20220324 |
| | | // model 0 为文件 1为数据 |
| | | public static void insertConfirmTrans(String module,Integer isSuccess, String sfRecordId ,String transId ,Integer model,String transUrl,List<idList> idList){ |
| | | Boolean result =false; |
| | | Transaction_Log__c traLog = new Transaction_Log__c(); |
| | | if (model==0) { |
| | | traLog.Module__c = 'ConfirmFileTransaction '+module; |
| | | }else { |
| | | traLog.Module__c = 'Confirm Transaction '+module; |
| | | } |
| | | traLog.Interface_URL__c = transUrl; |
| | | traLog.TransId__c = transId; |
| | | Integer MaxLogColumnLength = 131072; |
| | | if (!String.isEmpty(sfRecordId)) { |
| | | traLog.Request__c=sfRecordId.substring(0, (sfRecordId.length() > MaxLogColumnLength ? MaxLogColumnLength : sfRecordId.length())); |
| | | }else { |
| | | String sfIds =JSON.serialize(idList); |
| | | traLog.Request__c=sfIds.substring(0, (sfIds.length() > MaxLogColumnLength ? MaxLogColumnLength : sfIds.length())); |
| | | } |
| | | if(isSuccess==0){ |
| | | traLog.Status__c = 'fail'; |
| | | } else { |
| | | traLog.Status__c='success'; |
| | | } |
| | | insert traLog; |
| | | } |
| | | 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]; |
| | | 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); |
| | | |
| | | //获取appid和appsecret |