From 3ba0123db48f8bab81ddf0913e1b95280ef545e8 Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期四, 31 三月 2022 17:56:53 +0800
Subject: [PATCH] Deploy0331

---
 force-app/main/default/classes/NFM501FutureController.cls |   47 +++++++++++++++++++++++++++++++++++++----------
 1 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/force-app/main/default/classes/NFM501FutureController.cls b/force-app/main/default/classes/NFM501FutureController.cls
index cd34a5f..121005d 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,
@@ -55,9 +71,10 @@
         rowData.ErrorLog__c = rowData.ErrorLog__c == null ? '' : rowData.ErrorLog__c;
         // System.debug('+++++++1+++++++'+iflog501Future);
         String QLMDataStr = NFMUtil.QLMgetRowDataStr(rowData);
+        system.debug('QLMDataStr---'+QLMDataStr);
         NFM501controller.AllData getQLMData1 = (NFM501controller.AllData)
         JSON.deserialize(QLMDataStr, NFM501controller.AllData.class);
-        
+        system.debug('getQLMData1---'+json.serialize(getQLMData1));
         if (getQLMData1 == null) {
             return;
         }
@@ -106,7 +123,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 > ();
@@ -142,9 +160,13 @@
             Set < String > TarDetailSet = new Set < String > ();
             
             for (NFM501Controller.ListItem LI: getQLMData1.data.list1) {
+                system.debug('LI----'+json.serialize(LI));
                 // 闋呯洰杌㈤�併伄銈汇儍銉�
                 Tender_information__c te1 = new Tender_information__c();
                 //add aws dataid sushanhu 20220223 start
+                if(String.isEmpty(LI.DataId)){
+                    continue;
+                }
                 te1.AWS_Data_Id__c = LI.DataId;
                 //add aws dataid sushanhu 20220223 end
                 if (String.isBlank(LI.projectId)) {
@@ -501,7 +523,7 @@
                      //add 瀵嗘枃 sushanhu 20220223 end
                 }
                     
-
+                System.debug('te1-----'+json.serialize(te1));
                 //绮剧悽绉戞妧   zxk   2021-11-11  SWAG-C637NF   start
                 // 濡傛灉绗竴娆¢」鐩樁娈靛氨浼犳潵鍙樻洿鐘舵�佺殑璇濓紝閭d箞灏变笉鐢熸垚鎷涙姇鏍囬」鐩紙鐢变簬鍙樻洿闃舵椤圭洰鍚嶇О浼犳潵涓虹┖锛屼负浜嗕笉璁╅」鐩悕鑷姩璧嬪�间负Id锛�
                 if (String.isNotBlank(te1.InfoType__c) && String.isNotBlank(LI.projectId)) {
@@ -529,6 +551,7 @@
             if (DetlList.size() > 0) {
                 delete DetlList;
             }
+            system.debug('updateTenderMap---'+json.serialize(updateTenderMap));
             if (updateTenderMap.values().size() > 0) {
                 upsert updateTenderMap.values();
             }
@@ -537,6 +560,7 @@
             Map < string, Tender_information__c > TenderMap = new map < string, Tender_information__c > ();
             
             for (Tender_information__c TMap: updateTenderMap.values()) {
+                system.debug('TMap---'+JSON.serialize(TMap));
                 TenderMap.put(TMap.ProjectId__c, TMap);
                 PIHelper.IdList il= new PIHelper.IdList();
                 // add for pipl  sushanhu 20220310 start
@@ -572,7 +596,8 @@
                 insert insertbidInfoFileList;
             }
             if (!Manual_execution501future) {
-                System.enqueueJob(new NFM502Controller(rowData.id));
+                //娴嬭瘯
+                // System.enqueueJob(new NFM502Controller(rowData.id));
             }
             // logstr += '\nend';
             rowData.NFM501Future_Count__c = 0;
@@ -581,13 +606,15 @@
                 throw new ControllerUtil.myException('aaa');
             }
             //纭浜嬪姟 add for pi sushanhu 20220310 start
-            PIHelper.confirmTrans('NFM501',1,null,txId,NFM501AWS.token,NFM501AWS.transactionURL,idList);
+            // PIHelper.confirmTrans('NFM501',1,null,txId,NFM501AWS.token,NFM501AWS.transactionURL,idList);
+            PIHelper.insertConfirmTrans('NFM501',1,null,txId,1,NFM501AWS.transactionURL,idList);
             //纭浜嬪姟 add for pi sushanhu 20220310 end
         } catch (Exception ex) {
             // 濡傛灉鏁版嵁鑾峰彇杩囩▼涓紝鏈夐敊璇紙鍚屼竴娓告爣锛屽鏋滄姤閿欙紝鏄粬閲嶆柊鑾峰彇涓�閬嶏紝濡傛灉涓夋閮芥病鑳借幏鍙栧埌锛屽氨鍙戦�侀偖浠舵姤閿欎俊鎭紝鐒跺悗鎵嬪姩杩涜鑾峰彇锛�
             Database.rollback(sp);
             //纭浜嬪姟 add for pi sushanhu 20220310 start
-            PIHelper.confirmTrans('NFM501',0,null,txId,NFM501AWS.token,NFM501AWS.transactionURL,idList);
+            // PIHelper.confirmTrans('NFM501',0,null,txId,NFM501AWS.token,NFM501AWS.transactionURL,idList);
+            PIHelper.insertConfirmTrans('NFM501',0,null,txId,1,NFM501AWS.transactionURL,idList);
             //纭浜嬪姟 add for pi sushanhu 20220310 end
             System.debug(Logginglevel.ERROR, 'QLMData_' + rowData.MessageGroupNumber__c + ':' + ex.getMessage());
             System.debug(Logginglevel.ERROR, 'QLMData_' + rowData.MessageGroupNumber__c + ':' + ex.getStackTraceString());

--
Gitblit v1.9.1