From fbd4bea7bd57b4d4a33cb9ed0ebc15d9bf6551c0 Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期三, 12 七月 2023 17:54:54 +0800
Subject: [PATCH] 近日更新按钮,页面以及apex类

---
 force-app/main/default/classes/OPDNoReportApplicationController.cls |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/force-app/main/default/classes/OPDNoReportApplicationController.cls b/force-app/main/default/classes/OPDNoReportApplicationController.cls
index 94d2000..55ef72f 100644
--- a/force-app/main/default/classes/OPDNoReportApplicationController.cls
+++ b/force-app/main/default/classes/OPDNoReportApplicationController.cls
@@ -6,7 +6,7 @@
     //璺宠繃涓婁紶闄勪欢鍒ゆ柇 
     public Boolean IsHavFile { get; set; }
     //闄勪欢
-    public List<Attachment> attachmentinfo { get; set; }
+    public List<ContentDocument> attachmentinfo { get; set; }
     // //鎵ц瀹℃壒娴佹垚鍔熸爣璇�
     public Boolean approvalFlag { get; set; }
 
@@ -45,7 +45,18 @@
             this.ModelLendingCodeId = opdPlan.ModelLending__c;
         }
 
-        attachmentinfo = [SELECT Id, Name,OwnerId FROM Attachment WHERE  parentid = :paramId];
+        //闄勪欢(lightning)
+        List<ContentDocumentLink> cdlList = [SELECT ContentDocumentId
+        FROM ContentDocumentLink
+        WHERE LinkedEntityId = :paramId];
+        List<ID> fileIDs = new List<ID>();
+        for (ContentDocumentLink docLink : cdlList) {
+        fileIDs.add(docLink.ContentDocumentId);
+        }
+        attachmentinfo=[SELECT Title,OwnerId,ContentModifiedDate from ContentDocument WHERE id IN :fileIDs];
+
+
+        // attachmentinfo = [SELECT Id, Name,OwnerId FROM Attachment WHERE  parentid = :paramId];
         if(attachmentinfo.size()>0){
             IsHavFile =true;
         } else {

--
Gitblit v1.9.1