From 254ea442ff0e0a7a97e9f481e9f127a782cba840 Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期一, 17 七月 2023 11:37:35 +0800
Subject: [PATCH] 修改附件7.17
---
force-app/main/default/classes/ConsumTrialPDFController.cls | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/force-app/main/default/classes/ConsumTrialPDFController.cls b/force-app/main/default/classes/ConsumTrialPDFController.cls
index 7c8c801..d605b5e 100644
--- a/force-app/main/default/classes/ConsumTrialPDFController.cls
+++ b/force-app/main/default/classes/ConsumTrialPDFController.cls
@@ -224,10 +224,11 @@
}
public static string GetImageBase64(string 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 (atts.size()==0) {
+ 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;
}
- return 'data:image/png;base64,' + EncodingUtil.base64Encode(atts[0].body);
+ return 'data:image/png;base64,' + EncodingUtil.base64Encode(version[0].VersionData);
}
}
\ No newline at end of file
--
Gitblit v1.9.1