| | |
| | | // 2020/10/29 mzy 推广经理赋值 SFDC-BUF6LN add start |
| | | static testMethod void updateMngTest() { |
| | | // OPDPlanHandler.test(); |
| | | OPDPlan__c OPDPlan01 = new OPDPlan__c(); |
| | | OPDPlan01.Status__c = '提交'; |
| | | OPDPlan01.NoOpp_Reason__c= 'HCP对应'; |
| | | OPDPlan01.OPDType__c = '事件'; |
| | | insert OPDPlan01; |
| | | // OPDPlan__c OPDPlan01 = new OPDPlan__c(); |
| | | // OPDPlan01.Status__c = '提交'; |
| | | // OPDPlan01.NoOpp_Reason__c= 'HCP对应'; |
| | | // OPDPlan01.OPDType__c = '事件'; |
| | | // insert OPDPlan01; |
| | | |
| | | //用户 |
| | | // Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; |
| | | // User hpOwner = new User(Test_staff__c = true, LastName = 'hp1', FirstName = 'owner', Alias = 'hp', Work_Location__c = '北京', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); |
| | | // insert hpOwner; |
| | | // User hpOwner2 = new User(Test_staff__c = true, LastName = 'hp21', FirstName = 'owner', Alias = 'hp2', Work_Location__c = '重庆', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); |
| | | // insert hpOwner2; |
| | | |
| | | OPDPlan__c OPDPlan02 = new OPDPlan__c(); |
| | | OPDPlan02.Status__c = '草案中'; |
| | | OPDPlan02.NoOpp_Reason__c= 'HCP对应'; |
| | | OPDPlan02.OPDType__c = '询价'; |
| | | oPDPlan02.noReportStatus__c = '已保存'; |
| | | // oPDPlan02.SalesManager__c = hpOwner.id; |
| | | // oPDPlan02.BuchangApprovalManagerSales__c = hpOwner2.id; |
| | | insert OPDPlan02; |
| | | OPDPlan02.Status__c = '提交'; |
| | | oPDPlan02.noReportStatus__c = '提交'; |
| | | // update OPDPlan02; |
| | | |
| | | /** |
| | | OPDPlan__c OPDPlan03 = new OPDPlan__c(); |
| | | OPDPlan03.id = OPDPlan02.id; |
| | |
| | | oPDPlan4.OPD_Customers_Target__c =anot1.id; |
| | | oPDPlan4.PlanProdDetail__c ='CV-290*4; GI-290镜子*1; GI-290镜子CF*1;'; |
| | | oPDPlan4.OPDType__c = '学会'; |
| | | oPDPlan4.AttachmentCertificate__c = '0001.png'; |
| | | insert oPDPlan4; |
| | | |
| | | //取消 |
| | |
| | | tempCancelPostponePlan.Status__c = '取消成功'; |
| | | tempCancelPostponePlan.CancelOPDPlan__c = oPDPlan4.Id; |
| | | tempCancelPostponePlan.RecordTypeId = '01210000000gQyL'; |
| | | tempCancelPostponePlan.cancelReasonCombobox__c = '无备品'; |
| | | tempCancelPostponePlan.cancelReasonCombobox__c = '备品不足'; |
| | | insert tempCancelPostponePlan; |
| | | |
| | | |
| | |
| | | oPDPlan5.OPD_Customers_Target__c =anot1.id; |
| | | oPDPlan5.PlanProdDetail__c ='CV-290*4; GI-290镜子*1; GI-290镜子CF*1;'; |
| | | oPDPlan5.OriginalOpdPlan__c = oPDPlan4.Id; |
| | | |
| | | // oPDPlan5.OriginalOpdPlan__c = 'a3E10000000S7pdEAC'; |
| | | oPDPlan5.OPDType__c = '学会'; |
| | | |
| | | |
| | | ContentVersion version = new ContentVersion( |
| | | Title = 'A-65224941-20200923--1.docx', |
| | | VersionData = EncodingUtil.base64Decode('test'), |
| | | ContentLocation = 's', |
| | | PathOnClient = 'test.txt' |
| | | ); |
| | | insert version; |
| | | version = [select ContentDocumentId from ContentVersion where Id =: version.Id]; |
| | | ContentDocumentLink link = new ContentDocumentLink(); |
| | | link.ContentDocumentId = version.ContentDocumentId; |
| | | link.LinkedEntityId = oPDPlan4.Id; |
| | | link.ShareType = 'V'; |
| | | link.Visibility = 'AllUsers'; |
| | | insert link; |
| | | |
| | | |
| | | |
| | | |
| | | insert oPDPlan5; |
| | | |
| | | // OriginalOpdPlan__c = 'a3E10000000S7pdEAC'; |
| | | |
| | | |
| | | |
| | |
| | | insert insertTarget; |
| | | |
| | | OPDPlan__C opd = [SELECT Id,OPDPlan_ImplementDate__c FROM OPDPlan__C WHERE id =: oPDPlan0.Id]; |
| | | |
| | | |
| | | opd.OPDPlan_ImplementDate__c = opd.OPDPlan_ImplementDate__c.addDays(5); |
| | | |
| | |
| | | |
| | | update opd; |
| | | |
| | | |
| | | |
| | | oPDPlan0.Status__c = '完毕'; |
| | | update oPDPlan0; |
| | | |
| | | |
| | | |
| | | // OPDPlan__c oPDPlanTestDoc = new OPDPlan__c(); |
| | | // oPDPlanTestDoc.Status__c = '审批中'; |
| | | // oPDPlanTestDoc.OPDType__c = '事件'; |
| | | // oPDPlanTestDoc.PlanProdDetail__c ='CV-290*4; GI-290镜子*1; GI-290镜子CF*1;'; |
| | | // oPDPlanTestDoc.Account_Laboratory__c =dep.Id; |
| | | // oPDPlanTestDoc.OPDPlan_ImplementDate__c = Date.today(); |
| | | // oPDPlanTestDoc.OPDPlan_ImplementDate_temp__c = Date.today(); |
| | | // oPDPlanTestDoc.NoOpp_Reason__c = 'HCP对应'; |
| | | // oPDPlanTestDoc.RentalReson__c = '无法进入手术室'; |
| | | // oPDPlanTestDoc.AttachmentCertificate__c = '0001.png'; |
| | | // oPDPlanTestDoc.Task_ID__c = task.Id; |
| | | // oPDPlanTestDoc.OriginalOpdPlan__c = 'a3E10000000S7pdEAC'; |
| | | // insert oPDPlanTestDoc; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | //2021-06-26 mzy end |