From 02ddc35714cbd1688b7cb057f770f1410de79dab Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期五, 11 三月 2022 12:19:33 +0800
Subject: [PATCH] PIPL Updated Code 20220311

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

diff --git a/force-app/main/default/classes/NFM501FutureController.cls b/force-app/main/default/classes/NFM501FutureController.cls
index fc47917..cd34a5f 100644
--- a/force-app/main/default/classes/NFM501FutureController.cls
+++ b/force-app/main/default/classes/NFM501FutureController.cls
@@ -3,6 +3,10 @@
     //鍏堝畾涔�
     // 	鎶曟爣鎴鏃堕棿
     // 2021/01/04 18:00
+    //add by sushanhu for pi 20220310 start
+    public static String txId;
+    
+    //add by sushanhu for pi 20220310 end
     public String rowData_id;
     public NFM501FutureController(String rowData_id) {
         this.rowData_id = rowData_id;
@@ -13,16 +17,20 @@
         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,
-            NFM501_Web_Annex_Count__c
+            NFM501_Web_Annex_Count__c,
+            AWS_Transaction_Id__c //ADD BY SUSHANHU for pi 20220310
             from BatchIF_Log__c where RowDataFlg__c = true and Id = : rowData_id
         ];
         //瀛樻斁鎶ラ敊淇℃伅
+        txId =rowData.AWS_Transaction_Id__c; //add by sushanhu for pipl 20220310
+        system.debug('nfm501future awsid'+txId);
         BatchIF_Log__c iflog501Future = new BatchIF_Log__c();
         iflog501Future.Type__c = 'NFM501';
         iflog501Future.MessageGroupNumber__c = rowData.MessageGroupNumber__c;
         iflog501Future.Log__c = ' ';
         iflog501Future.ErrorLog__c = ' ';
         iflog501Future.RowDataFlg__c = false;
+        iflog501Future.AWS_Transaction_Id__c=rowData.AWS_Transaction_Id__c;
         insert iflog501Future;
         NFM501FutureController.main(rowData.Id, iflog501Future.Id, false);
     }
@@ -49,9 +57,12 @@
         String QLMDataStr = NFMUtil.QLMgetRowDataStr(rowData);
         NFM501controller.AllData getQLMData1 = (NFM501controller.AllData)
         JSON.deserialize(QLMDataStr, NFM501controller.AllData.class);
+        
         if (getQLMData1 == null) {
             return;
         }
+        List<PIHelper.IdList> idList = new List<PIHelper.IdList>();//瀛樺偍鏇存柊鍚庡緱sfid鍜宎wsid add by sushanhu 20220310
+        PIHelper.PIIntegration NFM501AWS =PIHelper.getPIIntegrationInfo('QLMNFM501'); //add by sushanhu 20220310
         Savepoint sp = Database.setSavepoint();
         //IF杞崲琛紙涓哄疄鐜伴�夐」鍒楄〃鐨勪笅鎷夐�夐」锛�
         Map < String, String > transferMap = new Map < String, String > ();
@@ -122,15 +133,20 @@
             tempbidInfoFileURLList.add(bidInfoFile.infoAddress__c);
             SelectbidInfoFileMap.put(bidInfoFile.Tender_information__r.ProjectId__c, tempbidInfoFileURLList);
         }
+        
         try {
             // 鎷涙爣淇℃伅
             Map < string, List < bidInfoFile__c >> createbidInfoFileMap = new map < string, List < bidInfoFile__c >> ();
             Map < String, List < Tender_information_details__c >> tempList1 = new Map < String, List < Tender_information_details__c >> ();
             Map < string, Tender_information__c > updateTenderMap = new map < string, Tender_information__c > ();
             Set < String > TarDetailSet = new Set < String > ();
+            
             for (NFM501Controller.ListItem LI: getQLMData1.data.list1) {
                 // 闋呯洰杌㈤�併伄銈汇儍銉�
                 Tender_information__c te1 = new Tender_information__c();
+                //add aws dataid sushanhu 20220223 start
+                te1.AWS_Data_Id__c = LI.DataId;
+                //add aws dataid sushanhu 20220223 end
                 if (String.isBlank(LI.projectId)) {
                     iflog501Future.ErrorLog__c += 'Error! [' + LI.projectId + ']NotExist. This information is skipped.\n';
                     continue;
@@ -183,6 +199,9 @@
                 //鎷兼帴瀛楃涓�
                 if (LI.ZhaoRelationWay != null && LI.ZhaoRelationWay.size() > 0) {
                     te1.ZhaoRelationWay__c = String.join(LI.ZhaoRelationWay, '锛�');
+                     //add 瀵嗘枃 sushanhu 20220223 start
+                     te1.ZhaoRelationWay_Encrypted__c =String.join(LI.ZhaoRelationWayEncrypted,'锛�');
+                     //add 瀵嗘枃 sushanhu 20220223 end
                 }
                 //杞崲琛紙閫夐」鍒楄〃鐨勪笅鎷夐�夐」锛�
                 te1.IsElectronic__c = NFMUtil.getMapValue(transferMap, 'IsElectronic__c', LI.isElectronic, iflog501Future);
@@ -283,6 +302,9 @@
                 }
                 if (LI.AgentRelationWay != null && LI.AgentRelationWay.size() > 0) {
                     te1.AgentRelationWay__c = String.join(LI.AgentRelationWay, '锛�');
+                    //add 瀵嗘枃 sushanhu 20220223 start
+                    te1.AgentRelationWay_Encrypted__c =String.join(LI.AgentRelationWayEncrypted,'锛�');
+                    //add 瀵嗘枃 sushanhu 20220223 end
                 }
                 // 灏嗘敼闄勪欢瀛樺叆鎷涙姇鏍囬」鐩瓙瀵硅薄涓�
                 if (LI.InfoFile != null && LI.InfoFile.size() > 0) {
@@ -327,6 +349,9 @@
                 }
                 if (LI.AgentRelationName != null && LI.AgentRelationName.size() > 0) {
                     te1.AgentRelationName__c = String.join(LI.AgentRelationName, '锛�');
+                    //add 瀵嗘枃 sushanhu 20220223 start
+                    te1.AgentRelationName_Encrypted__c =String.join(LI.AgentRelationNameEncrypted,'锛�');
+                    //add 瀵嗘枃 sushanhu 20220223 end
                 }
                 if (String.isNotBlank(LI.bidingEndTime)) {
                     te1.BidingEndTime__c = Datetime.valueOf(LI.bidingEndTime);
@@ -355,6 +380,9 @@
                 }
                 if (LI.ZhongRelationWay != null && LI.ZhongRelationWay.size() > 0) {
                     te1.ZhongRelationWay__c = String.join(LI.ZhongRelationWay, '锛�');
+                    //add 瀵嗘枃 sushanhu 20220223 start
+                    te1.ZhongRelationWay_Encrypted__c =String.join(LI.ZhongRelationWayEncrypted,'锛�');
+                    //add 瀵嗘枃 sushanhu 20220223 end
                 }
                 if (String.isNotBlank(LI.bidingAcquireTime)) {
                     te1.BidingAcquireTime__c = Datetime.valueOf(LI.bidingAcquireTime);
@@ -462,10 +490,18 @@
                 }
                 if (LI.ZhaoRelationName != null && LI.ZhaoRelationName.size() > 0) {
                     te1.ZhaoRelationName__c = String.join(LI.ZhaoRelationName, '锛�');
+                    //add 瀵嗘枃 sushanhu 20220223 start
+                    te1.ZhaoRelationName_Encrypted__c =String.join(LI.ZhaoRelationNameEncrypted,'锛�');
+                    //add 瀵嗘枃 sushanhu 20220223 end
                 }
                 if (LI.ZhongRelationName != null && LI.ZhongRelationName.size() > 0) {
                     te1.ZhongRelationName__c = String.join(LI.ZhaoRelationName, '锛�');
+                     //add 瀵嗘枃 sushanhu 20220223 start
+                     te1.ZhongRelationName_Encrypted__c =String.join(LI.ZhongRelationNameEncrypted,'锛�');
+                     //add 瀵嗘枃 sushanhu 20220223 end
                 }
+                    
+
                 //绮剧悽绉戞妧   zxk   2021-11-11  SWAG-C637NF   start
                 // 濡傛灉绗竴娆¢」鐩樁娈靛氨浼犳潵鍙樻洿鐘舵�佺殑璇濓紝閭d箞灏变笉鐢熸垚鎷涙姇鏍囬」鐩紙鐢变簬鍙樻洿闃舵椤圭洰鍚嶇О浼犳潵涓虹┖锛屼负浜嗕笉璁╅」鐩悕鑷姩璧嬪�间负Id锛�
                 if (String.isNotBlank(te1.InfoType__c) && String.isNotBlank(LI.projectId)) {
@@ -499,8 +535,15 @@
             System.debug('123456789123456789:' + updateTenderMap);
             //灏嗘嫑鏍囦俊鎭拰鎷涙爣淇℃伅璇︽儏鍏宠仈璧锋潵锛堥�氳繃ProjectId杩欎竴鍞竴鏍囪瘑锛�
             Map < string, Tender_information__c > TenderMap = new map < string, Tender_information__c > ();
+            
             for (Tender_information__c TMap: updateTenderMap.values()) {
                 TenderMap.put(TMap.ProjectId__c, TMap);
+                PIHelper.IdList il= new PIHelper.IdList();
+                // add for pipl  sushanhu 20220310 start
+                il.awsId =TMap.AWS_Data_Id__c;
+                il.sfRecordId=TMap.Id;
+                idList.add(il);
+                // add for pipl  sushanhu 20220310 end
             }
             System.debug('12345678!!!!!' + TenderMap.values());
             List < Tender_information_details__c > TenList = new List < Tender_information_details__c > ();
@@ -537,9 +580,15 @@
             if (System.Test.isRunningTest()) {
                 throw new ControllerUtil.myException('aaa');
             }
+            //纭浜嬪姟 add for pi sushanhu 20220310 start
+            PIHelper.confirmTrans('NFM501',1,null,txId,NFM501AWS.token,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);
+            //纭浜嬪姟 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());
             // logstr += '\n' + ex.getMessage();

--
Gitblit v1.9.1