From 9a717144ef086a92a34adfc0763dfa9f6cb4b0ba Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期六, 12 三月 2022 16:54:21 +0800
Subject: [PATCH] Merge PIPL Function code 20220311

---
 force-app/main/default/classes/LightningUtil.cls                     |   12 
 force-app/main/default/classes/NFM501FutureController.cls            |   27 ++
 force-app/main/default/classes/CM_SearchContactServiceController.cls |    4 
 force-app/main/default/pages/CM_SearchContactService.page            |   52 +++-
 force-app/main/default/classes/PIHelper.cls                          |   17 +
 force-app/main/default/classes/WeeklyReportCmp.cls                   |    8 
 force-app/main/default/classes/NFMUtil.cls                           |  149 +++++++++++++---
 force-app/main/default/classes/NewAndEditASEActivityController.cls   |   14 
 force-app/main/default/pages/NewConsumApply.page                     |   11 
 force-app/main/default/classes/NFM501Controller.cls                  |    3 
 force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js       |  155 +++++++++++++++-
 force-app/main/default/classes/RentalApplyController.cls             |   31 --
 force-app/main/default/triggers/FileAddressTrigger.trigger           |    2 
 force-app/main/default/pages/CampaignMember.page                     |    4 
 force-app/main/default/classes/NFM624Rest.cls                        |    2 
 force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp            |    7 
 force-app/main/default/pages/NewRentalApply.page                     |   10 +
 17 files changed, 391 insertions(+), 117 deletions(-)

diff --git a/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp b/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp
index 5865df2..41c8c07 100644
--- a/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp
+++ b/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp
@@ -78,6 +78,8 @@
     <aura:attribute name="AWStransactionURL" type="String"/>
     <aura:attribute name="AWSDoctor2Map" type="String"/>
     <aura:attribute name="awsurl" type="Map"/>
+    <aura:attribute name="contactawsurl" type="Map"/>
+    <aura:attribute name="allselectlistAgencyPerson" type="Map"/>
     <!-- PIPL update Yin Mingjie 21/02/2022 end -->
     <!-- 鎵归噺娣诲姞鍛ㄦ姤 end-->
 
@@ -162,7 +164,10 @@
                             </td>
                             <td role="gridcell" class="slds-cell-edit">
                                 <span class="slds-grid slds-grid--align-spread">
-                                    <span class="slds-truncate" title="{!item.Person_In_Charge2__r.Name}">{!item.Person_In_Charge2__r.Name}</span>
+                                    <span class="slds-truncate" title="{!item.Person_In_Charge2__r.Name}">
+                                        <span class="encrypt">{!item.Person_In_Charge2__r.Name}</span>
+                                        <span class="decrypt">{!item.Person_In_Charge2__r.awsdata.lastName}</span>
+                                    </span>
                                 </span>
                             </td>
                             <th scope="row" tabindex="0" class="slds-cell-edit">
diff --git a/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js b/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js
index 4fdf0b2..52e7b79 100644
--- a/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js
+++ b/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js
@@ -1,7 +1,6 @@
 ({
     doinit : function(component, event, helper) {
         this.report_date_list(component, event, helper, 5);
-
         component.set('v.login',true);
         var action = component.get('c.getalldata');
         action.setCallback(this,function(response){
@@ -12,7 +11,10 @@
                 component.set('v.fieldsmap',res.fieldsMap);
                 component.set('v.allselectlist',res.allselectlist);
                 component.set('v.doclist',res.doclist);
-                component.find('select_agency_person').set('v.options', this.conv_selected(res.allselectlist.AgencyPerson__c));
+                // PIPL update Yin Mingjie 21/02/2022 start
+                // component.find('select_agency_person').set('v.options', this.conv_selected(res.allselectlist.AgencyPerson__c));
+                this.search_contact(component, event, helper,res.allselectlist.AgencyPerson__c);
+                // PIPL update Yin Mingjie 21/02/2022 end
                 component.find('select_department').set('v.options', this.conv_selected(res.allselectlist.Department_Cateogy__c));
                 component.find('select_purpose_type').set('v.options', this.conv_selected(res.allselectlist.Purpose_Type__c));
                 component.find('select_result').set('v.options', this.conv_selected(res.allselectlist.Result__c));
@@ -23,6 +25,7 @@
                 component.set('v.selected_agency_person', res.allselectlist.AgencyPerson__c[0].label);
                 component.set('v.dialog_type', '鏂板缓');
                 component.set('v.awsurl', res.awsurl);// 20220222 PI鏀归�� by Bright
+                component.set('v.contactawsurl', res.contactawsurl);// 20220222 PI鏀归�� by Bright
                 
                 this.get_reports(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value'));
 				
@@ -35,6 +38,76 @@
         });
         $A.enqueueAction(action);
     },
+    
+    // PIPL update Yin Mingjie 21/02/2022 start
+    search_contact : function(component, event, helper, resobj) {
+        let contactData = Object.create(null);
+        var dataArr = new Array();
+        for (let i = 0; i < resobj.length; i++) {
+            if (resobj[i].awsid != null && resobj[i].awsid != ''){
+                contactData[resobj[i].awsid] = resobj[i];
+                dataArr.push(resobj[i].awsid);
+            }
+        }
+        let obj= Object.create(null);
+        obj['dataIds'] = dataArr;
+        var payload = JSON.stringify(obj);
+        this.search_contact_url(component, 'Contact', (result)=>{
+            var token = result.token;
+            var searchUrl = result.searchUrl;
+            this.search_core(token,searchUrl,payload,(result)=>{
+                if(result.status == '0'){
+                    this.to_contact_list(result,contactData,component);
+                }else{
+                    this.error('AWS search status : ' + result.status);
+                    component.set('v.login',false);
+                }
+            },component);
+            
+        });
+    },
+
+    to_contact_list : function(result,retMap,component) {
+        var resls = result.object;
+        var res = [];
+        var space = {};
+        space['label'] = '';
+        space['selected'] = true;
+        space['value'] = '';
+        res.push(space);
+
+        for (var i = 0; i < resls.length; i++) {
+            var t = {};
+            t['label'] = resls[i].lastName;
+            t['selected'] = false;
+            t['Doctor_Division1__c'] = resls[i].doctorDivision1;
+            t['value'] = retMap[resls[i].dataId].value;
+            res.push(t);
+        }
+        component.find('select_agency_person').set('v.options',res);
+        component.set('v.allselectlistAgencyPerson',res);
+        component.set('v.login',false);
+    },
+
+    search_contact_url : function(component, sobject, callback) {
+        var action = component.get('c.getAwsurl');
+        action.setParams({
+            "sobj" : sobject,
+        });
+        action.setCallback(this,function(response){
+            var state = response.getState();
+            if(state == 'SUCCESS'){
+                var result = response.getReturnValue();
+                if(callback)callback(result);
+            }
+            else{
+                this.error('AWS url/token error.');
+                component.set('v.login',false);
+            }
+        });
+        $A.enqueueAction(action);
+    },
+    // PIPL update Yin Mingjie 21/02/2022 end
 
     select_department : function(component, event, helper) {
         var dc = component.find("select_department").get("v.value");
@@ -99,32 +172,78 @@
                 
                 // 20220222 PI鏀归�� by Bright--start
                 let dataIds = [];
+                let dataIds1 = [];
+                let mm = {};
+                let b = false;
+                let b1 = false;
                 for (const rep of res.reports) {
                     if (rep.doctor2__r && rep.doctor2__r.AWS_Data_Id__c) {
                         dataIds.push(rep.doctor2__r.AWS_Data_Id__c);
+                    }
+
+                    if (rep.Person_In_Charge2__r && rep.Person_In_Charge2__r.AWS_Data_Id__c) {
+                        dataIds1.push(rep.Person_In_Charge2__r.AWS_Data_Id__c);
+                    }
+                }
+                let Foo = null;
+                Foo = function(){
+                    if(b && b1){
+                        for (const rep of res.reports) {
+                            if (rep.doctor2__r && rep.doctor2__r.AWS_Data_Id__c && mm.hasOwnProperty(rep.doctor2__r.AWS_Data_Id__c)) {
+                                rep.doctor2__r.awsdata = mm[rep.doctor2__r.AWS_Data_Id__c];
+                            }
+                            if (rep.Person_In_Charge2__r && rep.Person_In_Charge2__r.AWS_Data_Id__c && mm.hasOwnProperty(rep.Person_In_Charge2__r.AWS_Data_Id__c)) {
+                                rep.Person_In_Charge2__r.awsdata = mm[rep.Person_In_Charge2__r.AWS_Data_Id__c];
+                            }
+                        }
+
+                        $A.getCallback(()=>component.set('v.reports', res.reports))();
+                    }else{
+                        console.log('b='+b + ',b1='+b1+',continue');
+                        setTimeout(Foo,100);
                     }
                 }
                 
                 if(dataIds.length > 0){
                     let awsurl = component.get('v.awsurl');
-                    helper.search_agency_contact_core(awsurl.token,awsurl.searchUrl,JSON.stringify({
+                    helper.search_core(awsurl.token,awsurl.searchUrl,JSON.stringify({
                         "dataIds":dataIds
                     }),(result)=>{
                         if(result.status == '0'){
-                            let mm = {};
+                            
                             for (const m of result.object) {
                                 mm[m.dataId] = m;
                             }
-                            for (const rep of res.reports) {
-                                if (rep.doctor2__r && rep.doctor2__r.AWS_Data_Id__c && mm.hasOwnProperty(rep.doctor2__r.AWS_Data_Id__c)) {
-                                    rep.doctor2__r.awsdata = mm[rep.doctor2__r.AWS_Data_Id__c];
-                                }
-                            }
-                            component.set('v.reports', res.reports);
+                            b = true;
+                            Foo();
                         }else{
                             this.error('AWS search status : ' + result.status);
                         }
                     },component);
+                }else{
+                    b = true;
+                }
+
+                
+                
+                if(dataIds1.length > 0){
+                    let contactawsurl = component.get('v.contactawsurl');
+                    helper.search_core(contactawsurl.token,contactawsurl.searchUrl,JSON.stringify({
+                        "dataIds":dataIds1
+                    }),(result)=>{
+                        if(result.status == '0'){
+                            
+                            for (const m of result.object) {
+                                mm[m.dataId] = m;
+                            }
+                            b1 = true;
+                            Foo();
+                        }else{
+                            this.error('AWS search status : ' + result.status);
+                        }
+                    },component);
+                }else{
+                    b1 = true;
                 }
                 // 20220222 PI鏀归�� by Bright--end
 
@@ -179,7 +298,10 @@
     },
     
     get_agency_person_name : function(component, agency_person_value) {
-        var allselectlist = component.get('v.allselectlist.AgencyPerson__c');
+        // PIPL update Yin Mingjie 21/02/2022 start
+        // var allselectlist = component.get('v.allselectlist.AgencyPerson__c');
+        var allselectlist = component.get('v.allselectlistAgencyPerson');
+        // PIPL update Yin Mingjie 21/02/2022 end
         var new_label = '';
         for (var i = 0; i < allselectlist.length; i++) {
             if (agency_person_value == allselectlist[i].value) {
@@ -456,7 +578,7 @@
         var name = component.get('v.selected_agency_person');
         var ret = this.create_report_header(component, name, select_agency, select_date);
         // PIPL update Yin Mingjie 21/02/2022 start
-        this.set_aws_url(component)
+        this.set_aws_url(component,'Agency_Contact__c')
         // PIPL update Yin Mingjie 21/02/2022 end
     },
     
@@ -1066,10 +1188,10 @@
         }
     },
     // PIPL update Yin Mingjie 21/02/2022 start
-    set_aws_url : function(component) {
+    set_aws_url : function(component,sobject) {
         var action = component.get('c.getAwsurl');
         action.setParams({
-            "sobj" : "Agency_Contact__c",
+            "sobj" : sobject,
         });
         action.setCallback(this,function(response){
             var state = response.getState();
@@ -1077,6 +1199,7 @@
                 var awsmap = this.conv_selected(response.getReturnValue());
                 component.set('v.AWStoken',awsmap.token);
                 component.set('v.AWSinsert',awsmap.newUrl);
+                component.set('v.AWSsearch',awsmap.searchUrl);
                 component.set('v.AWStransactionURL',awsmap.transactionURL);
             }
             else{
@@ -1256,7 +1379,7 @@
     },
 
     search_agency_contact : function(token,searchUrl,payload,retMap,component) {
-        this.search_agency_contact_core(token,searchUrl,payload,(result)=>{
+        this.search_core(token,searchUrl,payload,(result)=>{
             if(result.status == '0'){
                 this.to_doctor_list(result,retMap,component);
             }else{
@@ -1280,7 +1403,7 @@
         //     component.set('v.login',false);
         // });
     },
-    search_agency_contact_core : function(token,searchUrl,payload,callback,component) {
+    search_core : function(token,searchUrl,payload,callback,component) {
         fetch(searchUrl, {
             method: 'POST',
             body: payload,
diff --git a/force-app/main/default/classes/CM_SearchContactServiceController.cls b/force-app/main/default/classes/CM_SearchContactServiceController.cls
index cd53c9a..405631b 100644
--- a/force-app/main/default/classes/CM_SearchContactServiceController.cls
+++ b/force-app/main/default/classes/CM_SearchContactServiceController.cls
@@ -23,7 +23,7 @@
         List<Contact> conList = new List<Contact>();
         system.debug('Account Id from Front-end:'+accountId);
         if(String.isNotBlank(accountId) && String.isNotEmpty(accountId)){
-            conList = new List<Contact>([select Id,AWS_Data_Id__c from Contact where AccountId=:accountId and AWS_Data_Id__c!='']);
+            conList = new List<Contact>([select Id,AWS_Data_Id__c from Contact where AccountId=:accountId and AWS_Data_Id__c!='' limit 500]);
         }        
         //2. Prepare the Contact Info
         Map<String,Contact> awsIdToContactMap = new Map<String,Contact>();
@@ -90,6 +90,8 @@
 
         system.debug('=====searchStr:' + searchStr);
 
+        searchStr += 'limit 500';
+
         List<Contact> searchResult = Database.query(searchStr);
 
         lineInfoList = new List<LineInfo>();
diff --git a/force-app/main/default/classes/LightningUtil.cls b/force-app/main/default/classes/LightningUtil.cls
index 855591b..9fd9a30 100644
--- a/force-app/main/default/classes/LightningUtil.cls
+++ b/force-app/main/default/classes/LightningUtil.cls
@@ -43,8 +43,12 @@
 
     public static List<contact> selectAgencyPerson() {
         String login_user_id = UserInfo.getUserId();
-        return [select id, Name, Agency_User__c from contact where  Agency_User__c = true and  Isactive__c = '鏈夋晥' and AccountId in 
+        // PIPL update Yin Mingjie 21/02/2022 start
+        // return [select id, Name, Agency_User__c from contact where  Agency_User__c = true and  Isactive__c = '鏈夋晥' and AccountId in 
+        // (select AccountId from User where id=:login_user_id)];
+        return [select id, Name, Agency_User__c, AWS_Data_Id__c from contact where  Agency_User__c = true and  Isactive__c = '鏈夋晥' and AccountId in 
         (select AccountId from User where id=:login_user_id)];
+        // PIPL update Yin Mingjie 21/02/2022 end
     }
     public static List<contact> selectAgencyPerson01() {
         String login_user_id = UserInfo.getUserId();
@@ -147,7 +151,7 @@
             List<Contact> person_list = selectAgencyPerson();
             return [Select Id, Name, Report_Date__c, Product_Category1__r.Name, Product_Category2__r.Name, Product_Category3__r.Name, Product_Category1__c, Product_Category2__c, Product_Category3__c,ConsumptionOfConsumables__c, WorkMark__c,warlocksNumber__c,Department_Cateogy__c,ProductClassification__c,WarlockClassification__c,ProductCcategory__c, productCategories__c,DealerPersonnel__c,WorkRecord__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c,
                             Person_In_Charge2__c,DealerPersonnel__r.Name, Person_In_Charge2__r.Name, doctor2__c, doctor2__r.Name, Submit_date__c,
-                            doctor2__r.AWS_Data_Id__c,// 20220222 PI鏀归�� by Bright
+                            doctor2__r.AWS_Data_Id__c,Person_In_Charge2__r.AWS_Data_Id__c,// 20220222 PI鏀归�� by Bright
                             Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c, Opportunity__c, Opportunity__r.Name,EffectProgress__c,
                             UseProduct1__c,UseProduct2__c,UseProduct3__c,UseProduct1__r.Name,UseProduct2__r.Name,UseProduct3__r.Name    
                             From Agency_Report__c
@@ -155,7 +159,7 @@
         } else {
             return [Select Id, Name, Report_Date__c, Product_Category1__r.Name, Product_Category2__r.Name, Product_Category3__r.Name, Product_Category1__c, Product_Category2__c, Product_Category3__c,ConsumptionOfConsumables__c, WorkMark__c,warlocksNumber__c,Department_Cateogy__c,DealerPersonnel__c,ProductClassification__c,WarlockClassification__c,ProductCcategory__c,productCategories__c,WorkRecord__c, Agency_Report_Header__c, Agency_Hospital__r.Name, Agency_Hospital__r.Hospital__c, OppName__c,
                             Person_In_Charge2__c,DealerPersonnel__r.Name, Person_In_Charge2__r.Name, doctor2__c, doctor2__r.Name, Submit_date__c,
-                            doctor2__r.AWS_Data_Id__c,// 20220222 PI鏀归�� by Bright
+                            doctor2__r.AWS_Data_Id__c,Person_In_Charge2__r.AWS_Data_Id__c,// 20220222 PI鏀归�� by Bright
                             Product_Category__c, Product_Category__r.Name, Result__c, visitor_title__c, Opportunity__c, Opportunity__r.Name,EffectProgress__c,
                             UseProduct1__c,UseProduct2__c,UseProduct3__c,UseProduct1__r.Name,UseProduct2__r.Name,UseProduct3__r.Name   
                             From Agency_Report__c
@@ -163,7 +167,7 @@
         }
     }
     //杩芥函绯荤粺
-    public static List<Agency_Report__c> selectAgencyReport01(Date week, String person_str) { 
+    public static List<Agency_Report__c> selectAgencyReport01(Date week, String person_str) {
         system.debug('person_strperson_str=================>'+person_str);
         if (String.isBlank(person_str)) {
             List<Contact> person_list = selectAgencyPerson01();
diff --git a/force-app/main/default/classes/NFM501Controller.cls b/force-app/main/default/classes/NFM501Controller.cls
index b8ec71c..7b97d5a 100644
--- a/force-app/main/default/classes/NFM501Controller.cls
+++ b/force-app/main/default/classes/NFM501Controller.cls
@@ -253,7 +253,8 @@
                 return;
             }
             rowData = NFMUtil.QLMmakeRowData(NFM501responseBody, rowData);
-            rowData.AWS_Transaction_Id__c = (String)results.get('txId');// add for pi susanhu 20220310
+            rowData.AWS_Transaction_Id__c = (String)results.get('txId');// add for pi susanhu 20220310 
+            update rowData;
             system.debug('rowData---'+rowData);
             System.debug('======2221234======');
 
diff --git a/force-app/main/default/classes/NFM501FutureController.cls b/force-app/main/default/classes/NFM501FutureController.cls
index cd34a5f..eef5e5c 100644
--- a/force-app/main/default/classes/NFM501FutureController.cls
+++ b/force-app/main/default/classes/NFM501FutureController.cls
@@ -4,13 +4,19 @@
     // 	鎶曟爣鎴鏃堕棿
     // 2021/01/04 18:00
     //add by sushanhu for pi 20220310 start
-    public static String txId;
+    public  String txId;
     
     //add by sushanhu for pi 20220310 end
     public String rowData_id;
     public NFM501FutureController(String rowData_id) {
         this.rowData_id = rowData_id;
     }
+     //add by sushanhu for pi 20220310 start
+    //  public NFM501FutureController(String rowData_id,String txId) {
+    //      this.rowData_id = rowData_id;
+    //     this.txId = txId;
+    //  }
+     //add by sushanhu for pi 20220310 end
     public static Integer batch_retry_max_cnt = Integer.valueOf(System.Label.batch_retry_max_cnt);
     public void execute(QueueableContext context /*, String iflog_Id*/ ) {
         //闇�鍔犱竴鏁板瓧鍙橀噺锛堝鏋滆幏鍙栧埌 html闄勪欢锛屽叾浠栭檮浠讹紝鍦ㄦ棩蹇椾腑鏄剧ず鏁伴噺锛�
@@ -22,7 +28,14 @@
             from BatchIF_Log__c where RowDataFlg__c = true and Id = : rowData_id
         ];
         //瀛樻斁鎶ラ敊淇℃伅
-        txId =rowData.AWS_Transaction_Id__c; //add by sushanhu for pipl 20220310
+        //add by sushanhu for pipl 20220311 start
+        system.debug('txId from log'+rowData.AWS_Transaction_Id__c);
+        if (!String.isEmpty(rowData.AWS_Transaction_Id__c)) {
+            txId =rowData.AWS_Transaction_Id__c; //add by sushanhu for pipl 20220310
+        }else {
+            system.debug('txId from NF501'+txId);
+        }
+         //add by sushanhu for pipl 20220311 end
         system.debug('nfm501future awsid'+txId);
         BatchIF_Log__c iflog501Future = new BatchIF_Log__c();
         iflog501Future.Type__c = 'NFM501';
@@ -32,11 +45,14 @@
         iflog501Future.RowDataFlg__c = false;
         iflog501Future.AWS_Transaction_Id__c=rowData.AWS_Transaction_Id__c;
         insert iflog501Future;
-        NFM501FutureController.main(rowData.Id, iflog501Future.Id, false);
+        NFM501FutureController.main(rowData.Id, iflog501Future.Id, false,txId);
     }
+    
     @future(callout = true)
     //閲嶅彂锛堟妸浠庢帴鍙h幏鍙栧埌鐨勬暟鎹瓨鍏ユ棩蹇椾腑锛屽啀鎶婃棩蹇椾腑瀛樺叆鐨勬暟鎹噸鏂癑OSN瑙f瀽涓�閬嶏級
-    public static void main(String rowData_id, String iflog_id, boolean Manual_execution501future) {
+    public static void main(String rowData_id, String iflog_id, boolean Manual_execution501future,
+                                String txId //澧炲姞浜嬪姟id forpipl 20220310 
+            ) {
         BatchIF_Log__c rowData = [Select Id, Name, Log__c, ErrorLog__c, Log2__c, Log3__c,
             Log4__c, Log5__c, Log6__c, Log7__c, Log8__c, Log9__c, Log10__c, Log11__c,
             Log12__c, MessageGroupNumber__c, retry_cnt__c, NFM501Future_Count__c,
@@ -106,7 +122,8 @@
             SumUnit__c, AreaCity__c, AreaCountry__c, AgentUnit1__c,
             AgentUnit2__c, AgentUnit3__c, AgentUnit4__c, AgentUnit5__c,
             ZhaoRelationName__c, ZhongRelationName__c,
-            publicDate__c, noticeDate__c, ResultDate__c
+            publicDate__c, noticeDate__c, ResultDate__c,
+            AWS_Data_Id__c //ADD FOR pi SUSHANHU 20220311
             FROM Tender_information__c Where ProjectId__c in : projectIdList
         ];
         Map < String, Tender_information__c > TenMap = new Map < String, Tender_information__c > ();
diff --git a/force-app/main/default/classes/NFM624Rest.cls b/force-app/main/default/classes/NFM624Rest.cls
index 369f114..ada2b1b 100644
--- a/force-app/main/default/classes/NFM624Rest.cls
+++ b/force-app/main/default/classes/NFM624Rest.cls
@@ -682,7 +682,7 @@
         //琛ュ厖璇㈤棶鍗曢儴鍒� end
         
         //琛ュ厖瀛︿細閮ㄥ垎 start
-        List<CampaignMember__c> campaignMemberList = new List<CampaignMember__c>();
+        //List<CampaignMember__c> campaignMemberList = new List<CampaignMember__c>();
         List<CampaignMember__c> capMemList = [select Id,Contact_ID__c,Campaign__c,Campaign__r.Num__c,ViewContactId__c from CampaignMember__c where Contact_ID__c = :ContactId];
         if(capMemList.size() > 0){
             system.debug('capMemList=================>'+capMemList);
diff --git a/force-app/main/default/classes/NFMUtil.cls b/force-app/main/default/classes/NFMUtil.cls
index d1bd09b2..56315c8 100644
--- a/force-app/main/default/classes/NFMUtil.cls
+++ b/force-app/main/default/classes/NFMUtil.cls
@@ -78,7 +78,8 @@
             //NFM007_ENDPOINT = 'http://wdp.olympus.com.cn:8089/RESTAdapter/NFM007';
             NFM007_ENDPOINT = 'https://wdp.olympus.com.cn:44301/RESTAdapter/NFM007';
             NFM008_ENDPOINT = 'https://owdc-test.olympus.co.jp/XISOAPAdapter/MessageServlet?senderParty=&senderService=OCM_SFDC_T&receiverParty=&receiverService=&interface=NFM008_Sync_BC2GPI&interfaceNamespace=http%3A%2F%2Folympus.co.jp%2Fgpi%2FNFM008';
-            NFM103_ENDPOINT = 'http://wdp.olympus.com.cn:8089/RESTAdapter/NFM103';
+            // NFM103_ENDPOINT = 'http://wdp.olympus.com.cn:8089/RESTAdapter/NFM103';
+            NFM103_ENDPOINT = 'https://sfpi-mebg-test.olympuschina.com/api/nfm/103';//aws 103鎺ュ彛
             // NFM106_ENDPOINT = 'https://owdc-test.olympus.co.jp/XISOAPAdapter/MessageServlet?senderParty=&senderService=OCM_SFDC_T&receiverParty=&receiverService=&interface=NFM106_Sync_BC2GPI&interfaceNamespace=http%3A%2F%2Folympus.co.jp%2Fgpi%2FNFM106';
             NFM106_ENDPOINT = 'http://wdp.olympus.com.cn:8089/RESTAdapter/NFM106';
             //NFM106_ENDPOINT = 'https://sfdc-ocm-test.olympus.co.jp/XISOAPAdapter/MessageServlet?senderParty=&senderService=OCM_SFDC_T&receiverParty=&receiverService=&interface=NFM106_Sync_BC2GPI&interfaceNamespace=http%3A%2F%2Folympus.co.jp%2Fgpi%2FNFM106';
@@ -100,7 +101,7 @@
             NFM401_ENDPOINT = 'http://ec2-161-189-3-104.cn-northwest-1.compute.amazonaws.com.cn:8088/dojtest/dojInfo/recevie';
             NFM402_ENDPOINT = 'http://ec2-161-189-3-104.cn-northwest-1.compute.amazonaws.com.cn:8088/dojtest/dojInfo/getDojInfoByRefNo';
 
-            NFM501_ENDPOINT = 'http://cusdata.qianlima.com/v1/info/page/';
+            NFM501_ENDPOINT = 'https://sfpi-mebg-test.olympuschina.com/api/nfm/501';
             NFM502_ENDPOINT = 'http://cusdata.qianlima.com/v1/info/detailHtml?url=';
             NFM504_ENDPOINT = 'http://cusdata.qianlima.com/v1/customer/albs/feedback';
             CBPR_Auth_Sap = 'Basic U0ZEQ19XU1VTRVI6cG9xMTIzNDU=';
@@ -109,7 +110,7 @@
             CBPR_Auth_Spo = 'http://cbpr.olympuschina.com/sfdc/token';
 
             QLM_Token = 'http://cusdata.qianlima.com/v1/token';
-            
+
 
             // 鏅烘収鍖荤枟&鏈嶅姟鏂扮郴缁熼�氫俊 瀹㈡埛鎺ュ彛
             NFM601_ENDPOINT = 'https://wdp.olympus.com.cn:44301/RESTAdapter/NFM601';
@@ -127,11 +128,11 @@
             NFM115_ENDPOINT = 'https://wdp.olympus.com.cn:44301/RESTAdapter/NFM115';
             // 鏂版湇鍔$郴缁� 娴嬭瘯鐜
             AWS_DOMAIN = 'https://olympus.bqbot.com';
-            // 鏂版湇鍔$郴缁� 鏈湴鐜锛堜复鏃讹級
+              // 鏂版湇鍔$郴缁� 鏈湴鐜锛堜复鏃讹級
             // AWS_DOMAIN = 'http://114.249.236.98:29990';
             // AWS_DOMAIN = 'http://jzbase.bqbot.com:29990';
             // AWS_DOMAIN = 'http://114.249.238.243:29990';
-            
+
 
             requestURILMS = '/v1/uc/user/syncOlympusUnit';
             appSecretLMS = 'CAE1D68BE3EB4F7AB5FE97EBDD11B83E';
@@ -158,7 +159,7 @@
             NFM401_ENDPOINT = 'http://ec2-161-189-3-104.cn-northwest-1.compute.amazonaws.com.cn:8082/doj/dojInfo/recevie';
             NFM402_ENDPOINT = 'http://ec2-161-189-3-104.cn-northwest-1.compute.amazonaws.com.cn:8082/doj/dojInfo/getDojInfoByRefNo';
 
-            NFM501_ENDPOINT = 'http://cusdata.qianlima.com/v1/info/page/';
+            NFM501_ENDPOINT ='https://sfpi-mebg-test.olympuschina.com/api/nfm/501';
             NFM502_ENDPOINT = 'http://cusdata.qianlima.com/v1/info/detailHtml?url=';
             NFM504_ENDPOINT = 'http://cusdata.qianlima.com/v1/customer/albs/feedback';
             CBPR_Auth_Sap = 'Basic U0ZEQ19XU1VTRVI6cG9wMTIzNDU=';
@@ -181,7 +182,7 @@
             //鏍锋湰绠$悊
             NFM115_ENDPOINT = 'https://wdp.olympus.com.cn:44302/RESTAdapter/NFM115';
 
-            // 鏂版湇鍔$郴缁�
+ // 鏂版湇鍔$郴缁�
             AWS_DOMAIN = 'https://svc-elb.olympuschina.com';
 
             requestURILMS = '/v1/uc/user/syncOlympusUnit';
@@ -231,7 +232,27 @@
         webservice String timestamp;
         webservice String appKey;
     }
-
+    // add to aws response sushanhu 20220224 start
+    global class NFMResponse{
+        public Boolean SFStatus;
+        public String SFMessage;
+        public StaticResponse staticResponse;
+    }
+    global class StaticResponse{
+        public string status;
+        public String Message;
+        public StaticResponse(){
+            status='Success';
+            Message='';
+        }
+    }
+    public static NFMResponse getNFMResponse(){
+        NFMResponse  result=new NFMResponse();
+        result.staticResponse =new StaticResponse();
+        return result;
+        
+    }
+// add to aws response sushanhu 20220224 end
     /**
      * @return yyyyMMdd 銇棩浠樻枃瀛楀垪
      */
@@ -344,7 +365,7 @@
         return rtn;
     }
 
-    /**
+     /**
      * add       wangweipeng       2022/02/11
      * [formatDateTime2StrDateTime description]
      * @param  dt [鏃ユ湡/鏃堕棿]
@@ -378,7 +399,7 @@
         return parseStr2Date(pDateTime.substring(0, 8));
     }
 
-    /**
+     /**
      * add    wangweipeng           2022/02/15
      * [parseStr2DateTime description]
      * @param  pDate [鏃ユ湡锛堜笉鍖呮嫭鏃堕棿锛塢
@@ -419,13 +440,13 @@
                 return null;
             }
             rtn = Datetime.newinstance(
-                Integer.valueOf(pDate.substring(0, 4)),
-                Integer.valueOf(pDate.substring(4, 6)),
-                Integer.valueOf(pDate.substring(6, 8)),
-                Integer.valueOf(pTime.substring(0, 2)),
-                Integer.valueOf(pTime.substring(2, 4)),
-                Integer.valueOf(pTime.substring(4, 6))
-            );
+                      Integer.valueOf(pDate.substring(0, 4)),
+                      Integer.valueOf(pDate.substring(4, 6)),
+                      Integer.valueOf(pDate.substring(6, 8)),
+                      Integer.valueOf(pTime.substring(0, 2)),
+                      Integer.valueOf(pTime.substring(2, 4)),
+                      Integer.valueOf(pTime.substring(4, 6))
+                  );
         } catch (Exception ex) {
             System.debug(Logginglevel.ERROR, 'NFMUtil#parseStr2DateTime(' + pDate + ', ' + pTime + ')' + ex.getMessage());
         }
@@ -455,10 +476,10 @@
                 return null;
             }
             rtn = Date.newinstance(
-                Integer.valueOf(pStr.substring(0, 4)),
-                Integer.valueOf(pStr.substring(4, 6)),
-                Integer.valueOf(pStr.substring(6, 8))
-            );
+                      Integer.valueOf(pStr.substring(0, 4)),
+                      Integer.valueOf(pStr.substring(4, 6)),
+                      Integer.valueOf(pStr.substring(6, 8))
+                  );
         } catch (Exception ex) {
             System.debug(Logginglevel.ERROR, 'NFMUtil#parseStr2Date(' + pStr + ')' + ex.getMessage());
         }
@@ -604,7 +625,7 @@
         return rowData;
     }
 
-    // public static BatchIF_Log__c makeRowDataToOnline(NFMUtil.MonitoringToOnline Monitoring, String NFMType, Object NFMData) {
+        // public static BatchIF_Log__c makeRowDataToOnline(NFMUtil.MonitoringToOnline Monitoring, String NFMType, Object NFMData) {
     //     BatchIF_Log__c rowData = new BatchIF_Log__c();
     //     rowData.Type__c = NFMType;
     //     rowData.MessageGroupNumber__c = Monitoring.MessageGroupNumber;
@@ -871,7 +892,30 @@
         system.debug('ress:' + ress);
         return new response(ress, resb);
     }
+    // send to aws to sap sushuanhu 20220222
+    public static response sendToPiAWS(String rowDataStr, String endpoint,String awsToken) {
 
+        Http http = new Http();
+        HttpRequest req = new HttpRequest();
+        HTTPResponse res;
+        String resb;       
+        req.setTimeout(120000);
+        req.setEndpoint(endpoint);
+        req.setMethod('POST');
+        req.setHeader('Content-Type', 'application/json');
+        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);
+    }
+    // 鑾峰彇aws token sushanhu 20220222
+    public static response getAwsToken(){
+        String responseBody = AWSServiceTool.getAWSToken();
+        return new response('success', responseBody);
+    }
     public class response {
         public string status;
         public string responseBody;
@@ -909,10 +953,10 @@
             return null;
         }
         return Time.newInstance(
-            Integer.valueOf(timeStr.substring(0, 2)),
-            Integer.valueOf(timeStr.substring(2, 4)),
-            Integer.valueOf(timeStr.substring(4, 6)),
-            0);
+                   Integer.valueOf(timeStr.substring(0, 2)),
+                   Integer.valueOf(timeStr.substring(2, 4)),
+                   Integer.valueOf(timeStr.substring(4, 6)),
+                   0);
     }
     //insert by rentongxiao 2020-10-12 end
 
@@ -933,8 +977,8 @@
         //1銆� 鑾峰彇token:
         Http http = new Http();
         HttpRequest req = new HttpRequest();
-        String content = 'appKey=' + EncodingUtil.urlEncode(appKey, 'UTF-8') +
-            '&appSecret=' + EncodingUtil.urlEncode(appSecret, 'UTF-8');
+        String content = 'appKey=' + EncodingUtil.urlEncode(appKey, 'UTF-8') + 
+                         '&appSecret=' + EncodingUtil.urlEncode(appSecret, 'UTF-8');
         //璇锋眰璺緞
         req.setEndpoint(QLM_Token);
         req.setHeader('Content-Type', QLM_NFM501_Point);
@@ -992,6 +1036,51 @@
         //姝e父鎵ц
         return new response(ress, response.getBody());
     }
+    // NEW QLM AWS 501  鎺ュ彛 sushanhu 20220223
+    public static response getAWSQLMData(String endpoint, String token) {
+        //2銆佽幏鍙栨嫑鏍囦俊鎭細璁板緱浣跨敤1涓幏鍙栫殑token
+        Http http = new Http();
+        HttpRequest req = new HttpRequest();
+        req.setHeader('Content-Type', 'application/json');
+        req.setHeader('pi-token',  token);
+        req.setTimeout(120000);
+        req.setEndpoint(endpoint);
+        req.setMethod('GET');
+        HTTPResponse response = http.send(req);
+        String statusCode = response.getStatus();
+        System.debug('response:' + response);
+        //http锛氱姸鎬佸拰code
+        //濡傛灉鐘舵�佷笉閫氳繃 锛� 鍒欏皢鐘舵�佸強绌虹殑鐨勬暟鎹� 锛� 杩斿洖
+        if (String.isNotBlank(statusCode)) {
+            return new response(statusCode, null);
+        }
+        System.debug('=====2======' + response.getBody());
+        //姝e父鎵ц
+        return new response(statusCode, response.getBody());
+    }
+    // NEW QLM AWS 502 503鎺ュ彛 sushanhu 20220223
+    public static response getAWSQLMData(String endpoint,String jsonStr,  String token) {
+        //2銆佽幏鍙栨嫑鏍囦俊鎭細璁板緱浣跨敤1涓幏鍙栫殑token
+        Http http = new Http();
+        HttpRequest req = new HttpRequest();
+        req.setHeader('Content-Type', 'application/json');
+        req.setHeader('pi-token',  token);
+        req.setTimeout(120000);
+        req.setEndpoint(endpoint);
+        req.setMethod('POST');
+        req.setBody(jsonStr);
+        HTTPResponse response = http.send(req);
+        String statusCode = response.getStatus();
+        System.debug('response:' + response);
+        //http锛氱姸鎬佸拰code
+        //濡傛灉鐘舵�佷笉閫氳繃 锛� 鍒欏皢鐘舵�佸強绌虹殑鐨勬暟鎹� 锛� 杩斿洖
+        if (String.isNotBlank(statusCode)) {
+            return new response(statusCode, null);
+        }
+        System.debug('=====2======' + response.getBody());
+        //姝e父鎵ц
+        return new response(statusCode, response.getBody());
+    }
 
     //鎺ュ彛3锛岃幏鍙栧叾浠栭檮浠�
     public static response503 getFileData(String token503, String endpoint) {
@@ -1038,7 +1127,7 @@
     public static String sendTenInfo(String token504, String jsonStr, String endpoint) {
         Http http = new Http();
         HttpRequest req = new HttpRequest();
-        req.setEndpoint('http://cusdata.qianlima.com/test/v1/customer/albs/feedback');
+        req.setEndpoint(endpoint);
         req.setHeader('open-authorization', 'Bearer' + token504);
         req.setHeader('Content-Type', 'application/x-www-form-urlencoded');
         req.setMethod('POST');
@@ -1157,7 +1246,7 @@
         return resb;
     }
     //鍙戦�佺粰鍏遍�氬钩鍙� 绮剧悽鎶�鏈� thh 2021-09-22 end
-    
+
     public static Integer ControllerUtil() {
         Integer i = 0;
         i++;
diff --git a/force-app/main/default/classes/NewAndEditASEActivityController.cls b/force-app/main/default/classes/NewAndEditASEActivityController.cls
index 2196438..6ec94a8 100644
--- a/force-app/main/default/classes/NewAndEditASEActivityController.cls
+++ b/force-app/main/default/classes/NewAndEditASEActivityController.cls
@@ -31,12 +31,14 @@
         //鑾峰彇contact 鍔犲瘑ID
         // contactsInfo = LookUpOverrideFieldsMapJson;
         //contact淇℃伅锛堟悳绱㈡煡璇uery url鐢級
-        ASEActivity__c aseActivity = [Select Id, ReporterASE__c From ASEActivity__c Where Id = : obj.Id];
-        if(aseActivity.ReporterASE__c != null){
-            Contact contact = [Select Id, AWS_Data_Id__c From Contact Where Id = : aseActivity.ReporterASE__c];
-            System.debug('contact : ' + contact );
-            contactAWS = contact.AWS_Data_Id__c;
-            System.debug('contactAWS : ' + contactAWS );
+        if(obj.Id != null){
+            ASEActivity__c aseActivity = [Select Id, ReporterASE__c From ASEActivity__c Where Id = : obj.Id];
+            if(aseActivity.ReporterASE__c != null){
+                Contact contact = [Select Id, AWS_Data_Id__c From Contact Where Id = : aseActivity.ReporterASE__c];
+                System.debug('contact : ' + contact );
+                contactAWS = contact.AWS_Data_Id__c;
+                System.debug('contactAWS : ' + contactAWS );
+            } 
         }
         staticResourceContact = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact'));
     }
diff --git a/force-app/main/default/classes/PIHelper.cls b/force-app/main/default/classes/PIHelper.cls
index 48cc2cd..a1217ab 100644
--- a/force-app/main/default/classes/PIHelper.cls
+++ b/force-app/main/default/classes/PIHelper.cls
@@ -18,19 +18,22 @@
         }    
     }
     // confirm file transaction
-    @future(callout =true)
+    // @future(callout =true)
     public static void confirmFileTrans(String module,Integer isSuccess, String   sfRecordId ,String transId ,String token,String transUrl){
         Boolean result =false;
         Transaction_Log__c traLog = new Transaction_Log__c();
         traLog.Module__c = 'ConfirmFileTransaction '+module;
         traLog.Interface_URL__c = transUrl;
         traLog.TransId__c = transId;
-        traLog.SFRecordId__c=sfRecordId;
+        // traLog.SFRecordId__c=sfRecordId;
+        Integer MaxLogColumnLength = 131072;
         try {
             Http http = new Http();
             HttpRequest request = new HttpRequest();
             request.setEndpoint(transUrl);
             request.setMethod('POST');
+            request.setHeader('pi-token',token);
+            request.setHeader('Content-Type', 'application/json');
             TransRequestBody requestBody =new TransRequestBody();
             requestBody.isSuccess=isSuccess;
             requestBody.sfRecordId=sfRecordId;
@@ -44,7 +47,9 @@
             result = (Boolean)results.get('success');
             System.debug('result = ' + result);
             traLog.Status__c = 'success';
-            traLog.Response__c=response.getBody();
+            String res=response.getBody();
+            traLog.Response__c=res.substring(0, (res.length() > MaxLogColumnLength ? MaxLogColumnLength : res.length()));
+           
         } catch (Exception e) {  
             traLog.Status__c = 'fail';
             traLog.Response__c = e.getMessage();    
@@ -59,6 +64,7 @@
          traLog.Module__c = 'Confirm Transaction '+module;
          traLog.Interface_URL__c = transUrl;
          traLog.TransId__c = transId;
+         Integer MaxLogColumnLength = 131072;
          if (!String.isEmpty(sfRecordId)) {
             traLog.SFRecordId__c=sfRecordId;
          }else {
@@ -70,6 +76,8 @@
              HttpRequest request = new HttpRequest();
              request.setEndpoint(transUrl);
              request.setMethod('POST');
+             request.setHeader('pi-token',token);
+             request.setHeader('Content-Type', 'application/json');
              TransactionRequestBody requestBody =new TransactionRequestBody();
              requestBody.isSuccess=isSuccess;
              requestBody.sfRecordId=sfRecordId;
@@ -83,7 +91,8 @@
              result = (Boolean)results.get('success');
              System.debug('result = ' + result);
              traLog.Status__c = 'success';
-             traLog.Response__c=response.getBody();
+             String res=response.getBody();
+             traLog.Response__c=res.substring(0, (res.length() > MaxLogColumnLength ? MaxLogColumnLength : res.length()));
          } catch (Exception e) {  
              traLog.Status__c = 'fail';
              traLog.Response__c = e.getMessage();    
diff --git a/force-app/main/default/classes/RentalApplyController.cls b/force-app/main/default/classes/RentalApplyController.cls
index 8fa1e82..1a23237 100644
--- a/force-app/main/default/classes/RentalApplyController.cls
+++ b/force-app/main/default/classes/RentalApplyController.cls
@@ -1,3 +1,10 @@
+/**
+ * @description       : 
+ * @author            : ChangeMeIn@UserSettingsUnder.SFDoc
+ * @group             : 
+ * @last modified on  : 03-11-2022
+ * @last modified by  : ChangeMeIn@UserSettingsUnder.SFDoc
+**/
 global without sharing class RentalApplyController {
     public List <LayoutDescriberHelper.LayoutSection > layoutSections{set;get;}
     public String awsToken{set;get;}
@@ -85,30 +92,6 @@
             }else {
                 rentalApplyInfo.put(fieldAPI,fieldValue);
             }
-            // system.debug('field API'+fieldAPI);
-            // String fieldValue = String.valueOf(fieldAPIToTypeMap.get(fieldAPI));
-            // if(String.isBlank(fieldValue) || String.isEmpty(fieldValue)){
-            //     continue;
-            // }
-            // Schema.DescribeFieldResult fielddataType = fieldAPIToTypeMap.get(fieldAPI).getDescribe();  
-            // Schema.DisplayType fieldDatas = fielddataType.getType();
-            // system.debug('fieldValue='+fieldValue);
-            // if(String.valueOf(fielddatas)=='DATE'){
-            //     rentalApplyInfo.put(fieldAPI, Date.valueOf(String.valueOf(fieldValueMap.get(fieldAPI)).replace('/', '-')));
-            // }else if(String.valueOf(fielddatas)=='DATETIME'){
-            //     String dt = String.valueOf(fieldValueMap.get(fieldAPI));
-            //     if(String.isNotBlank(dt)&&dt.contains('T')){
-            //         dt = dt.replace('T',' ');
-            //         rentalApplyInfo.put(fieldAPI, Datetime.valueOfGmt(dt));
-            //     }             
-            // }else if(String.valueOf(fielddatas)=='Number'||String.valueOf(fielddatas)=='DOUBLE'){
-            //     system.debug('decimal error:'+ String.valueOf(fieldValueMap.get(fieldAPI)));
-            //     rentalApplyInfo.put(fieldAPI, decimal.valueOf(String.valueOf(fieldValueMap.get(fieldAPI))));
-            // } else if(String.valueof(fielddatas)=='BOOLEAN'){
-            //     rentalApplyInfo.put(fieldAPI, fieldValueMap.get(fieldAPI));
-            // }else {
-            //     rentalApplyInfo.put(fieldAPI, String.valueOf(fieldValueMap.get(fieldAPI)));
-            // }                  
         }
         
         //2. Save Record Process
diff --git a/force-app/main/default/classes/WeeklyReportCmp.cls b/force-app/main/default/classes/WeeklyReportCmp.cls
index c2caf98..5197381 100644
--- a/force-app/main/default/classes/WeeklyReportCmp.cls
+++ b/force-app/main/default/classes/WeeklyReportCmp.cls
@@ -6,6 +6,7 @@
     @AuraEnabled public List<Map<String,String>> doctorList{get;set;}
     // PIPL update Yin Mingjie 21/02/2022 start
     @AuraEnabled public Map<String,String> awsurl{get;set;}
+    @AuraEnabled public Map<String,String> contactawsurl{get;set;}
     // PIPL update Yin Mingjie 21/02/2022 end
     public WeeklyReportCmp() {
     }
@@ -78,6 +79,9 @@
         Map<String,String> space = new Map<String,String>();
         space.put('label', '');
         space.put('value', '');
+        // PIPL update Yin Mingjie 21/02/2022 start
+        space.put('awsid', '');
+        // PIPL update Yin Mingjie 21/02/2022 end
         space.put('selected', 'true');
         tmp.add(space);
         
@@ -87,6 +91,9 @@
             Map<String,String> om = new Map<String,String>();
             om.put('label', var.Name);
             om.put('value', var.Id);
+            // PIPL update Yin Mingjie 21/02/2022 start
+            om.put('awsid', var.AWS_Data_Id__c);
+            // PIPL update Yin Mingjie 21/02/2022 end
             om.put('selected', 'false');
             tmp.add(om);
         }
@@ -149,6 +156,7 @@
         //System.debug('allselectlist is ' + this.allselectlist);
 
         this.awsurl = getAwsurl('Agency_Contact__c');// 20220222 PI鏀归�� by Bright
+        this.contactawsurl = getAwsurl('Contact');// 20220222 PI鏀归�� by Bright
     }
     
     
diff --git a/force-app/main/default/pages/CM_SearchContactService.page b/force-app/main/default/pages/CM_SearchContactService.page
index b902684..9968e6b 100644
--- a/force-app/main/default/pages/CM_SearchContactService.page
+++ b/force-app/main/default/pages/CM_SearchContactService.page
@@ -6,6 +6,15 @@
     <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
     <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
     <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
+    <style>
+        .decrypt{
+            position: relative;
+            text-align: left;
+            display: block;
+            margin-left: 5px;
+            margin-top: -5px;
+        }
+    </style>
     <script type="text/javascript">
 
         // 2022/02/15 寮犲崕寤� 鏀归�燩I start
@@ -112,25 +121,29 @@
             window.close();
         }
 
-        function showPIDiv(awsDataId){
-            console.log('awsDataId Value:'+awsDataId);
-            let parentNode = document.getElementById(awsDataId);
-            let createDiv = document.createElement("div");  
-            createDiv.id = awsDataId+"_PI";  
+        function showPIDiv(dataId,awsDataId){
+            // console.log('awsDataId Value:'+awsDataId);
+            // let parentNode = document.getElementById(awsDataId);
+            // let createDiv = document.createElement("div");  
+            // createDiv.id = awsDataId+"_PI";  
+            // let piInformation = 'Name:'+contact[awsDataId].lastName +'\n' +'Phone:'+contact[awsDataId].phone
+            // //let piInformation = 'Name:'+contact['943114607025717249'].lastName +'\n' +'Phone:'+contact['943114607025717249'].phone
+            // createDiv.innerText = piInformation;
+            // let x=window.event.x;
+            // let y=window.event.y; 
+            // createDiv.style.left=x;  
+            // createDiv.style.top=y;  
+            // createDiv.style.background="#dddddd";
+            // createDiv.style.position = "absolute";
+            // parentNode.appendChild(createDiv);  
+            console.log('dataId:'+dataId+'awsDataId Value:'+awsDataId);
             let piInformation = 'Name:'+contact[awsDataId].lastName +'\n' +'Phone:'+contact[awsDataId].phone
-            //let piInformation = 'Name:'+contact['943114607025717249'].lastName +'\n' +'Phone:'+contact['943114607025717249'].phone
-            createDiv.innerText = piInformation;
-            let x=window.event.x;
-            let y=window.event.y; 
-            createDiv.style.left=x;  
-            createDiv.style.top=y;  
-            createDiv.style.background="#dddddd";
-            createDiv.style.position = "absolute";
-            parentNode.appendChild(createDiv);  
+            document.getElementById(dataId+'_'+awsDataId).innerText = piInformation;
         }
 
-        function hidePIDiv(awsDataId){
-            document.getElementById(awsDataId+'_PI').remove();
+        function hidePIDiv(dataId,awsDataId){
+            // document.getElementById(awsDataId+'_PI').remove();
+            document.getElementById(dataId+'_'+awsDataId).innerText = '';
         }
 
         // 2022骞�2鏈�15鏃� PI鏀归�� 寰愪寒 start
@@ -270,7 +283,12 @@
                         </td>
                         <!-- <td><a href="#" onclick="setContact('{!lineinfo.lineNo}');" id="943114607025717249" onmouseover="showPIDiv('943114607025717249')" onmouseout="hidePIDiv('943114607025717249')">{!lineinfo.con.Name}</a></td> -->
                         <!-- 2022/02/15 寮犲崕寤� 瑙e瘑淇℃伅 start -->
-                        <td><a href="#" onclick="setContact('{!lineinfo.lineNo}','{!lineinfo.con.AWS_Data_Id__c}');" id="{!lineinfo.con.AWS_Data_Id__c}" onmouseover="showPIDiv('{!lineinfo.con.AWS_Data_Id__c}')" onmouseout="hidePIDiv('{!lineinfo.con.AWS_Data_Id__c}')">{!lineinfo.con.Name}</a></td>
+                        <td>
+                            <a href="#" onclick="setContact('{!lineinfo.lineNo}','{!lineinfo.con.AWS_Data_Id__c}');" id="{!lineinfo.con.AWS_Data_Id__c}" onmouseover="showPIDiv('{!lineinfo.con.id}','{!lineinfo.con.AWS_Data_Id__c}')" onmouseout="hidePIDiv('{!lineinfo.con.id}','{!lineinfo.con.AWS_Data_Id__c}')">
+                                {!lineinfo.con.Name}
+                            </a>
+                            <span id="{!lineinfo.con.id}_{!lineinfo.con.AWS_Data_Id__c}" class="decrypt"></span>
+                        </td>
                         <!-- 2022/02/15 寮犲崕寤� 瑙e瘑淇℃伅 end -->
                         <td>{!lineinfo.con.AccountName__c}</td>
                         <td><input style="width:90%;" type="button" value="缂栬緫" onclick="editContactJs('{!lineinfo.con.Id}'); return null;" /></td>
diff --git a/force-app/main/default/pages/CampaignMember.page b/force-app/main/default/pages/CampaignMember.page
index 7da4f58..dd9ccce 100644
--- a/force-app/main/default/pages/CampaignMember.page
+++ b/force-app/main/default/pages/CampaignMember.page
@@ -204,8 +204,8 @@
         alert("璇峰厛閫夋嫨鍖婚櫌绉戝銆�");
         return false;
     }
-    var urlStr = 'apex/CM_SearchContact?line='+ line + '&acc=' + vpHiddenId;
-    var w = window.open(urlStr,'CM_SearchContact','menubar=no,height=580,width=620');
+    var urlStr = 'apex/CM_SearchContactService?line='+ line + '&acc=' + vpHiddenId;
+    var w = window.open(urlStr,'CM_SearchContactService','menubar=no,height=580,width=620');
     w.focus();
 }
 
diff --git a/force-app/main/default/pages/NewConsumApply.page b/force-app/main/default/pages/NewConsumApply.page
index 46a0c55..88ce5be 100644
--- a/force-app/main/default/pages/NewConsumApply.page
+++ b/force-app/main/default/pages/NewConsumApply.page
@@ -1,3 +1,10 @@
+<!--
+  @description       : 
+  @author            : ChangeMeIn@UserSettingsUnder.SFDoc
+  @group             : 
+  @last modified on  : 03-11-2022
+  @last modified by  : ChangeMeIn@UserSettingsUnder.SFDoc
+-->
 <apex:page standardController="Consum_Apply__c" extensions="NewConsumApplyController" id="page">
     <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" />
     <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
@@ -44,7 +51,6 @@
 
         //Check If Insert Or Update
         var insertOrUpdateBack = function insertOrUpdateBack(payloadJson, result, isNewMode) {
-            debugger
             console.log(result);
             let r = result;
             console.log('Result from AWS' + JSON.stringify(r));
@@ -59,7 +65,6 @@
             } else {
                 payloadJson.AWS_Data_Id__c = '{!AWSDataId}';
             }
-            debugger
             return payloadJson;
         }
 
@@ -259,7 +264,7 @@
             return template.content.firstChild;
         }
         function queryContactName() {
-            let sfId = document.getElementById(document.querySelector("[data-id='Loaner_medical_Staff__c']").id + '_lkid').value;
+            let sfId = document.getElementById(document.querySelector("[data-id='Account__c']").id + '_lkid').value;
             let contactsInfo = JSON.parse('{!contactsInfo}');
             let dataId = contactsInfo[sfId];
             let url = staticResourcesContact.queryUrl + '?dataId=' + dataId;
diff --git a/force-app/main/default/pages/NewRentalApply.page b/force-app/main/default/pages/NewRentalApply.page
index 02d03e3..c9b638e 100644
--- a/force-app/main/default/pages/NewRentalApply.page
+++ b/force-app/main/default/pages/NewRentalApply.page
@@ -1,3 +1,10 @@
+<!--
+  @description       : 
+  @author            : ChangeMeIn@UserSettingsUnder.SFDoc
+  @group             : 
+  @last modified on  : 03-11-2022
+  @last modified by  : ChangeMeIn@UserSettingsUnder.SFDoc
+-->
 <apex:page standardController="Rental_Apply__c" extensions="RentalApplyController" id="page">
     <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
     <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" />
@@ -244,7 +251,8 @@
             return template.content.firstChild;
         }
         function queryContactName() {
-            let sfId = document.getElementById(document.querySelector("[data-id='Loaner_medical_Staff__c']").id + '_lkid').value;
+            // let sfId = document.getElementById(document.querySelector("[data-id='Loaner_medical_Staff__c']").id + '_lkid').value;
+            let sfId = document.getElementById(document.querySelector("[data-id='Account__c']").id + '_lkid').value;
             let contactsInfo = JSON.parse('{!contactsInfo}');
             let dataId = contactsInfo[sfId];
             let url = staticResourcesContact.queryUrl + '?dataId=' + dataId;
diff --git a/force-app/main/default/triggers/FileAddressTrigger.trigger b/force-app/main/default/triggers/FileAddressTrigger.trigger
index 861b577..c60cda1 100644
--- a/force-app/main/default/triggers/FileAddressTrigger.trigger
+++ b/force-app/main/default/triggers/FileAddressTrigger.trigger
@@ -6,7 +6,7 @@
             deleteFiles.add(fd.AWS_File_Key__c);
         } 
     }
-    if(!deleteFiles.isEmpty()){
+    if(!deleteFiles.isEmpty()&&(!System.isFuture()||System.isBatch())){
         system.debug('DeleteFiles Value:'+JSON.serialize(deleteFiles));
         AWSServiceTool.deleteFileAddress(deleteFiles);
     }  

--
Gitblit v1.9.1