From f50c0ec115e25dc7f980bafda8169ed5ddfe1a8f Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期五, 08 四月 2022 21:04:16 +0800
Subject: [PATCH] Session
---
force-app/main/default/classes/SBG007TriggerHandler.cls | 67 +++++++++++++++++++++++++--------
1 files changed, 51 insertions(+), 16 deletions(-)
diff --git a/force-app/main/default/classes/SBG007TriggerHandler.cls b/force-app/main/default/classes/SBG007TriggerHandler.cls
index ed41915..673b338 100644
--- a/force-app/main/default/classes/SBG007TriggerHandler.cls
+++ b/force-app/main/default/classes/SBG007TriggerHandler.cls
@@ -4,6 +4,7 @@
public static Set<Id> SBG007_Ids = new Set<Id>();
//007淇敼Rest gwy start 2021-04-06
public static String status;
+ public static String responseBody;//dennis 2022/3/3
public class SBG007 {
public GeDatas_element GeDatas;
}
@@ -29,6 +30,8 @@
public String Other2;
public String Other3;
public GeDataDetails_element[] GeDataDetails;
+ //dennis start for pi 2022/3/3
+ public String DataId;
}
public class GeDataDetails_element {
@@ -72,8 +75,10 @@
* @param oppIds 閫佷俊瀵捐薄鍟嗚珖(璜栫悊涓�1浠躲伄銇裤仹銇�)
* @param purposeOfAdviceMap 1:Delete 2:Add(Insert) 3:Change(Update)
*/
+
@future (callout=true)
public static void callout(String iflog_Id, List<String> oppIds, Map<String, String> purposeOfAdviceMap) {
+ System.debug('杩涘叆callout');
if (oppIds == null || oppIds.size() == 0) {
return;
}
@@ -125,7 +130,8 @@
EndUser__c, Machine_Parts__c,
SalesChannel__c, ExpectedDeliveryDate__c, DealerId__c,Dealer__r.ManagementCode_F__c,Dealer__r.ManagementCode_Ext__c,DealerSalesStaffName__c,
ForeignTradeCompany__c, SpecialDeliveryAddress__c,
- SyncedQuoteId
+ SyncedQuoteId,
+ AWS_Data_Id__c //dennis start for pi 2022/3/3
from Opportunity where Id IN :oppIds];
System.debug('11111 oppList='+oppList);
@@ -203,6 +209,7 @@
quotation.DealerSalesStaffName = opp.DealerSalesStaffName__c;
quotation.ForeignTradeCompany = opp.ForeignTradeCompany__c;
quotation.SpecialDeliveryAddress = opp.SpecialDeliveryAddress__c;
+ quotation.DataId = opp.AWS_Data_Id__c;//dennis start for pi 2022/3/3
//007淇敼Rest gwy start 2021-04-06
quotation.GeDataDetails = new List<GeDataDetails_element>();
@@ -319,6 +326,31 @@
logstr = iflog.Log__c;
}
try{
+ //update to aws 2022/3/3 dennis
+ PIHelper.PIIntegration pi =PIHelper.getPIIntegrationInfo('SBG007');
+ NFMUtil.response result =NFMUtil.sendToPiAWS(rowDataStr,pi.newUrl,pi.token);
+ system.debug('aws result---'+result);
+ status = result.status;
+ responseBody=result.responseBody;
+ system.debug('aws status--'+status);
+ if ('200'.equals(status)) {
+ logstr += status + '\n';
+ 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 +responseBody// update 鍔犲叆閿欒鐨勮繑鍥炰綋 sushanhu20220406
+ +'\n閿欒娆℃暟宸茬粡瓒呰繃鑷姩閫佷俊璁惧畾鐨勬渶澶ф鏁帮紝璇锋墜鍔ㄩ�佷俊';
+ }
+ }
+
+
//gaozw
/*Sbg007Sync.HTTPS_Port stub = new Sbg007Sync.HTTPS_Port();
stub.timeout_x = 100000; // timeout in milliseconds
@@ -329,24 +361,27 @@
stub.clientCertName_x = NFMUtil.CLIENT_CERT_NAME;
}*/
//007淇敼Rest gwy start 2021-04-12
- status = NFMUtil.sendToSapRet(rowDataStr, NFMUtil.SBG007_ENDPOINT);
- if (status == 'OK') {
- logstr += '\n' + 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閿欒娆℃暟宸茬粡瓒呰繃鑷姩閫佷俊璁惧畾鐨勬渶澶ф鏁帮紝璇锋墜鍔ㄩ�佷俊';
- }
- }
+ //comment by dennis 2022/3/3 start
+ // status = NFMUtil.sendToSapRet(rowDataStr, NFMUtil.SBG007_ENDPOINT);
+ // if (status == 'OK') {
+ // logstr += '\n' + 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閿欒娆℃暟宸茬粡瓒呰繃鑷姩閫佷俊璁惧畾鐨勬渶澶ф鏁帮紝璇锋墜鍔ㄩ�佷俊';
+ // }
+ // }
+ //comment by dennis 2022/3/3 end
//007淇敼Rest gwy end 2021-04-12
//Sbg007Sync.GeDatas_element[] pQuotations = new Sbg007Sync.GeDatas_element[] { quotations };
//OlympusCoJpCommonMessage.LOG_element[] logs = stub.SBG007_Sync_BC2GPI(pQuotations);
+ //comment by dennis 2022/3/3
rowData.retry_cnt__c=0;
}catch(Exception ex) {
// TODO IOException
--
Gitblit v1.9.1