| | |
| | | |
| | | @testSetup |
| | | static void makeTestRepair() { |
| | | StaticParameter.EscapeQISTrigger = false; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | throw new ControllerUtil.myException('not found 病院 recodetype'); |
| | |
| | | System.runAs(new User(Id = Userinfo.getUserId())){ |
| | | insert rpr; |
| | | } |
| | | ContentVersion version = new ContentVersion(); |
| | | version.Title = '123'; |
| | | version.VersionData = EncodingUtil.base64Decode('test02'); |
| | | version.ContentLocation = 's'; |
| | | version.PathOnClient = '123.txt'; |
| | | insert version; |
| | | version = [select ContentDocumentId from ContentVersion where Id =: version.Id]; |
| | | ContentDocumentLink link = new ContentDocumentLink(); |
| | | link.ContentDocumentId = version.ContentDocumentId; |
| | | link.LinkedEntityId = rpr.Id; |
| | | link.ShareType = 'I'; |
| | | link.Visibility = 'AllUsers'; |
| | | insert link; |
| | | |
| | | Attachment att = new Attachment(); |
| | | att.ParentId = rpr.Id; |
| | | att.Name = 'test01'; |
| | | att.Body = EncodingUtil.base64Decode('test02'); |
| | | insert att; |
| | | // Attachment att = new Attachment(); |
| | | // att.ParentId = rpr.Id; |
| | | // att.Name = 'test01'; |
| | | // att.Body = EncodingUtil.base64Decode('test02'); |
| | | // insert att; |
| | | |
| | | |
| | | qis = new QIS_Report__c(); |
| | |
| | | qis.next_action__c = '无偿更换'; |
| | | insert qis; |
| | | |
| | | Attachment att1 = new Attachment(); |
| | | att1.ParentId = qis.Id; |
| | | att1.Name = 'test02'; |
| | | att1.Body = EncodingUtil.base64Decode('test02'); |
| | | insert att1; |
| | | // ContentVersion version1 = new ContentVersion(); |
| | | // version1.Title = '123'; |
| | | // version1.VersionData = EncodingUtil.base64Decode('test02'); |
| | | // version1.ContentLocation = 's'; |
| | | // version1.PathOnClient = '123.txt'; |
| | | // insert version1; |
| | | // version1 = [select ContentDocumentId from ContentVersion where Id =: version1.Id]; |
| | | // ContentDocumentLink link1 = new ContentDocumentLink(); |
| | | // link1.ContentDocumentId = version1.ContentDocumentId; |
| | | // link1.LinkedEntityId = qis.Id; |
| | | // link1.ShareType = 'I'; |
| | | // link1.Visibility = 'AllUsers'; |
| | | // insert link; |
| | | |
| | | // Attachment att1 = new Attachment(); |
| | | // att1.ParentId = qis.Id; |
| | | // att1.Name = 'test02'; |
| | | // att1.Body = EncodingUtil.base64Decode('test02'); |
| | | // insert att1; |
| | | |
| | | } |
| | | |