From 2d5b6ced9bbcb7a30159fd892b39d27a7e048b82 Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期日, 24 四月 2022 09:41:45 +0800
Subject: [PATCH] BatchForAgencyContact

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

diff --git a/force-app/main/default/classes/ConsumTrialPDFController.cls b/force-app/main/default/classes/ConsumTrialPDFController.cls
index 906ec62..7c8c801 100644
--- a/force-app/main/default/classes/ConsumTrialPDFController.cls
+++ b/force-app/main/default/classes/ConsumTrialPDFController.cls
@@ -21,12 +21,21 @@
     public Integer consumApplySetDetailListSize { get; set; }  // 鑰楁潗澶囧搧鎬绘暟閲�
     public String errorMsg { get; set; }  // 閿欒淇℃伅
 
+    public string staticResource { get; private set; }
+    public string staticResourceCon { get; private set; }
+    public string staticResourceFile { get; private set; }
+    public string BRSrc{get;private set;}
+    public string QRSrc{get;private set;}
+
     public ConsumTrialPDFController() {
         targetConsumApplyId = ApexPages.currentPage().getParameters().get('id');
         if (String.isBlank(targetConsumApplyId)) {
             throw new ControllerUtil.myException('鍙傛暟閿欒锛氳鎸囧畾Id銆�');
         }
         pdfPageList = new List<PdfPageClass>();
+        staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Consum_Apply_Equipment_Set_Detail__c'));
+        staticResourceCon = JSON.serialize(PIHelper.getPIIntegrationInfo('Consum_Apply__c'));
+        staticResourceFile = JSON.serialize(PIHelper.getPIIntegrationInfo('Document'));
     }
 
     /**
@@ -40,6 +49,10 @@
             ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.ERROR, errorMsg));
             return;
         }
+
+        BRSrc = GetImageBase64(targetConsumApply.BRId__c);
+        QRSrc = GetImageBase64(targetConsumApply.QRId__c);
+        
 
         // 鑾峰彇鑰楁潗澶囧搧閰嶅涓�瑙堟槑缁�
         List<Consum_Apply_Equipment_Set_Detail__c> targetConsumSetDetailList = getTargetConsumSetDetailList();
@@ -78,6 +91,7 @@
                      , Post_Code__c  // 閭紪
                      , Loaner_received_staff__c  // 鎺ユ敹浜哄鍚�
                      , Loaner_received_staff_phone__c  // 鎺ユ敹浜虹數璇�
+            		,AWS_Data_Id__c
                   FROM Consum_Apply__c
                  WHERE Id = :targetConsumApplyId
         ];
@@ -139,12 +153,13 @@
                      , Follower_User__r.Name
                      , Spare__c  // 澶囩敤
                      , Comment__c  // 澶囨敞
+                     , AWS_Data_Id__c
                      , ManagementCode__c  // 绠$悊缂栫爜 yc 鑰楁潗杩芥函
                      , EquipmentManagementCode__c  // 澶囧搧绠$悊鐮� yc 鑰楁潗杩芥函
                   FROM Consum_Apply_Equipment_Set_Detail__c
                  WHERE Consum_Apply_Equipment_Set__r.Consum_Apply__c = :targetConsumApplyId  // 鑰楁潗澶囧搧閰嶅涓�瑙�.鑰楁潗澶囧搧鐢宠
                    AND (Cancel_Select__c = false OR NG_Select_Again__c = true)
-                   AND Shipment_request_time2__c != null
+                //    AND Shipment_request_time2__c != null //Commented By Li Jun 20220422 for PIPL
               ORDER BY Consum_Apply_Equipment_Set__r.Consum_Apply__c, Consum_Apply_Equipment_Set__c, Fixture_Model_No_F__c, Degree_Of_Importance__c
         ];
         if (consumApplySetDetailList.size() > 0) {
@@ -207,4 +222,12 @@
             equipSetDetailList = new List<Consum_Apply_Equipment_Set_Detail__c>();
         }
     }
+
+    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) {
+            return null;
+        }
+        return 'data:image/png;base64,' + EncodingUtil.base64Encode(atts[0].body);
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.1