| | |
| | | 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; |
| | | } |
| | |
| | | public String Other2; |
| | | public String Other3; |
| | | public GeDataDetails_element[] GeDataDetails; |
| | | //dennis start for pi 2022/3/3 |
| | | public String DataId; |
| | | |
| | | } |
| | | public class GeDataDetails_element { |
| | |
| | | * @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; |
| | | } |
| | |
| | | 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); |
| | | |
| | |
| | | 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>(); |
| | |
| | | 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 |
| | |
| | | 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 |