| | |
| | | public String HcpNo; //HPC编码 |
| | | public Boolean IsActive; //是否有效 |
| | | public String UpdateStatus; //操作类型 |
| | | // add by sushanhu 20220304 for pi satrt |
| | | public String DataId; //aws 存储凭据 |
| | | // add by sushanhu 20220304 for pi end |
| | | } |
| | | |
| | | @future(callout = true) |
| | |
| | | Phone, //电话 |
| | | HcpNo__c, //HCP编码 |
| | | Isactive__c, //是否有效 |
| | | UpdateStatus__c //操作类型 |
| | | // UpdateStatus__c, //操作类型 |
| | | AWS_Data_Id__c //aws 存储凭据 add bysushanhu 20220304 for Pi |
| | | from Contact WHERE Id IN:accIdList order by Id]; //AccountId |
| | | String logstr = iflog.Log__c + ' ' + 'NumberOfRecord=' + conList.size() + '\n'; |
| | | |
| | |
| | | ged.Mobile = con.Phone; |
| | | ged.HcpNo = con.HcpNo__c; |
| | | ged.IsActive = '有效'.equals(con.Isactive__c)? true:false; |
| | | ged.UpdateStatus = con.UpdateStatus__c; |
| | | // ged.UpdateStatus = con.UpdateStatus__c; |
| | | ged.UpdateStatus = String.isBlank(con.HcpNo__c) ? 'I' : 'U'; |
| | | ged.DataId = con.AWS_Data_Id__c;//add by sushanhu for pi 20220304 |
| | | gds.GeData.add(ged); |
| | | } |
| | | |
| | |
| | | } |
| | | try { |
| | | |
| | | NFMUtil.response response = NFMUtil.sendToSapStatusAndBody(rowDataStr, NFMUtil.NFM702_ENDPOINT); |
| | | System.debug('NFM702Log--status->'+ status); |
| | | // NFMUtil.response response = NFMUtil.sendToSapStatusAndBody(rowDataStr, NFMUtil.NFM702_ENDPOINT); |
| | | // System.debug('NFM702Log--status->'+ status); |
| | | |
| | | // status = response.status; |
| | | // ResponseBody = response.responseBody; |
| | | // Response resultList = ( Response ) JSON.deserializeStrict(ResponseBody, Response.class); |
| | | // System.debug('NFM702Log--status->'+ ResponseBody); |
| | | |
| | | // Result = resultList.Result.Result; |
| | | |
| | | // if ('00'.equals(Result)) { |
| | | // logstr += ResponseBody+'\n'; |
| | | // rowDataSFDC.retry_cnt__c = 0; |
| | | // //iflog.Log__c = 'ok'; |
| | | // } |
| | | // else { |
| | | // //iflog.Log__c = 'ok2'; |
| | | // rowDataSFDC = NFMUtil.LogAutoSend(rowDataSFDC, null, status); |
| | | // } |
| | | //update to AWS sushanhu FOR PI start 20220304 |
| | | PIHelper.PIIntegration pi =PIHelper.getPIIntegrationInfo('NFM702'); |
| | | NFMUtil.response response = NFMUtil.sendToPiAWS(rowDataStr, pi.newUrl,pi.token); |
| | | |
| | | status = response.status; |
| | | System.debug('NFM702Log--status->'+ status); |
| | | |
| | | ResponseBody = response.responseBody; |
| | | Response resultList = ( Response ) JSON.deserializeStrict(ResponseBody, Response.class); |
| | | System.debug('NFM702Log--status->'+ ResponseBody); |
| | | |
| | | Result = resultList.Result.Result; |
| | | |
| | | if ('00'.equals(Result)) { |
| | | logstr += ResponseBody+'\n'; |
| | | rowDataSFDC.retry_cnt__c = 0; |
| | | //iflog.Log__c = 'ok'; |
| | | } |
| | | else { |
| | | //iflog.Log__c = 'ok2'; |
| | | System.debug('NFM702Log--responsebody->'+ ResponseBody); |
| | | if ('200'.equals(status)) { |
| | | //aws 正确响应 |
| | | // Response resultList = ( Response ) JSON.deserializeStrict(ResponseBody, Response.class); |
| | | Map<String, Object> result = (Map<String, Object>)JSON.deserializeUntyped(ResponseBody); |
| | | String statusCode =(String)result.get('status'); |
| | | |
| | | if ('0'.equals(statusCode)) { |
| | | logstr += ResponseBody+'\n'; |
| | | rowDataSFDC.retry_cnt__c = 0; |
| | | //iflog.Log__c = 'ok'; |
| | | } else { |
| | | //iflog.Log__c = 'ok2'; |
| | | rowDataSFDC = NFMUtil.LogAutoSend(rowDataSFDC, null, status); |
| | | } |
| | | } |
| | | |
| | | else { |
| | | |
| | | logstr=ResponseBody; |
| | | iflog.ErrorLog__c=ResponseBody; |
| | | } |
| | | //update to AWS sushanhu FOR PI 20220304 end |
| | | }catch ( Exception ex ) { |
| | | //打印错误日志 |
| | | System.debug(Logginglevel.ERROR, LOG_TYPE + iflog.Name + ':' + ex.getMessage()); |
| | |
| | | logstr = ex.getMessage(); |
| | | iflog.ErrorLog__c += ex.getMessage() + '\n'; |
| | | iflog.ErrorLog__c += ex.getStackTraceString() + '\n'; |
| | | |
| | | rowDataSFDC = NFMUtil.LogAutoSend(rowDataSFDC, null, status); |
| | | if(!Test.isRunningTest()){ |
| | | //rowDataSFDC = NFMUtil.LogAutoSend(rowDataSFDC, null, status); |
| | | } |
| | | } |
| | | |
| | | iflog.Log__c = iflog.Log__c + logstr; |