| | |
| | | public without sharing class OPDNoReportApplicationController { |
| | | //定义OPD计划 |
| | | public OPDPlan__c opdPlan { get; set; } |
| | | public OPDPlan__c opdPlan { get; set; } |
| | | //是否上传附件 |
| | | public Boolean IsUpload { get; set; } |
| | | //跳过上传附件判断 |
| | | public Boolean IsHavFile { get; set; } |
| | | //附件 |
| | | // 20231103 chenjingwu Lightning文件修改 Start |
| | | public List<ContentDocument> attachmentinfo { get; set; } |
| | | // 20231103 chenjingwu Lightning文件修改 End |
| | | // //执行审批流成功标识 |
| | | public Boolean approvalFlag { get; set; } |
| | | |
| | |
| | | //获取页面参数 |
| | | String paramId = ApexPages.currentPage().getParameters().get('id'); |
| | | //检索opd计划的状态、出借目的、出借目的(工作流用)、模型出借产品型号、对应修理维修NO,无报告状态,追加配套,opd来源,推广经理 |
| | | List<OPDPlan__c> OPDPlanList = [select Id,Status__c,RentalReson__c,RentalResonTemp__c,ModelLendingProduct__c,ModelLendingProduct__r.Name,CorrespondingRepairNo__c,noReportStatus__c,AdditionalSupport__c,ModelLending__c,OPDType__c,SalesManager__c,ownerId from OPDPlan__c where Id = :paramId]; |
| | | |
| | | //kk 增加几个字段的查询Account_Laboratory__c,OPDPlan_ImplementDate__c 20231027 start |
| | | // List<OPDPlan__c> OPDPlanList = [select Id,Status__c,RentalReson__c,RentalResonTemp__c,ModelLendingProduct__c,ModelLendingProduct__r.Name,CorrespondingRepairNo__c,noReportStatus__c,AdditionalSupport__c,ModelLending__c,OPDType__c,SalesManager__c,ownerId,AdditionalSupport__r.Account_Laboratory__c,AdditionalSupport__r.OPDPlan_ImplementDate__c from OPDPlan__c where Id = :paramId]; |
| | | List<OPDPlan__c> OPDPlanList = [select Id,Status__c,RentalReson__c,RentalResonTemp__c,ModelLendingProduct__c,ModelLendingProduct__r.Name,CorrespondingRepairNo__c,noReportStatus__c,AdditionalSupport__c,ModelLending__c,OPDType__c,SalesManager__c,ownerId,AdditionalSupport__r.Account_Laboratory__c,AdditionalSupport__r.OPDPlan_ImplementDate__c ,Account_Laboratory__c,OPDPlan_ImplementDate__c from OPDPlan__c where Id = :paramId]; |
| | | //kk 增加几个字段的查询 20231027 end |
| | | if( OPDPlanList.size() == 0){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '找不到对应的OPD计划!')); |
| | | return; |
| | |
| | | } |
| | | |
| | | //附件(lightning) |
| | | // 20231103 chenjingwu Lightning文件修改 Start |
| | | List<ContentDocumentLink> cdlList = [SELECT ContentDocumentId |
| | | FROM ContentDocumentLink |
| | | WHERE LinkedEntityId = :paramId]; |
| | |
| | | fileIDs.add(docLink.ContentDocumentId); |
| | | } |
| | | attachmentinfo=[SELECT Id,Title,OwnerId from ContentDocument WHERE Id IN :fileIDs]; |
| | | |
| | | // 20231103 chenjingwu Lightning文件修改 End |
| | | |
| | | // attachmentinfo = [SELECT Id, Name,OwnerId FROM Attachment WHERE parentid = :paramId]; |
| | | if(attachmentinfo.size()>0){ |
| | |
| | | @RemoteAction |
| | | public static String testAddAttachment(String attachmentName,String attachmentType, String attachmentBody,String parentId) { |
| | | String operateResult; |
| | | // 20231103 chenjingwu Lightning文件修改 Start |
| | | // Attachment tmpAttachment = new Attachment(); |
| | | // tmpAttachment.Name = attachmentName; |
| | | // tmpAttachment.Body = EncodingUtil.base64Decode(attachmentBody); |
| | |
| | | link.ShareType = 'I'; |
| | | link.Visibility = 'AllUsers'; |
| | | insert link; |
| | | // 20231103 chenjingwu Lightning文件修改 End |
| | | operateResult = '您已上传文件成功!'; |
| | | } catch (Exception e){ |
| | | operateResult = '上传文件失败,请重试!'; |
| | |
| | | opdPlan.noReportStatus__c = '已保存'; |
| | | System.debug('opdPlan2:'+opdPlan); |
| | | update opdPlan; |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.CONFIRM, '保存完毕!')); |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.CONFIRM, '保存完毕!')); |
| | | saveFlag = true; |
| | | }catch(exception e){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, e.getMessage())); |