From 8475b9f98c8a4c95446f02be4bf2a64e359c359a Mon Sep 17 00:00:00 2001
From: liwentao <1376563863@qq.com>
Date: 星期五, 11 八月 2023 09:10:31 +0800
Subject: [PATCH] 与测试环境对比,部分代码已被人修改,删除其中的alert和部分硬编码,还原测试环境代码逻辑

---
 force-app/main/default/classes/GuaranteePeriodAlterationController.cls |   25 ++++++++++++++++++++++---
 1 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/force-app/main/default/classes/GuaranteePeriodAlterationController.cls b/force-app/main/default/classes/GuaranteePeriodAlterationController.cls
index 4dfc08a..6d33eca 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; }//update by liwentao 鏇存柊lightning闄勪欢涓婁紶
     //鍒嗛〉鍔熻兘
     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,16 @@
         pageLimit = Integer.valueOf(System.Label.orderdetPageLimitsize);
 
         attachments = new List<Attachment>();
+        //update 鏉庢枃娑� 2023/07/13 鏇存柊lightning闄勪欢涓婁紶 start
+        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];
+        //update 鏉庢枃娑� 2023/07/13 鏇存柊lightning闄勪欢涓婁紶 end
     }
 
     // 鐢婚潰鍒濆鍖�
@@ -184,6 +194,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 +262,15 @@
         ref.setRedirect(true);
         return ref;
     }
-
+    //update 鏉庢枃娑� 2023/07/13 鏇存柊lightning闄勪欢涓婁紶 start
+    //璺宠浆鍒颁笂浼犻檮浠堕〉闈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;
+    }
+    //update 鏉庢枃娑� 2023/07/13 鏇存柊lightning闄勪欢涓婁紶 start
     //鏌ユ壘"淇濇湁璁惧"鏄惁鍚湁"QIS"鍜�"淇悊"鍜�"淇濇湁璁惧鐨勪繚淇湡闄愬彉鏇磋繃"
     public Boolean find_QIS_Repair(List<String> assetIdList) {
 

--
Gitblit v1.9.1