| | |
| | | public String contactName3{set;get;} |
| | | 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 NewAndEditReportController(ApexPages.StandardController controller) { |
| | | ApiPrefix = 'PIBackApi'; |
| | | layoutEncryptedAPIList = new List<String>(); |
| | |
| | | |
| | | rtTypeId = ReportData.RecordTypeId; |
| | | AWSDataId = ReportData.AWS_Data_Id__c; |
| | | sfRecordIdForEdit = obj.Id; |
| | | Map<String,String> sfIdToAWSIdMap = new Map<String,String>(); |
| | | system.debug('ReportData.Practitioner1__r.Id:' + ReportData.Practitioner1__r.Id); |
| | | system.debug('ReportData.Practitioner1__r.AWS_Data_Id__c:' + ReportData.Practitioner1__r.AWS_Data_Id__c); |
| | |
| | | contactAWSDataId1 = '无'; |
| | | contactName1 = '无'; |
| | | } |
| | | }else if(ApexPages.currentPage().getParameters().get('CF00N10000008ps6d_lkid') != null){ |
| | | }else{ |
| | | //新建 |
| | | // Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | //医院/科室/经销商(手写) |
| | | if(mso.containsKey('00N10000002GE3Z')){ |
| | | controller.getRecord().put('Manual_Name__c',mso.get('00N10000002GE3Z')); |
| | | } |
| | | rtTypeId = ApexPages.currentPage().getParameters().get('RecordType'); |
| | | obj.put('OwnerId',UserInfo.getUserId()); |
| | | } |
| | | if(ApexPages.currentPage().getParameters().get('CF00N10000008ps6d_lkid') != null){ |
| | | //OPD计划过来的,通过Id查出借出备品申请No1进行展示 |
| | | String opdPlanId = ApexPages.currentPage().getParameters().get('CF00N10000008ps6d_lkid'); |
| | | if(String.isNotEmpty(opdPlanId)&&String.isNotBlank(opdPlanId)){ |
| | |
| | | } |
| | | } |
| | | } |
| | | rtTypeId = ApexPages.currentPage().getParameters().get('RecordType'); |
| | | obj.put('OwnerId',UserInfo.getUserId()); |
| | | }else{ |
| | | //新建 |
| | | // Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | //医院/科室/经销商(手写) |
| | | if(mso.containsKey('00N10000002GE3Z')){ |
| | | controller.getRecord().put('Manual_Name__c',mso.get('00N10000002GE3Z')); |
| | | } |
| | | rtTypeId = ApexPages.currentPage().getParameters().get('RecordType'); |
| | | obj.put('OwnerId',UserInfo.getUserId()); |
| | | } |
| | | //OPD计划 |
| | | if(mso.containsKey('CF00N10000008ps6d_lkid')){ |
| | | controller.getRecord().put('Report_OPDPlan__c',mso.get('CF00N10000008ps6d_lkid')); |
| | | } |
| | | LayoutDescriberHelper.LayoutWrapper LayoutWrapperValue = LayoutDescriberHelper.describeSectionWithFieldsWrapper(rtTypeId, 'Report__c','classic'); |
| | | layoutSections = LayoutWrapperValue.layoutSections; |
| | |
| | | System.debug('自定义格式转换结束'); |
| | | |
| | | 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]; |
| | | report__c[] reports = [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){ |
| | | System.debug('reportInfo = ' + reportInfo); |
| | | if(!Test.isRunningTest()){ |