From ba1c90575c47f9cb5c2ce0a20da90d3b1739b5fa Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期二, 26 四月 2022 11:47:45 +0800
Subject: [PATCH] 0425 Commit
---
force-app/main/default/classes/SBG001TriggerHandler.cls | 55 ++++++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 46 insertions(+), 9 deletions(-)
diff --git a/force-app/main/default/classes/SBG001TriggerHandler.cls b/force-app/main/default/classes/SBG001TriggerHandler.cls
index 65f3d37..3ebc381 100644
--- a/force-app/main/default/classes/SBG001TriggerHandler.cls
+++ b/force-app/main/default/classes/SBG001TriggerHandler.cls
@@ -8,6 +8,7 @@
//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;
}
@@ -33,6 +34,7 @@
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
@@ -516,7 +518,8 @@
Phone, MobilePhone,
Fax, Email, PostCode__c, Address1__c,
CreatedDate, LastModifiedDate,
- Account.UserType__c
+ Account.UserType__c,
+ AWS_Data_Id__c//dennis update for pi 2022/3/9
from Contact where Id IN :conIds]; // 鍓婇櫎銉囥兗銈裤倰妞滅储銇椼仾銇勩伅銇氥�丄ll ROWS 銇勩倝銇亜銇仛
// System.debug(Logginglevel.DEBUG, 'SBG001_' + iflog.Name + ' conList.size()=' + conList.size());
@@ -549,6 +552,7 @@
+ ',' + (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 = '';
@@ -738,26 +742,59 @@
} else {
logstr = iflog.Log__c;
}
+ // 娣诲姞aws涓婄嚎寮�鍏� by sushanhu 20220419
+ Boolean piOn =AWSServiceTool.getAWSServiceStatus();
try{
-
- status = NFMUtil.sendToSapRet(rowDataStr, NFMUtil.SBG001_ENDPOINT);
- system.debug('status--->'+status);
- if (status == 'OK') {
+ if (piOn) {
+ //update to aws 2022/3/9 dennis
+ PIHelper.PIIntegration pi =PIHelper.getPIIntegrationInfo('SBG001');
+ // NFMUtil.response result =NFMUtil.sendToPiAWS(rowDataStr,pi.newUrl,pi.token);
+ AWSServiceTool.response result = AWSServiceTool.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)) {
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) {
- rowData.ErrorLog__c = 'status:' + status +
+ //add respomseBody 璁板綍閿欒淇℃伅 by sushanhu 20220406 start
+ rowData.ErrorLog__c = 'status:' + status +responseBody+
'\n閿欒娆℃暟宸茬粡瓒呰繃鑷姩閫佷俊璁惧畾鐨勬渶澶ф鏁帮紝璇锋墜鍔ㄩ�佷俊';
+ //add respomseBody 璁板綍閿欒淇℃伅 by sushanhu 20220406 end
}
+ }
+ //update to aws 2022/3/9 dennis
+ logstr += '\nend';
+ }else {
+ 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