From d8dc84a3d56df839895f1c417a4d9cbee763d262 Mon Sep 17 00:00:00 2001
From: 高章伟 <gaozhangwei@prec-tech.com>
Date: 星期五, 03 三月 2023 14:50:59 +0800
Subject: [PATCH] gzw 测试环境代码更新

---
 force-app/main/default/classes/NFM503InfoFileBatch.cls |   47 ++++++++++++++++++++++++++++-------------------
 1 files changed, 28 insertions(+), 19 deletions(-)

diff --git a/force-app/main/default/classes/NFM503InfoFileBatch.cls b/force-app/main/default/classes/NFM503InfoFileBatch.cls
index fa5c005..1a55477 100644
--- a/force-app/main/default/classes/NFM503InfoFileBatch.cls
+++ b/force-app/main/default/classes/NFM503InfoFileBatch.cls
@@ -2,12 +2,12 @@
     public String TenId;
     public String bidInfoFileID;
     //add staic sushanhu 20220302 start
-    public static String transUrl;
-    public static String transId;
-    public static String token;
+	public static String transUrl;
+	public static String transId;
+	public static String token;
     public static  integer isSuccess=0; 
     public static List<String> sfRecordIds =new List<String>();
-    //add staic sushanhu 20220302 end
+	//add staic sushanhu 20220302 end
     Boolean IsNeedExecute = false;  //2021-06-28 mzy  WLIG-BYHD79  SFDC鐜batch鍚堝苟璋冩煡  鏄惁绗﹀悎鎵ц鏉′欢
     //add nfm 503 aws response start sushanhu 20220301
     global class File{
@@ -30,6 +30,9 @@
 
     global Database.QueryLocator start(Database.BatchableContext bc) {
         String query = 'select Id, Tender_information__c, infoAddress__c, ' +
+                        // SWAG-C9S9P6 鏂板瀛楁 2022-05-25 ssm start
+                        'Tender_information__r.InfoId__c, Tender_information__r.subInfoType__c, ' +    
+                        // SWAG-C9S9P6 鏂板瀛楁 2022-05-25 ssm end 
                         'Tender_information__r.InfoType__c, isProcessed__c, ' +
                         ' ErrorMessage__c from bidInfoFile__c where isProcessed__c = false ';
         if (String.isNotBlank(TenId)) {
@@ -49,8 +52,8 @@
         queryfileList.add(bidInfoFile.infoAddress__c);
         try {
            //update 鍚宻taic 20220302 satrt
-            // String token;
-            //update 鍚宻taic 20220302 end
+			// String token;
+			//update 鍚宻taic 20220302 end
             Datetime oldTime;
             // 浠庤浆鎹㈣〃涓幏鍙杢oken
             BatchIF_Transfer__c token503 = [Select ID, NFM501_Token__c
@@ -70,14 +73,15 @@
                 timeslot = newTime.getTime() - oldTime.getTime();
             }
             // System.debug('++++1++++' + token + '  : ' + timeslot);
+            PIHelper.piIntegration pi =PIHelper.getPIIntegrationInfo('NFM503');
             if (string.isblank(token) || timeslot > 1800000) {
                 //UP TO AWAS TOKEN 20220225 SUSHANHU START
-                NFMUtil.response response = NFMUtil.getAWSToken();
-                //UP TO AWAS TOKEN 20220225 SUSHANHU END
-                if (String.isBlank(response.responseBody)) {
-                    bidInfoFile.ErrorMessage__c = '503token:' + response.status;
-                }
-                token = response.responseBody;
+                // NFMUtil.response response = NFMUtil.getAWSToken();
+                // //UP TO AWAS TOKEN 20220225 SUSHANHU END
+                // if (String.isBlank(response.responseBody)) {
+                //     bidInfoFile.ErrorMessage__c = '503token:' + response.status;
+                // }
+                token = pi.token;
                 oldTime = Datetime.now();
                 token503.NFM501_Token__c = token;
                 oldTime503.NFM501_Gain_End_Time__c = oldTime;
@@ -93,7 +97,6 @@
             //UP TO NEW  AWS method sushanhu start 20220301
             // List< Tender_information__c> updateTenderList = new  List< Tender_information__c>();
             List<FileAddress__c> fileList = new List<FileAddress__c>();
-            PIHelper.piIntegration pi =PIHelper.getPIIntegrationInfo('NFM503');
             transUrl =pi.searchUrl;
             NFMUtil.response response = NFMUtil.getAWSQLMData(pi.newUrl ,JSON.serialize(queryfileList), token);
             system.debug('aws result'+response.responseBody);
@@ -179,6 +182,12 @@
             file.DownloadLink__c =pi.undeleteUrl+(String)fileVO.get('key')+'&fileName='+file.FileName__c;
             file.ViewLink__c = pi.queryUrl+(String)fileVO.get('key');
             file.AWS_File_Key__c =(String)fileVO.get('key');
+            // SWAG-C9S9P6 鏂板瀛楁 start
+            file.InfoId__c = bidInfoFile.Tender_information__r.InfoId__c;
+            file.InfoType__c = bidInfoFile.Tender_information__r.InfoType__c;
+            file.subInfoType__c = bidInfoFile.Tender_information__r.subInfoType__c;
+            file.UpdateDate__c = Date.today(); 
+            // SWAG-C9S9P6 鏂板瀛楁 end
             fileList.add(file);
             sp = Database.setSavepoint();
 
@@ -194,26 +203,26 @@
             // add 纭浜嬪姟 sushanhu 20220302 start
             
             if (fileList.size() > 0 ) {
-            for (FileAddress__c fileAddress : fileList) {
+			for (FileAddress__c fileAddress : fileList) {
                 system.debug('fileAddress.Id---'+json.serialize(fileAddress));
-                sfRecordIds.add(fileAddress.Id);
+				sfRecordIds.add(fileAddress.Id);
                 system.debug('fileAddress.Id---'+fileAddress.Id);
-            }
+			}
             }
             system.debug('鎴愬姛鐨則oken'+token);
             isSuccess =1;
            
             // if (!confirm) {
-            //  //鍥炴粴
+			// 	//鍥炴粴
             //     if (sp != null) {
             //         Database.rollback(sp);
             //     }
-            // }
+			// }
             // add 纭浜嬪姟 sushanhu 20220302 end
             if (System.Test.isRunningTest()) {
                 throw new ControllerUtil.myException('aaa');
             }
-            return;
+            // return;
         } catch (Exception ex) {
             if (sp != null) {
                 Database.rollback(sp);

--
Gitblit v1.9.1