| | |
| | | contact2.LastName = 'test2医院'; |
| | | insert contact2; |
| | | // ユーザー |
| | | Profile p = [select Id from Profile where Name = '901_经销商活动系统']; |
| | | User user = new User(); |
| | | user.ProfileId = p.Id; |
| | | user.ContactId = contact2.Id; |
| | | user.FirstName = 'ユーザー'; |
| | | user.LastName = 'テスト'; |
| | | user.Email = 'test_user@example.com'; |
| | | user.emailencodingkey='UTF-8'; |
| | | user.languagelocalekey='zh_CN'; |
| | | user.localesidkey='ja_JP'; |
| | | user.timezonesidkey='Asia/Shanghai'; |
| | | user.Username = 'test_user@example.com'; |
| | | user.Alias = 'テユ'; |
| | | user.CommunityNickname = 'テストユーザー'; |
| | | insert user; |
| | | // Profile p = [select Id from Profile where Name = '901_经销商活动系统']; |
| | | // User user = new User(); |
| | | // user.ProfileId = p.Id; |
| | | // user.ContactId = contact2.Id; |
| | | // user.FirstName = 'ユーザー'; |
| | | // user.LastName = 'テスト'; |
| | | // user.Email = 'test_user@example.com'; |
| | | // user.emailencodingkey='UTF-8'; |
| | | // user.languagelocalekey='zh_CN'; |
| | | // user.localesidkey='ja_JP'; |
| | | // user.timezonesidkey='Asia/Shanghai'; |
| | | // user.Username = 'test_user@example.com'; |
| | | // user.Alias = 'テユ'; |
| | | // user.CommunityNickname = 'テストユーザー'; |
| | | // insert user; |
| | | |
| | | // 代理店医院 |
| | | Agency_Hospital_Link__c agency_hospital_link = new Agency_Hospital_Link__c(); |
| | | agency_hospital_link.Name = 'test1代理店医院'; |
| | | agency_hospital_link.Hospital__c = account1.Id; |
| | | agency_hospital_link.Agency__c = account2.Id; |
| | | agency_hospital_link.OwnerId = user.Id; |
| | | insert agency_hospital_link; |
| | | // // 代理店医院 |
| | | // Agency_Hospital_Link__c agency_hospital_link = new Agency_Hospital_Link__c(); |
| | | // agency_hospital_link.Name = 'test1代理店医院'; |
| | | // agency_hospital_link.Hospital__c = account1.Id; |
| | | // agency_hospital_link.Agency__c = account2.Id; |
| | | // agency_hospital_link.OwnerId = user.Id; |
| | | // insert agency_hospital_link; |
| | | |
| | | |
| | | Agency_Contact__c ac1 = new Agency_Contact__c(); |
| | | ac1.Name = 'test1のび太'; |
| | | ac1.Agency_Hospital__c = agency_hospital_link.Id; |
| | | insert ac1; |
| | | // Agency_Contact__c ac1 = new Agency_Contact__c(); |
| | | // ac1.Name = 'test1のび太'; |
| | | // ac1.Agency_Hospital__c = agency_hospital_link.Id; |
| | | // insert ac1; |
| | | |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | |
| | | test.Department__c = depart1.Id; |
| | | test.Management_Code__c = 'BJ-RS-BJ0062233'; |
| | | test.Status__c = '询价中'; |
| | | test.Service_Contract_Staff__c = user.Id; |
| | | test.Service_Contract_Staff__c = UserInfo.getUserId(); |
| | | insert test; |
| | | |
| | | |