| | |
| | | } |
| | | |
| | | try{ |
| | | // 20231103 陈京武 Lightning文件修改 Start |
| | | List < ContentVersion > newAttList = AttachmentFiledDownload(endpoint, parentId, attachmentName); |
| | | |
| | | // if (newAttList.size() > 0) { |
| | |
| | | // } |
| | | // insert newAttList; |
| | | // } |
| | | // 20231103 陈京武 Lightning文件修改 End |
| | | if (updateCaseList.size() > 0) { |
| | | update updateCaseList; |
| | | } |
| | |
| | | } |
| | | // } |
| | | } |
| | | |
| | | // 20231103 陈京武 Lightning文件修改 Start |
| | | global static List < ContentVersion > AttachmentFiledDownload(String endpoint, String parentId, String attachmentName) { |
| | | List<ContentDocumentLink> linkList = [ |
| | | select |
| | |
| | | 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); |
| | | } |
| | |
| | | link.Visibility = 'AllUsers'; |
| | | insert link; |
| | | } |
| | | |
| | | // 20231103 陈京武 Lightning文件修改 End |
| | | |
| | | |
| | | // system.debug('responseBody503--->'+bodyAsBlob); |