| | |
| | | repair.Hospital__c = hospital.Id; |
| | | repair.Delivered_Product__c = asset.Id; |
| | | insert repair; |
| | | // Attachment att = new Attachment( |
| | | // Name = 'test', |
| | | // ParentId = repair.Id, |
| | | // Body = EncodingUtil.base64Decode('test') |
| | | // ); |
| | | ContentVersion version = new ContentVersion( |
| | | Title = 'test', |
| | | VersionData = EncodingUtil.base64Decode('test'), |
| | | ContentLocation = 's', |
| | | PathOnClient = 'test.txt' |
| | | Attachment att = new Attachment( |
| | | Name = 'test', |
| | | ParentId = repair.Id, |
| | | Body = EncodingUtil.base64Decode('test') |
| | | ); |
| | | insert version; |
| | | version = [select ContentDocumentId from ContentVersion where Id =: version.Id]; |
| | | ContentDocumentLink link = new ContentDocumentLink(); |
| | | link.ContentDocumentId = version.ContentDocumentId; |
| | | link.LinkedEntityId = repair.Id; |
| | | link.ShareType = 'I'; |
| | | link.Visibility = 'AllUsers'; |
| | | insert link; |
| | | |
| | | |
| | | } |
| | | // 覆盖率补充 |
| | |
| | | ofile.Oppor_File_Stage__c = 'G'; |
| | | insert ofile; |
| | | |
| | | ContentVersion version = new ContentVersion( |
| | | Title = 'test', |
| | | VersionData = EncodingUtil.base64Decode('test'), |
| | | ContentLocation = 's', |
| | | PathOnClient = 'test.txt' |
| | | Attachment att1 = new Attachment( |
| | | Name = 'test', |
| | | ParentId = ofile.Id, |
| | | Body = EncodingUtil.base64Decode('test') |
| | | ); |
| | | insert version; |
| | | version = [select ContentDocumentId from ContentVersion where Id =: version.Id]; |
| | | ContentDocumentLink link = new ContentDocumentLink(); |
| | | link.ContentDocumentId = version.ContentDocumentId; |
| | | link.LinkedEntityId = ofile.Id; |
| | | link.ShareType = 'I'; |
| | | link.Visibility = 'AllUsers'; |
| | | insert link; |
| | | |
| | | insert att1; |
| | | |
| | | delete ofile; |
| | | |