From 2f4492ee18f90274582fcc2bb06f5e9bf64136e8 Mon Sep 17 00:00:00 2001 From: buli <137736985@qq.com> Date: 星期五, 13 五月 2022 17:32:14 +0800 Subject: [PATCH] ProdBackup0513 --- force-app/main/default/classes/SBG001TriggerHandler.cls | 61 ++++++------------------------ 1 files changed, 12 insertions(+), 49 deletions(-) diff --git a/force-app/main/default/classes/SBG001TriggerHandler.cls b/force-app/main/default/classes/SBG001TriggerHandler.cls index 9bc649a..8f43ef4 100644 --- a/force-app/main/default/classes/SBG001TriggerHandler.cls +++ b/force-app/main/default/classes/SBG001TriggerHandler.cls @@ -8,7 +8,6 @@ //001淇敼Rest gwy start 2021-04-06 //public class SBG001ResrException extends Exception {} public static String status; - public static String responseBody;//dennis update for pi 2022/3/9 public class SBG001 { public SSBDCustomerContacts_element SSBDCustomerContacts; } @@ -34,7 +33,6 @@ public String ContactCode; public String ContactEffectiveDateFrom; public String PurposeOfAdvice; - public String DataId;//dennis update for pi 2022/3/9 } //001淇敼Rest gwy end 2021-04-06 @@ -67,7 +65,6 @@ || acc.RecordTypeId == '01228000000TdFG' // NDT || acc.RecordTypeId == '01228000000TdFL' // ANI || acc.RecordTypeId == '01228000000TdF1' // BS - || acc.RecordTypeId == '0120T0000003Cxt' // IE鐩撮攢 ) && acc.stautesD__c == 'Pass') || acc.RecordTypeId == SBG001TriggerHandler.Account_Agency_Id //鍔炰簨澶� ) { @@ -88,7 +85,6 @@ || acc.RecordTypeId == '01228000000TdFG' // NDT || acc.RecordTypeId == '01228000000TdFL' // ANI || acc.RecordTypeId == '01228000000TdF1' // BS - || acc.RecordTypeId == '0120T0000003Cxt' // IE鐩撮攢 ) && acc.stautesD__c == 'Pass' && (acc.ManagementCode_Ext__c != old.ManagementCode_Ext__c @@ -163,7 +159,6 @@ || con.AccountRecordTypeId__c == '01228000000TdFB' // RVI || con.AccountRecordTypeId__c == '01228000000TdFG' // NDT || con.AccountRecordTypeId__c == '01228000000TdF1' // BS - || con.AccountRecordTypeId__c == '0120T0000003Cxt' // IE鐩撮攢 ) && con.StatusD__c == 'Pass') || con.AccountRecordTypeId__c == SBG001TriggerHandler.Account_Agency_Id// 鍔炰簨澶� ) { @@ -189,7 +184,6 @@ || con.AccountRecordTypeId__c == '01228000000TdFG' // NDT || con.AccountRecordTypeId__c == '01228000000TdF1' // BS || con.AccountRecordTypeId__c == SBG001TriggerHandler.Account_Agency_Id // 鍔炰簨澶� - || con.AccountRecordTypeId__c == '0120T0000003Cxt' // IE鐩撮攢 ) && con.StatusD__c == 'Pass' && (con.ManagementCode_Ext__c != old.ManagementCode_Ext__c @@ -330,7 +324,7 @@ SSBDCustomerContact.CustomerDescription = acc.FacilityName__c; SSBDCustomerContact.CustomerDescription2Description3 = (String.isBlank(acc.DivisionName__c) ? '' : (acc.DivisionName__c=='鏃�' ? '' : acc.DivisionName__c)); - if (acc.RecordTypeId == '01228000000TdF6' || acc.RecordTypeId == '01228000000TdFB' || acc.RecordTypeId == '01228000000TdFG' || acc.RecordTypeId == '01228000000TdFL' || acc.RecordTypeId == '0120T0000003Cxt') { // IE or RVI + if (acc.RecordTypeId == '01228000000TdF6' || acc.RecordTypeId == '01228000000TdFB' || acc.RecordTypeId == '01228000000TdFG' || acc.RecordTypeId == '01228000000TdFL') { // IE or RVI SSBDCustomerContact.CustomerDescription2Description3 += ',' + (String.isBlank(acc.EnglishName__c) ? '' : acc.EnglishName__c); } else { SSBDCustomerContact.CustomerDescription2Description3 += ',' + (String.isBlank(acc.DepartmentName__c) ? '' : acc.Departmentname__c); @@ -518,8 +512,7 @@ Phone, MobilePhone, Fax, Email, PostCode__c, Address1__c, CreatedDate, LastModifiedDate, - Account.UserType__c, - AWS_Data_Id__c//dennis update for pi 2022/3/9 + Account.UserType__c from Contact where Id IN :conIds]; // 鍓婇櫎銉囥兗銈裤倰妞滅储銇椼仾銇勩伅銇氥�丄ll ROWS 銇勩倝銇亜銇仛 // System.debug(Logginglevel.DEBUG, 'SBG001_' + iflog.Name + ' conList.size()=' + conList.size()); @@ -539,7 +532,7 @@ SSBDCustomerContact.CustomerDescription = con.Account.FacilityName__c; SSBDCustomerContact.CustomerDescription2Description3 = (String.isBlank(con.Account.DivisionName__c) ? '' : (con.Account.DivisionName__c=='鏃�' ? '' : con.Account.DivisionName__c)); - if (con.AccountRecordTypeId__c == '01228000000TdF6' || con.AccountRecordTypeId__c == '01228000000TdFB' || con.AccountRecordTypeId__c == '01228000000TdFG' || con.AccountRecordTypeId__c == '01228000000TdFL' || con.AccountRecordTypeId__c == '0120T0000003Cxt') { // IE or RVI + if (con.AccountRecordTypeId__c == '01228000000TdF6' || con.AccountRecordTypeId__c == '01228000000TdFB' || con.AccountRecordTypeId__c == '01228000000TdFG' || con.AccountRecordTypeId__c == '01228000000TdFL') { // IE or RVI SSBDCustomerContact.CustomerDescription2Description3 += ',' + (String.isBlank(con.Account.EnglishName__c) ? '' : con.Account.EnglishName__c); } else { SSBDCustomerContact.CustomerDescription2Description3 += ',' + (String.isBlank(con.Account.DepartmentName__c) ? '' : con.Account.Departmentname__c); @@ -552,7 +545,6 @@ + ',' + (String.isBlank(con.Email) ? '' : con.Email); SSBDCustomerContact.PostalCode = String.isBlank(con.PostCode__c) ? '' : con.PostCode__c; SSBDCustomerContact.Address = String.isBlank(con.Address1__c) ? '' : con.Address1__c; - SSBDCustomerContact.DataId = String.isBlank(con.AWS_Data_Id__c) ? '' : con.AWS_Data_Id__c; SSBDCustomerContact.CustomerCategory = GetCustomerCategory(null,con);//'瀹㈡埛' + (String.isBlank(con.Account.ProductSegment__c) ? '' : con.Account.ProductSegment__c); // JZHU-BPQBVK-IE鏈�缁堢敤鎴锋帴鍙d紶杈撻�昏緫鍙樻洿(update-Start-20200525) SSBDCustomerContact.UserType = ''; @@ -743,54 +735,25 @@ logstr = iflog.Log__c; } try{ - - //update to aws 2022/3/9 dennis - PIHelper.PIIntegration pi =PIHelper.getPIIntegrationInfo('SBG001'); - NFMUtil.response result =NFMUtil.sendToPiAWS(rowDataStr,pi.newUrl,pi.token); - system.debug('aws result---'+result); - status = result.status; - system.debug('aws status---'+status); - responseBody=result.responseBody; - // Map<String, Object> res = (Map<String, Object>)JSON.deserializeUntyped(responseBody); - // status=(String)res.get(status); - if ('200'.equals(status)) { + + status = NFMUtil.sendToSapRet(rowDataStr, NFMUtil.SBG001_ENDPOINT); + system.debug('status--->'+status); + if (status == 'OK') { logstr += '\nstatus='+status; rowData.retry_cnt__c = 0; - } else { + } else { if (rowData.retry_cnt__c == null) rowData.retry_cnt__c = 0; if (rowData.retry_cnt__c < batch_retry_max_cnt) { rowData.retry_cnt__c++; LogAutoSendSchedule.assignOneMinute(); } if (rowData.retry_cnt__c >= batch_retry_max_cnt) { - //add respomseBody 璁板綍閿欒淇℃伅 by sushanhu 20220406 start - rowData.ErrorLog__c = 'status:' + status +responseBody+ + rowData.ErrorLog__c = 'status:' + status + '\n閿欒娆℃暟宸茬粡瓒呰繃鑷姩閫佷俊璁惧畾鐨勬渶澶ф鏁帮紝璇锋墜鍔ㄩ�佷俊'; - //add respomseBody 璁板綍閿欒淇℃伅 by sushanhu 20220406 end } - } - //update to aws 2022/3/9 dennis - logstr += '\nend'; - // rowData.retry_cnt__c=0; - - // status = NFMUtil.sendToSapRet(rowDataStr, NFMUtil.SBG001_ENDPOINT); - // system.debug('status--->'+status); - // if (status == 'OK') { - // logstr += '\nstatus='+status; - // rowData.retry_cnt__c = 0; - // } else { - // if (rowData.retry_cnt__c == null) rowData.retry_cnt__c = 0; - // if (rowData.retry_cnt__c < batch_retry_max_cnt) { - // rowData.retry_cnt__c++; - // LogAutoSendSchedule.assignOneMinute(); - // } - // if (rowData.retry_cnt__c >= batch_retry_max_cnt) { - // rowData.ErrorLog__c = 'status:' + status + - // '\n閿欒娆℃暟宸茬粡瓒呰繃鑷姩閫佷俊璁惧畾鐨勬渶澶ф鏁帮紝璇锋墜鍔ㄩ�佷俊'; - // } - // } - // logstr += '\nend'; - // // rowData.retry_cnt__c=0; + } + logstr += '\nend'; + // rowData.retry_cnt__c=0; }catch(Exception ex) { // TODO IOException // 銈ㄣ儵銉笺亴鐧虹敓銇椼仧鍫村悎 -- Gitblit v1.9.1