| | |
| | | public static string ResponseBody; |
| | | public static String SAPRepairNo; |
| | | public class NFM103Response { |
| | | public RepairRequest_element RepairRequest; |
| | | // public RepairRequest_element RepairRequest; |
| | | public response[] response; |
| | | } |
| | | public class response { |
| | |
| | | public String UpdateStatus;//直返修改标识 |
| | | //add by wangweipeng 2021/07/14 end |
| | | //add pi 加密 sushanhu 20220222 start |
| | | //public String DataId;//AWS存储凭证 |
| | | public String DataId;//AWS存储凭证 |
| | | //add pi 加密 sushanhu 20220222 end |
| | | |
| | | //20220330 lt WLIG-CCT9UG 【委托】关于市场多年保计提金调整 start |
| | |
| | | */ |
| | | @future (callout = true) |
| | | public static void callout(String iflog_Id, List<Id> repairIds) { |
| | | |
| | | |
| | | if (repairIds == null || repairIds.size() == 0) { |
| | | return; |
| | |
| | | ,Returns_Product_way__c //返品方式 |
| | | ,FSE_ApplyForRepair_time__c //申请修理时间 |
| | | //add by wangweipeng 2021/07/14 start |
| | | //,AWS_Data_Id__c //add by sushanhu AWSDateID for PIPL |
| | | ,AWS_Data_Id__c //add by sushanhu AWSDateID for PIPL |
| | | //20220330 lt WLIG-CCT9UG 【委托】关于市场多年保计提金调整 start |
| | | ,Delivered_Product__r.Backorder__r.Opportunity__r.SAP_Send_OK_Date__c |
| | | //20220330 lt WLIG-CCT9UG 【委托】关于市场多年保计提金调整 end |
| | |
| | | element.UpdateStatus = rpr.Address_type__c; //申请修理时间 |
| | | //add by wangweipeng 2021/07/14 end |
| | | //add pi 密文 sushanhu 20220222 start |
| | | //element.DataId =rpr.AWS_Data_Id__c;//aws存储凭证 |
| | | element.DataId =rpr.AWS_Data_Id__c;//aws存储凭证 |
| | | //add pi 密文 sushanhu 20220222 end |
| | | |
| | | } |
| | |
| | | // NFM103修改Rest end |
| | | |
| | | // WLIG-BXQBH6 start |
| | | NFMUtil.response response = |
| | | NFMUtil.sendToSapStatusAndBody(rowDataStr, NFMUtil.NFM103_ENDPOINT); |
| | | // NFMUtil.response response = |
| | | // NFMUtil.sendToSapStatusAndBody(rowDataStr, NFMUtil.NFM103_ENDPOINT); |
| | | //update to aws 20220222 sushanhu start for PIPL |
| | | // PIHelper.PIIntegration NFM103AWS =PIHelper.getPIIntegrationInfo('NFM103'); |
| | | // NFMUtil.response response = NFMUtil.sendToPiAWS(rowDataStr, NFM103AWS.newUrl,NFM103AWS.token); |
| | | PIHelper.PIIntegration NFM103AWS =PIHelper.getPIIntegrationInfo('NFM103'); |
| | | NFMUtil.response response = NFMUtil.sendToPiAWS(rowDataStr, NFM103AWS.newUrl,NFM103AWS.token); |
| | | //update to aws 20220222 sushanhu end for PIPL |
| | | status = response.status; |
| | | system.debug('AWS Response status:'+status); |
| | | ResponseBody = response.responseBody; |
| | | status = response.status; |
| | | system.debug('AWS Response status:'+status); |
| | | system.System.debug('NGM103 AWS result--'+ response.ResponseBody); |
| | | ResponseBody = response.responseBody; |
| | | //update to aws 20220302 sushanhu start for PIPL |
| | | // Map<String, Object> results = (Map<String, Object>)JSON.deserializeUntyped(ResponseBody); |
| | | // system.System.debug('NGM103 AWS result--'+ ResponseBody); |
| | | //update to aws 20220302 sushanhu end for PIPL |
| | | NFM103Response NFM103Response = new NFM103Response(); |
| | | if ('200'.equals(status)) { |
| | | Map<String, Object> results = (Map<String, Object>)JSON.deserializeUntyped(ResponseBody); |
| | | NFM103Response NFM103Response = new NFM103Response(); |
| | | system.debug(ResponseBody); |
| | | if (string.isNotEmpty(ResponseBody)) { |
| | | NFM103Response = |
| | |
| | | NFM103Response.response.size() > 0 && |
| | | NFM103Response.response[0].LOG != null && |
| | | string.isNotEmpty(NFM103Response.response[0].LOG.SAPRepairNo)) { |
| | | SAPRepairNo = NFM103Response.response[0].LOG.SAPRepairNo; |
| | | SAPRepairNo = NFM103Response.response[0].LOG.SAPRepairNo; |
| | | |
| | | } |
| | | rowData.retry_cnt__c = 0; |
| | | //add wangweipeng 2022/02/18 start |
| | | //如果为true,证明是重新发送的接口,需要把日志记录下 |
| | | if(needUpdateIflog){ |
| | | logstr += 'Status:' + status; |
| | | logstr += '\nResponse:' + ResponseBody; |
| | | logstr += '\nend'; |
| | | } |
| | | //add wangweipeng 2022/02/18 start |
| | | } 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:' + ResponseBody + |
| | | '\n错误次数已经超过自动送信设定的最大次数,请手动送信'; |
| | | } |
| | | } |
| | | // Map<String, Object> results = (Map<String, Object>)JSON.deserializeUntyped(ResponseBody); |
| | | |
| | | //update to aws 20220302 sushanhu end for PIPL |
| | | |
| | | // 原代码: |
| | | // NFM103修改Rest start |
| | | //status = |
| | |
| | | // WLIG-BXQBH6 end |
| | | |
| | | // 原則非同期ですので、logsを確認する必要がないでしょう。 |
| | | if (status == 'OK') { |
| | | rowData.retry_cnt__c = 0; |
| | | //add wangweipeng 2022/02/18 start |
| | | //如果为true,证明是重新发送的接口,需要把日志记录下 |
| | | if(needUpdateIflog){ |
| | | logstr += 'Status:' + status; |
| | | logstr += '\nResponse:' + responseBody; |
| | | logstr += '\nend'; |
| | | } |
| | | //add wangweipeng 2022/02/18 start |
| | | } 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错误次数已经超过自动送信设定的最大次数,请手动送信'; |
| | | } |
| | | } |
| | | // if (status == 'OK') { |
| | | // rowData.retry_cnt__c = 0; |
| | | // //add wangweipeng 2022/02/18 start |
| | | // //如果为true,证明是重新发送的接口,需要把日志记录下 |
| | | // if(needUpdateIflog){ |
| | | // logstr += 'Status:' + status; |
| | | // logstr += '\nResponse:' + responseBody; |
| | | // logstr += '\nend'; |
| | | // } |
| | | // //add wangweipeng 2022/02/18 start |
| | | // } 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错误次数已经超过自动送信设定的最大次数,请手动送信'; |
| | | // } |
| | | // } |
| | | } catch (Exception ex) { |
| | | // TODO IOException |
| | | // エラーが発生した場合 |