From 248433c920f935ffcaee52b240f0c162decc1564 Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期一, 09 五月 2022 15:16:45 +0800
Subject: [PATCH] NFMUtilUpdate

---
 force-app/main/default/classes/AWSServiceTool.cls |   69 ++++++++++++++++++++++++++++++++++
 1 files changed, 68 insertions(+), 1 deletions(-)

diff --git a/force-app/main/default/classes/AWSServiceTool.cls b/force-app/main/default/classes/AWSServiceTool.cls
index 5f10b3e..190c925 100644
--- a/force-app/main/default/classes/AWSServiceTool.cls
+++ b/force-app/main/default/classes/AWSServiceTool.cls
@@ -8,11 +8,26 @@
  * 
  * */
 public without sharing class AWSServiceTool {
+    public static Boolean getAWSServiceStatus(){
+        AWS_Integration_Info__mdt awsConfiguration = [SELECT Enable_AWS_Service__c FROM AWS_Integration_Info__mdt  WHERE DeveloperName = 'AWS_Default_Configuration'];
+        if (awsConfiguration == null) {
+            System.debug('AWS_Integration_Info__mdt娌¢厤缃�');
+            return false;
+        }
+        return awsConfiguration.Enable_AWS_Service__c;
+    }
     public static List<Contact>  getNoPIContact(String searchContactName,String accountId){
         if(searchContactName!='' || accountId!=''){
             String noPISQL = 'select Id,Name,Email,Phone,Account.Name,MobilePhone from Contact where Account_Record_Type_DeveloperName__c in('+'\'Agency\''+','+'\'Dealer\''+')';
             if(String.isNotEmpty(accountId)){
-                noPISQL += ' and AccountId=\''+accountId+'\'';
+                String[] accountIds = accountId.split(',');
+                String accounts = '';
+                for(String s : accountIds){
+                    accounts += ',\''+s+'\'';
+                }
+                accounts = accounts.substring(1);
+                System.debug('accounts = ' + accounts);
+                noPISQL += ' and AccountId in ('+accounts+')';
             }
             if(String.isNotEmpty(searchContactName)){
                 noPISQL += ' and Name like \'%'+searchContactName+'%\'';
@@ -67,4 +82,56 @@
             }
         }
     }
+ //add for pipl sushanhu 20220311 start
+ public static response sendToPiAWS(String rowDataStr, String endpoint,String awsToken) {
+
+    Http http = new Http();
+    HttpRequest req = new HttpRequest();
+    HTTPResponse res;
+    String resb;
+    req.setHeader('Content-Type', 'application/json');
+    req.setTimeout(120000);
+    req.setEndpoint(endpoint);
+    req.setMethod('POST');
+    req.setHeader('pi-token', awsToken);
+    req.setBody(rowDataStr);
+    res = http.send(req);
+    string ress = String.valueOf(res.getStatusCode()) ;
+    resb = res.getBody();
+    system.debug('ress:' + ress);
+    return new response(ress, resb);
+}
+
+    public class response {
+        public string status;
+        public string responseBody;
+        public response(string status, string responseBody ) {
+            this.status         = status;
+            this.responseBody   = responseBody;
+        }
+    }
+//add for pipl sushanhu 20220311 end
+//add for pipl sushanhu 20220311 start
+    public class NFMResponse{
+        public Boolean SFStatus;
+        public String SFMessage;
+        public StaticResponse staticResponse;
+    }
+    public class StaticResponse{
+        public string status;
+        public String Message;
+        public StaticResponse(){
+            status='0';
+            Message='';
+        }
+    }
+    public static NFMResponse getNFMResponse(){
+        NFMResponse  result=new NFMResponse();
+        result.staticResponse =new StaticResponse();
+        return result;
+        
+    }
+//add for pipl sushanhu 20220311 en
+   
+
 }
\ No newline at end of file

--
Gitblit v1.9.1