19626
2023-10-11 7c7cb195462c2ded7bfe4105959ea36d1dd68ded
force-app/main/default/classes/ConsumTrialPDFController.cls
@@ -21,9 +21,9 @@
    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 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;}
@@ -33,9 +33,9 @@
            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'));
        //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'));
    }
    /**
@@ -91,7 +91,7 @@
                     , Post_Code__c  // 邮编
                     , Loaner_received_staff__c  // 接收人姓名
                     , Loaner_received_staff_phone__c  // 接收人电话
                  ,AWS_Data_Id__c
                   //,AWS_Data_Id__c    //deloitte-zhj 20231010 PIPL还原
                  FROM Consum_Apply__c
                 WHERE Id = :targetConsumApplyId
        ];
@@ -153,7 +153,7 @@
                     , Follower_User__r.Name
                     , Spare__c  // 备用
                     , Comment__c  // 备注
                     , AWS_Data_Id__c
                     //, AWS_Data_Id__c    //deloitte-zhj 20231010 PIPL还原
                     , ManagementCode__c  // 管理编码 yc 耗材追溯
                     , EquipmentManagementCode__c  // 备品管理码 yc 耗材追溯
                  FROM Consum_Apply_Equipment_Set_Detail__c
@@ -223,12 +223,16 @@
        }
    }
    public static string GetImageBase64(string id){
        List<ContentVersion> version = [select VersionData from ContentVersion where Id =: 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;
        }
        List<ContentVersion> version =new List<ContentVersion>();
        version = [select VersionData from ContentVersion where Id =: id];
        if(version.size() > 0){
        return 'data:image/png;base64,' + EncodingUtil.base64Encode(version[0].VersionData);
        }else{
            return '';
        }
    }
}