19626
2023-10-31 fd9df05c48c09b4d7f39a3b401882bda226dedea
force-app/main/default/classes/ConsumTrialPDFController.cls
@@ -91,7 +91,7 @@
                     , Post_Code__c  // 邮编
                     , Loaner_received_staff__c  // 接收人姓名
                     , Loaner_received_staff_phone__c  // 接收人电话
                  ,AWS_Data_Id__c
                   ,AWS_Data_Id__c
                  FROM Consum_Apply__c
                 WHERE Id = :targetConsumApplyId
        ];
@@ -153,7 +153,7 @@
                     , Follower_User__r.Name
                     , Spare__c  // 备用
                     , Comment__c  // 备注
                     , AWS_Data_Id__c
                     , AWS_Data_Id__c
                     , ManagementCode__c  // 管理编码 yc 耗材追溯
                     , EquipmentManagementCode__c  // 备品管理码 yc 耗材追溯
                  FROM Consum_Apply_Equipment_Set_Detail__c
@@ -223,12 +223,18 @@
        }
    }
    public static string GetImageBase64(string id){
        List<ContentVersion> version = [select VersionData from ContentVersion where ContentDocumentId =: id];
        // List<Attachment> atts = [SELECT Id, IsDeleted, ParentId, Name, IsPrivate, ContentType, BodyLength, Body, OwnerId, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, Description FROM Attachment where id=:id];
        if (version.size()==0) {
            return null;
        // 20231103   Lightning文件修改 Start
        List<ContentVersion> version =new List<ContentVersion>();
        version = [select VersionData from ContentVersion where Id =: id];
        if(version.size() > 0){
            return 'data:image/png;base64,' + EncodingUtil.base64Encode(version[0].VersionData);
        }else{
            return '';
        }
        return 'data:image/png;base64,' + EncodingUtil.base64Encode(version[0].VersionData);
        // 20231103   Lightning文件修改 End
    }
}