| | |
| | | // } |
| | | // } |
| | | List<ContentDocumentLink> attList = rAMap.get(rr.id); |
| | | |
| | | |
| | | if (attList != null && attList.size() > 0) { |
| | | List<Id> idList = new List<Id>(); |
| | | for(ContentDocumentLink rpd : attList){ |
| | | ContentVersion version = [ |
| | | idList.add(rpd.ContentDocumentId); |
| | | } |
| | | List<ContentVersion> version = [ |
| | | select |
| | | Title, |
| | | VersionData, |
| | | ContentSize |
| | | from ContentVersion where ContentDocumentId =: rpd.ContentDocumentId |
| | | from ContentVersion where ContentDocumentId in: idList |
| | | ]; |
| | | Integer i = 0; |
| | | for(ContentDocumentLink rpd : attList){ |
| | | //2020-11-05 如果附件大小超过1.5mb 发送邮件提示 |
| | | if (version.ContentSize > 1048576) { |
| | | sendemail(version,'修理'+rr.Name); |
| | | if (version[i].ContentSize > 1048576) { |
| | | sendemail(version[i],'修理'+rr.Name); |
| | | }else{ |
| | | Attachment_element Attachmentdet = new Attachment_element(); |
| | | RepairRequest.ATTACHMENT.add(Attachmentdet); |
| | | Attachmentdet.FILE_DATA = EncodingUtil.base64Encode(version.VersionData); |
| | | Attachmentdet.FILE_DATA = EncodingUtil.base64Encode(version[i].VersionData); |
| | | Attachmentdet.ATTACHMENT_FIELD_NAME = 'COMPLAINTS_DOCUMENT_ATTACHMENT'; |
| | | Attachmentdet.FILE_NAME = version.Title; |
| | | Attachmentdet.FILE_NAME = version[i].Title; |
| | | Attachmentdet.GLOBAL_ATTRIBUTE1 = 'COMPLAINT'; |
| | | Attachmentdet.RECORD_INSERTED_DATE = NFMUtil.formatDate2Str(Date.today()); |
| | | } |
| | | i++; |
| | | } |
| | | } |
| | | } |