| | |
| | | public String contactName4{set;get;} |
| | | public String contactName5{set;get;} |
| | | public String sfRecordIdForEdit{set;get;}//Add By LiJun for Edit Record from NFM609, 20220510 |
| | | public String VLookUpFieldsJson{get;private set;} |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | public String staticResourceV2 {get; set;} |
| | | //zhj MEBG新方案改造 2022-11-29 end |
| | | |
| | | public NewAndEditReportController(ApexPages.StandardController controller) { |
| | | ApiPrefix = 'PIBackApi'; |
| | | layoutEncryptedAPIList = new List<String>(); |
| | |
| | | } |
| | | } |
| | | } |
| | | //获取lookup字段 |
| | | List<String> VLookUpFields = new List<String>(); |
| | | for (LayoutDescriberHelper.LayoutSection ls : layoutSections) { |
| | | for (LayoutDescriberHelper.LayoutField lf : ls.layoutFields) { |
| | | if (lf.fieldAPI != '' && lf.fieldType == 'reference') { |
| | | VLookUpFields.add(lf.fieldAPI); |
| | | } |
| | | } |
| | | } |
| | | VLookUpFieldsJson = Json.serialize(VLookUpFields); |
| | | for (PI_Field_Policy_Detail__c PIDetail : piIntegration.PIDetails) { |
| | | AWSToSobjectEncryptedMap.put(PIDetail.AWS_Field_API__c, PIDetail.SF_Field_API_Name__c); |
| | | } |
| | | System.debug('AWSToSobjectEncryptedMap = ' + AWSToSobjectEncryptedMap); |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | staticResourceV2 = JSON.serialize(PIHelper.getPIIntegrationInfo('Report__cV2')); |
| | | //zhj MEBG新方案改造 2022-11-29 end |
| | | } |
| | | |
| | | global class Response{ |
| | |
| | | String awsDataId = (String)reportInfo.get('AWS_Data_Id__c'); |
| | | String sfRecordId = (String)reportInfo.get('Id'); |
| | | System.debug('awsDataId = ' + awsDataId); |
| | | report__c[] reports = [select id from report__c where AWS_Data_Id__c =:awsDataId or id =:sfRecordId]; |
| | | System.debug('sfRecordId = ' + sfRecordId); |
| | | report__c[] reports = [select id from report__c where AWS_Data_Id__c =:awsDataId or id=:sfRecordId]; |
| | | //report__c[] reportsFromDaily = [select id from report__c where AWS_Data_Id__c =:awsDataId or id=:sfRecordId]; |
| | | |
| | | if(!isNew){ |
| | | isClone = reports.size() == 0; |
| | | } |
| | | system.debug('isClone'+isClone + ' isNew'+isNew); |
| | | if(isNew){ |
| | | if(isNew || isClone){ |
| | | System.debug('reportInfo = ' + reportInfo); |
| | | if(!Test.isRunningTest()){ |
| | | insert reportInfo; |
| | | // if(isClone){ |
| | | // Report__c[] r = [select Practitioner4__c,Practitioner5__c from Report__c where id=:sfRecordId]; |
| | | // if(r.size()>0){ |
| | | // reportInfo.Practitioner4__c = r[0].Practitioner4__c; |
| | | // reportInfo.Practitioner5__c = r[0].Practitioner5__c; |
| | | // } |
| | | // reportInfo.Id = null; |
| | | // } |
| | | reportInfo.Status__c = '草案中'; |
| | | insert reportInfo; |
| | | } else { |
| | | Report__c reportTest = new Report__c(); |
| | | insert reportTest; |
| | |
| | | System.debug('reports[0].id = ' + reports[0].id); |
| | | reportInfo.put('Id',reports[0].id);//For testing; |
| | | if(!Test.isRunningTest()){ |
| | | update reportInfo; |
| | | update reportInfo; |
| | | } |
| | | } |
| | | rid=reportInfo.Id; |
| | |
| | | System.debug(e.getDmlMessage(index)); |
| | | System.debug(e.getDmlStatusCode(index)); |
| | | System.debug(e.getDmlType(index)); |
| | | system.debug(e.getMessage()); |
| | | system.debug(e.getMessage()); |
| | | system.debug(e.getStackTraceString()); |
| | | |
| | | System.debug('into catch'+e.getMessage()); |