19626
2023-10-31 fd9df05c48c09b4d7f39a3b401882bda226dedea
force-app/main/default/classes/NFM609FiledDownloadBatch.cls
@@ -43,6 +43,7 @@
        }
        try{
            // 20231103 陈京武 Lightning文件修改 Start
            List < ContentVersion > newAttList = AttachmentFiledDownload(endpoint, parentId, attachmentName);
            // if (newAttList.size() > 0) {
@@ -52,6 +53,7 @@
            //     }
            //     insert newAttList;
            // } 
            // 20231103 陈京武 Lightning文件修改 End
            if (updateCaseList.size() > 0) {
                update updateCaseList;
            }
@@ -65,7 +67,7 @@
        }
        // }
    }
// 20231103 陈京武 Lightning文件修改 Start
    global static List < ContentVersion > AttachmentFiledDownload(String endpoint, String parentId, String attachmentName) {
        List<ContentDocumentLink> linkList = [
            select
@@ -110,12 +112,14 @@
            if (ContentLength < 12582912) {
                Blob bodyAsBlob = response.getBodyAsBlob();
                version.VersionData = bodyAsBlob;
                version.PathOnClient = attachmentName + '.txt';
                // atta.Body = bodyAsBlob;
                result.add(version);
            } else {
                // atta.Name = '文件大小超过12M,请在新服务系统查看';
                // atta.Body = Blob.valueOf('文件大小超过12M');
                version.Title = '文件大小超过12M,请在新服务系统查看';
                version.PathOnClient = '文件大小超过12M,请在新服务系统查看.txt';
                version.VersionData = Blob.valueOf('文件大小超过12M');
                result.add(version);
            }
@@ -128,7 +132,7 @@
            link.Visibility = 'AllUsers';
            insert link;
        }
// 20231103 陈京武 Lightning文件修改 End
        // system.debug('responseBody503--->'+bodyAsBlob);