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/GuaranteePeriodAlterationController.cls |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/force-app/main/default/classes/GuaranteePeriodAlterationController.cls b/force-app/main/default/classes/GuaranteePeriodAlterationController.cls
index 4dfc08a..6b3029d 100644
--- a/force-app/main/default/classes/GuaranteePeriodAlterationController.cls
+++ b/force-app/main/default/classes/GuaranteePeriodAlterationController.cls
@@ -48,7 +48,7 @@
     public String Id  { get; set; }
     public Boolean isShow { get; set; }
     public List<Attachment> attachments { get; set; }
-
+	public List<ContentDocument> contents { get; set; }
     //鍒嗛〉鍔熻兘
     public Integer pageLimit{get;set;}
     public String soql {get;set;}
@@ -57,7 +57,7 @@
         isShow = false;
         Statu_AchievementsId = ApexPages.currentPage().getParameters().get('Statu_AchievementsId');
         Id = ApexPages.currentPage().getParameters().get('Id');
-
+		System.debug('id:'+Id+'   and sId:'+Statu_AchievementsId);
         statusEdit = ApexPages.currentPage().getParameters().get('KeyWords');
         guaranteePeriodAlterationDetailRecords = new List<GuaranteePeriodAlterationDetailInfo>();
         guaranteePeriodAlterationDetaiRecordsview = new List<GuaranteePeriodAlterationDetailInfo>();
@@ -66,6 +66,14 @@
         pageLimit = Integer.valueOf(System.Label.orderdetPageLimitsize);
 
         attachments = new List<Attachment>();
+        List<ContentDocumentLink> cdlList = [SELECT ContentDocumentId
+                                                   FROM ContentDocumentLink
+                                                   WHERE LinkedEntityId = :Id];
+        List<ID> fileIDs = new List<ID>();
+        for (ContentDocumentLink docLink : cdlList) {
+            fileIDs.add(docLink.ContentDocumentId);
+        }
+        contents=[SELECT Title,OwnerId,ContentModifiedDate from ContentDocument WHERE id IN :fileIDs];
     }
 
     // 鐢婚潰鍒濆鍖�
@@ -184,6 +192,7 @@
         }  else {
             statu_AchievementId = ambc.GpaaStatu_Achievements__c;
         }
+        statu_AchievementId='';
         String soql = 'select Id,name,SerialNumber,Asset_situation__c,Order_No__c,Account.Name,Status,Installation_Site__c,CurrentContract__c,guarantee_period__c,RepairQuantity__c from Asset where Backorder__c = \'' + statu_AchievementId +'\'';
         soql += ' AND AssetMark__c != \'鑰楁潗\'';
         if(!String.isBlank(text1)){
@@ -251,7 +260,13 @@
         ref.setRedirect(true);
         return ref;
     }
-
+    //璺宠浆鍒颁笂浼犻檮浠堕〉闈ightning
+    public PageReference uploadingAttachmentLightning(){
+        //PageReference ref = new Pagereference('/p/attach/NoteAttach?pid=' + Id +'&retURL=%2Fapex/AssetGuaranteePeriodAlteration?Id='+Id);
+        PageReference ref = new Pagereference('/lightning/n/lightning?objectApiName&context=RECORD_DETAIL&backgroundContext=%2Flightning%2Fr%2FAssetGuaranteePeriodAlteration__c%2F'+Id+'%2Fedit%3F0.source%3DalohaHeader&0.recordId='+Id+'');
+        ref.setRedirect(true);
+        return ref;
+    }
     //鏌ユ壘"淇濇湁璁惧"鏄惁鍚湁"QIS"鍜�"淇悊"鍜�"淇濇湁璁惧鐨勪繚淇湡闄愬彉鏇磋繃"
     public Boolean find_QIS_Repair(List<String> assetIdList) {
 

--
Gitblit v1.9.1