| | |
| | | private static String accDepId {get; set;} |
| | | private static String accDepName {get; set;} |
| | | |
| | | @testSetup |
| | | static void setUp(){ |
| | | |
| | | TestDataUtility.CreatePIPolicyConfigurations( new string[]{'Contact'}); |
| | | } |
| | | |
| | | /** |
| | | * 初期処理. |
| | | */ |
| | | @TestSetup |
| | | private static void init() { |
| | | NFM001Controller.isRunning = false; |
| | | loginId = UserInfo.getUserId(); |
| | | id pid = UserInfo.getProfileId(); |
| | | // id pid = System.Label.ProfileId_2S1; |
| | | //Profile p = [select id from Profile where id = :System.Label.ProfileId_SystemAdmin]; |
| | | System.Test.startTest(); |
| | | u3 = new User(Test_staff__c = true); |
| | | u3.LastName = '_サンブリッジ'; |
| | | u3.Batch_User__c = true; |
| | |
| | | |
| | | //Address_Level__c al = [select id from Address_Level__c where Level1_Code__c =:'CN-01']; |
| | | //Address_Level2__c al2 = [select id from Address_Level2__c where Name =:'延庆县']; |
| | | system.runAs(u2) { |
| | | system.runAs(u1) { |
| | | List<String> strList = new List<String>(); |
| | | strList.add('Contact'); |
| | | strList.add('Agency_Contact__c'); |
| | | TestDataUtility.CreatePIPolicyConfigurations(strList); |
| | | Address_Level__c al = new Address_Level__c(); |
| | | al.Name = '東京'; |
| | | al.Level1_Code__c = 'CN-99'; |
| | |
| | | conList.add(con4); |
| | | conList.add(con5); |
| | | insert conList; |
| | | System.Test.stopTest(); |
| | | List<Opportunity> oppList = new List<Opportunity>(); |
| | | opp1 = new Opportunity(); |
| | | opp1.Name = '引合1'; |
| | |
| | | System.debug('opp1.Name:' + opp1.Name); |
| | | |
| | | accompanying_report__c ar = new accompanying_report__c(); |
| | | ar.Name = 'システム管理者'; |
| | | ar.Name = '管理者'; |
| | | ar.Profile_ID_1__c = pid; |
| | | //Database.insert(ar, false); |
| | | insert ar; |
| | | |
| | | report_report__c rr = new report_report__c(); |
| | | rr.Name = 'システム管理者'; |
| | | rr.Name = '管理者'; |
| | | rr.Profile_ID_1__c = pid; |
| | | //Database.insert(rr, false); |
| | | insert rr; |
| | | |
| | | Daily_Report__c dr = new Daily_Report__c(); |
| | | dr.Reported_Date__c = date.today(); |
| | | dr.Reported_Date__c = Date.today(); |
| | | dr.Reporter__c = u1.id; |
| | | dr.OwnerId = u1.Id; |
| | | insert dr; |
| | | List<Maintenance_Contract__c> mcList = new List<Maintenance_Contract__c>(); |
| | | mc1 = new Maintenance_Contract__c(); |
| | | mc1.Name = 'サービス契約1'; |
| | | mc1.Status__c = '引合中'; |
| | | mc1.Hospital__c = accHP.id; |
| | | mc1.Department_Class__c = accDepClass.id; |
| | | mc1.Department__c = accDep.Id; |
| | | mc1.CurrencyIsoCode = 'CNY'; |
| | | insert mc1; |
| | | mc2 = new Maintenance_Contract__c(); |
| | | mc2.Name = 'サービス契約2'; |
| | | mc2.Status__c = '引合中'; |
| | | mc2.Hospital__c = accHP.id; |
| | | mc2.Department_Class__c = accDepClass.id; |
| | | mc2.Department__c = accDep.Id; |
| | | mc2.CurrencyIsoCode = 'CNY'; |
| | | insert mc2; |
| | | } |
| | | } |
| | | @isTest |
| | | static void testMethod1(){ |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | t.getDailyReport(); |
| | | } |
| | | @isTest |
| | | static void testMethod2(){ |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user){ |
| | | Daily_Report__c report = [select Id from Daily_Report__c limit 1]; |
| | | Pagereference page = new Pagereference('/apex/XinDailyReport?id=' + report.Id); |
| | | System.Test.setCurrentPage(page); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | t.report.Reported_Date__c = date.today(); |
| | | t.repoStartHourText = ''; |
| | | t.repoStartMinuteText = ''; |
| | | t.repoEndHourText = ''; |
| | | t.repoEndMinuteText = ''; |
| | | t.report.Status__c = null; |
| | | t.activities.get(0).act.Companion__c = 'a'; |
| | | t.activities.get(0).act.nextPlanDate__c = date.today(); |
| | | t.activities.get(0).actStartHourText = '9'; |
| | | t.activities.get(0).planStartHourText = '9'; |
| | | t.upsertActIndex = null; |
| | | t.save(); |
| | | } |
| | | } |
| | | |
| | | private static void init2() { |
| | | List<Maintenance_Contract__c> mcList = new List<Maintenance_Contract__c>(); |
| | | mc1 = new Maintenance_Contract__c(); |
| | | mc1.Name = 'サービス契約1'; |
| | | mc1.Status__c = '引合中'; |
| | | mc1.Hospital__c = accHP.id; |
| | | mc1.Department_Class__c = accDepClass.id; |
| | | mc1.Department__c = accDep.Id; |
| | | mc1.CurrencyIsoCode = 'CNY'; |
| | | mc2 = new Maintenance_Contract__c(); |
| | | mc2.Name = 'サービス契約2'; |
| | | mc2.Status__c = '引合中'; |
| | | mc2.Hospital__c = accHP.id; |
| | | mc2.Department_Class__c = accDepClass.id; |
| | | mc2.Department__c = accDep.Id; |
| | | mc2.CurrencyIsoCode = 'CNY'; |
| | | mcList.add(mc1); |
| | | mcList.add(mc2); |
| | | insert mcList; |
| | | @isTest |
| | | static void testMethod2_01(){ |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user){ |
| | | System.Test.startTest(); |
| | | Daily_Report__c report = [select Id from Daily_Report__c limit 1]; |
| | | Pagereference page = new Pagereference('/apex/XinDailyReport?id=' + report.Id); |
| | | System.Test.setCurrentPage(page); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | Event__c ec = new Event__c( |
| | | Subject__c = 'test', |
| | | StartDateTime__c = Datetime.newInstance(2016, 1, 1, 1, 0, 0), |
| | | DurationInMinutes__c = 60, |
| | | EndDateTime__c = Datetime.newInstance(2016, 1, 1, 2, 0, 0), |
| | | ActivityDate__c = Date.today(), |
| | | Daily_Report__c = report.Id |
| | | ); |
| | | insert ec; |
| | | Event e = new Event(); |
| | | e.WS_flg__c = false; |
| | | e.ActivityDate = date.today(); |
| | | e.OwnerId = UserInfo.getUserId(); |
| | | e.StartDateTime = date.today(); |
| | | e.DurationInMinutes = 0; |
| | | e.EventStatus__c = '02 接受'; |
| | | e.NextEventC_ID__c = ec.Id; |
| | | insert e; |
| | | t.init(); |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | t.report.Reported_Date__c = date.today(); |
| | | t.repoStartHourText = ''; |
| | | t.repoStartMinuteText = ''; |
| | | t.repoEndHourText = ''; |
| | | t.repoEndMinuteText = ''; |
| | | t.report.Status__c = null; |
| | | t.activities.get(0).act.Companion__c = 'a'; |
| | | t.activities.get(0).act.nextPlanDate__c = date.today(); |
| | | t.activities.get(0).actStartHourText = '9'; |
| | | t.activities.get(0).planStartHourText = '9'; |
| | | t.upsertActIndex = null; |
| | | t.save(); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | @isTest |
| | | static void test01_01() { |
| | | // ControllerUtil.EscapeNFM001Trigger = true; |
| | | // init(); |
| | | static void testMethod3(){ |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | Daily_Report__c report = [select Id from Daily_Report__c limit 1]; |
| | | List<Opportunity> opplist = [select Name from Opportunity]; |
| | | List<Maintenance_Contract__c> mcList = [select Name from Maintenance_Contract__c]; |
| | | System.runAs(user){ |
| | | Pagereference page = new Pagereference('/apex/XinDailyReport?id=' + report.Id); |
| | | System.Test.setCurrentPage(page); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.report.Reporter__c = UserInfo.getUserId(); |
| | | t.report.Reported_Date__c = date.today(); |
| | | t.repoStartHourText = '9'; |
| | | t.repoStartMinuteText = '00'; |
| | | t.repoEndHourText = '18'; |
| | | t.repoEndMinuteText = '00'; |
| | | t.report.Status__c = '申請中'; |
| | | t.activities.get(0).actStartHourText = '9'; |
| | | t.activities.get(0).actStartMinuteText = '00'; |
| | | t.activities.get(0).actEndHourText = '18'; |
| | | t.activities.get(0).actEndMinuteText = '00'; |
| | | t.activities.get(0).act.nextPlanDate__c = date.today().addDays(10); |
| | | t.activities.get(0).act.Activity_Type2__c = '社内活動'; |
| | | t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1test'; |
| | | t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(0).act.Description__c = '結果'; |
| | | t.activities.get(0).act.whatid__c = accDepId; |
| | | t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = null; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = null; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = null; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = null; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = null; |
| | | t.activities.get(0).act.eventStatus__c = '分配'; |
| | | t.activities.get(0).act.Related_Opportunity1__c = opplist[0].Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = opplist[1].Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = opplist[2].Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = opplist[3].Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = opplist[4].Name + 'test'; |
| | | t.activities.get(0).act.Related_Service1__c = mcList[0].Name + 'test'; |
| | | t.activities.get(0).act.Related_Service2__c = mcList[1].Name + 'test'; |
| | | t.activities.get(0).planStartHourText = '9'; |
| | | t.activities.get(0).planStartMinuteText = '00'; |
| | | t.activities.get(0).planEndHourText = '18'; |
| | | t.activities.get(0).planEndMinuteText = '00'; |
| | | t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // System.runAs(u1) { |
| | | // //System.Test.startTest(); |
| | | // init2(); |
| | | // //System.Test.stopTest(); |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // t.getDailyReport(); |
| | | // //t.getEvent(); |
| | | // t.report.Reporter__c = u1.id; |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // t.report.Reported_Date__c = date.today(); |
| | | // t.repoStartHourText = ''; |
| | | // t.repoStartMinuteText = ''; |
| | | // t.repoEndHourText = ''; |
| | | // t.repoEndMinuteText = ''; |
| | | // t.report.Status__c = null; |
| | | // t.activities.get(0).act.Companion__c = 'a'; |
| | | // t.activities.get(0).act.nextPlanDate__c = date.today(); |
| | | // t.activities.get(0).actStartHourText = '9'; |
| | | // t.activities.get(0).planStartHourText = '9'; |
| | | // t.upsertActIndex = null; |
| | | // t.save(); |
| | | |
| | | // t.report.Reported_Date__c = date.today(); |
| | | // t.repoStartHourText = '24'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '25'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.activities.get(0).actStartHourText = '24'; |
| | | // t.activities.get(0).actStartMinuteText = '00'; |
| | | // t.activities.get(0).actEndHourText = '25'; |
| | | // t.activities.get(0).actEndMinuteText = '00'; |
| | | // t.activities.get(0).act.nextPlanDate__c = date.today(); |
| | | // t.activities.get(0).planStartHourText = '24'; |
| | | // t.activities.get(0).planStartMinuteText = '00'; |
| | | // t.activities.get(0).planEndHourText = '25'; |
| | | // t.activities.get(0).planEndMinuteText = '00'; |
| | | // t.save(); |
| | | |
| | | // t.report.Reported_Date__c = date.today(); |
| | | // t.repoStartHourText = '9'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '8'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.activities.get(0).actStartHourText = '9'; |
| | | // t.activities.get(0).actStartMinuteText = '00'; |
| | | // t.activities.get(0).actEndHourText = '8'; |
| | | // t.activities.get(0).actEndMinuteText = '00'; |
| | | // t.activities.get(0).act.nextPlanDate__c = null; |
| | | // t.activities.get(0).planStartHourText = '9'; |
| | | // t.activities.get(0).planStartMinuteText = '00'; |
| | | // t.activities.get(0).planEndHourText = '8'; |
| | | // t.activities.get(0).planEndMinuteText = '00'; |
| | | // t.save(); |
| | | |
| | | // t.report.Reported_Date__c = date.today(); |
| | | // t.repoStartHourText = 'a'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '8'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.activities.get(0).actStartHourText = 'a'; |
| | | // t.activities.get(0).actStartMinuteText = '00'; |
| | | // t.activities.get(0).actEndHourText = '8'; |
| | | // t.activities.get(0).actEndMinuteText = '00'; |
| | | // t.activities.get(0).act.nextPlanDate__c = null; |
| | | // t.activities.get(0).planStartHourText = 'a'; |
| | | // t.activities.get(0).planStartMinuteText = '00'; |
| | | // t.activities.get(0).planEndHourText = '8'; |
| | | // t.activities.get(0).planEndMinuteText = '00'; |
| | | // t.save(); |
| | | // t.cancelRequest(); |
| | | |
| | | // //2021-07-14 mzy add |
| | | // Address_Level__c al = new Address_Level__c(); |
| | | // al.Name = '東京'; |
| | | // al.Level1_Code__c = 'CN-99'; |
| | | // al.Level1_Sys_No__c = '999999'; |
| | | // insert al; |
| | | |
| | | // Address_Level2__c al2 = new Address_Level2__c(); |
| | | // al2.Level1_Code__c = 'CN-99'; |
| | | // al2.Level1_Sys_No__c = '999999'; |
| | | // al2.Level1_Name__c = '東京'; |
| | | // al2.Name = '渋谷区'; |
| | | // al2.Level2_Code__c = 'CN-9999'; |
| | | // al2.Level2_Sys_No__c = '9999999'; |
| | | // al2.Address_Level__c = al.id; |
| | | // insert al2; |
| | | // Account acHP = new Account(); |
| | | // acHP.Name = '病院1'; |
| | | // acHP.Grade__c = '一般'; |
| | | // acHP.OCM_Category__c = '一般'; |
| | | // acHP.Attribute_Type__c = '保険省'; |
| | | // acHP.Speciality_Type__c = '総合病院'; |
| | | // acHP.Is_Active__c = '有効'; |
| | | // acHP.State_Master__c = al.id; |
| | | // acHP.City_Master__c = al2.id; |
| | | // acHP.RecordTypeId = '01210000000QemG'; |
| | | // acHP.Valid_To__c = Date.today() + 2; |
| | | // acHP.FSE_GI_Main_Leader__c = UserInfo.getUserId(); |
| | | // acHP.FSE_SP_Main_Leader__c = UserInfo.getUserId(); |
| | | // insert acHP; |
| | | // XinDailyReportController.testI(); |
| | | // XinDailyReportController.testY(); |
| | | // Xin_Maintenance_Contract blgmc = new Xin_Maintenance_Contract(); |
| | | // PageReference pageRef6 = Page.Xin_SearchMaintenanceContract; |
| | | // pageRef6.getParameters().put('q', '契約'); |
| | | // pageRef6.getParameters().put('r', ''); |
| | | // Test.setCurrentPage(pageRef6); |
| | | // blgmc.search(); |
| | | // //2021-07-14 mzy add |
| | | // } |
| | | XinDailyReportController.testI(); |
| | | XinDailyReportController.testY(); |
| | | |
| | | |
| | | Test.startTest(); |
| | | t.save(); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | static void test01_02() { |
| | | init(); |
| | | |
| | | System.runAs(u1) { |
| | | @isTest |
| | | static void testMethod4(){ |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user){ |
| | | Test.startTest(); |
| | | Account account = [select Id,Name from Account where Department_Name__c = '診療科1']; |
| | | List<Contact> conList = [select Id from Contact]; |
| | | List<Opportunity> opplist = [select Id from Opportunity]; |
| | | List<Maintenance_Contract__c> mcList = [select Id,Name from Maintenance_Contract__c]; |
| | | Daily_Report__c report = [select Id from Daily_Report__c limit 1]; |
| | | Pagereference page = new Pagereference('/apex/XinDailyReport?id=' + report.Id); |
| | | System.Test.setCurrentPage(page); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.activities.get(0).act.Location__c = account.Name; |
| | | t.activities.get(0).act.whatid__c = account.Id; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = conList[0].Id; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = conList[1].Id; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = conList[2].Id; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = conList[3].Id; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = conList[4].Id; |
| | | t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | t.activities.get(0).act.Related_Opportunity1_ID__c = opplist[0].Id; |
| | | t.activities.get(0).act.Related_Opportunity2_ID__c = opplist[1].Id; |
| | | t.activities.get(0).act.Related_Opportunity3_ID__c = opplist[2].Id; |
| | | t.activities.get(0).act.Related_Opportunity4_ID__c = opplist[3].Id; |
| | | t.activities.get(0).act.Related_Opportunity5_ID__c = opplist[4].Id; |
| | | t.activities.get(0).act.Related_Service1__c = mcList[0].Name; |
| | | t.activities.get(0).act.Related_Service2__c = mcList[1].Name; |
| | | t.activities.get(0).act.Related_Service1_ID__c = mcList[0].Id; |
| | | t.activities.get(0).act.Related_Service2_ID__c = mcList[1].Id; |
| | | t.upsertActIndex = '0'; |
| | | t.save(); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | // @isTest |
| | | // static void testMethod5(){ |
| | | // User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | // System.runAs(user){ |
| | | // Test.startTest(); |
| | | // XinDailyReportControllerTest.settTestData(); |
| | | // Event__c |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // Event e = new Event( |
| | | // OwnerId = ec.Reporter__c, |
| | | // Subject = (ec.Subject__c==null||ec.Subject__c=='')?ec.Activity_Purpose__c:ec.Subject__c, |
| | | // IsAllDayEvent = false, |
| | | // ActivityDateTime = ec.StartDateTime__c, |
| | | // StartDateTime = ec.StartDateTime__c, |
| | | // EndDateTime = ec.EndDateTime__c, |
| | | // DurationInMinutes = Integer.valueOf((ec.EndDateTime__c.getTime() - ec.StartDateTime__c.getTime()) / 1000 / 60), |
| | | // Main_Visit_Location__c = ec.Main_Visit_Location__c, |
| | | // Activity_Type2__c = ec.Activity_Type2__c, |
| | | // Purpose_Type__c = ec.Purpose_Type__c, |
| | | // Purpose_TypeFSE__c = ec.Purpose_TypeFSE__c, |
| | | // Purpose_TypeEscFSE__c = ec.Purpose_TypeEscFSE__c, |
| | | // Location = String.isBlank(ec.Location__c) ? ec.Visitor_Place_Free__c : ec.Location__c, |
| | | // Related_Opportunity1__c = ec.Related_Opportunity1__c, |
| | | // Related_Opportunity1_ID__c = ec.Related_Opportunity1_ID__c, |
| | | // Related_Opportunity2__c = ec.Related_Opportunity2__c, |
| | | // Related_Opportunity2_ID__c = ec.Related_Opportunity2_ID__c, |
| | | // Related_Opportunity3__c = ec.Related_Opportunity3__c, |
| | | // Related_Opportunity3_ID__c = ec.Related_Opportunity3_ID__c, |
| | | // Related_Opportunity4__c = ec.Related_Opportunity4__c, |
| | | // Related_Opportunity4_ID__c = ec.Related_Opportunity4_ID__c, |
| | | // Related_Opportunity5__c = ec.Related_Opportunity5__c, |
| | | // Related_Opportunity5_ID__c = ec.Related_Opportunity5_ID__c, |
| | | // Related_Service1__c = ec.Related_Service1__c, |
| | | // Related_Service1_ID__c = ec.Related_Service1_ID__c, |
| | | // Visitor1__c = ec.Visitor1__c, |
| | | // Visitor2__c = ec.Visitor2__c, |
| | | // Visitor3__c = ec.Visitor3__c, |
| | | // Visitor4__c = ec.Visitor4__c, |
| | | // Visitor5__c = ec.Visitor5__c, |
| | | // Visitor1_ID__c = ec.Visitor1_ID__c, |
| | | // Visitor2_ID__c = ec.Visitor2_ID__c, |
| | | // Visitor3_ID__c = ec.Visitor3_ID__c, |
| | | // Visitor4_ID__c = ec.Visitor4_ID__c, |
| | | // Visitor5_ID__c = ec.Visitor5_ID__c, |
| | | // Activity_Purpose__c = ec.Activity_Purpose__c, |
| | | // Activity_PurposeFSE__c = ec.Activity_PurposeFSE__c, |
| | | // Activity_PurposeEscFSE__c = ec.Activity_PurposeEscFSE__c, |
| | | // whatid__c = ec.whatid__c, |
| | | // EventC_ID__c = ec.Id, |
| | | // IsScheduled__c = ec.IsScheduled__c, |
| | | // WhatId = ec.Daily_Report__c, |
| | | // BeforeActivityDate__c = ec.BeforeActivityDate__c, |
| | | // AppCdId__c = ec.AppCdId__c, |
| | | // SyncCreatedDate__c = ec.SyncCreatedDate__c, |
| | | // WS_flg__c = false, |
| | | // EventStatus__c = '02 接受' |
| | | // ); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | @isTest |
| | | static void test01_03() { |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user) { |
| | | Test.startTest(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.save(); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | @isTest |
| | | static void test01_02() { |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user) { |
| | | Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = con1.Id; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = con2.Id; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = con3.Id; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = con4.Id; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = con5.Id; |
| | | t.init(); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | @isTest |
| | | static void test01_04() { |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user) { |
| | | Test.startTest(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.addActivity(); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | // @isTest |
| | | // static void test01_05() { |
| | | // User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | // System.runAs(user) { |
| | | // Test.startTest(); |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // t.calcelActivity(); |
| | | // Test.stopTest(); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | @isTest |
| | | static void test01_06() { |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user) { |
| | | Test.startTest(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.cancelRequest(); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @isTest |
| | | static void test01_07() { |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user) { |
| | | Test.startTest(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.cancelRequest(); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | @isTest |
| | | static void test01_03_01() { |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user) { |
| | | System.Test.startTest(); |
| | | Account account = [select Id,Name from Account where Department_Name__c = '診療科1']; |
| | | List<Contact> conList = [select Id from Contact]; |
| | | List<Opportunity> opplist = [select Id,Name from Opportunity]; |
| | | List<Maintenance_Contract__c> mcList = [select Id,Name from Maintenance_Contract__c]; |
| | | Daily_Report__c report = [select Id from Daily_Report__c limit 1]; |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | // t.getEvent(); |
| | | t.report.Reporter__c = user.id; |
| | | |
| | | t.report.Reported_Date__c = date.today(); |
| | | t.repoStartHourText = '9'; |
| | | t.repoStartMinuteText = '00'; |
| | | t.repoEndHourText = '18'; |
| | | t.repoEndMinuteText = '00'; |
| | | t.report.Status__c = '申請中'; |
| | | t.activities.get(0).actStartHourText = '9'; |
| | | t.activities.get(0).actStartMinuteText = '00'; |
| | | t.activities.get(0).actEndHourText = '18'; |
| | | t.activities.get(0).actEndMinuteText = '00'; |
| | | t.activities.get(0).act.nextPlanDate__c = date.today(); |
| | | t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1test'; |
| | | t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(0).act.Description__c = '結果'; |
| | | t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = null; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = null; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = null; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = null; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = null; |
| | | t.activities.get(0).act.Related_Opportunity1__c = opplist[0].Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = opplist[1].Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = opplist[2].Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = opplist[3].Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = opplist[4].Name + 'test'; |
| | | t.activities.get(0).act.Related_Service1__c = mcList[0].Name + 'test'; |
| | | t.activities.get(0).act.Related_Service2__c = mcList[1].Name + 'test'; |
| | | t.activities.get(0).planStartHourText = '9'; |
| | | t.activities.get(0).planStartMinuteText = '00'; |
| | | t.activities.get(0).planEndHourText = '18'; |
| | | t.activities.get(0).planEndMinuteText = '00'; |
| | | t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | t.save(); |
| | | |
| | | t.activities.get(0).act.Location__c = account.Name; |
| | | t.activities.get(0).act.whatid__c = account.Id; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = conList[0].Id; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = conList[1].Id; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = conList[2].Id; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = conList[3].Id; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = conList[4].Id; |
| | | t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | t.activities.get(0).act.Related_Opportunity1_ID__c = opplist[0].Id; |
| | | t.activities.get(0).act.Related_Opportunity2_ID__c = opplist[1].Id; |
| | | t.activities.get(0).act.Related_Opportunity3_ID__c = opplist[2].Id; |
| | | t.activities.get(0).act.Related_Opportunity4_ID__c = opplist[3].Id; |
| | | t.activities.get(0).act.Related_Opportunity5_ID__c = opplist[4].Id; |
| | | t.activities.get(0).act.Related_Service1__c = mcList[0].Name; |
| | | t.activities.get(0).act.Related_Service2__c = mcList[1].Name; |
| | | t.activities.get(0).act.Related_Service1_ID__c = mcList[0].Id; |
| | | t.activities.get(0).act.Related_Service2_ID__c = mcList[1].Id; |
| | | t.upsertActIndex = '0'; |
| | | t.save(); |
| | | Date d = date.today(); |
| | | String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | Datetime dt = datetime.now(); |
| | | String strDatetime = '2000/01/01 10:10'; |
| | | System.debug('strDatetime' + strDatetime); |
| | | System.debug('t.activities.get(0).act.id:::::' + t.activities.get(0).act.id); |
| | | // String pdId = Add_Report.addReportPr(user.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Product_Explanation', account.Id, conList[0].id, conList[1].id, conList[2].id, conList[3].id, conList[4].id, '結果', strDate); |
| | | // if (pdId != 'false') t.activities.get(0).act.Product_Description_Id__c = pdId; |
| | | // t.save(); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | @isTest |
| | | static void test01_04_01() { |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user) { |
| | | System.Test.startTest(); |
| | | Account account = [select Id,Name from Account where Department_Name__c = '診療科1']; |
| | | List<Contact> conList = [select Id from Contact]; |
| | | List<Opportunity> opplist = [select Id,Name from Opportunity]; |
| | | List<Maintenance_Contract__c> mcList = [select Id,Name from Maintenance_Contract__c]; |
| | | Daily_Report__c report = [select Id from Daily_Report__c limit 1]; |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | // t.getEvent(); |
| | | // t.report.Reporter__c = u1.id; |
| | | |
| | | t.report.Reported_Date__c = date.today(); |
| | | t.repoStartHourText = '9'; |
| | | t.repoStartMinuteText = '00'; |
| | | t.repoEndHourText = '18'; |
| | | t.repoEndMinuteText = '00'; |
| | | t.report.Status__c = '申請中'; |
| | | t.activities.get(0).actStartHourText = '9'; |
| | | t.activities.get(0).actStartMinuteText = '00'; |
| | | t.activities.get(0).actEndHourText = '18'; |
| | | t.activities.get(0).actEndMinuteText = '00'; |
| | | t.activities.get(0).act.nextPlanDate__c = date.today(); |
| | | t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1test'; |
| | | t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(0).act.Description__c = '結果'; |
| | | t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = null; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = null; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = null; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = null; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = null; |
| | | t.activities.get(0).act.Related_Opportunity1__c = opplist[0].Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = opplist[1].Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = opplist[2].Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = opplist[3].Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = opplist[4].Name + 'test'; |
| | | t.activities.get(0).act.Related_Service1__c = mcList[0].Name + 'test'; |
| | | t.activities.get(0).act.Related_Service2__c = mcList[1].Name + 'test'; |
| | | t.activities.get(0).planStartHourText = '9'; |
| | | t.activities.get(0).planStartMinuteText = '00'; |
| | | t.activities.get(0).planEndHourText = '18'; |
| | | t.activities.get(0).planEndMinuteText = '00'; |
| | | t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | t.save(); |
| | | |
| | | t.activities.get(0).act.eventStatus__c = '分配'; |
| | | t.activities.get(0).act.ETAPPAct__c = false; |
| | | t.activities.get(0).act.Activity_PurposeFSE__c = 'ET APP活动'; |
| | | t.activities.get(0).act.Location__c = account.Name; |
| | | t.activities.get(0).act.whatid__c = account.Id; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = conList[0].id; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = conList[1].id; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = conList[2].id; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = conList[3].id; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = conList[4].id; |
| | | t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | t.activities.get(0).act.Related_Opportunity1_ID__c = opplist[0].Id; |
| | | t.activities.get(0).act.Related_Opportunity2_ID__c = opplist[1].Id; |
| | | t.activities.get(0).act.Related_Opportunity3_ID__c = opplist[2].Id; |
| | | t.activities.get(0).act.Related_Opportunity4_ID__c = opplist[3].Id; |
| | | t.activities.get(0).act.Related_Opportunity5_ID__c = opplist[4].Id; |
| | | t.activities.get(0).act.Related_Service1__c = mcList[0].Name; |
| | | t.activities.get(0).act.Related_Service2__c = mcList[1].Name; |
| | | t.activities.get(0).act.Related_Service1_ID__c = mcList[0].Id; |
| | | t.activities.get(0).act.Related_Service2_ID__c = mcList[1].Id; |
| | | t.upsertActIndex = '0'; |
| | | t.save(); |
| | | // Date d = date.today(); |
| | | // String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | // Datetime dt = datetime.now(); |
| | | // String strDatetime = '2000/01/01 10:10'; |
| | | // System.debug('strDatetime' + strDatetime); |
| | | // System.debug('t.activities.get(0).act.id:::::' + t.activities.get(0).act.id); |
| | | // String pdId = Add_Report.addReportPr(user.id, t.activities.get(0).act.Product_Description_Id__c, t.report.id, t.activities.get(0).act.id, 'Product_Explanation', account.Id, conList[0].id, conList[1].id, conList[2].id, conList[3].id, conList[4].id, '結果', strDate); |
| | | // if (pdId != 'false') t.activities.get(0).act.Product_Description_Id__c = pdId; |
| | | // t.save(); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | static void test01_05_01() { |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | |
| | | System.runAs(user) { |
| | | System.Test.startTest(); |
| | | Account account = [select Id,Name from Account where Department_Name__c = '診療科1']; |
| | | List<Contact> conList = [select Id from Contact]; |
| | | List<Opportunity> opplist = [select Id,Name from Opportunity]; |
| | | List<Maintenance_Contract__c> mcList = [select Id,Name from Maintenance_Contract__c]; |
| | | Daily_Report__c report = [select Id from Daily_Report__c limit 1]; |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | // t.getEvent(); |
| | | // t.report.Reporter__c = u1.id; |
| | | |
| | | t.report.Reported_Date__c = date.today(); |
| | | t.repoStartHourText = '9'; |
| | | t.repoStartMinuteText = '00'; |
| | | t.repoEndHourText = '18'; |
| | | t.repoEndMinuteText = '00'; |
| | | t.report.Status__c = '申請中'; |
| | | t.activities.get(0).actStartHourText = '9'; |
| | | t.activities.get(0).actStartMinuteText = '00'; |
| | | t.activities.get(0).actEndHourText = '18'; |
| | | t.activities.get(0).actEndMinuteText = '00'; |
| | | t.activities.get(0).act.nextPlanDate__c = date.today(); |
| | | t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1test'; |
| | | t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(0).act.Description__c = '結果'; |
| | | t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = null; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = null; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = null; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = null; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = null; |
| | | t.activities.get(0).act.Related_Opportunity1__c = opplist[0].Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = opplist[1].Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = opplist[2].Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = opplist[3].Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = opplist[4].Name + 'test'; |
| | | t.activities.get(0).act.Related_Service1__c = mcList[0].Name + 'test'; |
| | | t.activities.get(0).act.Related_Service2__c = mcList[1].Name + 'test'; |
| | | t.activities.get(0).planStartHourText = '9'; |
| | | t.activities.get(0).planStartMinuteText = '00'; |
| | | t.activities.get(0).planEndHourText = '18'; |
| | | t.activities.get(0).planEndMinuteText = '00'; |
| | | t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | t.save(); |
| | | |
| | | t.activities.get(0).act.Location__c = account.Name; |
| | | t.activities.get(0).act.whatid__c = account.Id; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = conList[0].id; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = conList[1].id; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = conList[2].id; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = conList[3].id; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = conList[4].id; |
| | | t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | t.activities.get(0).act.Related_Opportunity1_ID__c = opplist[0].Id; |
| | | t.activities.get(0).act.Related_Opportunity2_ID__c = opplist[1].Id; |
| | | t.activities.get(0).act.Related_Opportunity3_ID__c = opplist[2].Id; |
| | | t.activities.get(0).act.Related_Opportunity4_ID__c = opplist[3].Id; |
| | | t.activities.get(0).act.Related_Opportunity5_ID__c = opplist[4].Id; |
| | | t.activities.get(0).act.Related_Service1__c = mcList[0].Name; |
| | | t.activities.get(0).act.Related_Service2__c = mcList[1].Name; |
| | | t.activities.get(0).act.Related_Service1_ID__c = mcList[0].Id; |
| | | t.activities.get(0).act.Related_Service2_ID__c = mcList[1].Id; |
| | | t.upsertActIndex = '0'; |
| | | t.save(); |
| | | |
| | | // Date d = date.today(); |
| | | // String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | |
| | | // Datetime dt = datetime.now(); |
| | | // String strDatetime = '2000/01/01 10:10'; |
| | | // System.debug('strDatetime' + strDatetime); |
| | | |
| | | |
| | | // String ntId = Add_Report.addReportNT(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'NTC', '戦略科室分類1 診療科1test', con1.id, con2.id, con3.id, con4.id, con5.id, strDatetime, strDatetime, '内視鏡室'); |
| | | // if (ntId != 'false') t.activities.get(0).act.NTC_ID__c = ntId; |
| | | // t.save(); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | static void test01_06_01() { |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | |
| | | System.runAs(user) { |
| | | System.Test.startTest(); |
| | | Account account = [select Id,Name from Account where Department_Name__c = '診療科1']; |
| | | List<Contact> conList = [select Id from Contact]; |
| | | List<Opportunity> opplist = [select Id,Name from Opportunity]; |
| | | List<Maintenance_Contract__c> mcList = [select Id,Name from Maintenance_Contract__c]; |
| | | Daily_Report__c report = [select Id from Daily_Report__c limit 1]; |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | // t.getEvent(); |
| | | // t.report.Reporter__c = u1.id; |
| | | |
| | | t.report.Reported_Date__c = date.today(); |
| | | t.repoStartHourText = '9'; |
| | | t.repoStartMinuteText = '00'; |
| | | t.repoEndHourText = '18'; |
| | | t.repoEndMinuteText = '00'; |
| | | t.report.Status__c = '申請中'; |
| | | t.activities.get(0).actStartHourText = '9'; |
| | | t.activities.get(0).actStartMinuteText = '00'; |
| | | t.activities.get(0).actEndHourText = '18'; |
| | | t.activities.get(0).actEndMinuteText = '00'; |
| | | t.activities.get(0).act.nextPlanDate__c = date.today(); |
| | | t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1test'; |
| | | t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(0).act.Description__c = '結果'; |
| | | t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = null; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = null; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = null; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = null; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = null; |
| | | t.activities.get(0).act.Related_Opportunity1__c = opplist[0].Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = opplist[1].Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = opplist[2].Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = opplist[3].Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = opplist[4].Name + 'test'; |
| | | t.activities.get(0).act.Related_Service1__c = mcList[0].Name + 'test'; |
| | | t.activities.get(0).act.Related_Service2__c = mcList[1].Name + 'test'; |
| | | t.activities.get(0).planStartHourText = '9'; |
| | | t.activities.get(0).planStartMinuteText = '00'; |
| | | t.activities.get(0).planEndHourText = '18'; |
| | | t.activities.get(0).planEndMinuteText = '00'; |
| | | t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | t.save(); |
| | | |
| | | t.activities.get(0).act.Location__c = account.Name; |
| | | t.activities.get(0).act.whatid__c = account.Id; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = conList[0].id; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = conList[1].id; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = conList[2].id; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = conList[3].id; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = conList[4].id; |
| | | t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | t.activities.get(0).act.Related_Opportunity1_ID__c = opplist[0].Id; |
| | | t.activities.get(0).act.Related_Opportunity2_ID__c = opplist[1].Id; |
| | | t.activities.get(0).act.Related_Opportunity3_ID__c = opplist[2].Id; |
| | | t.activities.get(0).act.Related_Opportunity4_ID__c = opplist[3].Id; |
| | | t.activities.get(0).act.Related_Opportunity5_ID__c = opplist[4].Id; |
| | | t.activities.get(0).act.Related_Service1__c = mcList[0].Name; |
| | | t.activities.get(0).act.Related_Service2__c = mcList[1].Name; |
| | | t.activities.get(0).act.Related_Service1_ID__c = mcList[0].Id; |
| | | t.activities.get(0).act.Related_Service2_ID__c = mcList[1].Id; |
| | | t.upsertActIndex = '0'; |
| | | t.save(); |
| | | |
| | | // Date d = date.today(); |
| | | // String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | |
| | | // Datetime dt = datetime.now(); |
| | | // String strDatetime = '2000/01/01 10:10'; |
| | | // System.debug('strDatetime' + strDatetime); |
| | | |
| | | // String ntId = Add_Report.addReportNT(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'NTC', accDep.Id, con1.id, con2.id, con3.id, con4.id, con5.id, strDatetime, strDatetime, '内視鏡室'); |
| | | // if (ntId != 'false') t.activities.get(0).act.NTC_ID__c = ntId; |
| | | // t.save(); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | static void test01_07_01() { |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user) { |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | // t.getEvent(); |
| | | // t.report.Reporter__c = u1.id; |
| | | |
| | | t.report.Reported_Date__c = date.today(); |
| | | t.repoStartHourText = '9'; |
| | | t.repoStartMinuteText = '00'; |
| | | t.repoEndHourText = '18'; |
| | | t.repoEndMinuteText = '00'; |
| | | t.report.Status__c = '申請中'; |
| | | t.activities.get(0).actStartHourText = '9'; |
| | | t.activities.get(0).actStartMinuteText = '00'; |
| | | t.activities.get(0).actEndHourText = '18'; |
| | | t.activities.get(0).actEndMinuteText = '00'; |
| | | t.activities.get(0).act.nextPlanDate__c = date.today(); |
| | | t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1test'; |
| | | t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(0).act.Description__c = '結果'; |
| | | t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = null; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = null; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = null; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = null; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = null; |
| | | t.activities.get(0).act.Related_Opportunity1__c = opp1.Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = opp2.Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = opp3.Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = opp4.Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = opp5.Name + 'test'; |
| | | t.activities.get(0).act.Related_Service1__c = mc1.Name + 'test'; |
| | | t.activities.get(0).act.Related_Service2__c = mc2.Name + 'test'; |
| | | t.activities.get(0).planStartHourText = '9'; |
| | | t.activities.get(0).planStartMinuteText = '00'; |
| | | t.activities.get(0).planEndHourText = '18'; |
| | | t.activities.get(0).planEndMinuteText = '00'; |
| | | t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | t.save(); |
| | | |
| | | t.activities.get(0).act.Location__c = accDepName; |
| | | t.activities.get(0).act.whatid__c = accDep.Id; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | t.activities.get(0).act.Related_Service1_ID__c = mc1.Id; |
| | | t.activities.get(0).act.Related_Service2_ID__c = mc2.Id; |
| | | t.upsertActIndex = '0'; |
| | | t.save(); |
| | | |
| | | Date d = date.today(); |
| | | String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | |
| | | Datetime dt = datetime.now(); |
| | | String strDatetime = '2000/01/01 10:10'; |
| | | System.debug('strDatetime' + strDatetime); |
| | | |
| | | // String ntId = Add_Report.addReportNT(u1.id, t.activities.get(0).act.NTC_ID__c, t.report.id, t.activities.get(0).act.id, 'NTC', accDep.Id, con1.id, con2.id, con3.id, con4.id, con5.id, strDatetime, strDatetime, '内視鏡室'); |
| | | // t.save(); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | static void test01_08_01() { |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user) { |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | |
| | |
| | | String strDatetime = '2000/01/01 10:10'; |
| | | System.debug('strDatetime' + strDatetime); |
| | | |
| | | System.Test.startTest(); |
| | | System.debug('t.activities.get(0).act.id:::::' + t.activities.get(0).act.id); |
| | | String pdId = Add_Report.addReportPr(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Product_Explanation', '戦略科室分類1 診療科1test', con1.id, con2.id, con3.id, con4.id, con5.id, '結果', strDate); |
| | | if (pdId != 'false') t.activities.get(0).act.Product_Description_Id__c = pdId; |
| | | // String opId = Add_Report.addReportOP(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'OPD', '戦略科室分類1 診療科1test', con1.id, con2.id, con3.id, con4.id, con5.id, opp1.Id, opp2.Id, opp3.Id, opp4.Id, opp5.Id, strDate); |
| | | // if (opId != 'false') t.activities.get(0).act.OPD_ID__c = opId; |
| | | // t.save(); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | static void test01_09_01() { |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user) { |
| | | System.Test.startTest(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | t.init(); |
| | | |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | // t.getEvent(); |
| | | // t.report.Reporter__c = u1.id; |
| | | |
| | | t.report.Reported_Date__c = date.today(); |
| | | t.repoStartHourText = '9'; |
| | | t.repoStartMinuteText = '00'; |
| | | t.repoEndHourText = '18'; |
| | | t.repoEndMinuteText = '00'; |
| | | t.report.Status__c = '申請中'; |
| | | t.activities.get(0).actStartHourText = '9'; |
| | | t.activities.get(0).actStartMinuteText = '00'; |
| | | t.activities.get(0).actEndHourText = '18'; |
| | | t.activities.get(0).actEndMinuteText = '00'; |
| | | t.activities.get(0).act.nextPlanDate__c = date.today(); |
| | | t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1test'; |
| | | t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(0).act.Description__c = '結果'; |
| | | t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = null; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = null; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = null; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = null; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = null; |
| | | t.activities.get(0).act.Related_Opportunity1__c = opp1.Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = opp2.Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = opp3.Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = opp4.Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = opp5.Name + 'test'; |
| | | t.activities.get(0).act.Related_Service1__c = mc1.Name + 'test'; |
| | | t.activities.get(0).act.Related_Service2__c = mc2.Name + 'test'; |
| | | t.activities.get(0).planStartHourText = '9'; |
| | | t.activities.get(0).planStartMinuteText = '00'; |
| | | t.activities.get(0).planEndHourText = '18'; |
| | | t.activities.get(0).planEndMinuteText = '00'; |
| | | t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | t.save(); |
| | | |
| | | t.activities.get(0).act.Location__c = accDepName; |
| | | t.activities.get(0).act.whatid__c = accDep.Id; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | t.activities.get(0).act.Related_Service1_ID__c = mc1.Id; |
| | | t.activities.get(0).act.Related_Service2_ID__c = mc2.Id; |
| | | t.upsertActIndex = '0'; |
| | | t.save(); |
| | | |
| | | Date d = date.today(); |
| | | String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | |
| | | Datetime dt = datetime.now(); |
| | | String strDatetime = '2000/01/01 10:10'; |
| | | System.debug('strDatetime' + strDatetime); |
| | | |
| | | System.debug('t.activities.get(0).act.id:::::' + t.activities.get(0).act.id); |
| | | // String opId = Add_Report.addReportOP(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'OPD', accDep.Id, con1.id, con2.id, con3.id, con4.id, con5.id, opp1.Id, opp2.Id, opp3.Id, opp1.Id, opp5.Id, strDate); |
| | | // if (opId != 'false') t.activities.get(0).act.OPD_ID__c = opId; |
| | | // t.save(); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | static void test01_10_01() { |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user) { |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | // t.getEvent(); |
| | | // t.report.Reporter__c = u1.id; |
| | | |
| | | t.report.Reported_Date__c = date.today(); |
| | | t.repoStartHourText = '9'; |
| | | t.repoStartMinuteText = '00'; |
| | | t.repoEndHourText = '18'; |
| | | t.repoEndMinuteText = '00'; |
| | | t.report.Status__c = '申請中'; |
| | | t.activities.get(0).actStartHourText = '9'; |
| | | t.activities.get(0).actStartMinuteText = '00'; |
| | | t.activities.get(0).actEndHourText = '18'; |
| | | t.activities.get(0).actEndMinuteText = '00'; |
| | | t.activities.get(0).act.nextPlanDate__c = date.today(); |
| | | t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1test'; |
| | | t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(0).act.Description__c = '結果'; |
| | | t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = null; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = null; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = null; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = null; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = null; |
| | | t.activities.get(0).act.Related_Opportunity1__c = opp1.Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = opp2.Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = opp3.Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = opp4.Name + 'test'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = opp5.Name + 'test'; |
| | | t.activities.get(0).act.Related_Service1__c = mc1.Name + 'test'; |
| | | t.activities.get(0).act.Related_Service2__c = mc2.Name + 'test'; |
| | | t.activities.get(0).planStartHourText = '9'; |
| | | t.activities.get(0).planStartMinuteText = '00'; |
| | | t.activities.get(0).planEndHourText = '18'; |
| | | t.activities.get(0).planEndMinuteText = '00'; |
| | | t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | t.save(); |
| | | |
| | | t.activities.get(0).act.Location__c = accDepName; |
| | | t.activities.get(0).act.whatid__c = accDep.Id; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | t.activities.get(0).act.Related_Service1_ID__c = mc1.Id; |
| | | t.activities.get(0).act.Related_Service2_ID__c = mc2.Id; |
| | | t.upsertActIndex = '0'; |
| | | t.save(); |
| | | |
| | | Date d = date.today(); |
| | | String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | |
| | | Datetime dt = datetime.now(); |
| | | String strDatetime = '2000/01/01 10:10'; |
| | | System.debug('strDatetime' + strDatetime); |
| | | |
| | | // System.Test.startTest(); |
| | | // System.debug('t.activities.get(0).act.id:::::' + t.activities.get(0).act.id); |
| | | // String opId = Add_Report.addReportOP(u1.id, t.activities.get(0).act.OPD_ID__c, t.report.id, t.activities.get(0).act.id, 'OPD', accDep.Id, con1.id, con2.id, con3.id, con4.id, con5.id, opp1.Id, opp2.Id, opp3.Id, opp1.Id, opp5.Id, strDate); |
| | | // if (opId != 'false') t.activities.get(0).act.OPD_ID__c = opId; |
| | | // t.save(); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | static void test02_01_01() { |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user) { |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | // t.getEvent(); |
| | | |
| | | t.report.Status__c = '申請中'; |
| | | t.report.Reported_Date__c = date.today(); |
| | | t.repoStartHourText = '9'; |
| | | t.repoStartMinuteText = '00'; |
| | | t.repoEndHourText = '18'; |
| | | t.repoEndMinuteText = '00'; |
| | | t.activities.get(0).actStartHourText = '9'; |
| | | t.activities.get(0).actStartMinuteText = '00'; |
| | | t.activities.get(0).actEndHourText = '18'; |
| | | t.activities.get(0).actEndMinuteText = '00'; |
| | | t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(0).act.Description__c = '結果'; |
| | | t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(0).act.Location__c = accDepName; |
| | | t.activities.get(0).act.whatid__c = accDep.Id; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | t.activities.get(0).act.Related_Service1_ID__c = mc1.Id; |
| | | t.activities.get(0).act.Related_Service2_ID__c = mc2.Id; |
| | | t.activities.get(0).planStartHourText = '9'; |
| | | t.activities.get(0).planStartMinuteText = '00'; |
| | | t.activities.get(0).planEndHourText = '18'; |
| | | t.activities.get(0).planEndMinuteText = '00'; |
| | | t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | t.upsertActIndex = '0'; |
| | | t.save(); |
| | | |
| | | Date d = date.today(); |
| | | String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | |
| | | Datetime dt = datetime.now(); |
| | | String strDatetime = '2000/01/01 10:10'; |
| | | |
| | | //t.activities.get(0).act.OnCall_ID__c = Add_Report.addReportOn(t.report.id, t.report.id, t.activities.get(0).act.id, 'On_Call', '戦略科室分類1 診療科1test', strDate); |
| | | //t.activities.get(0).act.OnCall_ID__c = Add_Report.addReportOn(t.report.id, t.report.id, t.activities.get(0).act.id, 'On_Call', '戦略科室分類1 診療科1', strDate); |
| | | //t.activities.get(0).act.OnCall_ID__c = Add_Report.addReportOn(t.activities.get(0).act.OnCall_ID__c, t.report.id, t.activities.get(0).act.id, 'On_Call', '戦略科室分類1 診療科1', strDate); |
| | | |
| | | // String raId = Add_Report.addReportAc(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Visit_With', '戦略科室分類1 診療科1test', strDate, '結果'); |
| | | // raId = Add_Report.addReportAc(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Visit_With', accDep.Id, strDate, '結果'); |
| | | // raId = Add_Report.addReportAc(u1.id, t.activities.get(0).act.ReportAccompanied_ID__c, t.report.id, t.activities.get(0).act.id, 'Visit_With', accDep.Id, strDate, '結果'); |
| | | // if (raId != 'false') t.activities.get(0).act.ReportAccompanied_ID__c = raId; |
| | | // // t.activities.get(0).act.ReportAccompanied_ID__c = Add_Report.addReportAc(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Visit_With', '戦略科室分類1 診療科1test', strDate, '結果'); |
| | | // // t.activities.get(0).act.ReportAccompanied_ID__c = Add_Report.addReportAc(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Visit_With', '戦略科室分類1 診療科1', strDate, '結果'); |
| | | // // t.activities.get(0).act.ReportAccompanied_ID__c = Add_Report.addReportAc(u1.id, t.activities.get(0).act.ReportAccompanied_ID__c, t.report.id, t.activities.get(0).act.id, 'Visit_With', '戦略科室分類1 診療科1', strDate, '結果'); |
| | | |
| | | // String csId = Add_Report.addReportEx(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'MarketCondition', '戦略科室分類1 診療科1test', con1.id, strDate, '結果'); |
| | | // csId = Add_Report.addReportEx(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'MarketCondition', accDep.Id, con1.id, strDate, '結果'); |
| | | // csId = Add_Report.addReportEx(u1.id, t.activities.get(0).act.CityStatus_ID__c, t.report.id, t.activities.get(0).act.id, 'MarketCondition', accDep.Id, con1.id, strDate, '結果'); |
| | | // if (csId != 'false') t.activities.get(0).act.CityStatus_ID__c = csId; |
| | | // // t.activities.get(0).act.CityStatus_ID__c = Add_Report.addReportEx(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'MarketCondition', '戦略科室分類1 診療科1test', strDate, '結果'); |
| | | // // t.activities.get(0).act.CityStatus_ID__c = Add_Report.addReportEx(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'MarketCondition', '戦略科室分類1 診療科1', strDate, '結果'); |
| | | // // t.activities.get(0).act.CityStatus_ID__c = Add_Report.addReportEx(u1.id, t.activities.get(0).act.CityStatus_ID__c, t.report.id, t.activities.get(0).act.id, 'MarketCondition', '戦略科室分類1 診療科1', strDate, '結果'); |
| | | |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | static void test02_02_01() { |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user) { |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | // t.getEvent(); |
| | | |
| | | t.report.Status__c = '申請中'; |
| | | t.report.Reported_Date__c = date.today(); |
| | | t.repoStartHourText = '9'; |
| | | t.repoStartMinuteText = '00'; |
| | | t.repoEndHourText = '18'; |
| | | t.repoEndMinuteText = '00'; |
| | | t.activities.get(0).actStartHourText = '9'; |
| | | t.activities.get(0).actStartMinuteText = '00'; |
| | | t.activities.get(0).actEndHourText = '18'; |
| | | t.activities.get(0).actEndMinuteText = '00'; |
| | | t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(0).act.Description__c = '結果'; |
| | | t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(0).act.Location__c = accDepName; |
| | | t.activities.get(0).act.whatid__c = accDep.Id; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | t.activities.get(0).act.Related_Service1_ID__c = mc1.Id; |
| | | t.activities.get(0).act.Related_Service2_ID__c = mc2.Id; |
| | | t.activities.get(0).planStartHourText = '9'; |
| | | t.activities.get(0).planStartMinuteText = '00'; |
| | | t.activities.get(0).planEndHourText = '18'; |
| | | t.activities.get(0).planEndMinuteText = '00'; |
| | | t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | t.upsertActIndex = '0'; |
| | | t.save(); |
| | | |
| | | Date d = date.today(); |
| | | String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | |
| | | Datetime dt = datetime.now(); |
| | | String strDatetime = '2000/01/01 10:10'; |
| | | |
| | | // System.Test.startTest(); |
| | | |
| | | // String cId = Add_Report.addReportEx(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Competitor', '戦略科室分類1 診療科1test', con1.id, strDate, '結果'); |
| | | // cId = Add_Report.addReportEx(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Competitor', accDep.Id, con1.id, strDate, '結果'); |
| | | // cId = Add_Report.addReportEx(u1.id, t.activities.get(0).act.Conflict_ID__c, t.report.id, t.activities.get(0).act.id, 'Competitor', accDep.Id, con1.id, strDate, '結果'); |
| | | // if (cId != 'false') t.activities.get(0).act.Conflict_ID__c = cId; |
| | | // // t.activities.get(0).act.Conflict_ID__c = Add_Report.addReportEx(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Competitor', '戦略科室分類1 診療科1test', strDate, '結果'); |
| | | // // t.activities.get(0).act.Conflict_ID__c = Add_Report.addReportEx(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Competitor', '戦略科室分類1 診療科1', strDate, '結果'); |
| | | // // t.activities.get(0).act.Conflict_ID__c = Add_Report.addReportEx(u1.id, t.activities.get(0).act.Conflict_ID__c, t.report.id, t.activities.get(0).act.id, 'Competitor', '戦略科室分類1 診療科1', strDate, '結果'); |
| | | |
| | | // t.save(); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | |
| | | // static void test01_03() { |
| | | // init(); |
| | | static void test02_03_01() { |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | |
| | | // System.runAs(u1) { |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | System.runAs(user) { |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | // t.getEvent(); |
| | | |
| | | t.report.Status__c = '申請中'; |
| | | t.report.Reported_Date__c = date.today(); |
| | | t.repoStartHourText = '9'; |
| | | t.repoStartMinuteText = '00'; |
| | | t.repoEndHourText = '18'; |
| | | t.repoEndMinuteText = '00'; |
| | | t.activities.get(0).actStartHourText = '9'; |
| | | t.activities.get(0).actStartMinuteText = '00'; |
| | | t.activities.get(0).actEndHourText = '18'; |
| | | t.activities.get(0).actEndMinuteText = '00'; |
| | | t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(0).act.Description__c = '結果'; |
| | | t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(0).act.Location__c = accDepName; |
| | | t.activities.get(0).act.whatid__c = accDep.Id; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | t.activities.get(0).act.Related_Service1_ID__c = mc1.Id; |
| | | t.activities.get(0).act.Related_Service2_ID__c = mc2.Id; |
| | | t.activities.get(0).planStartHourText = '9'; |
| | | t.activities.get(0).planStartMinuteText = '00'; |
| | | t.activities.get(0).planEndHourText = '18'; |
| | | t.activities.get(0).planEndMinuteText = '00'; |
| | | t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | t.upsertActIndex = '0'; |
| | | t.save(); |
| | | |
| | | // // t.getEvent(); |
| | | // t.report.Reporter__c = u1.id; |
| | | |
| | | // t.report.Reported_Date__c = date.today(); |
| | | // t.repoStartHourText = '9'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '18'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.report.Status__c = '申請中'; |
| | | // t.activities.get(0).actStartHourText = '9'; |
| | | // t.activities.get(0).actStartMinuteText = '00'; |
| | | // t.activities.get(0).actEndHourText = '18'; |
| | | // t.activities.get(0).actEndMinuteText = '00'; |
| | | // t.activities.get(0).act.nextPlanDate__c = date.today(); |
| | | // t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1test'; |
| | | // t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(0).act.Description__c = '結果'; |
| | | // t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = null; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = null; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = null; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = null; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = null; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = opp1.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = opp2.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = opp3.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = opp4.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = opp5.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name + 'test'; |
| | | // t.activities.get(0).planStartHourText = '9'; |
| | | // t.activities.get(0).planStartMinuteText = '00'; |
| | | // t.activities.get(0).planEndHourText = '18'; |
| | | // t.activities.get(0).planEndMinuteText = '00'; |
| | | // t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | // t.save(); |
| | | Date d = date.today(); |
| | | String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | |
| | | // t.activities.get(0).act.Location__c = accDepName; |
| | | // t.activities.get(0).act.whatid__c = accDep.Id; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | // t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | // t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | // t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | // t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | // t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | // t.activities.get(0).act.Related_Service1_ID__c = mc1.Id; |
| | | // t.activities.get(0).act.Related_Service2_ID__c = mc2.Id; |
| | | // t.upsertActIndex = '0'; |
| | | // t.save(); |
| | | Datetime dt = datetime.now(); |
| | | String strDatetime = '2000/01/01 10:10'; |
| | | |
| | | // Date d = date.today(); |
| | | // String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | // String imId = Add_Report.addReportIm(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Improvement', '戦略科室分類1 診療科1test', strDate, '結果'); |
| | | // imId = Add_Report.addReportIm(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Improvement', accDep.Id, strDate, '結果'); |
| | | // imId = Add_Report.addReportIm(u1.id, t.activities.get(0).act.Improvement_ID__c, t.report.id, t.activities.get(0).act.id, 'Improvement', accDep.Id, strDate, '結果'); |
| | | // if (imId != 'false') t.activities.get(0).act.Improvement_ID__c = imId; |
| | | // // t.activities.get(0).act.Improvement_ID__c = Add_Report.addReportIm(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Improvement', '戦略科室分類1 診療科1test', strDate, '結果'); |
| | | // // t.activities.get(0).act.Improvement_ID__c = Add_Report.addReportIm(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Improvement', '戦略科室分類1 診療科1', strDate, '結果'); |
| | | // // t.activities.get(0).act.Improvement_ID__c = Add_Report.addReportIm(u1.id, t.activities.get(0).act.Improvement_ID__c, t.report.id, t.activities.get(0).act.id, 'Improvement', '戦略科室分類1 診療科1', strDate, '結果'); |
| | | |
| | | // Datetime dt = datetime.now(); |
| | | // String strDatetime = '2000/01/01 10:10'; |
| | | // System.debug('strDatetime' + strDatetime); |
| | | // String clId = Add_Report.addClaim(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Complaint', '戦略科室分類1 診療科1test', strDate, '結果'); |
| | | // clId = Add_Report.addClaim(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Complaint', accDep.Id, strDate, '結果'); |
| | | // clId = Add_Report.addClaim(u1.id, t.activities.get(0).act.Claim_ID__c, t.report.id, t.activities.get(0).act.id, 'Complaint', accDep.Id, strDate, '結果'); |
| | | |
| | | // System.Test.startTest(); |
| | | // System.debug('t.activities.get(0).act.id:::::' + t.activities.get(0).act.id); |
| | | // String pdId = Add_Report.addReportPr(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Product_Explanation', accDep.Id, con1.id, con2.id, con3.id, con4.id, con5.id, '結果', strDate); |
| | | // if (pdId != 'false') t.activities.get(0).act.Product_Description_Id__c = pdId; |
| | | // t.save(); |
| | | // System.Test.stopTest(); |
| | | // } |
| | | // } |
| | | // if (clId != 'false') t.activities.get(0).act.Claim_ID__c = clId; |
| | | // // t.activities.get(0).act.Claim_ID__c = Add_Report.addClaim(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Complaint', '戦略科室分類1 診療科1test', strDate, '結果'); |
| | | // // t.activities.get(0).act.Claim_ID__c = Add_Report.addClaim(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Complaint', '戦略科室分類1 診療科1', strDate, '結果'); |
| | | // // t.activities.get(0).act.Claim_ID__c = Add_Report.addClaim(u1.id, t.activities.get(0).act.Claim_ID__c, t.report.id, t.activities.get(0).act.id, 'Complaint', '戦略科室分類1 診療科1', strDate, '結果'); |
| | | |
| | | // static void test01_04() { |
| | | // init(); |
| | | // t.save(); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | // System.runAs(u1) { |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | public static void settTestData(){ |
| | | Account account = [select Id,Name from Account where Department_Name__c = '診療科1']; |
| | | List<Contact> conList = [select Id from Contact]; |
| | | List<Opportunity> opplist = [select Id,Name from Opportunity]; |
| | | List<Maintenance_Contract__c> mcList = [select Id,Name from Maintenance_Contract__c]; |
| | | Daily_Report__c report = [select Id from Daily_Report__c limit 1]; |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | accDep = account; |
| | | accDepId = account.Id; |
| | | accDepName = account.Name; |
| | | con1 = conList[0]; |
| | | con2 = conList[1]; |
| | | con3 = conList[2]; |
| | | con4 = conList[3]; |
| | | con5 = conList[4]; |
| | | opp1 = oppList[0]; |
| | | opp2 = oppList[1]; |
| | | opp3 = oppList[2]; |
| | | opp4 = oppList[3]; |
| | | opp5 = oppList[4]; |
| | | mc1 = mcList[0]; |
| | | mc2 = mcList[1]; |
| | | u1 = user; |
| | | |
| | | } |
| | | @isTest |
| | | static void test03() { |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | XinDailyReportControllerTest.settTestData(); |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user) { |
| | | System.Test.startTest(); |
| | | |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // // t.getEvent(); |
| | | // // t.report.Reporter__c = u1.id; |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | |
| | | // t.report.Reported_Date__c = date.today(); |
| | | // t.repoStartHourText = '9'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '18'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.report.Status__c = '申請中'; |
| | | // t.activities.get(0).actStartHourText = '9'; |
| | | // t.activities.get(0).actStartMinuteText = '00'; |
| | | // t.activities.get(0).actEndHourText = '18'; |
| | | // t.activities.get(0).actEndMinuteText = '00'; |
| | | // t.activities.get(0).act.nextPlanDate__c = date.today(); |
| | | // t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1test'; |
| | | // t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(0).act.Description__c = '結果'; |
| | | // t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = null; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = null; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = null; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = null; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = null; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = opp1.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = opp2.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = opp3.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = opp4.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = opp5.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name + 'test'; |
| | | // t.activities.get(0).planStartHourText = '9'; |
| | | // t.activities.get(0).planStartMinuteText = '00'; |
| | | // t.activities.get(0).planEndHourText = '18'; |
| | | // t.activities.get(0).planEndMinuteText = '00'; |
| | | // t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | // t.save(); |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | // t.getEvent(); |
| | | |
| | | // t.activities.get(0).act.Location__c = accDepName; |
| | | // t.activities.get(0).act.whatid__c = accDep.Id; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | // t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | // t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | // t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | // t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | // t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | // t.activities.get(0).act.Related_Service1_ID__c = mc1.Id; |
| | | // t.activities.get(0).act.Related_Service2_ID__c = mc2.Id; |
| | | // t.upsertActIndex = '0'; |
| | | // t.save(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | |
| | | // Date d = date.today(); |
| | | // String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | t.report.Status__c = '申請中'; |
| | | t.report.Reported_Date__c = date.today(); |
| | | t.repoStartHourText = '9'; |
| | | t.repoStartMinuteText = '00'; |
| | | t.repoEndHourText = '18'; |
| | | t.repoEndMinuteText = '00'; |
| | | t.activities.get(0).actStartHourText = '9'; |
| | | t.activities.get(0).actStartMinuteText = '00'; |
| | | t.activities.get(0).actEndHourText = '18'; |
| | | t.activities.get(0).actEndMinuteText = '00'; |
| | | t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(0).act.Description__c = '結果'; |
| | | t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(0).act.Purpose_Type2__c = '客户咨询对应'; |
| | | t.activities.get(0).act.Purpose_Type3__c = '学会or展会对应'; |
| | | t.activities.get(0).act.Purpose_Type4__c = '信息搜集'; |
| | | t.activities.get(0).act.Purpose_Type5__c = '产品介绍or推广'; |
| | | t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1'; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | t.activities.get(0).act.Related_Opportunity1__c = '引合1'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = '引合2'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = '引合3'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = '引合4'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = '引合5'; |
| | | t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | t.activities.get(0).planStartHourText = '9'; |
| | | t.activities.get(0).planStartMinuteText = '00'; |
| | | t.activities.get(0).planEndHourText = '18'; |
| | | t.activities.get(0).planEndMinuteText = '00'; |
| | | t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // Datetime dt = datetime.now(); |
| | | // String strDatetime = '2000/01/01 10:10'; |
| | | // System.debug('strDatetime' + strDatetime); |
| | | t.activities.get(1).actStartHourText = '9'; |
| | | t.activities.get(1).actStartMinuteText = '00'; |
| | | t.activities.get(1).actEndHourText = '18'; |
| | | t.activities.get(1).actEndMinuteText = '00'; |
| | | t.activities.get(1).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(1).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(1).act.Description__c = '結果'; |
| | | t.activities.get(1).act.Purpose_Type__c = 'OPD'; |
| | | t.activities.get(1).act.Purpose_Type2__c = '询价or维修询价跟进'; |
| | | t.activities.get(1).act.Purpose_Type3__c = '经销商协助or拜访'; |
| | | t.activities.get(1).act.Purpose_Type4__c = '合同商谈'; |
| | | t.activities.get(1).act.Purpose_Type5__c = '参加招标'; |
| | | t.activities.get(1).act.Location__c = '戦略科室分類1 診療科1'; |
| | | t.activities.get(1).planStartHourText = '9'; |
| | | t.activities.get(1).planStartMinuteText = '00'; |
| | | t.activities.get(1).planEndHourText = '18'; |
| | | t.activities.get(1).planEndMinuteText = '00'; |
| | | t.activities.get(1).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // System.Test.startTest(); |
| | | // System.debug('t.activities.get(0).act.id:::::' + t.activities.get(0).act.id); |
| | | // String pdId = Add_Report.addReportPr(u1.id, t.activities.get(0).act.Product_Description_Id__c, t.report.id, t.activities.get(0).act.id, 'Product_Explanation', accDep.Id, con1.id, con2.id, con3.id, con4.id, con5.id, '結果', strDate); |
| | | // if (pdId != 'false') t.activities.get(0).act.Product_Description_Id__c = pdId; |
| | | // t.save(); |
| | | // System.Test.stopTest(); |
| | | // } |
| | | // } |
| | | t.activities.get(2).actStartHourText = '9'; |
| | | t.activities.get(2).actStartMinuteText = '00'; |
| | | t.activities.get(2).actEndHourText = '18'; |
| | | t.activities.get(2).actEndMinuteText = '00'; |
| | | t.activities.get(2).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(2).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(2).act.Description__c = '結果'; |
| | | t.activities.get(2).act.Purpose_Type__c = '签订合同'; |
| | | t.activities.get(2).act.Purpose_Type2__c = '納品(装机)'; |
| | | t.activities.get(2).act.Purpose_Type3__c = '送or取设备'; |
| | | t.activities.get(2).act.Purpose_Type4__c = '送or取文件类资料'; |
| | | t.activities.get(2).act.Purpose_Type5__c = '跟台'; |
| | | t.activities.get(2).act.Location__c = '戦略科室分類1 診療科1'; |
| | | t.activities.get(2).planStartHourText = '9'; |
| | | t.activities.get(2).planStartMinuteText = '00'; |
| | | t.activities.get(2).planEndHourText = '18'; |
| | | t.activities.get(2).planEndMinuteText = '00'; |
| | | t.activities.get(2).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // static void test01_05() { |
| | | // init(); |
| | | t.activities.get(3).actStartHourText = '9'; |
| | | t.activities.get(3).actStartMinuteText = '00'; |
| | | t.activities.get(3).actEndHourText = '18'; |
| | | t.activities.get(3).actEndMinuteText = '00'; |
| | | t.activities.get(3).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(3).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(3).act.Description__c = '結果'; |
| | | t.activities.get(3).act.Purpose_Type__c = '新品装机使用保养培训'; |
| | | t.activities.get(3).act.Purpose_Type2__c = 'NTC/TTC'; |
| | | t.activities.get(3).act.Purpose_Type3__c = '点検'; |
| | | t.activities.get(3).act.Purpose_Type4__c = '巡回'; |
| | | t.activities.get(3).act.Purpose_Type5__c = 'ON-CALL'; |
| | | t.activities.get(3).act.Location__c = '戦略科室分類1 診療科1'; |
| | | t.activities.get(3).planStartHourText = '9'; |
| | | t.activities.get(3).planStartMinuteText = '00'; |
| | | t.activities.get(3).planEndHourText = '18'; |
| | | t.activities.get(3).planEndMinuteText = '00'; |
| | | t.activities.get(3).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // System.runAs(u1) { |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | t.activities.get(4).actStartHourText = '9'; |
| | | t.activities.get(4).actStartMinuteText = '00'; |
| | | t.activities.get(4).actEndHourText = '18'; |
| | | t.activities.get(4).actEndMinuteText = '00'; |
| | | t.activities.get(4).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(4).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(4).act.Description__c = '結果'; |
| | | t.activities.get(4).act.Purpose_Type__c = '修理説明'; |
| | | t.activities.get(4).act.Purpose_Type2__c = '投诉対応(含QIS)'; |
| | | t.activities.get(4).act.Purpose_Type3__c = '回款'; |
| | | t.activities.get(4).act.Location__c = '戦略科室分類1 診療科1'; |
| | | t.activities.get(4).planStartHourText = '9'; |
| | | t.activities.get(4).planStartMinuteText = '00'; |
| | | t.activities.get(4).planEndHourText = '18'; |
| | | t.activities.get(4).planEndMinuteText = '00'; |
| | | t.activities.get(4).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // // t.getEvent(); |
| | | // // t.report.Reporter__c = u1.id; |
| | | t.activities.get(5).actStartHourText = '9'; |
| | | t.activities.get(5).actStartMinuteText = '00'; |
| | | t.activities.get(5).actEndHourText = '18'; |
| | | t.activities.get(5).actEndMinuteText = '00'; |
| | | t.activities.get(5).act.Activity_Type2__c = '販売店'; |
| | | t.activities.get(5).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(5).act.Description__c = '結果'; |
| | | t.activities.get(5).act.Purpose_Type__c = '会議参加'; |
| | | t.activities.get(5).act.Purpose_Type2__c = '产品培训'; |
| | | t.activities.get(5).act.Purpose_Type3__c = '询价进行活动'; |
| | | t.activities.get(5).act.Purpose_Type4__c = '售后事宜'; |
| | | t.activities.get(5).act.Purpose_Type5__c = '库存管理'; |
| | | t.activities.get(5).planStartHourText = '9'; |
| | | t.activities.get(5).planStartMinuteText = '00'; |
| | | t.activities.get(5).planEndHourText = '18'; |
| | | t.activities.get(5).planEndMinuteText = '00'; |
| | | t.activities.get(5).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.report.Reported_Date__c = date.today(); |
| | | // t.repoStartHourText = '9'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '18'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.report.Status__c = '申請中'; |
| | | // t.activities.get(0).actStartHourText = '9'; |
| | | // t.activities.get(0).actStartMinuteText = '00'; |
| | | // t.activities.get(0).actEndHourText = '18'; |
| | | // t.activities.get(0).actEndMinuteText = '00'; |
| | | // t.activities.get(0).act.nextPlanDate__c = date.today(); |
| | | // t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1test'; |
| | | // t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(0).act.Description__c = '結果'; |
| | | // t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = null; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = null; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = null; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = null; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = null; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = opp1.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = opp2.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = opp3.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = opp4.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = opp5.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name + 'test'; |
| | | // t.activities.get(0).planStartHourText = '9'; |
| | | // t.activities.get(0).planStartMinuteText = '00'; |
| | | // t.activities.get(0).planEndHourText = '18'; |
| | | // t.activities.get(0).planEndMinuteText = '00'; |
| | | // t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | // t.save(); |
| | | t.activities.get(6).actStartHourText = '9'; |
| | | t.activities.get(6).actStartMinuteText = '00'; |
| | | t.activities.get(6).actEndHourText = '18'; |
| | | t.activities.get(6).actEndMinuteText = '00'; |
| | | t.activities.get(6).act.Activity_Type2__c = '社内活動'; |
| | | t.activities.get(6).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(6).act.Description__c = '結果'; |
| | | t.activities.get(6).act.Purpose_Type__c = '備品検査'; |
| | | t.activities.get(6).act.Purpose_Type2__c = '軽修理'; |
| | | t.activities.get(6).act.Purpose_Type3__c = '会議'; |
| | | t.activities.get(6).act.Purpose_Type4__c = '培训'; |
| | | t.activities.get(6).act.Purpose_Type5__c = '顧客訪問対応'; |
| | | t.activities.get(6).planStartHourText = '9'; |
| | | t.activities.get(6).planStartMinuteText = '00'; |
| | | t.activities.get(6).planEndHourText = '18'; |
| | | t.activities.get(6).planEndMinuteText = '00'; |
| | | t.activities.get(6).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(0).act.Location__c = accDepName; |
| | | // t.activities.get(0).act.whatid__c = accDep.Id; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | // t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | // t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | // t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | // t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | // t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | // t.activities.get(0).act.Related_Service1_ID__c = mc1.Id; |
| | | // t.activities.get(0).act.Related_Service2_ID__c = mc2.Id; |
| | | // t.upsertActIndex = '0'; |
| | | // t.save(); |
| | | t.activities.get(7).actStartHourText = '9'; |
| | | t.activities.get(7).actStartMinuteText = '00'; |
| | | t.activities.get(7).actEndHourText = '18'; |
| | | t.activities.get(7).actEndMinuteText = '00'; |
| | | t.activities.get(7).act.Activity_Type2__c = '社内活動'; |
| | | t.activities.get(7).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(7).act.Description__c = '結果'; |
| | | t.activities.get(7).act.Purpose_Type__c = '資料作成'; |
| | | t.activities.get(7).act.Purpose_Type2__c = '电话拜访'; |
| | | t.activities.get(7).planStartHourText = '9'; |
| | | t.activities.get(7).planStartMinuteText = '00'; |
| | | t.activities.get(7).planEndHourText = '18'; |
| | | t.activities.get(7).planEndMinuteText = '00'; |
| | | t.activities.get(7).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // Date d = date.today(); |
| | | // String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | t.activities.get(8).actStartHourText = '9'; |
| | | t.activities.get(8).actStartMinuteText = '00'; |
| | | t.activities.get(8).actEndHourText = '18'; |
| | | t.activities.get(8).actEndMinuteText = '00'; |
| | | t.activities.get(8).act.Activity_Type2__c = '社外イベント'; |
| | | t.activities.get(8).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(8).act.Description__c = '結果'; |
| | | t.activities.get(8).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(8).act.Purpose_Type2__c = '客户咨询对应'; |
| | | t.activities.get(8).act.Purpose_Type3__c = '学会or展会对应'; |
| | | t.activities.get(8).act.Purpose_Type4__c = '信息搜集'; |
| | | t.activities.get(8).act.Purpose_Type5__c = '产品介绍or推广'; |
| | | t.activities.get(8).planStartHourText = '9'; |
| | | t.activities.get(8).planStartMinuteText = '00'; |
| | | t.activities.get(8).planEndHourText = '18'; |
| | | t.activities.get(8).planEndMinuteText = '00'; |
| | | t.activities.get(8).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // Datetime dt = datetime.now(); |
| | | // String strDatetime = '2000/01/01 10:10'; |
| | | // System.debug('strDatetime' + strDatetime); |
| | | t.activities.get(9).actStartHourText = '9'; |
| | | t.activities.get(9).actStartMinuteText = '00'; |
| | | t.activities.get(9).actEndHourText = '18'; |
| | | t.activities.get(9).actEndMinuteText = '00'; |
| | | t.activities.get(9).act.Activity_Type2__c = '移動'; |
| | | t.activities.get(9).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(9).act.Description__c = '結果'; |
| | | t.activities.get(9).act.Purpose_Type__c = '移動'; |
| | | t.activities.get(9).planStartHourText = '9'; |
| | | t.activities.get(9).planStartMinuteText = '00'; |
| | | t.activities.get(9).planEndHourText = '18'; |
| | | t.activities.get(9).planEndMinuteText = '00'; |
| | | t.activities.get(9).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // System.Test.startTest(); |
| | | // String ntId = Add_Report.addReportNT(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'NTC', '戦略科室分類1 診療科1test', con1.id, con2.id, con3.id, con4.id, con5.id, strDatetime, strDatetime, '内視鏡室'); |
| | | // if (ntId != 'false') t.activities.get(0).act.NTC_ID__c = ntId; |
| | | // t.save(); |
| | | // System.Test.stopTest(); |
| | | // } |
| | | // } |
| | | t.activities.get(10).actStartHourText = '9'; |
| | | t.activities.get(10).actStartMinuteText = '00'; |
| | | t.activities.get(10).actEndHourText = '18'; |
| | | t.activities.get(10).actEndMinuteText = '00'; |
| | | t.activities.get(10).act.Activity_Type2__c = '休暇'; |
| | | t.activities.get(10).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(10).act.Description__c = '結果'; |
| | | t.activities.get(10).act.Purpose_Type__c = '休暇'; |
| | | t.activities.get(10).planStartHourText = '9'; |
| | | t.activities.get(10).planStartMinuteText = '00'; |
| | | t.activities.get(10).planEndHourText = '18'; |
| | | t.activities.get(10).planEndMinuteText = '00'; |
| | | t.activities.get(10).planPurposeText = '次の活動予定目的(計画)'; |
| | | t.upsertActIndex = '0'; |
| | | t.openPDNew(); |
| | | |
| | | // static void test01_06() { |
| | | // init(); |
| | | t.upsertActIndex = ''; |
| | | //t.save(); |
| | | |
| | | // System.runAs(u1) { |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | String actId = t.activities.get(0).act.id; |
| | | |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // // t.getEvent(); |
| | | // // t.report.Reporter__c = u1.id; |
| | | Event e = new Event(); |
| | | e.ActivityDateTime = datetime.now(); |
| | | e.DurationInMinutes = 0; |
| | | e.OwnerId = UserInfo.getUserId(); |
| | | insert e; |
| | | |
| | | // t.report.Reported_Date__c = date.today(); |
| | | // t.repoStartHourText = '9'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '18'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.report.Status__c = '申請中'; |
| | | // t.activities.get(0).actStartHourText = '9'; |
| | | // t.activities.get(0).actStartMinuteText = '00'; |
| | | // t.activities.get(0).actEndHourText = '18'; |
| | | // t.activities.get(0).actEndMinuteText = '00'; |
| | | // t.activities.get(0).act.nextPlanDate__c = date.today(); |
| | | // t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1test'; |
| | | // t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(0).act.Description__c = '結果'; |
| | | // t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = null; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = null; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = null; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = null; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = null; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = opp1.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = opp2.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = opp3.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = opp4.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = opp5.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name + 'test'; |
| | | // t.activities.get(0).planStartHourText = '9'; |
| | | // t.activities.get(0).planStartMinuteText = '00'; |
| | | // t.activities.get(0).planEndHourText = '18'; |
| | | // t.activities.get(0).planEndMinuteText = '00'; |
| | | // t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | // t.save(); |
| | | PageReference pageRef1 = Page.XinDailyReport; |
| | | pageRef1.getParameters().put('id', e.id); |
| | | Test.setCurrentPage(pageRef1); |
| | | t.init(); |
| | | |
| | | // t.activities.get(0).act.Location__c = accDepName; |
| | | // t.activities.get(0).act.whatid__c = accDep.Id; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | // t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | // t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | // t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | // t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | // t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | // t.activities.get(0).act.Related_Service1_ID__c = mc1.Id; |
| | | // t.activities.get(0).act.Related_Service2_ID__c = mc2.Id; |
| | | // t.upsertActIndex = '0'; |
| | | // t.save(); |
| | | PageReference pageRef2 = Page.XinDailyReport; |
| | | pageRef2.getParameters().put('id', actId); |
| | | Test.setCurrentPage(pageRef2); |
| | | t.init(); |
| | | |
| | | // Date d = date.today(); |
| | | // String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | t.getDailyReport(); |
| | | System.Test.stopTest(); |
| | | // t.getEvent(); |
| | | //System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | // Datetime dt = datetime.now(); |
| | | // String strDatetime = '2000/01/01 10:10'; |
| | | // System.debug('strDatetime' + strDatetime); |
| | | @isTest |
| | | static void test04() { |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | System.runAs(user) { |
| | | //System.Test.startTest(); |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | |
| | | // System.Test.startTest(); |
| | | // String ntId = Add_Report.addReportNT(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'NTC', accDep.Id, con1.id, con2.id, con3.id, con4.id, con5.id, strDatetime, strDatetime, '内視鏡室'); |
| | | // if (ntId != 'false') t.activities.get(0).act.NTC_ID__c = ntId; |
| | | // t.save(); |
| | | // System.Test.stopTest(); |
| | | // } |
| | | // } |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | // t.getEvent(); |
| | | |
| | | // static void test01_07() { |
| | | // init(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | |
| | | // System.runAs(u1) { |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | t.report.Status__c = '申請中'; |
| | | t.report.Reported_Date__c = date.today(); |
| | | t.repoStartHourText = '9'; |
| | | t.repoStartMinuteText = '00'; |
| | | t.repoEndHourText = '18'; |
| | | t.repoEndMinuteText = '00'; |
| | | t.activities.get(0).actStartHourText = '9'; |
| | | t.activities.get(0).actStartMinuteText = '00'; |
| | | t.activities.get(0).actEndHourText = '18'; |
| | | t.activities.get(0).actEndMinuteText = '00'; |
| | | t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(0).act.Description__c = '結果'; |
| | | t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(0).act.Purpose_Type2__c = '客户咨询对应'; |
| | | t.activities.get(0).act.Purpose_Type3__c = '学会or展会对应'; |
| | | t.activities.get(0).act.Purpose_Type4__c = '信息搜集'; |
| | | t.activities.get(0).act.Purpose_Type5__c = '产品介绍or推广'; |
| | | t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1'; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | t.activities.get(0).act.Related_Opportunity1__c = '引合1'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = '引合2'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = '引合3'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = '引合4'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = '引合5'; |
| | | t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | t.activities.get(0).planStartHourText = '9'; |
| | | t.activities.get(0).planStartMinuteText = '00'; |
| | | t.activities.get(0).planEndHourText = '18'; |
| | | t.activities.get(0).planEndMinuteText = '00'; |
| | | t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // // t.getEvent(); |
| | | // // t.report.Reporter__c = u1.id; |
| | | t.activities.get(1).actStartHourText = '9'; |
| | | t.activities.get(1).actStartMinuteText = '00'; |
| | | t.activities.get(1).actEndHourText = '18'; |
| | | t.activities.get(1).actEndMinuteText = '00'; |
| | | t.activities.get(1).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(1).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(1).act.Description__c = '結果'; |
| | | t.activities.get(1).act.Purpose_Type__c = 'OPD'; |
| | | t.activities.get(1).act.Purpose_Type2__c = '询价or维修询价跟进'; |
| | | t.activities.get(1).act.Purpose_Type3__c = '经销商协助or拜访'; |
| | | t.activities.get(1).act.Purpose_Type4__c = '合同商谈'; |
| | | t.activities.get(1).act.Purpose_Type5__c = '参加招标'; |
| | | t.activities.get(1).act.Location__c = '戦略科室分類1 診療科1'; |
| | | t.activities.get(1).planStartHourText = '9'; |
| | | t.activities.get(1).planStartMinuteText = '00'; |
| | | t.activities.get(1).planEndHourText = '18'; |
| | | t.activities.get(1).planEndMinuteText = '00'; |
| | | t.activities.get(1).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.report.Reported_Date__c = date.today(); |
| | | // t.repoStartHourText = '9'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '18'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.report.Status__c = '申請中'; |
| | | // t.activities.get(0).actStartHourText = '9'; |
| | | // t.activities.get(0).actStartMinuteText = '00'; |
| | | // t.activities.get(0).actEndHourText = '18'; |
| | | // t.activities.get(0).actEndMinuteText = '00'; |
| | | // t.activities.get(0).act.nextPlanDate__c = date.today(); |
| | | // t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1test'; |
| | | // t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(0).act.Description__c = '結果'; |
| | | // t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = null; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = null; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = null; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = null; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = null; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = opp1.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = opp2.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = opp3.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = opp4.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = opp5.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name + 'test'; |
| | | // t.activities.get(0).planStartHourText = '9'; |
| | | // t.activities.get(0).planStartMinuteText = '00'; |
| | | // t.activities.get(0).planEndHourText = '18'; |
| | | // t.activities.get(0).planEndMinuteText = '00'; |
| | | // t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | // t.save(); |
| | | t.activities.get(2).actStartHourText = '9'; |
| | | t.activities.get(2).actStartMinuteText = '00'; |
| | | t.activities.get(2).actEndHourText = '18'; |
| | | t.activities.get(2).actEndMinuteText = '00'; |
| | | t.activities.get(2).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(2).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(2).act.Description__c = '結果'; |
| | | t.activities.get(2).act.Purpose_Type__c = '签订合同'; |
| | | t.activities.get(2).act.Purpose_Type2__c = '納品(装机)'; |
| | | t.activities.get(2).act.Purpose_Type3__c = '送or取设备'; |
| | | t.activities.get(2).act.Purpose_Type4__c = '送or取文件类资料'; |
| | | t.activities.get(2).act.Purpose_Type5__c = '跟台'; |
| | | t.activities.get(2).act.Location__c = '戦略科室分類1 診療科1'; |
| | | t.activities.get(2).planStartHourText = '9'; |
| | | t.activities.get(2).planStartMinuteText = '00'; |
| | | t.activities.get(2).planEndHourText = '18'; |
| | | t.activities.get(2).planEndMinuteText = '00'; |
| | | t.activities.get(2).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(0).act.Location__c = accDepName; |
| | | // t.activities.get(0).act.whatid__c = accDep.Id; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | // t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | // t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | // t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | // t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | // t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | // t.activities.get(0).act.Related_Service1_ID__c = mc1.Id; |
| | | // t.activities.get(0).act.Related_Service2_ID__c = mc2.Id; |
| | | // t.upsertActIndex = '0'; |
| | | // t.save(); |
| | | t.activities.get(3).actStartHourText = '9'; |
| | | t.activities.get(3).actStartMinuteText = '00'; |
| | | t.activities.get(3).actEndHourText = '18'; |
| | | t.activities.get(3).actEndMinuteText = '00'; |
| | | t.activities.get(3).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(3).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(3).act.Description__c = '結果'; |
| | | t.activities.get(3).act.Purpose_Type__c = '新品装机使用保养培训'; |
| | | t.activities.get(3).act.Purpose_Type2__c = 'NTC/TTC'; |
| | | t.activities.get(3).act.Purpose_Type3__c = '点検'; |
| | | t.activities.get(3).act.Purpose_Type4__c = '巡回'; |
| | | t.activities.get(3).act.Purpose_Type5__c = 'ON-CALL'; |
| | | t.activities.get(3).act.Location__c = '戦略科室分類1 診療科1'; |
| | | t.activities.get(3).planStartHourText = '9'; |
| | | t.activities.get(3).planStartMinuteText = '00'; |
| | | t.activities.get(3).planEndHourText = '18'; |
| | | t.activities.get(3).planEndMinuteText = '00'; |
| | | t.activities.get(3).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // Date d = date.today(); |
| | | // String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | t.activities.get(4).actStartHourText = '9'; |
| | | t.activities.get(4).actStartMinuteText = '00'; |
| | | t.activities.get(4).actEndHourText = '18'; |
| | | t.activities.get(4).actEndMinuteText = '00'; |
| | | t.activities.get(4).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(4).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(4).act.Description__c = '結果'; |
| | | t.activities.get(4).act.Purpose_Type__c = '修理説明'; |
| | | t.activities.get(4).act.Purpose_Type2__c = '投诉対応(含QIS)'; |
| | | t.activities.get(4).act.Purpose_Type3__c = '回款'; |
| | | t.activities.get(4).act.Location__c = '戦略科室分類1 診療科1'; |
| | | t.activities.get(4).planStartHourText = '9'; |
| | | t.activities.get(4).planStartMinuteText = '00'; |
| | | t.activities.get(4).planEndHourText = '18'; |
| | | t.activities.get(4).planEndMinuteText = '00'; |
| | | t.activities.get(4).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // Datetime dt = datetime.now(); |
| | | // String strDatetime = '2000/01/01 10:10'; |
| | | // System.debug('strDatetime' + strDatetime); |
| | | t.activities.get(5).actStartHourText = '9'; |
| | | t.activities.get(5).actStartMinuteText = '00'; |
| | | t.activities.get(5).actEndHourText = '18'; |
| | | t.activities.get(5).actEndMinuteText = '00'; |
| | | t.activities.get(5).act.Activity_Type2__c = '販売店'; |
| | | t.activities.get(5).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(5).act.Description__c = '結果'; |
| | | t.activities.get(5).act.Purpose_Type__c = '会議参加'; |
| | | t.activities.get(5).act.Purpose_Type2__c = '产品培训'; |
| | | t.activities.get(5).act.Purpose_Type3__c = '询价进行活动'; |
| | | t.activities.get(5).act.Purpose_Type4__c = '售后事宜'; |
| | | t.activities.get(5).act.Purpose_Type5__c = '库存管理'; |
| | | t.activities.get(5).planStartHourText = '9'; |
| | | t.activities.get(5).planStartMinuteText = '00'; |
| | | t.activities.get(5).planEndHourText = '18'; |
| | | t.activities.get(5).planEndMinuteText = '00'; |
| | | t.activities.get(5).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // System.Test.startTest(); |
| | | // String ntId = Add_Report.addReportNT(u1.id, t.activities.get(0).act.NTC_ID__c, t.report.id, t.activities.get(0).act.id, 'NTC', accDep.Id, con1.id, con2.id, con3.id, con4.id, con5.id, strDatetime, strDatetime, '内視鏡室'); |
| | | // t.save(); |
| | | // System.Test.stopTest(); |
| | | // } |
| | | // } |
| | | t.activities.get(6).actStartHourText = '9'; |
| | | t.activities.get(6).actStartMinuteText = '00'; |
| | | t.activities.get(6).actEndHourText = '18'; |
| | | t.activities.get(6).actEndMinuteText = '00'; |
| | | t.activities.get(6).act.Activity_Type2__c = '社内活動'; |
| | | t.activities.get(6).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(6).act.Description__c = '結果'; |
| | | t.activities.get(6).act.Purpose_Type__c = '備品検査'; |
| | | t.activities.get(6).act.Purpose_Type2__c = '軽修理'; |
| | | t.activities.get(6).act.Purpose_Type3__c = '会議'; |
| | | t.activities.get(6).act.Purpose_Type4__c = '培训'; |
| | | t.activities.get(6).act.Purpose_Type5__c = '顧客訪問対応'; |
| | | t.activities.get(6).planStartHourText = '9'; |
| | | t.activities.get(6).planStartMinuteText = '00'; |
| | | t.activities.get(6).planEndHourText = '18'; |
| | | t.activities.get(6).planEndMinuteText = '00'; |
| | | t.activities.get(6).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // static void test01_08() { |
| | | // init(); |
| | | t.activities.get(7).actStartHourText = '9'; |
| | | t.activities.get(7).actStartMinuteText = '00'; |
| | | t.activities.get(7).actEndHourText = '18'; |
| | | t.activities.get(7).actEndMinuteText = '00'; |
| | | t.activities.get(7).act.Activity_Type2__c = '社内活動'; |
| | | t.activities.get(7).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(7).act.Description__c = '結果'; |
| | | t.activities.get(7).act.Purpose_Type__c = '資料作成'; |
| | | t.activities.get(7).act.Purpose_Type2__c = '电话拜访'; |
| | | t.activities.get(7).planStartHourText = '9'; |
| | | t.activities.get(7).planStartMinuteText = '00'; |
| | | t.activities.get(7).planEndHourText = '18'; |
| | | t.activities.get(7).planEndMinuteText = '00'; |
| | | t.activities.get(7).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // System.runAs(u1) { |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | t.activities.get(8).actStartHourText = '9'; |
| | | t.activities.get(8).actStartMinuteText = '00'; |
| | | t.activities.get(8).actEndHourText = '18'; |
| | | t.activities.get(8).actEndMinuteText = '00'; |
| | | t.activities.get(8).act.Activity_Type2__c = '社外イベント'; |
| | | t.activities.get(8).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(8).act.Description__c = '結果'; |
| | | t.activities.get(8).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(8).act.Purpose_Type2__c = '客户咨询对应'; |
| | | t.activities.get(8).act.Purpose_Type3__c = '学会or展会对应'; |
| | | t.activities.get(8).act.Purpose_Type4__c = '信息搜集'; |
| | | t.activities.get(8).act.Purpose_Type5__c = '产品介绍or推广'; |
| | | t.activities.get(8).planStartHourText = '9'; |
| | | t.activities.get(8).planStartMinuteText = '00'; |
| | | t.activities.get(8).planEndHourText = '18'; |
| | | t.activities.get(8).planEndMinuteText = '00'; |
| | | t.activities.get(8).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // // t.getEvent(); |
| | | // // t.report.Reporter__c = u1.id; |
| | | t.activities.get(9).actStartHourText = '9'; |
| | | t.activities.get(9).actStartMinuteText = '00'; |
| | | t.activities.get(9).actEndHourText = '18'; |
| | | t.activities.get(9).actEndMinuteText = '00'; |
| | | t.activities.get(9).act.Activity_Type2__c = '移動'; |
| | | t.activities.get(9).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(9).act.Description__c = '結果'; |
| | | t.activities.get(9).act.Purpose_Type__c = '移動'; |
| | | t.activities.get(9).planStartHourText = '9'; |
| | | t.activities.get(9).planStartMinuteText = '00'; |
| | | t.activities.get(9).planEndHourText = '18'; |
| | | t.activities.get(9).planEndMinuteText = '00'; |
| | | t.activities.get(9).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | t.activities.get(10).actStartHourText = '9'; |
| | | t.activities.get(10).actStartMinuteText = '00'; |
| | | t.activities.get(10).actEndHourText = '18'; |
| | | t.activities.get(10).actEndMinuteText = '00'; |
| | | t.activities.get(10).act.Activity_Type2__c = '休暇'; |
| | | t.activities.get(10).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(10).act.Description__c = '結果'; |
| | | t.activities.get(10).act.Purpose_Type__c = '休暇'; |
| | | t.activities.get(10).planStartHourText = '9'; |
| | | t.activities.get(10).planStartMinuteText = '00'; |
| | | t.activities.get(10).planEndHourText = '18'; |
| | | t.activities.get(10).planEndMinuteText = '00'; |
| | | t.activities.get(10).planPurposeText = '次の活動予定目的(計画)'; |
| | | t.upsertActIndex = '0'; |
| | | t.openPDNew(); |
| | | |
| | | t.upsertActIndex = ''; |
| | | t.save(); |
| | | |
| | | String actId = t.activities.get(0).act.id; |
| | | |
| | | Event e = new Event(); |
| | | e.ActivityDateTime = datetime.now(); |
| | | e.DurationInMinutes = 0; |
| | | e.OwnerId = UserInfo.getUserId(); |
| | | insert e; |
| | | |
| | | PageReference pageRef1 = Page.XinDailyReport; |
| | | pageRef1.getParameters().put('id', e.id); |
| | | Test.setCurrentPage(pageRef1); |
| | | t.init(); |
| | | |
| | | PageReference pageRef2 = Page.XinDailyReport; |
| | | pageRef2.getParameters().put('id', actId); |
| | | Test.setCurrentPage(pageRef2); |
| | | t.init(); |
| | | |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | t.getDailyReport(); |
| | | // t.getEvent(); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | @isTest |
| | | static void test05() { |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user) { |
| | | //System.Test.startTest(); |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | // t.getEvent(); |
| | | |
| | | // t.report.Reported_Date__c = date.today(); |
| | | // t.repoStartHourText = '9'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '18'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.report.Status__c = '申請中'; |
| | | // t.activities.get(0).actStartHourText = '9'; |
| | | // t.activities.get(0).actStartMinuteText = '00'; |
| | | // t.activities.get(0).actEndHourText = '18'; |
| | | // t.activities.get(0).actEndMinuteText = '00'; |
| | | // t.activities.get(0).act.nextPlanDate__c = date.today(); |
| | | // t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1test'; |
| | | // t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(0).act.Description__c = '結果'; |
| | | // t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = null; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = null; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = null; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = null; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = null; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = opp1.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = opp2.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = opp3.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = opp4.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = opp5.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name + 'test'; |
| | | // t.activities.get(0).planStartHourText = '9'; |
| | | // t.activities.get(0).planStartMinuteText = '00'; |
| | | // t.activities.get(0).planEndHourText = '18'; |
| | | // t.activities.get(0).planEndMinuteText = '00'; |
| | | // t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | // t.save(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | |
| | | // t.activities.get(0).act.Location__c = accDepName; |
| | | // t.activities.get(0).act.whatid__c = accDep.Id; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | // t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | // t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | // t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | // t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | // t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | // t.activities.get(0).act.Related_Service1_ID__c = mc1.Id; |
| | | // t.activities.get(0).act.Related_Service2_ID__c = mc2.Id; |
| | | // t.upsertActIndex = '0'; |
| | | // t.save(); |
| | | t.report.Status__c = '申請中'; |
| | | t.report.Reported_Date__c = date.today(); |
| | | t.repoStartHourText = '9'; |
| | | t.repoStartMinuteText = '00'; |
| | | t.repoEndHourText = '18'; |
| | | t.repoEndMinuteText = '00'; |
| | | t.activities.get(0).actStartHourText = '9'; |
| | | t.activities.get(0).actStartMinuteText = '00'; |
| | | t.activities.get(0).actEndHourText = '18'; |
| | | t.activities.get(0).actEndMinuteText = '00'; |
| | | t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(0).act.Description__c = '結果'; |
| | | t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(0).act.Purpose_Type2__c = '客户咨询对应'; |
| | | t.activities.get(0).act.Purpose_Type3__c = '学会or展会对应'; |
| | | t.activities.get(0).act.Purpose_Type4__c = '信息搜集'; |
| | | t.activities.get(0).act.Purpose_Type5__c = '产品介绍or推广'; |
| | | t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1'; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | t.activities.get(0).act.Related_Opportunity1__c = '引合1'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = '引合2'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = '引合3'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = '引合4'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = '引合5'; |
| | | t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | t.activities.get(0).planStartHourText = '9'; |
| | | t.activities.get(0).planStartMinuteText = '00'; |
| | | t.activities.get(0).planEndHourText = '18'; |
| | | t.activities.get(0).planEndMinuteText = '00'; |
| | | t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // Date d = date.today(); |
| | | // String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | t.activities.get(1).actStartHourText = '9'; |
| | | t.activities.get(1).actStartMinuteText = '00'; |
| | | t.activities.get(1).actEndHourText = '18'; |
| | | t.activities.get(1).actEndMinuteText = '00'; |
| | | t.activities.get(1).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(1).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(1).act.Description__c = '結果'; |
| | | t.activities.get(1).act.Purpose_Type__c = 'OPD'; |
| | | t.activities.get(1).act.Purpose_Type2__c = '询价or维修询价跟进'; |
| | | t.activities.get(1).act.Purpose_Type3__c = '经销商协助or拜访'; |
| | | t.activities.get(1).act.Purpose_Type4__c = '合同商谈'; |
| | | t.activities.get(1).act.Purpose_Type5__c = '参加招标'; |
| | | t.activities.get(1).act.Location__c = '戦略科室分類1 診療科1'; |
| | | t.activities.get(1).planStartHourText = '9'; |
| | | t.activities.get(1).planStartMinuteText = '00'; |
| | | t.activities.get(1).planEndHourText = '18'; |
| | | t.activities.get(1).planEndMinuteText = '00'; |
| | | t.activities.get(1).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // Datetime dt = datetime.now(); |
| | | // String strDatetime = '2000/01/01 10:10'; |
| | | // System.debug('strDatetime' + strDatetime); |
| | | t.activities.get(2).actStartHourText = '9'; |
| | | t.activities.get(2).actStartMinuteText = '00'; |
| | | t.activities.get(2).actEndHourText = '18'; |
| | | t.activities.get(2).actEndMinuteText = '00'; |
| | | t.activities.get(2).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(2).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(2).act.Description__c = '結果'; |
| | | t.activities.get(2).act.Purpose_Type__c = '签订合同'; |
| | | t.activities.get(2).act.Purpose_Type2__c = '納品(装机)'; |
| | | t.activities.get(2).act.Purpose_Type3__c = '送or取设备'; |
| | | t.activities.get(2).act.Purpose_Type4__c = '送or取文件类资料'; |
| | | t.activities.get(2).act.Purpose_Type5__c = '跟台'; |
| | | t.activities.get(2).act.Location__c = '戦略科室分類1 診療科1'; |
| | | t.activities.get(2).planStartHourText = '9'; |
| | | t.activities.get(2).planStartMinuteText = '00'; |
| | | t.activities.get(2).planEndHourText = '18'; |
| | | t.activities.get(2).planEndMinuteText = '00'; |
| | | t.activities.get(2).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // System.Test.startTest(); |
| | | // System.debug('t.activities.get(0).act.id:::::' + t.activities.get(0).act.id); |
| | | // String opId = Add_Report.addReportOP(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'OPD', '戦略科室分類1 診療科1test', con1.id, con2.id, con3.id, con4.id, con5.id, opp1.Id, opp2.Id, opp3.Id, opp4.Id, opp5.Id, strDate); |
| | | // if (opId != 'false') t.activities.get(0).act.OPD_ID__c = opId; |
| | | // t.save(); |
| | | // System.Test.stopTest(); |
| | | // } |
| | | // } |
| | | t.activities.get(3).actStartHourText = '9'; |
| | | t.activities.get(3).actStartMinuteText = '00'; |
| | | t.activities.get(3).actEndHourText = '18'; |
| | | t.activities.get(3).actEndMinuteText = '00'; |
| | | t.activities.get(3).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(3).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(3).act.Description__c = '結果'; |
| | | t.activities.get(3).act.Purpose_Type__c = '新品装机使用保养培训'; |
| | | t.activities.get(3).act.Purpose_Type2__c = 'NTC/TTC'; |
| | | t.activities.get(3).act.Purpose_Type3__c = '点検'; |
| | | t.activities.get(3).act.Purpose_Type4__c = '巡回'; |
| | | t.activities.get(3).act.Purpose_Type5__c = 'ON-CALL'; |
| | | t.activities.get(3).act.Location__c = '戦略科室分類1 診療科1'; |
| | | t.activities.get(3).planStartHourText = '9'; |
| | | t.activities.get(3).planStartMinuteText = '00'; |
| | | t.activities.get(3).planEndHourText = '18'; |
| | | t.activities.get(3).planEndMinuteText = '00'; |
| | | t.activities.get(3).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // static void test01_09() { |
| | | // init(); |
| | | t.activities.get(4).actStartHourText = '9'; |
| | | t.activities.get(4).actStartMinuteText = '00'; |
| | | t.activities.get(4).actEndHourText = '18'; |
| | | t.activities.get(4).actEndMinuteText = '00'; |
| | | t.activities.get(4).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(4).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(4).act.Description__c = '結果'; |
| | | t.activities.get(4).act.Purpose_Type__c = '修理説明'; |
| | | t.activities.get(4).act.Purpose_Type2__c = '投诉対応(含QIS)'; |
| | | t.activities.get(4).act.Purpose_Type3__c = '回款'; |
| | | t.activities.get(4).act.Location__c = '戦略科室分類1 診療科1'; |
| | | t.activities.get(4).planStartHourText = '9'; |
| | | t.activities.get(4).planStartMinuteText = '00'; |
| | | t.activities.get(4).planEndHourText = '18'; |
| | | t.activities.get(4).planEndMinuteText = '00'; |
| | | t.activities.get(4).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // System.runAs(u1) { |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | t.activities.get(5).actStartHourText = '9'; |
| | | t.activities.get(5).actStartMinuteText = '00'; |
| | | t.activities.get(5).actEndHourText = '18'; |
| | | t.activities.get(5).actEndMinuteText = '00'; |
| | | t.activities.get(5).act.Activity_Type2__c = '販売店'; |
| | | t.activities.get(5).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(5).act.Description__c = '結果'; |
| | | t.activities.get(5).act.Purpose_Type__c = '会議参加'; |
| | | t.activities.get(5).act.Purpose_Type2__c = '产品培训'; |
| | | t.activities.get(5).act.Purpose_Type3__c = '询价进行活动'; |
| | | t.activities.get(5).act.Purpose_Type4__c = '售后事宜'; |
| | | t.activities.get(5).act.Purpose_Type5__c = '库存管理'; |
| | | t.activities.get(5).planStartHourText = '9'; |
| | | t.activities.get(5).planStartMinuteText = '00'; |
| | | t.activities.get(5).planEndHourText = '18'; |
| | | t.activities.get(5).planEndMinuteText = '00'; |
| | | t.activities.get(5).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // // t.getEvent(); |
| | | // // t.report.Reporter__c = u1.id; |
| | | t.activities.get(6).actStartHourText = '9'; |
| | | t.activities.get(6).actStartMinuteText = '00'; |
| | | t.activities.get(6).actEndHourText = '18'; |
| | | t.activities.get(6).actEndMinuteText = '00'; |
| | | t.activities.get(6).act.Activity_Type2__c = '社内活動'; |
| | | t.activities.get(6).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(6).act.Description__c = '結果'; |
| | | t.activities.get(6).act.Purpose_Type__c = '備品検査'; |
| | | t.activities.get(6).act.Purpose_Type2__c = '軽修理'; |
| | | t.activities.get(6).act.Purpose_Type3__c = '会議'; |
| | | t.activities.get(6).act.Purpose_Type4__c = '培训'; |
| | | t.activities.get(6).act.Purpose_Type5__c = '顧客訪問対応'; |
| | | t.activities.get(6).planStartHourText = '9'; |
| | | t.activities.get(6).planStartMinuteText = '00'; |
| | | t.activities.get(6).planEndHourText = '18'; |
| | | t.activities.get(6).planEndMinuteText = '00'; |
| | | t.activities.get(6).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.report.Reported_Date__c = date.today(); |
| | | // t.repoStartHourText = '9'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '18'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.report.Status__c = '申請中'; |
| | | // t.activities.get(0).actStartHourText = '9'; |
| | | // t.activities.get(0).actStartMinuteText = '00'; |
| | | // t.activities.get(0).actEndHourText = '18'; |
| | | // t.activities.get(0).actEndMinuteText = '00'; |
| | | // t.activities.get(0).act.nextPlanDate__c = date.today(); |
| | | // t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1test'; |
| | | // t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(0).act.Description__c = '結果'; |
| | | // t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = null; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = null; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = null; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = null; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = null; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = opp1.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = opp2.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = opp3.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = opp4.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = opp5.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name + 'test'; |
| | | // t.activities.get(0).planStartHourText = '9'; |
| | | // t.activities.get(0).planStartMinuteText = '00'; |
| | | // t.activities.get(0).planEndHourText = '18'; |
| | | // t.activities.get(0).planEndMinuteText = '00'; |
| | | // t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | // t.save(); |
| | | t.activities.get(7).actStartHourText = '9'; |
| | | t.activities.get(7).actStartMinuteText = '00'; |
| | | t.activities.get(7).actEndHourText = '18'; |
| | | t.activities.get(7).actEndMinuteText = '00'; |
| | | t.activities.get(7).act.Activity_Type2__c = '社内活動'; |
| | | t.activities.get(7).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(7).act.Description__c = '結果'; |
| | | t.activities.get(7).act.Purpose_Type__c = '資料作成'; |
| | | t.activities.get(7).act.Purpose_Type2__c = '电话拜访'; |
| | | t.activities.get(7).planStartHourText = '9'; |
| | | t.activities.get(7).planStartMinuteText = '00'; |
| | | t.activities.get(7).planEndHourText = '18'; |
| | | t.activities.get(7).planEndMinuteText = '00'; |
| | | t.activities.get(7).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(0).act.Location__c = accDepName; |
| | | // t.activities.get(0).act.whatid__c = accDep.Id; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | // t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | // t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | // t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | // t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | // t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | // t.activities.get(0).act.Related_Service1_ID__c = mc1.Id; |
| | | // t.activities.get(0).act.Related_Service2_ID__c = mc2.Id; |
| | | // t.upsertActIndex = '0'; |
| | | // t.save(); |
| | | t.activities.get(8).actStartHourText = '9'; |
| | | t.activities.get(8).actStartMinuteText = '00'; |
| | | t.activities.get(8).actEndHourText = '18'; |
| | | t.activities.get(8).actEndMinuteText = '00'; |
| | | t.activities.get(8).act.Activity_Type2__c = '社外イベント'; |
| | | t.activities.get(8).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(8).act.Description__c = '結果'; |
| | | t.activities.get(8).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(8).act.Purpose_Type2__c = '客户咨询对应'; |
| | | t.activities.get(8).act.Purpose_Type3__c = '学会or展会对应'; |
| | | t.activities.get(8).act.Purpose_Type4__c = '信息搜集'; |
| | | t.activities.get(8).act.Purpose_Type5__c = '产品介绍or推广'; |
| | | t.activities.get(8).planStartHourText = '9'; |
| | | t.activities.get(8).planStartMinuteText = '00'; |
| | | t.activities.get(8).planEndHourText = '18'; |
| | | t.activities.get(8).planEndMinuteText = '00'; |
| | | t.activities.get(8).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // Date d = date.today(); |
| | | // String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | t.activities.get(9).actStartHourText = '9'; |
| | | t.activities.get(9).actStartMinuteText = '00'; |
| | | t.activities.get(9).actEndHourText = '18'; |
| | | t.activities.get(9).actEndMinuteText = '00'; |
| | | t.activities.get(9).act.Activity_Type2__c = '移動'; |
| | | t.activities.get(9).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(9).act.Description__c = '結果'; |
| | | t.activities.get(9).act.Purpose_Type__c = '移動'; |
| | | t.activities.get(9).planStartHourText = '9'; |
| | | t.activities.get(9).planStartMinuteText = '00'; |
| | | t.activities.get(9).planEndHourText = '18'; |
| | | t.activities.get(9).planEndMinuteText = '00'; |
| | | t.activities.get(9).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // Datetime dt = datetime.now(); |
| | | // String strDatetime = '2000/01/01 10:10'; |
| | | // System.debug('strDatetime' + strDatetime); |
| | | t.activities.get(10).actStartHourText = '9'; |
| | | t.activities.get(10).actStartMinuteText = '00'; |
| | | t.activities.get(10).actEndHourText = '18'; |
| | | t.activities.get(10).actEndMinuteText = '00'; |
| | | t.activities.get(10).act.Activity_Type2__c = '休暇'; |
| | | t.activities.get(10).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(10).act.Description__c = '結果'; |
| | | t.activities.get(10).act.Purpose_Type__c = '休暇'; |
| | | t.activities.get(10).planStartHourText = '9'; |
| | | t.activities.get(10).planStartMinuteText = '00'; |
| | | t.activities.get(10).planEndHourText = '18'; |
| | | t.activities.get(10).planEndMinuteText = '00'; |
| | | t.activities.get(10).planPurposeText = '次の活動予定目的(計画)'; |
| | | t.upsertActIndex = '0'; |
| | | t.openPDNew(); |
| | | |
| | | // System.Test.startTest(); |
| | | // System.debug('t.activities.get(0).act.id:::::' + t.activities.get(0).act.id); |
| | | // String opId = Add_Report.addReportOP(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'OPD', accDep.Id, con1.id, con2.id, con3.id, con4.id, con5.id, opp1.Id, opp2.Id, opp3.Id, opp1.Id, opp5.Id, strDate); |
| | | // if (opId != 'false') t.activities.get(0).act.OPD_ID__c = opId; |
| | | // t.save(); |
| | | // System.Test.stopTest(); |
| | | // } |
| | | // } |
| | | t.upsertActIndex = ''; |
| | | t.save(); |
| | | |
| | | // static void test01_10() { |
| | | // init(); |
| | | String actId = t.activities.get(0).act.id; |
| | | |
| | | // System.runAs(u1) { |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | Event e = new Event(); |
| | | e.ActivityDateTime = datetime.now(); |
| | | e.DurationInMinutes = 0; |
| | | e.OwnerId = UserInfo.getUserId(); |
| | | insert e; |
| | | |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // // t.getEvent(); |
| | | // // t.report.Reporter__c = u1.id; |
| | | PageReference pageRef1 = Page.XinDailyReport; |
| | | pageRef1.getParameters().put('id', e.id); |
| | | Test.setCurrentPage(pageRef1); |
| | | t.init(); |
| | | |
| | | // t.report.Reported_Date__c = date.today(); |
| | | // t.repoStartHourText = '9'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '18'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.report.Status__c = '申請中'; |
| | | // t.activities.get(0).actStartHourText = '9'; |
| | | // t.activities.get(0).actStartMinuteText = '00'; |
| | | // t.activities.get(0).actEndHourText = '18'; |
| | | // t.activities.get(0).actEndMinuteText = '00'; |
| | | // t.activities.get(0).act.nextPlanDate__c = date.today(); |
| | | // t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1test'; |
| | | // t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(0).act.Description__c = '結果'; |
| | | // t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = null; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = null; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = null; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = null; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = null; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = opp1.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = opp2.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = opp3.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = opp4.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = opp5.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name + 'test'; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name + 'test'; |
| | | // t.activities.get(0).planStartHourText = '9'; |
| | | // t.activities.get(0).planStartMinuteText = '00'; |
| | | // t.activities.get(0).planEndHourText = '18'; |
| | | // t.activities.get(0).planEndMinuteText = '00'; |
| | | // t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | // t.save(); |
| | | PageReference pageRef2 = Page.XinDailyReport; |
| | | pageRef2.getParameters().put('id', actId); |
| | | Test.setCurrentPage(pageRef2); |
| | | t.init(); |
| | | |
| | | // t.activities.get(0).act.Location__c = accDepName; |
| | | // t.activities.get(0).act.whatid__c = accDep.Id; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | // t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | // t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | // t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | // t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | // t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | // t.activities.get(0).act.Related_Service1_ID__c = mc1.Id; |
| | | // t.activities.get(0).act.Related_Service2_ID__c = mc2.Id; |
| | | // t.upsertActIndex = '0'; |
| | | // t.save(); |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | t.getDailyReport(); |
| | | // t.getEvent(); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | // Date d = date.today(); |
| | | // String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | @isTest |
| | | static void test06() { |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | XinDailyReportControllerTest.settTestData(); |
| | | System.runAs(u1) { |
| | | System.Test.startTest(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | |
| | | // Datetime dt = datetime.now(); |
| | | // String strDatetime = '2000/01/01 10:10'; |
| | | // System.debug('strDatetime' + strDatetime); |
| | | Event e = new Event(); |
| | | e.ActivityDateTime = datetime.now(); |
| | | e.DurationInMinutes = 0; |
| | | e.OwnerId = u1.id; |
| | | insert e; |
| | | |
| | | // System.Test.startTest(); |
| | | // System.debug('t.activities.get(0).act.id:::::' + t.activities.get(0).act.id); |
| | | // String opId = Add_Report.addReportOP(u1.id, t.activities.get(0).act.OPD_ID__c, t.report.id, t.activities.get(0).act.id, 'OPD', accDep.Id, con1.id, con2.id, con3.id, con4.id, con5.id, opp1.Id, opp2.Id, opp3.Id, opp1.Id, opp5.Id, strDate); |
| | | // if (opId != 'false') t.activities.get(0).act.OPD_ID__c = opId; |
| | | // t.save(); |
| | | // System.Test.stopTest(); |
| | | // } |
| | | // } |
| | | PageReference pageRef1 = Page.XinDailyReport; |
| | | pageRef1.getParameters().put('id', e.id); |
| | | Test.setCurrentPage(pageRef1); |
| | | t.init(); |
| | | |
| | | // static void test02_01() { |
| | | // init(); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | // System.runAs(u1) { |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | @isTest |
| | | static void test07_01() { |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user) { |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | // t.getEvent(); |
| | | |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // // t.getEvent(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | t.addActivity(); |
| | | |
| | | // t.report.Status__c = '申請中'; |
| | | // t.report.Reported_Date__c = date.today(); |
| | | // t.repoStartHourText = '9'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '18'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.activities.get(0).actStartHourText = '9'; |
| | | // t.activities.get(0).actStartMinuteText = '00'; |
| | | // t.activities.get(0).actEndHourText = '18'; |
| | | // t.activities.get(0).actEndMinuteText = '00'; |
| | | // t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(0).act.Description__c = '結果'; |
| | | // t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | // t.activities.get(0).act.Location__c = accDepName; |
| | | // t.activities.get(0).act.whatid__c = accDep.Id; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | // t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | // t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | // t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | // t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | // t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | // t.activities.get(0).act.Related_Service1_ID__c = mc1.Id; |
| | | // t.activities.get(0).act.Related_Service2_ID__c = mc2.Id; |
| | | // t.activities.get(0).planStartHourText = '9'; |
| | | // t.activities.get(0).planStartMinuteText = '00'; |
| | | // t.activities.get(0).planEndHourText = '18'; |
| | | // t.activities.get(0).planEndMinuteText = '00'; |
| | | // t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | // t.upsertActIndex = '0'; |
| | | // t.save(); |
| | | t.report.Status__c = '申請中'; |
| | | t.report.Reported_Date__c = date.today(); |
| | | t.repoStartHourText = '9'; |
| | | t.repoStartMinuteText = '00'; |
| | | t.repoEndHourText = '18'; |
| | | t.repoEndMinuteText = '00'; |
| | | t.activities.get(0).actStartHourText = '9'; |
| | | t.activities.get(0).actStartMinuteText = '00'; |
| | | t.activities.get(0).actEndHourText = '18'; |
| | | t.activities.get(0).actEndMinuteText = '00'; |
| | | t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(0).act.Description__c = '結果'; |
| | | t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(0).act.Purpose_Type2__c = '客户咨询对应'; |
| | | t.activities.get(0).act.Purpose_Type3__c = '学会or展会对应'; |
| | | t.activities.get(0).act.Purpose_Type4__c = '信息搜集'; |
| | | t.activities.get(0).act.Purpose_Type5__c = '产品介绍or推广'; |
| | | t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1'; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | t.activities.get(0).act.Related_Opportunity1__c = '引合1'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = '引合2'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = '引合3'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = '引合4'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = '引合5'; |
| | | t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | t.activities.get(0).planStartHourText = '9'; |
| | | t.activities.get(0).planStartMinuteText = '00'; |
| | | t.activities.get(0).planEndHourText = '18'; |
| | | t.activities.get(0).planEndMinuteText = '00'; |
| | | t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | t.activities.get(0).act.Free_Input__c = true; |
| | | t.activities.get(0).act.Find_Imitations_Flag__c = true; |
| | | t.save(); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | // Date d = date.today(); |
| | | // String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | // 取引先などのマスタ検索 |
| | | @isTest |
| | | static void test07_02_1() { |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | //System.Test.startTest(); |
| | | System.runAs(user) { |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | t.report_search.Reporter__c = u1.id; |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | System.assertEquals(u1.id, t.report.Reporter__c); |
| | | // t.getEvent(); |
| | | |
| | | // Datetime dt = datetime.now(); |
| | | // String strDatetime = '2000/01/01 10:10'; |
| | | t.report.Status__c = '承認'; |
| | | t.save(); |
| | | |
| | | // System.Test.startTest(); |
| | | t.report.Feed_Back_From_Manager__c = 'OK'; |
| | | t.report.Submit_Date_New__c = date.today(); |
| | | t.save(); |
| | | |
| | | // //t.activities.get(0).act.OnCall_ID__c = Add_Report.addReportOn(t.report.id, t.report.id, t.activities.get(0).act.id, 'On_Call', '戦略科室分類1 診療科1test', strDate); |
| | | // //t.activities.get(0).act.OnCall_ID__c = Add_Report.addReportOn(t.report.id, t.report.id, t.activities.get(0).act.id, 'On_Call', '戦略科室分類1 診療科1', strDate); |
| | | // //t.activities.get(0).act.OnCall_ID__c = Add_Report.addReportOn(t.activities.get(0).act.OnCall_ID__c, t.report.id, t.activities.get(0).act.id, 'On_Call', '戦略科室分類1 診療科1', strDate); |
| | | t.report.Status__c = '非承認'; |
| | | t.save(); |
| | | System.Test.stopTest(); |
| | | } |
| | | //System.Test.stopTest(); |
| | | } |
| | | @isTest |
| | | static void test07_02_1_2() { |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | //System.Test.startTest(); |
| | | System.runAs(user) { |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | t.report_search.Reporter__c = u1.id; |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | System.assertEquals(u1.id, t.report.Reporter__c); |
| | | // t.getEvent(); |
| | | |
| | | // String raId = Add_Report.addReportAc(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Visit_With', '戦略科室分類1 診療科1test', strDate, '結果'); |
| | | // raId = Add_Report.addReportAc(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Visit_With', accDep.Id, strDate, '結果'); |
| | | // raId = Add_Report.addReportAc(u1.id, t.activities.get(0).act.ReportAccompanied_ID__c, t.report.id, t.activities.get(0).act.id, 'Visit_With', accDep.Id, strDate, '結果'); |
| | | // if (raId != 'false') t.activities.get(0).act.ReportAccompanied_ID__c = raId; |
| | | // // t.activities.get(0).act.ReportAccompanied_ID__c = Add_Report.addReportAc(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Visit_With', '戦略科室分類1 診療科1test', strDate, '結果'); |
| | | // // t.activities.get(0).act.ReportAccompanied_ID__c = Add_Report.addReportAc(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Visit_With', '戦略科室分類1 診療科1', strDate, '結果'); |
| | | // // t.activities.get(0).act.ReportAccompanied_ID__c = Add_Report.addReportAc(u1.id, t.activities.get(0).act.ReportAccompanied_ID__c, t.report.id, t.activities.get(0).act.id, 'Visit_With', '戦略科室分類1 診療科1', strDate, '結果'); |
| | | t.report.Status__c = '承認'; |
| | | t.save(); |
| | | |
| | | // String csId = Add_Report.addReportEx(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'MarketCondition', '戦略科室分類1 診療科1test', con1.id, strDate, '結果'); |
| | | // csId = Add_Report.addReportEx(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'MarketCondition', accDep.Id, con1.id, strDate, '結果'); |
| | | // csId = Add_Report.addReportEx(u1.id, t.activities.get(0).act.CityStatus_ID__c, t.report.id, t.activities.get(0).act.id, 'MarketCondition', accDep.Id, con1.id, strDate, '結果'); |
| | | // if (csId != 'false') t.activities.get(0).act.CityStatus_ID__c = csId; |
| | | // // t.activities.get(0).act.CityStatus_ID__c = Add_Report.addReportEx(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'MarketCondition', '戦略科室分類1 診療科1test', strDate, '結果'); |
| | | // // t.activities.get(0).act.CityStatus_ID__c = Add_Report.addReportEx(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'MarketCondition', '戦略科室分類1 診療科1', strDate, '結果'); |
| | | // // t.activities.get(0).act.CityStatus_ID__c = Add_Report.addReportEx(u1.id, t.activities.get(0).act.CityStatus_ID__c, t.report.id, t.activities.get(0).act.id, 'MarketCondition', '戦略科室分類1 診療科1', strDate, '結果'); |
| | | t.report.Feed_Back_From_Manager__c = 'OK'; |
| | | t.report.Submit_Date_New__c = date.today(); |
| | | t.save(); |
| | | |
| | | // System.Test.stopTest(); |
| | | // } |
| | | // } |
| | | // static void test02_02() { |
| | | // init(); |
| | | t.report.Status__c = '非承認'; |
| | | t.save(); |
| | | System.Test.stopTest(); |
| | | } |
| | | //System.Test.stopTest(); |
| | | } |
| | | @isTest |
| | | static void test07_02_1_3() { |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | //System.Test.startTest(); |
| | | System.runAs(user) { |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | Xin_SearchVisitorPlace_Campaign blgsvpc = new Xin_SearchVisitorPlace_Campaign(); |
| | | PageReference pageRef4 = Page.Xin_SearchVisitorPlace_Campaign; |
| | | pageRef4.getParameters().put('q', ''); |
| | | Test.setCurrentPage(pageRef4); |
| | | blgsvpc.search(); |
| | | |
| | | // System.runAs(u1) { |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | pageRef4.getParameters().put('q', 'test'); |
| | | Test.setCurrentPage(pageRef4); |
| | | blgsvpc.search(); |
| | | RestContext.response = new RestResponse(); |
| | | Xin_SearchVisitorPlace_CampaignRest.doPost('test', '東京', '2000/01/01'); |
| | | |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // // t.getEvent(); |
| | | Xin_SearchVisitorPlace_Training blgsvpt = new Xin_SearchVisitorPlace_Training(); |
| | | PageReference pageRef5 = Page.Xin_SearchVisitorPlace_Training; |
| | | pageRef5.getParameters().put('q', ''); |
| | | Test.setCurrentPage(pageRef5); |
| | | blgsvpt.search(); |
| | | System.Test.stopTest(); |
| | | } |
| | | //System.Test.stopTest(); |
| | | } |
| | | @isTest |
| | | static void test07_02_1_4() { |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user) { |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | Xin_SearchVisitorPlace blgsv = new Xin_SearchVisitorPlace(); |
| | | PageReference pageRef1 = Page.Xin_SearchVisitorPlace; |
| | | pageRef1.getParameters().put('q', ''); |
| | | Test.setCurrentPage(pageRef1); |
| | | blgsv.search(); |
| | | |
| | | // t.report.Status__c = '申請中'; |
| | | // t.report.Reported_Date__c = date.today(); |
| | | // t.repoStartHourText = '9'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '18'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.activities.get(0).actStartHourText = '9'; |
| | | // t.activities.get(0).actStartMinuteText = '00'; |
| | | // t.activities.get(0).actEndHourText = '18'; |
| | | // t.activities.get(0).actEndMinuteText = '00'; |
| | | // t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(0).act.Description__c = '結果'; |
| | | // t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | // t.activities.get(0).act.Location__c = accDepName; |
| | | // t.activities.get(0).act.whatid__c = accDep.Id; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | // t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | // t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | // t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | // t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | // t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | // t.activities.get(0).act.Related_Service1_ID__c = mc1.Id; |
| | | // t.activities.get(0).act.Related_Service2_ID__c = mc2.Id; |
| | | // t.activities.get(0).planStartHourText = '9'; |
| | | // t.activities.get(0).planStartMinuteText = '00'; |
| | | // t.activities.get(0).planEndHourText = '18'; |
| | | // t.activities.get(0).planEndMinuteText = '00'; |
| | | // t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | // t.upsertActIndex = '0'; |
| | | // t.save(); |
| | | pageRef1.getParameters().put('q', 'test'); |
| | | Test.setCurrentPage(pageRef1); |
| | | blgsv.search(); |
| | | RestContext.response = new RestResponse(); |
| | | Date Tling = Date.today(); |
| | | Xin_SearchVisitorPlaceRest.doPost('診療科1', '東京', Date.today() + ''); |
| | | |
| | | // Date d = date.today(); |
| | | // String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | Xin_SearchVisitorPlace_Sales blgsvp = new Xin_SearchVisitorPlace_Sales(); |
| | | PageReference pageRef2 = Page.Xin_SearchVisitorPlace_Sales; |
| | | pageRef2.getParameters().put('q', ''); |
| | | Test.setCurrentPage(pageRef2); |
| | | blgsvp.search(); |
| | | |
| | | // Datetime dt = datetime.now(); |
| | | // String strDatetime = '2000/01/01 10:10'; |
| | | pageRef2.getParameters().put('q', 'test'); |
| | | pageRef2.getParameters().put('d', '2000/01/01'); |
| | | Test.setCurrentPage(pageRef2); |
| | | blgsvp.search(); |
| | | RestContext.response = new RestResponse(); |
| | | Xin_SearchVisitorPlace_SalesRest.doPost('test', '東京', '2000/01/01'); |
| | | |
| | | // System.Test.startTest(); |
| | | Xin_SearchVisitorPlace_Training blgsvpt = new Xin_SearchVisitorPlace_Training(); |
| | | PageReference pageRef5 = Page.Xin_SearchVisitorPlace_Training; |
| | | pageRef5.getParameters().put('q', ''); |
| | | Test.setCurrentPage(pageRef5); |
| | | blgsvpt.search(); |
| | | System.Test.stopTest(); |
| | | } |
| | | //System.Test.stopTest(); |
| | | } |
| | | // // 商談などのマスタ検索 |
| | | //@isTest |
| | | static void test07_02_2() { |
| | | User user = [select Id from User where Username = 'olympusTest10@sunbridge.com']; |
| | | System.runAs(user) { |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | t.init(); |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | t.report_search.Reporter__c = u1.id; |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | t = new XinDailyReportController(); |
| | | t.init(); |
| | | System.assertEquals(u1.id, t.report.Reporter__c); |
| | | t.report.Status__c = '非承認'; |
| | | t.save(); |
| | | |
| | | // String cId = Add_Report.addReportEx(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Competitor', '戦略科室分類1 診療科1test', con1.id, strDate, '結果'); |
| | | // cId = Add_Report.addReportEx(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Competitor', accDep.Id, con1.id, strDate, '結果'); |
| | | // cId = Add_Report.addReportEx(u1.id, t.activities.get(0).act.Conflict_ID__c, t.report.id, t.activities.get(0).act.id, 'Competitor', accDep.Id, con1.id, strDate, '結果'); |
| | | // if (cId != 'false') t.activities.get(0).act.Conflict_ID__c = cId; |
| | | // // t.activities.get(0).act.Conflict_ID__c = Add_Report.addReportEx(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Competitor', '戦略科室分類1 診療科1test', strDate, '結果'); |
| | | // // t.activities.get(0).act.Conflict_ID__c = Add_Report.addReportEx(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Competitor', '戦略科室分類1 診療科1', strDate, '結果'); |
| | | // // t.activities.get(0).act.Conflict_ID__c = Add_Report.addReportEx(u1.id, t.activities.get(0).act.Conflict_ID__c, t.report.id, t.activities.get(0).act.id, 'Competitor', '戦略科室分類1 診療科1', strDate, '結果'); |
| | | Xin_SearchOpportunity blgso = new Xin_SearchOpportunity(); |
| | | PageReference pageRef3 = Page.Xin_SearchOpportunity; |
| | | pageRef3.getParameters().put('q', ''); |
| | | pageRef3.getParameters().put('r', ''); |
| | | Test.setCurrentPage(pageRef3); |
| | | blgso.search(); |
| | | |
| | | // t.save(); |
| | | // System.Test.stopTest(); |
| | | // } |
| | | // } |
| | | Account accTmp = [Select Id, Hospital__c from Account where id = : accDep.Id]; |
| | | List<Opportunity> oppTmp = [Select Id from Opportunity where StageName IN ('引合', '注残', '出荷')]; |
| | | pageRef3.getParameters().put('q', '::'); |
| | | pageRef3.getParameters().put('r', accDep.Id); |
| | | Test.setCurrentPage(pageRef3); |
| | | blgso.search(); |
| | | RestContext.response = new RestResponse(); |
| | | Xin_SearchOpportunityRest.doPost('::', accDep.Id); |
| | | |
| | | Xin_Maintenance_Contract blgmc = new Xin_Maintenance_Contract(); |
| | | PageReference pageRef6 = Page.Xin_SearchMaintenanceContract; |
| | | pageRef6.getParameters().put('q', ''); |
| | | pageRef6.getParameters().put('r', ''); |
| | | Test.setCurrentPage(pageRef6); |
| | | blgmc.search(); |
| | | |
| | | // static void test02_03() { |
| | | // init(); |
| | | pageRef6.getParameters().put('q', 'サービス'); |
| | | pageRef6.getParameters().put('r', accDep.Id); |
| | | Test.setCurrentPage(pageRef6); |
| | | blgmc.search(); |
| | | RestContext.response = new RestResponse(); |
| | | Xin_Maintenance_ContractRest.doPost('サービス', accDep.Id); |
| | | |
| | | // System.runAs(u1) { |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | PageReference pageRef7 = Page.SearchVisitor; |
| | | pageRef7.getParameters().put('vp', accDepId); |
| | | Test.setCurrentPage(pageRef7); |
| | | SearchVisitorController svc = new SearchVisitorController(); |
| | | svc.rc.MyDr_Flg__c = true; |
| | | svc.rc.Search_LastName__c = 'testLastName'; |
| | | svc.rc.FirstName = 'testFirstName'; |
| | | svc.rc.Account_Visitor_Search__c = accDep.Id; |
| | | svc.rc.Type__c = 'test'; |
| | | svc.rc.Doctor_Division1__c = 'test'; |
| | | svc.regContact(); |
| | | |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // // t.getEvent(); |
| | | svc.sc.Search_LastName__c = 'testLastName'; |
| | | svc.sc.Search_FirstName__c = 'testFirstName'; |
| | | svc.sc.Type__c = 'test'; |
| | | svc.sc.Doctor_Division1__c = 'test'; |
| | | svc.sc.MyDr_Flg__c = true; |
| | | svc.serContact(); |
| | | |
| | | // t.report.Status__c = '申請中'; |
| | | // t.report.Reported_Date__c = date.today(); |
| | | // t.repoStartHourText = '9'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '18'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.activities.get(0).actStartHourText = '9'; |
| | | // t.activities.get(0).actStartMinuteText = '00'; |
| | | // t.activities.get(0).actEndHourText = '18'; |
| | | // t.activities.get(0).actEndMinuteText = '00'; |
| | | // t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(0).act.Description__c = '結果'; |
| | | // t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | // t.activities.get(0).act.Location__c = accDepName; |
| | | // t.activities.get(0).act.whatid__c = accDep.Id; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = '::引合1'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = '::引合2'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = '::引合3'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = '::引合4'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = '::引合5'; |
| | | // t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | // t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | // t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | // t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | // t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | // t.activities.get(0).act.Related_Service1_ID__c = mc1.Id; |
| | | // t.activities.get(0).act.Related_Service2_ID__c = mc2.Id; |
| | | // t.activities.get(0).planStartHourText = '9'; |
| | | // t.activities.get(0).planStartMinuteText = '00'; |
| | | // t.activities.get(0).planEndHourText = '18'; |
| | | // t.activities.get(0).planEndMinuteText = '00'; |
| | | // t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | // t.upsertActIndex = '0'; |
| | | // t.save(); |
| | | t.delIndex = '0'; |
| | | t.deleteActivity(); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | // System.Test.startTest(); |
| | | // // 部长/经理的反馈 编辑可能 |
| | | @isTest |
| | | static void test08() { |
| | | Profile p = [select id from Profile where id = :System.Label.ProfileId_SystemAdmin]; |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | u3 = [select Id from User where Username = 'olympusTest03@sunbridge.com']; |
| | | u2 = [select Id from User where Username = 'olympusTest02@sunbridge.com']; |
| | | |
| | | // Date d = date.today(); |
| | | // String strDate = d.year() + '/' + d.month() + '/' + d.day(); |
| | | system.runAs(u3) { |
| | | Daily_Report__c dr = new Daily_Report__c(); |
| | | dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | dr.Status__c = '申請中'; |
| | | dr.Reporter__c = u3.Id; |
| | | insert dr; |
| | | |
| | | // Datetime dt = datetime.now(); |
| | | // String strDatetime = '2000/01/01 10:10'; |
| | | Datetime dt = Datetime.now(); |
| | | Event__c e = new Event__c( |
| | | Subject__c = 'test', |
| | | StartDateTime__c = Datetime.newInstance(2016, 1, 1, 1, 0, 0), |
| | | DurationInMinutes__c = 60, |
| | | EndDateTime__c = Datetime.newInstance(2016, 1, 1, 2, 0, 0), |
| | | ActivityDate__c = Date.today(), |
| | | Daily_Report__c = dr.Id |
| | | ); |
| | | insert e; |
| | | |
| | | // String imId = Add_Report.addReportIm(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Improvement', '戦略科室分類1 診療科1test', strDate, '結果'); |
| | | // imId = Add_Report.addReportIm(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Improvement', accDep.Id, strDate, '結果'); |
| | | // imId = Add_Report.addReportIm(u1.id, t.activities.get(0).act.Improvement_ID__c, t.report.id, t.activities.get(0).act.id, 'Improvement', accDep.Id, strDate, '結果'); |
| | | // if (imId != 'false') t.activities.get(0).act.Improvement_ID__c = imId; |
| | | // // t.activities.get(0).act.Improvement_ID__c = Add_Report.addReportIm(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Improvement', '戦略科室分類1 診療科1test', strDate, '結果'); |
| | | // // t.activities.get(0).act.Improvement_ID__c = Add_Report.addReportIm(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Improvement', '戦略科室分類1 診療科1', strDate, '結果'); |
| | | // // t.activities.get(0).act.Improvement_ID__c = Add_Report.addReportIm(u1.id, t.activities.get(0).act.Improvement_ID__c, t.report.id, t.activities.get(0).act.id, 'Improvement', '戦略科室分類1 診療科1', strDate, '結果'); |
| | | PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id); |
| | | System.Test.setCurrentPage(page); |
| | | XinDailyReportController controller = new XinDailyReportController(); |
| | | //初始化 |
| | | controller.init(); |
| | | } |
| | | |
| | | // String clId = Add_Report.addClaim(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Complaint', '戦略科室分類1 診療科1test', strDate, '結果'); |
| | | // clId = Add_Report.addClaim(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Complaint', accDep.Id, strDate, '結果'); |
| | | // clId = Add_Report.addClaim(u1.id, t.activities.get(0).act.Claim_ID__c, t.report.id, t.activities.get(0).act.id, 'Complaint', accDep.Id, strDate, '結果'); |
| | | System.runAs(u1) { |
| | | Daily_Report__c dr = new Daily_Report__c(); |
| | | dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | dr.Status__c = '申請中'; |
| | | dr.Reporter__c = u2.Id; |
| | | insert dr; |
| | | |
| | | // if (clId != 'false') t.activities.get(0).act.Claim_ID__c = clId; |
| | | // // t.activities.get(0).act.Claim_ID__c = Add_Report.addClaim(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Complaint', '戦略科室分類1 診療科1test', strDate, '結果'); |
| | | // // t.activities.get(0).act.Claim_ID__c = Add_Report.addClaim(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'Complaint', '戦略科室分類1 診療科1', strDate, '結果'); |
| | | // // t.activities.get(0).act.Claim_ID__c = Add_Report.addClaim(u1.id, t.activities.get(0).act.Claim_ID__c, t.report.id, t.activities.get(0).act.id, 'Complaint', '戦略科室分類1 診療科1', strDate, '結果'); |
| | | PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id); |
| | | System.Test.setCurrentPage(page); |
| | | XinDailyReportController controller = new XinDailyReportController(); |
| | | //初始化 |
| | | controller.init(); |
| | | controller.activities[0].act.Minister_Comment__c = '111'; |
| | | controller.saveComment(); |
| | | } |
| | | |
| | | // t.save(); |
| | | // System.Test.stopTest(); |
| | | // } |
| | | // } |
| | | System.runAs(u2) { |
| | | Daily_Report__c dr = new Daily_Report__c(); |
| | | dr.Reported_Date__c = Date.newInstance(2019, 2, 19); |
| | | dr.Status__c = '申請中'; |
| | | dr.Reporter__c = u1.Id; |
| | | insert dr; |
| | | Date t = Date.today(); |
| | | //Date t1 = t.addMonths(6); |
| | | Event__c ec1 = new Event__c( |
| | | Daily_Report__c = dr.Id, |
| | | StartDateTime__c = Datetime.newInstance(t.year(), t.month(), t.day(), 1, 0, 0), |
| | | EndDateTime__c = Datetime.newInstance(t.year(), t.month(), t.day(), 1, 0, 0), |
| | | ActivityDate__c = dr.Reported_Date__c, |
| | | Subject__c = 'eventc1' |
| | | ); |
| | | insert ec1; |
| | | PageReference page = new PageReference('/apex/XinDailyReport?id=' + +ec1.Id); |
| | | System.Test.setCurrentPage(page); |
| | | XinDailyReportController controller = new XinDailyReportController(); |
| | | //初始化 |
| | | controller.init(); |
| | | controller.activities[0].act.Manager_Comment__c = '222'; |
| | | controller.saveComment(); |
| | | } |
| | | System.Test.stopTest(); |
| | | } |
| | | |
| | | // @isTest |
| | | // static void test03() { |
| | | // ControllerUtil.EscapeNFM001Trigger = true; |
| | | // init(); |
| | | // static void test08_01() { |
| | | // Profile p = [select id from Profile where id = :System.Label.ProfileId_SystemAdmin]; |
| | | // System.Test.startTest(); |
| | | // XinDailyReportControllerTest.settTestData(); |
| | | // u3 = [select Id from User where Username = 'olympusTest03@sunbridge.com']; |
| | | // u2 = [select Id from User where Username = 'olympusTest02@sunbridge.com']; |
| | | |
| | | // System.runAs(u1) { |
| | | // //System.Test.startTest(); |
| | | // init2(); |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // system.runAs(u3) { |
| | | // Daily_Report__c dr = new Daily_Report__c(); |
| | | // dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | // dr.Status__c = '申請中'; |
| | | // dr.Reporter__c = u3.Id; |
| | | // insert dr; |
| | | |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // // t.getEvent(); |
| | | |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | |
| | | // t.report.Status__c = '申請中'; |
| | | // t.report.Reported_Date__c = date.today(); |
| | | // t.repoStartHourText = '9'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '18'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.activities.get(0).actStartHourText = '9'; |
| | | // t.activities.get(0).actStartMinuteText = '00'; |
| | | // t.activities.get(0).actEndHourText = '18'; |
| | | // t.activities.get(0).actEndMinuteText = '00'; |
| | | // t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(0).act.Description__c = '結果'; |
| | | // t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | // t.activities.get(0).act.Purpose_Type2__c = '客户咨询对应'; |
| | | // t.activities.get(0).act.Purpose_Type3__c = '学会or展会对应'; |
| | | // t.activities.get(0).act.Purpose_Type4__c = '信息搜集'; |
| | | // t.activities.get(0).act.Purpose_Type5__c = '产品介绍or推广'; |
| | | // t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1'; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = '引合1'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = '引合2'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = '引合3'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = '引合4'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = '引合5'; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | // t.activities.get(0).planStartHourText = '9'; |
| | | // t.activities.get(0).planStartMinuteText = '00'; |
| | | // t.activities.get(0).planEndHourText = '18'; |
| | | // t.activities.get(0).planEndMinuteText = '00'; |
| | | // t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(1).actStartHourText = '9'; |
| | | // t.activities.get(1).actStartMinuteText = '00'; |
| | | // t.activities.get(1).actEndHourText = '18'; |
| | | // t.activities.get(1).actEndMinuteText = '00'; |
| | | // t.activities.get(1).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(1).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(1).act.Description__c = '結果'; |
| | | // t.activities.get(1).act.Purpose_Type__c = 'OPD'; |
| | | // t.activities.get(1).act.Purpose_Type2__c = '询价or维修询价跟进'; |
| | | // t.activities.get(1).act.Purpose_Type3__c = '经销商协助or拜访'; |
| | | // t.activities.get(1).act.Purpose_Type4__c = '合同商谈'; |
| | | // t.activities.get(1).act.Purpose_Type5__c = '参加招标'; |
| | | // t.activities.get(1).act.Location__c = '戦略科室分類1 診療科1'; |
| | | // t.activities.get(1).planStartHourText = '9'; |
| | | // t.activities.get(1).planStartMinuteText = '00'; |
| | | // t.activities.get(1).planEndHourText = '18'; |
| | | // t.activities.get(1).planEndMinuteText = '00'; |
| | | // t.activities.get(1).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(2).actStartHourText = '9'; |
| | | // t.activities.get(2).actStartMinuteText = '00'; |
| | | // t.activities.get(2).actEndHourText = '18'; |
| | | // t.activities.get(2).actEndMinuteText = '00'; |
| | | // t.activities.get(2).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(2).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(2).act.Description__c = '結果'; |
| | | // t.activities.get(2).act.Purpose_Type__c = '签订合同'; |
| | | // t.activities.get(2).act.Purpose_Type2__c = '納品(装机)'; |
| | | // t.activities.get(2).act.Purpose_Type3__c = '送or取设备'; |
| | | // t.activities.get(2).act.Purpose_Type4__c = '送or取文件类资料'; |
| | | // t.activities.get(2).act.Purpose_Type5__c = '跟台'; |
| | | // t.activities.get(2).act.Location__c = '戦略科室分類1 診療科1'; |
| | | // t.activities.get(2).planStartHourText = '9'; |
| | | // t.activities.get(2).planStartMinuteText = '00'; |
| | | // t.activities.get(2).planEndHourText = '18'; |
| | | // t.activities.get(2).planEndMinuteText = '00'; |
| | | // t.activities.get(2).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(3).actStartHourText = '9'; |
| | | // t.activities.get(3).actStartMinuteText = '00'; |
| | | // t.activities.get(3).actEndHourText = '18'; |
| | | // t.activities.get(3).actEndMinuteText = '00'; |
| | | // t.activities.get(3).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(3).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(3).act.Description__c = '結果'; |
| | | // t.activities.get(3).act.Purpose_Type__c = '新品装机使用保养培训'; |
| | | // t.activities.get(3).act.Purpose_Type2__c = 'NTC/TTC'; |
| | | // t.activities.get(3).act.Purpose_Type3__c = '点検'; |
| | | // t.activities.get(3).act.Purpose_Type4__c = '巡回'; |
| | | // t.activities.get(3).act.Purpose_Type5__c = 'ON-CALL'; |
| | | // t.activities.get(3).act.Location__c = '戦略科室分類1 診療科1'; |
| | | // t.activities.get(3).planStartHourText = '9'; |
| | | // t.activities.get(3).planStartMinuteText = '00'; |
| | | // t.activities.get(3).planEndHourText = '18'; |
| | | // t.activities.get(3).planEndMinuteText = '00'; |
| | | // t.activities.get(3).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(4).actStartHourText = '9'; |
| | | // t.activities.get(4).actStartMinuteText = '00'; |
| | | // t.activities.get(4).actEndHourText = '18'; |
| | | // t.activities.get(4).actEndMinuteText = '00'; |
| | | // t.activities.get(4).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(4).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(4).act.Description__c = '結果'; |
| | | // t.activities.get(4).act.Purpose_Type__c = '修理説明'; |
| | | // t.activities.get(4).act.Purpose_Type2__c = '投诉対応(含QIS)'; |
| | | // t.activities.get(4).act.Purpose_Type3__c = '回款'; |
| | | // t.activities.get(4).act.Location__c = '戦略科室分類1 診療科1'; |
| | | // t.activities.get(4).planStartHourText = '9'; |
| | | // t.activities.get(4).planStartMinuteText = '00'; |
| | | // t.activities.get(4).planEndHourText = '18'; |
| | | // t.activities.get(4).planEndMinuteText = '00'; |
| | | // t.activities.get(4).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(5).actStartHourText = '9'; |
| | | // t.activities.get(5).actStartMinuteText = '00'; |
| | | // t.activities.get(5).actEndHourText = '18'; |
| | | // t.activities.get(5).actEndMinuteText = '00'; |
| | | // t.activities.get(5).act.Activity_Type2__c = '販売店'; |
| | | // t.activities.get(5).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(5).act.Description__c = '結果'; |
| | | // t.activities.get(5).act.Purpose_Type__c = '会議参加'; |
| | | // t.activities.get(5).act.Purpose_Type2__c = '产品培训'; |
| | | // t.activities.get(5).act.Purpose_Type3__c = '询价进行活动'; |
| | | // t.activities.get(5).act.Purpose_Type4__c = '售后事宜'; |
| | | // t.activities.get(5).act.Purpose_Type5__c = '库存管理'; |
| | | // t.activities.get(5).planStartHourText = '9'; |
| | | // t.activities.get(5).planStartMinuteText = '00'; |
| | | // t.activities.get(5).planEndHourText = '18'; |
| | | // t.activities.get(5).planEndMinuteText = '00'; |
| | | // t.activities.get(5).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(6).actStartHourText = '9'; |
| | | // t.activities.get(6).actStartMinuteText = '00'; |
| | | // t.activities.get(6).actEndHourText = '18'; |
| | | // t.activities.get(6).actEndMinuteText = '00'; |
| | | // t.activities.get(6).act.Activity_Type2__c = '社内活動'; |
| | | // t.activities.get(6).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(6).act.Description__c = '結果'; |
| | | // t.activities.get(6).act.Purpose_Type__c = '備品検査'; |
| | | // t.activities.get(6).act.Purpose_Type2__c = '軽修理'; |
| | | // t.activities.get(6).act.Purpose_Type3__c = '会議'; |
| | | // t.activities.get(6).act.Purpose_Type4__c = '培训'; |
| | | // t.activities.get(6).act.Purpose_Type5__c = '顧客訪問対応'; |
| | | // t.activities.get(6).planStartHourText = '9'; |
| | | // t.activities.get(6).planStartMinuteText = '00'; |
| | | // t.activities.get(6).planEndHourText = '18'; |
| | | // t.activities.get(6).planEndMinuteText = '00'; |
| | | // t.activities.get(6).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(7).actStartHourText = '9'; |
| | | // t.activities.get(7).actStartMinuteText = '00'; |
| | | // t.activities.get(7).actEndHourText = '18'; |
| | | // t.activities.get(7).actEndMinuteText = '00'; |
| | | // t.activities.get(7).act.Activity_Type2__c = '社内活動'; |
| | | // t.activities.get(7).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(7).act.Description__c = '結果'; |
| | | // t.activities.get(7).act.Purpose_Type__c = '資料作成'; |
| | | // t.activities.get(7).act.Purpose_Type2__c = '电话拜访'; |
| | | // t.activities.get(7).planStartHourText = '9'; |
| | | // t.activities.get(7).planStartMinuteText = '00'; |
| | | // t.activities.get(7).planEndHourText = '18'; |
| | | // t.activities.get(7).planEndMinuteText = '00'; |
| | | // t.activities.get(7).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(8).actStartHourText = '9'; |
| | | // t.activities.get(8).actStartMinuteText = '00'; |
| | | // t.activities.get(8).actEndHourText = '18'; |
| | | // t.activities.get(8).actEndMinuteText = '00'; |
| | | // t.activities.get(8).act.Activity_Type2__c = '社外イベント'; |
| | | // t.activities.get(8).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(8).act.Description__c = '結果'; |
| | | // t.activities.get(8).act.Purpose_Type__c = '礼节性拜访'; |
| | | // t.activities.get(8).act.Purpose_Type2__c = '客户咨询对应'; |
| | | // t.activities.get(8).act.Purpose_Type3__c = '学会or展会对应'; |
| | | // t.activities.get(8).act.Purpose_Type4__c = '信息搜集'; |
| | | // t.activities.get(8).act.Purpose_Type5__c = '产品介绍or推广'; |
| | | // t.activities.get(8).planStartHourText = '9'; |
| | | // t.activities.get(8).planStartMinuteText = '00'; |
| | | // t.activities.get(8).planEndHourText = '18'; |
| | | // t.activities.get(8).planEndMinuteText = '00'; |
| | | // t.activities.get(8).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(9).actStartHourText = '9'; |
| | | // t.activities.get(9).actStartMinuteText = '00'; |
| | | // t.activities.get(9).actEndHourText = '18'; |
| | | // t.activities.get(9).actEndMinuteText = '00'; |
| | | // t.activities.get(9).act.Activity_Type2__c = '移動'; |
| | | // t.activities.get(9).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(9).act.Description__c = '結果'; |
| | | // t.activities.get(9).act.Purpose_Type__c = '移動'; |
| | | // t.activities.get(9).planStartHourText = '9'; |
| | | // t.activities.get(9).planStartMinuteText = '00'; |
| | | // t.activities.get(9).planEndHourText = '18'; |
| | | // t.activities.get(9).planEndMinuteText = '00'; |
| | | // t.activities.get(9).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(10).actStartHourText = '9'; |
| | | // t.activities.get(10).actStartMinuteText = '00'; |
| | | // t.activities.get(10).actEndHourText = '18'; |
| | | // t.activities.get(10).actEndMinuteText = '00'; |
| | | // t.activities.get(10).act.Activity_Type2__c = '休暇'; |
| | | // t.activities.get(10).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(10).act.Description__c = '結果'; |
| | | // t.activities.get(10).act.Purpose_Type__c = '休暇'; |
| | | // t.activities.get(10).planStartHourText = '9'; |
| | | // t.activities.get(10).planStartMinuteText = '00'; |
| | | // t.activities.get(10).planEndHourText = '18'; |
| | | // t.activities.get(10).planEndMinuteText = '00'; |
| | | // t.activities.get(10).planPurposeText = '次の活動予定目的(計画)'; |
| | | // t.upsertActIndex = '0'; |
| | | // t.openPDNew(); |
| | | |
| | | // t.upsertActIndex = ''; |
| | | // //t.save(); |
| | | |
| | | // String actId = t.activities.get(0).act.id; |
| | | |
| | | // Event e = new Event(); |
| | | // e.ActivityDateTime = datetime.now(); |
| | | // e.DurationInMinutes = 0; |
| | | // e.OwnerId = loginId; |
| | | // Datetime dt = Datetime.now(); |
| | | // Event__c e = new Event__c( |
| | | // Subject__c = 'test', |
| | | // StartDateTime__c = Datetime.newInstance(2016, 1, 1, 1, 0, 0), |
| | | // DurationInMinutes__c = 60, |
| | | // EndDateTime__c = Datetime.newInstance(2016, 1, 1, 2, 0, 0), |
| | | // ActivityDate__c = Date.today() |
| | | // // Daily_Report__c = dr.Id |
| | | // ); |
| | | // insert e; |
| | | |
| | | // PageReference pageRef1 = Page.XinDailyReport; |
| | | // pageRef1.getParameters().put('id', e.id); |
| | | // Test.setCurrentPage(pageRef1); |
| | | // t.init(); |
| | | |
| | | // PageReference pageRef2 = Page.XinDailyReport; |
| | | // pageRef2.getParameters().put('id', actId); |
| | | // Test.setCurrentPage(pageRef2); |
| | | // t.init(); |
| | | |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // t.getDailyReport(); |
| | | // // t.getEvent(); |
| | | // //System.Test.stopTest(); |
| | | // PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id); |
| | | // System.Test.setCurrentPage(page); |
| | | // XinDailyReportController controller = new XinDailyReportController(); |
| | | // //初始化 |
| | | // controller.init(); |
| | | // } |
| | | // } |
| | | |
| | | //@isTest |
| | | // static void test04() { |
| | | // ControllerUtil.EscapeNFM001Trigger = true; |
| | | // init(); |
| | | // System.runAs(u1) { |
| | | // Daily_Report__c dr = new Daily_Report__c(); |
| | | // dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | // dr.Status__c = '申請中'; |
| | | // dr.Reporter__c = u2.Id; |
| | | // insert dr; |
| | | |
| | | // PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id); |
| | | // System.Test.setCurrentPage(page); |
| | | // XinDailyReportController controller = new XinDailyReportController(); |
| | | // //初始化 |
| | | // controller.init(); |
| | | // controller.activities[0].act.Minister_Comment__c = '111'; |
| | | // controller.saveComment(); |
| | | // } |
| | | |
| | | // System.runAs(u2) { |
| | | // //System.Test.startTest(); |
| | | // init2(); |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // // t.getEvent(); |
| | | |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | |
| | | // t.report.Status__c = '申請中'; |
| | | // t.report.Reported_Date__c = date.today(); |
| | | // t.repoStartHourText = '9'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '18'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.activities.get(0).actStartHourText = '9'; |
| | | // t.activities.get(0).actStartMinuteText = '00'; |
| | | // t.activities.get(0).actEndHourText = '18'; |
| | | // t.activities.get(0).actEndMinuteText = '00'; |
| | | // t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(0).act.Description__c = '結果'; |
| | | // t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | // t.activities.get(0).act.Purpose_Type2__c = '客户咨询对应'; |
| | | // t.activities.get(0).act.Purpose_Type3__c = '学会or展会对应'; |
| | | // t.activities.get(0).act.Purpose_Type4__c = '信息搜集'; |
| | | // t.activities.get(0).act.Purpose_Type5__c = '产品介绍or推广'; |
| | | // t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1'; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = '引合1'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = '引合2'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = '引合3'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = '引合4'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = '引合5'; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | // t.activities.get(0).planStartHourText = '9'; |
| | | // t.activities.get(0).planStartMinuteText = '00'; |
| | | // t.activities.get(0).planEndHourText = '18'; |
| | | // t.activities.get(0).planEndMinuteText = '00'; |
| | | // t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(1).actStartHourText = '9'; |
| | | // t.activities.get(1).actStartMinuteText = '00'; |
| | | // t.activities.get(1).actEndHourText = '18'; |
| | | // t.activities.get(1).actEndMinuteText = '00'; |
| | | // t.activities.get(1).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(1).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(1).act.Description__c = '結果'; |
| | | // t.activities.get(1).act.Purpose_Type__c = 'OPD'; |
| | | // t.activities.get(1).act.Purpose_Type2__c = '询价or维修询价跟进'; |
| | | // t.activities.get(1).act.Purpose_Type3__c = '经销商协助or拜访'; |
| | | // t.activities.get(1).act.Purpose_Type4__c = '合同商谈'; |
| | | // t.activities.get(1).act.Purpose_Type5__c = '参加招标'; |
| | | // t.activities.get(1).act.Location__c = '戦略科室分類1 診療科1'; |
| | | // t.activities.get(1).planStartHourText = '9'; |
| | | // t.activities.get(1).planStartMinuteText = '00'; |
| | | // t.activities.get(1).planEndHourText = '18'; |
| | | // t.activities.get(1).planEndMinuteText = '00'; |
| | | // t.activities.get(1).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(2).actStartHourText = '9'; |
| | | // t.activities.get(2).actStartMinuteText = '00'; |
| | | // t.activities.get(2).actEndHourText = '18'; |
| | | // t.activities.get(2).actEndMinuteText = '00'; |
| | | // t.activities.get(2).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(2).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(2).act.Description__c = '結果'; |
| | | // t.activities.get(2).act.Purpose_Type__c = '签订合同'; |
| | | // t.activities.get(2).act.Purpose_Type2__c = '納品(装机)'; |
| | | // t.activities.get(2).act.Purpose_Type3__c = '送or取设备'; |
| | | // t.activities.get(2).act.Purpose_Type4__c = '送or取文件类资料'; |
| | | // t.activities.get(2).act.Purpose_Type5__c = '跟台'; |
| | | // t.activities.get(2).act.Location__c = '戦略科室分類1 診療科1'; |
| | | // t.activities.get(2).planStartHourText = '9'; |
| | | // t.activities.get(2).planStartMinuteText = '00'; |
| | | // t.activities.get(2).planEndHourText = '18'; |
| | | // t.activities.get(2).planEndMinuteText = '00'; |
| | | // t.activities.get(2).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(3).actStartHourText = '9'; |
| | | // t.activities.get(3).actStartMinuteText = '00'; |
| | | // t.activities.get(3).actEndHourText = '18'; |
| | | // t.activities.get(3).actEndMinuteText = '00'; |
| | | // t.activities.get(3).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(3).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(3).act.Description__c = '結果'; |
| | | // t.activities.get(3).act.Purpose_Type__c = '新品装机使用保养培训'; |
| | | // t.activities.get(3).act.Purpose_Type2__c = 'NTC/TTC'; |
| | | // t.activities.get(3).act.Purpose_Type3__c = '点検'; |
| | | // t.activities.get(3).act.Purpose_Type4__c = '巡回'; |
| | | // t.activities.get(3).act.Purpose_Type5__c = 'ON-CALL'; |
| | | // t.activities.get(3).act.Location__c = '戦略科室分類1 診療科1'; |
| | | // t.activities.get(3).planStartHourText = '9'; |
| | | // t.activities.get(3).planStartMinuteText = '00'; |
| | | // t.activities.get(3).planEndHourText = '18'; |
| | | // t.activities.get(3).planEndMinuteText = '00'; |
| | | // t.activities.get(3).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(4).actStartHourText = '9'; |
| | | // t.activities.get(4).actStartMinuteText = '00'; |
| | | // t.activities.get(4).actEndHourText = '18'; |
| | | // t.activities.get(4).actEndMinuteText = '00'; |
| | | // t.activities.get(4).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(4).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(4).act.Description__c = '結果'; |
| | | // t.activities.get(4).act.Purpose_Type__c = '修理説明'; |
| | | // t.activities.get(4).act.Purpose_Type2__c = '投诉対応(含QIS)'; |
| | | // t.activities.get(4).act.Purpose_Type3__c = '回款'; |
| | | // t.activities.get(4).act.Location__c = '戦略科室分類1 診療科1'; |
| | | // t.activities.get(4).planStartHourText = '9'; |
| | | // t.activities.get(4).planStartMinuteText = '00'; |
| | | // t.activities.get(4).planEndHourText = '18'; |
| | | // t.activities.get(4).planEndMinuteText = '00'; |
| | | // t.activities.get(4).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(5).actStartHourText = '9'; |
| | | // t.activities.get(5).actStartMinuteText = '00'; |
| | | // t.activities.get(5).actEndHourText = '18'; |
| | | // t.activities.get(5).actEndMinuteText = '00'; |
| | | // t.activities.get(5).act.Activity_Type2__c = '販売店'; |
| | | // t.activities.get(5).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(5).act.Description__c = '結果'; |
| | | // t.activities.get(5).act.Purpose_Type__c = '会議参加'; |
| | | // t.activities.get(5).act.Purpose_Type2__c = '产品培训'; |
| | | // t.activities.get(5).act.Purpose_Type3__c = '询价进行活动'; |
| | | // t.activities.get(5).act.Purpose_Type4__c = '售后事宜'; |
| | | // t.activities.get(5).act.Purpose_Type5__c = '库存管理'; |
| | | // t.activities.get(5).planStartHourText = '9'; |
| | | // t.activities.get(5).planStartMinuteText = '00'; |
| | | // t.activities.get(5).planEndHourText = '18'; |
| | | // t.activities.get(5).planEndMinuteText = '00'; |
| | | // t.activities.get(5).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(6).actStartHourText = '9'; |
| | | // t.activities.get(6).actStartMinuteText = '00'; |
| | | // t.activities.get(6).actEndHourText = '18'; |
| | | // t.activities.get(6).actEndMinuteText = '00'; |
| | | // t.activities.get(6).act.Activity_Type2__c = '社内活動'; |
| | | // t.activities.get(6).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(6).act.Description__c = '結果'; |
| | | // t.activities.get(6).act.Purpose_Type__c = '備品検査'; |
| | | // t.activities.get(6).act.Purpose_Type2__c = '軽修理'; |
| | | // t.activities.get(6).act.Purpose_Type3__c = '会議'; |
| | | // t.activities.get(6).act.Purpose_Type4__c = '培训'; |
| | | // t.activities.get(6).act.Purpose_Type5__c = '顧客訪問対応'; |
| | | // t.activities.get(6).planStartHourText = '9'; |
| | | // t.activities.get(6).planStartMinuteText = '00'; |
| | | // t.activities.get(6).planEndHourText = '18'; |
| | | // t.activities.get(6).planEndMinuteText = '00'; |
| | | // t.activities.get(6).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(7).actStartHourText = '9'; |
| | | // t.activities.get(7).actStartMinuteText = '00'; |
| | | // t.activities.get(7).actEndHourText = '18'; |
| | | // t.activities.get(7).actEndMinuteText = '00'; |
| | | // t.activities.get(7).act.Activity_Type2__c = '社内活動'; |
| | | // t.activities.get(7).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(7).act.Description__c = '結果'; |
| | | // t.activities.get(7).act.Purpose_Type__c = '資料作成'; |
| | | // t.activities.get(7).act.Purpose_Type2__c = '电话拜访'; |
| | | // t.activities.get(7).planStartHourText = '9'; |
| | | // t.activities.get(7).planStartMinuteText = '00'; |
| | | // t.activities.get(7).planEndHourText = '18'; |
| | | // t.activities.get(7).planEndMinuteText = '00'; |
| | | // t.activities.get(7).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(8).actStartHourText = '9'; |
| | | // t.activities.get(8).actStartMinuteText = '00'; |
| | | // t.activities.get(8).actEndHourText = '18'; |
| | | // t.activities.get(8).actEndMinuteText = '00'; |
| | | // t.activities.get(8).act.Activity_Type2__c = '社外イベント'; |
| | | // t.activities.get(8).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(8).act.Description__c = '結果'; |
| | | // t.activities.get(8).act.Purpose_Type__c = '礼节性拜访'; |
| | | // t.activities.get(8).act.Purpose_Type2__c = '客户咨询对应'; |
| | | // t.activities.get(8).act.Purpose_Type3__c = '学会or展会对应'; |
| | | // t.activities.get(8).act.Purpose_Type4__c = '信息搜集'; |
| | | // t.activities.get(8).act.Purpose_Type5__c = '产品介绍or推广'; |
| | | // t.activities.get(8).planStartHourText = '9'; |
| | | // t.activities.get(8).planStartMinuteText = '00'; |
| | | // t.activities.get(8).planEndHourText = '18'; |
| | | // t.activities.get(8).planEndMinuteText = '00'; |
| | | // t.activities.get(8).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(9).actStartHourText = '9'; |
| | | // t.activities.get(9).actStartMinuteText = '00'; |
| | | // t.activities.get(9).actEndHourText = '18'; |
| | | // t.activities.get(9).actEndMinuteText = '00'; |
| | | // t.activities.get(9).act.Activity_Type2__c = '移動'; |
| | | // t.activities.get(9).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(9).act.Description__c = '結果'; |
| | | // t.activities.get(9).act.Purpose_Type__c = '移動'; |
| | | // t.activities.get(9).planStartHourText = '9'; |
| | | // t.activities.get(9).planStartMinuteText = '00'; |
| | | // t.activities.get(9).planEndHourText = '18'; |
| | | // t.activities.get(9).planEndMinuteText = '00'; |
| | | // t.activities.get(9).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(10).actStartHourText = '9'; |
| | | // t.activities.get(10).actStartMinuteText = '00'; |
| | | // t.activities.get(10).actEndHourText = '18'; |
| | | // t.activities.get(10).actEndMinuteText = '00'; |
| | | // t.activities.get(10).act.Activity_Type2__c = '休暇'; |
| | | // t.activities.get(10).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(10).act.Description__c = '結果'; |
| | | // t.activities.get(10).act.Purpose_Type__c = '休暇'; |
| | | // t.activities.get(10).planStartHourText = '9'; |
| | | // t.activities.get(10).planStartMinuteText = '00'; |
| | | // t.activities.get(10).planEndHourText = '18'; |
| | | // t.activities.get(10).planEndMinuteText = '00'; |
| | | // t.activities.get(10).planPurposeText = '次の活動予定目的(計画)'; |
| | | // t.upsertActIndex = '0'; |
| | | // t.openPDNew(); |
| | | |
| | | // t.upsertActIndex = ''; |
| | | // t.save(); |
| | | |
| | | // String actId = t.activities.get(0).act.id; |
| | | |
| | | // Event e = new Event(); |
| | | // e.ActivityDateTime = datetime.now(); |
| | | // e.DurationInMinutes = 0; |
| | | // e.OwnerId = loginId; |
| | | // insert e; |
| | | |
| | | // PageReference pageRef1 = Page.XinDailyReport; |
| | | // pageRef1.getParameters().put('id', e.id); |
| | | // Test.setCurrentPage(pageRef1); |
| | | // t.init(); |
| | | |
| | | // PageReference pageRef2 = Page.XinDailyReport; |
| | | // pageRef2.getParameters().put('id', actId); |
| | | // Test.setCurrentPage(pageRef2); |
| | | // t.init(); |
| | | |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // t.getDailyReport(); |
| | | // // t.getEvent(); |
| | | // //System.Test.stopTest(); |
| | | // Daily_Report__c dr = new Daily_Report__c(); |
| | | // dr.Reported_Date__c = Date.newInstance(2019, 2, 19); |
| | | // dr.Status__c = '申請中'; |
| | | // dr.Reporter__c = u1.Id; |
| | | // insert dr; |
| | | // Date t = Date.today(); |
| | | // //Date t1 = t.addMonths(6); |
| | | // Event__c ec1 = new Event__c( |
| | | // // Daily_Report__c = dr.Id, |
| | | // StartDateTime__c = Datetime.newInstance(t.year(), t.month(), t.day(), 1, 0, 0), |
| | | // EndDateTime__c = Datetime.newInstance(t.year(), t.month(), t.day(), 1, 0, 0), |
| | | // ActivityDate__c = dr.Reported_Date__c, |
| | | // Subject__c = 'eventc1' |
| | | // ); |
| | | // insert ec1; |
| | | // PageReference page = new PageReference('/apex/XinDailyReport?id=' + +ec1.Id); |
| | | // System.Test.setCurrentPage(page); |
| | | // XinDailyReportController controller = new XinDailyReportController(); |
| | | // //初始化 |
| | | // controller.init(); |
| | | // controller.activities[0].act.Manager_Comment__c = '222'; |
| | | // controller.saveComment(); |
| | | // } |
| | | // System.Test.stopTest(); |
| | | // } |
| | | |
| | | // @isTest |
| | | // static void test05() { |
| | | // ControllerUtil.EscapeNFM001Trigger = true; |
| | | // init(); |
| | | @isTest |
| | | static void test9() { |
| | | Profile p = [select id from Profile where id = :System.Label.ProfileId_SystemAdmin]; |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | u3 = [select Id from User where Username = 'olympusTest03@sunbridge.com']; |
| | | u2 = [select Id from User where Username = 'olympusTest02@sunbridge.com']; |
| | | |
| | | // System.runAs(u3) { |
| | | // //System.Test.startTest(); |
| | | // init2(); |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | System.runAs(u3) { |
| | | Daily_Report__c dr = new Daily_Report__c(); |
| | | dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | dr.Status__c = '申請中'; |
| | | dr.Reporter__c = u3.Id; |
| | | insert dr; |
| | | |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // // t.getEvent(); |
| | | Datetime dt = Datetime.now(); |
| | | Event__c e = new Event__c( |
| | | Subject__c = 'test', |
| | | StartDateTime__c = Datetime.newInstance(2016, 1, 1, 1, 0, 0), |
| | | DurationInMinutes__c = 60, |
| | | EndDateTime__c = Datetime.newInstance(2016, 1, 1, 2, 0, 0), |
| | | ActivityDate__c = Date.today(), |
| | | Daily_Report__c = dr.Id |
| | | ); |
| | | insert e; |
| | | |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id + '&dt=' + String.valueOf(dt)); |
| | | System.Test.setCurrentPage(page); |
| | | XinDailyReportController controller = new XinDailyReportController(); |
| | | //初始化 |
| | | controller.init(); |
| | | } |
| | | |
| | | // t.report.Status__c = '申請中'; |
| | | // t.report.Reported_Date__c = date.today(); |
| | | // t.repoStartHourText = '9'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '18'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.activities.get(0).actStartHourText = '9'; |
| | | // t.activities.get(0).actStartMinuteText = '00'; |
| | | // t.activities.get(0).actEndHourText = '18'; |
| | | // t.activities.get(0).actEndMinuteText = '00'; |
| | | // t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(0).act.Description__c = '結果'; |
| | | // t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | // t.activities.get(0).act.Purpose_Type2__c = '客户咨询对应'; |
| | | // t.activities.get(0).act.Purpose_Type3__c = '学会or展会对应'; |
| | | // t.activities.get(0).act.Purpose_Type4__c = '信息搜集'; |
| | | // t.activities.get(0).act.Purpose_Type5__c = '产品介绍or推广'; |
| | | // t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1'; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = '引合1'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = '引合2'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = '引合3'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = '引合4'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = '引合5'; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | // t.activities.get(0).planStartHourText = '9'; |
| | | // t.activities.get(0).planStartMinuteText = '00'; |
| | | // t.activities.get(0).planEndHourText = '18'; |
| | | // t.activities.get(0).planEndMinuteText = '00'; |
| | | // t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | System.runAs(u1) { |
| | | Daily_Report__c dr = new Daily_Report__c(); |
| | | dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | dr.Status__c = '申請中'; |
| | | dr.Reporter__c = u2.Id; |
| | | insert dr; |
| | | |
| | | // t.activities.get(1).actStartHourText = '9'; |
| | | // t.activities.get(1).actStartMinuteText = '00'; |
| | | // t.activities.get(1).actEndHourText = '18'; |
| | | // t.activities.get(1).actEndMinuteText = '00'; |
| | | // t.activities.get(1).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(1).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(1).act.Description__c = '結果'; |
| | | // t.activities.get(1).act.Purpose_Type__c = 'OPD'; |
| | | // t.activities.get(1).act.Purpose_Type2__c = '询价or维修询价跟进'; |
| | | // t.activities.get(1).act.Purpose_Type3__c = '经销商协助or拜访'; |
| | | // t.activities.get(1).act.Purpose_Type4__c = '合同商谈'; |
| | | // t.activities.get(1).act.Purpose_Type5__c = '参加招标'; |
| | | // t.activities.get(1).act.Location__c = '戦略科室分類1 診療科1'; |
| | | // t.activities.get(1).planStartHourText = '9'; |
| | | // t.activities.get(1).planStartMinuteText = '00'; |
| | | // t.activities.get(1).planEndHourText = '18'; |
| | | // t.activities.get(1).planEndMinuteText = '00'; |
| | | // t.activities.get(1).planPurposeText = '次の活動予定目的(計画)'; |
| | | PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id); |
| | | System.Test.setCurrentPage(page); |
| | | XinDailyReportController controller = new XinDailyReportController(); |
| | | //初始化 |
| | | controller.init(); |
| | | |
| | | // t.activities.get(2).actStartHourText = '9'; |
| | | // t.activities.get(2).actStartMinuteText = '00'; |
| | | // t.activities.get(2).actEndHourText = '18'; |
| | | // t.activities.get(2).actEndMinuteText = '00'; |
| | | // t.activities.get(2).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(2).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(2).act.Description__c = '結果'; |
| | | // t.activities.get(2).act.Purpose_Type__c = '签订合同'; |
| | | // t.activities.get(2).act.Purpose_Type2__c = '納品(装机)'; |
| | | // t.activities.get(2).act.Purpose_Type3__c = '送or取设备'; |
| | | // t.activities.get(2).act.Purpose_Type4__c = '送or取文件类资料'; |
| | | // t.activities.get(2).act.Purpose_Type5__c = '跟台'; |
| | | // t.activities.get(2).act.Location__c = '戦略科室分類1 診療科1'; |
| | | // t.activities.get(2).planStartHourText = '9'; |
| | | // t.activities.get(2).planStartMinuteText = '00'; |
| | | // t.activities.get(2).planEndHourText = '18'; |
| | | // t.activities.get(2).planEndMinuteText = '00'; |
| | | // t.activities.get(2).planPurposeText = '次の活動予定目的(計画)'; |
| | | controller.activities[0].act.Minister_Comment__c = '111'; |
| | | controller.saveComment(); |
| | | |
| | | // t.activities.get(3).actStartHourText = '9'; |
| | | // t.activities.get(3).actStartMinuteText = '00'; |
| | | // t.activities.get(3).actEndHourText = '18'; |
| | | // t.activities.get(3).actEndMinuteText = '00'; |
| | | // t.activities.get(3).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(3).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(3).act.Description__c = '結果'; |
| | | // t.activities.get(3).act.Purpose_Type__c = '新品装机使用保养培训'; |
| | | // t.activities.get(3).act.Purpose_Type2__c = 'NTC/TTC'; |
| | | // t.activities.get(3).act.Purpose_Type3__c = '点検'; |
| | | // t.activities.get(3).act.Purpose_Type4__c = '巡回'; |
| | | // t.activities.get(3).act.Purpose_Type5__c = 'ON-CALL'; |
| | | // t.activities.get(3).act.Location__c = '戦略科室分類1 診療科1'; |
| | | // t.activities.get(3).planStartHourText = '9'; |
| | | // t.activities.get(3).planStartMinuteText = '00'; |
| | | // t.activities.get(3).planEndHourText = '18'; |
| | | // t.activities.get(3).planEndMinuteText = '00'; |
| | | // t.activities.get(3).planPurposeText = '次の活動予定目的(計画)'; |
| | | } |
| | | |
| | | // t.activities.get(4).actStartHourText = '9'; |
| | | // t.activities.get(4).actStartMinuteText = '00'; |
| | | // t.activities.get(4).actEndHourText = '18'; |
| | | // t.activities.get(4).actEndMinuteText = '00'; |
| | | // t.activities.get(4).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(4).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(4).act.Description__c = '結果'; |
| | | // t.activities.get(4).act.Purpose_Type__c = '修理説明'; |
| | | // t.activities.get(4).act.Purpose_Type2__c = '投诉対応(含QIS)'; |
| | | // t.activities.get(4).act.Purpose_Type3__c = '回款'; |
| | | // t.activities.get(4).act.Location__c = '戦略科室分類1 診療科1'; |
| | | // t.activities.get(4).planStartHourText = '9'; |
| | | // t.activities.get(4).planStartMinuteText = '00'; |
| | | // t.activities.get(4).planEndHourText = '18'; |
| | | // t.activities.get(4).planEndMinuteText = '00'; |
| | | // t.activities.get(4).planPurposeText = '次の活動予定目的(計画)'; |
| | | System.runAs(u2) { |
| | | Daily_Report__c dr = new Daily_Report__c(); |
| | | dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | dr.Status__c = '申請中'; |
| | | dr.Reporter__c = u1.Id; |
| | | insert dr; |
| | | |
| | | // t.activities.get(5).actStartHourText = '9'; |
| | | // t.activities.get(5).actStartMinuteText = '00'; |
| | | // t.activities.get(5).actEndHourText = '18'; |
| | | // t.activities.get(5).actEndMinuteText = '00'; |
| | | // t.activities.get(5).act.Activity_Type2__c = '販売店'; |
| | | // t.activities.get(5).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(5).act.Description__c = '結果'; |
| | | // t.activities.get(5).act.Purpose_Type__c = '会議参加'; |
| | | // t.activities.get(5).act.Purpose_Type2__c = '产品培训'; |
| | | // t.activities.get(5).act.Purpose_Type3__c = '询价进行活动'; |
| | | // t.activities.get(5).act.Purpose_Type4__c = '售后事宜'; |
| | | // t.activities.get(5).act.Purpose_Type5__c = '库存管理'; |
| | | // t.activities.get(5).planStartHourText = '9'; |
| | | // t.activities.get(5).planStartMinuteText = '00'; |
| | | // t.activities.get(5).planEndHourText = '18'; |
| | | // t.activities.get(5).planEndMinuteText = '00'; |
| | | // t.activities.get(5).planPurposeText = '次の活動予定目的(計画)'; |
| | | PageReference page = new PageReference('/apex/XinDailyReport?dt=' + String.valueOf('20190215')); |
| | | //PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id +'&dt='+String.valueOf('20190215')); |
| | | System.Test.setCurrentPage(page); |
| | | XinDailyReportController controller = new XinDailyReportController(); |
| | | //初始化 |
| | | controller.init(); |
| | | } |
| | | System.runAs(u2) { |
| | | |
| | | // t.activities.get(6).actStartHourText = '9'; |
| | | // t.activities.get(6).actStartMinuteText = '00'; |
| | | // t.activities.get(6).actEndHourText = '18'; |
| | | // t.activities.get(6).actEndMinuteText = '00'; |
| | | // t.activities.get(6).act.Activity_Type2__c = '社内活動'; |
| | | // t.activities.get(6).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(6).act.Description__c = '結果'; |
| | | // t.activities.get(6).act.Purpose_Type__c = '備品検査'; |
| | | // t.activities.get(6).act.Purpose_Type2__c = '軽修理'; |
| | | // t.activities.get(6).act.Purpose_Type3__c = '会議'; |
| | | // t.activities.get(6).act.Purpose_Type4__c = '培训'; |
| | | // t.activities.get(6).act.Purpose_Type5__c = '顧客訪問対応'; |
| | | // t.activities.get(6).planStartHourText = '9'; |
| | | // t.activities.get(6).planStartMinuteText = '00'; |
| | | // t.activities.get(6).planEndHourText = '18'; |
| | | // t.activities.get(6).planEndMinuteText = '00'; |
| | | // t.activities.get(6).planPurposeText = '次の活動予定目的(計画)'; |
| | | |
| | | // t.activities.get(7).actStartHourText = '9'; |
| | | // t.activities.get(7).actStartMinuteText = '00'; |
| | | // t.activities.get(7).actEndHourText = '18'; |
| | | // t.activities.get(7).actEndMinuteText = '00'; |
| | | // t.activities.get(7).act.Activity_Type2__c = '社内活動'; |
| | | // t.activities.get(7).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(7).act.Description__c = '結果'; |
| | | // t.activities.get(7).act.Purpose_Type__c = '資料作成'; |
| | | // t.activities.get(7).act.Purpose_Type2__c = '电话拜访'; |
| | | // t.activities.get(7).planStartHourText = '9'; |
| | | // t.activities.get(7).planStartMinuteText = '00'; |
| | | // t.activities.get(7).planEndHourText = '18'; |
| | | // t.activities.get(7).planEndMinuteText = '00'; |
| | | // t.activities.get(7).planPurposeText = '次の活動予定目的(計画)'; |
| | | PageReference page = new PageReference('/apex/XinDailyReport'); |
| | | //PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id +'&dt='+String.valueOf('20190215')); |
| | | System.Test.setCurrentPage(page); |
| | | XinDailyReportController controller = new XinDailyReportController(); |
| | | //初始化 |
| | | controller.init(); |
| | | |
| | | // t.activities.get(8).actStartHourText = '9'; |
| | | // t.activities.get(8).actStartMinuteText = '00'; |
| | | // t.activities.get(8).actEndHourText = '18'; |
| | | // t.activities.get(8).actEndMinuteText = '00'; |
| | | // t.activities.get(8).act.Activity_Type2__c = '社外イベント'; |
| | | // t.activities.get(8).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(8).act.Description__c = '結果'; |
| | | // t.activities.get(8).act.Purpose_Type__c = '礼节性拜访'; |
| | | // t.activities.get(8).act.Purpose_Type2__c = '客户咨询对应'; |
| | | // t.activities.get(8).act.Purpose_Type3__c = '学会or展会对应'; |
| | | // t.activities.get(8).act.Purpose_Type4__c = '信息搜集'; |
| | | // t.activities.get(8).act.Purpose_Type5__c = '产品介绍or推广'; |
| | | // t.activities.get(8).planStartHourText = '9'; |
| | | // t.activities.get(8).planStartMinuteText = '00'; |
| | | // t.activities.get(8).planEndHourText = '18'; |
| | | // t.activities.get(8).planEndMinuteText = '00'; |
| | | // t.activities.get(8).planPurposeText = '次の活動予定目的(計画)'; |
| | | } |
| | | |
| | | // t.activities.get(9).actStartHourText = '9'; |
| | | // t.activities.get(9).actStartMinuteText = '00'; |
| | | // t.activities.get(9).actEndHourText = '18'; |
| | | // t.activities.get(9).actEndMinuteText = '00'; |
| | | // t.activities.get(9).act.Activity_Type2__c = '移動'; |
| | | // t.activities.get(9).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(9).act.Description__c = '結果'; |
| | | // t.activities.get(9).act.Purpose_Type__c = '移動'; |
| | | // t.activities.get(9).planStartHourText = '9'; |
| | | // t.activities.get(9).planStartMinuteText = '00'; |
| | | // t.activities.get(9).planEndHourText = '18'; |
| | | // t.activities.get(9).planEndMinuteText = '00'; |
| | | // t.activities.get(9).planPurposeText = '次の活動予定目的(計画)'; |
| | | System.runAs(u2) { |
| | | |
| | | // t.activities.get(10).actStartHourText = '9'; |
| | | // t.activities.get(10).actStartMinuteText = '00'; |
| | | // t.activities.get(10).actEndHourText = '18'; |
| | | // t.activities.get(10).actEndMinuteText = '00'; |
| | | // t.activities.get(10).act.Activity_Type2__c = '休暇'; |
| | | // t.activities.get(10).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(10).act.Description__c = '結果'; |
| | | // t.activities.get(10).act.Purpose_Type__c = '休暇'; |
| | | // t.activities.get(10).planStartHourText = '9'; |
| | | // t.activities.get(10).planStartMinuteText = '00'; |
| | | // t.activities.get(10).planEndHourText = '18'; |
| | | // t.activities.get(10).planEndMinuteText = '00'; |
| | | // t.activities.get(10).planPurposeText = '次の活動予定目的(計画)'; |
| | | // t.upsertActIndex = '0'; |
| | | // t.openPDNew(); |
| | | |
| | | // t.upsertActIndex = ''; |
| | | // t.save(); |
| | | PageReference page = new PageReference('/apex/XinDailyReport?id=00Uabcd'); |
| | | //PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id +'&dt='+String.valueOf('20190215')); |
| | | System.Test.setCurrentPage(page); |
| | | XinDailyReportController controller = new XinDailyReportController(); |
| | | //初始化 |
| | | controller.init(); |
| | | |
| | | // String actId = t.activities.get(0).act.id; |
| | | } |
| | | |
| | | // Event e = new Event(); |
| | | // e.ActivityDateTime = datetime.now(); |
| | | // e.DurationInMinutes = 0; |
| | | // e.OwnerId = loginId; |
| | | // insert e; |
| | | System.runAs(u2) { |
| | | |
| | | // PageReference pageRef1 = Page.XinDailyReport; |
| | | // pageRef1.getParameters().put('id', e.id); |
| | | // Test.setCurrentPage(pageRef1); |
| | | // t.init(); |
| | | |
| | | // PageReference pageRef2 = Page.XinDailyReport; |
| | | // pageRef2.getParameters().put('id', actId); |
| | | // Test.setCurrentPage(pageRef2); |
| | | // t.init(); |
| | | PageReference page = new PageReference('/apex/XinDailyReport?id=a0Aabcd'); |
| | | //PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id +'&dt='+String.valueOf('20190215')); |
| | | System.Test.setCurrentPage(page); |
| | | XinDailyReportController controller = new XinDailyReportController(); |
| | | //初始化 |
| | | controller.init(); |
| | | |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // t.getDailyReport(); |
| | | // // t.getEvent(); |
| | | // //System.Test.stopTest(); |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | System.runAs(u2) { |
| | | |
| | | |
| | | PageReference page = new PageReference('/apex/XinDailyReport?id=UaMabcd'); |
| | | //PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id +'&dt='+String.valueOf('20190215')); |
| | | System.Test.setCurrentPage(page); |
| | | XinDailyReportController controller = new XinDailyReportController(); |
| | | //初始化 |
| | | controller.init(); |
| | | |
| | | } |
| | | System.Test.stopTest(); |
| | | } |
| | | |
| | | @isTest |
| | | static void test10() { |
| | | Profile p = [select id from Profile where id = :System.Label.ProfileId_SystemAdmin]; |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | u3 = [select Id from User where Username = 'olympusTest03@sunbridge.com']; |
| | | u2 = [select Id from User where Username = 'olympusTest02@sunbridge.com']; |
| | | |
| | | |
| | | |
| | | System.runAs(u3) { |
| | | Daily_Report__c dr = new Daily_Report__c(); |
| | | dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | dr.Status__c = '申請中'; |
| | | dr.Reporter__c = u3.Id; |
| | | insert dr; |
| | | |
| | | Datetime dt = Datetime.now(); |
| | | Event__c e = new Event__c( |
| | | Subject__c = 'test', |
| | | StartDateTime__c = Datetime.newInstance(2016, 1, 1, 1, 0, 0), |
| | | DurationInMinutes__c = 60, |
| | | EndDateTime__c = Datetime.newInstance(2016, 1, 1, 2, 0, 0), |
| | | ActivityDate__c = Date.today(), |
| | | Daily_Report__c = dr.Id |
| | | ); |
| | | insert e; |
| | | |
| | | PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id); |
| | | System.Test.setCurrentPage(page); |
| | | XinDailyReportController controller = new XinDailyReportController(); |
| | | //初始化 |
| | | controller.init(); |
| | | } |
| | | |
| | | System.runAs(u1) { |
| | | Daily_Report__c dr = new Daily_Report__c(); |
| | | dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | dr.Status__c = '申請中'; |
| | | dr.Reporter__c = u2.Id; |
| | | insert dr; |
| | | |
| | | PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id); |
| | | System.Test.setCurrentPage(page); |
| | | XinDailyReportController controller = new XinDailyReportController(); |
| | | //初始化 |
| | | controller.init(); |
| | | |
| | | controller.activities[0].act.Minister_Comment__c = '111'; |
| | | controller.saveComment(); |
| | | |
| | | //Event__c event = [select id,Minister_Comment__c from Event__c where id = :e.id]; |
| | | //System.assertEquals('111', event.Minister_Comment__c); |
| | | } |
| | | |
| | | System.runAs(u2) { |
| | | Daily_Report__c dr = new Daily_Report__c(); |
| | | dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | dr.Status__c = '申請中'; |
| | | dr.Reporter__c = u1.Id; |
| | | insert dr; |
| | | |
| | | PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id); |
| | | System.Test.setCurrentPage(page); |
| | | XinDailyReportController controller = new XinDailyReportController(); |
| | | //初始化 |
| | | controller.init(); |
| | | |
| | | controller.activities[0].act.Manager_Comment__c = '222'; |
| | | controller.saveComment(); |
| | | |
| | | //Event__c event = [select id,Manager_Comment__c from Event__c where id = :e.id]; |
| | | //System.assertEquals('222', event.Manager_Comment__c); |
| | | } |
| | | System.Test.stopTest(); |
| | | } |
| | | |
| | | @isTest |
| | | static void test11() { |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | Daily_Report__c dr = [select Id from Daily_Report__c limit 1]; |
| | | t.init(); |
| | | System.runAs(u1) { |
| | | t.report_search.Reported_Date__c = date.today(); |
| | | PageReference ref = t.getDailyReport(); |
| | | Test.setCurrentPage(ref); |
| | | Event__c ec = new Event__c( |
| | | Subject__c = 'test', |
| | | StartDateTime__c = Datetime.newInstance(2016, 1, 1, 1, 0, 0), |
| | | DurationInMinutes__c = 60, |
| | | EndDateTime__c = Datetime.newInstance(2016, 1, 1, 2, 0, 0), |
| | | ActivityDate__c = Date.today(), |
| | | Daily_Report__c = dr.Id |
| | | ); |
| | | insert ec; |
| | | t = new XinDailyReportController(); |
| | | // Event e = new Event(); |
| | | // e.ActivityDateTime = datetime.now(); |
| | | // e.DurationInMinutes = 0; |
| | | // e.OwnerId = u1.id; |
| | | // e.IsScheduled__c = true; |
| | | // e.whatid__c = accDep.Id; |
| | | // e.EventC_ID__c = ec.Id; |
| | | // insert e; |
| | | Event e = [select Id from Event limit 1]; |
| | | t.init(); |
| | | // t.getEvent(); |
| | | |
| | | t.addActivity(); |
| | | |
| | | t.report.Status__c = '作成中'; |
| | | t.report.Reported_Date__c = date.today(); |
| | | t.report.Daily_Report_Data_Type__c = '通常'; |
| | | t.repoStartHourText = '9'; |
| | | t.repoStartMinuteText = '00'; |
| | | t.repoEndHourText = '18'; |
| | | t.repoEndMinuteText = '00'; |
| | | t.activities.get(0).actStartHourText = '9'; |
| | | t.activities.get(0).actStartMinuteText = '00'; |
| | | t.activities.get(0).actEndHourText = '18'; |
| | | t.activities.get(0).actEndMinuteText = '00'; |
| | | t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(0).act.Event_ID__c = e.Id; |
| | | t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(0).act.Description__c = '結果'; |
| | | t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(0).act.Purpose_Type2__c = '客户咨询对应'; |
| | | t.activities.get(0).act.Purpose_Type3__c = '学会or展会对应'; |
| | | t.activities.get(0).act.Purpose_Type4__c = '信息搜集'; |
| | | t.activities.get(0).act.Purpose_Type5__c = '产品介绍or推广'; |
| | | t.activities.get(0).act.Location__c = accDepName; |
| | | t.activities.get(0).act.whatid__c = accDep.Id; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | t.activities.get(0).act.Related_Opportunity1__c = '引合1'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = '引合2'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = '引合3'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = '引合4'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = '引合5'; |
| | | t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | t.activities.get(0).act.Related_Service1_ID__c = mc1.Id; |
| | | t.activities.get(0).act.Related_Service2_ID__c = mc2.Id; |
| | | t.activities.get(0).planStartHourText = '9'; |
| | | t.activities.get(0).planStartMinuteText = '00'; |
| | | t.activities.get(0).planEndHourText = '18'; |
| | | t.activities.get(0).planEndMinuteText = '00'; |
| | | t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | //t.activities.get(0).act.Free_Input__c = true; |
| | | t.activities.get(0).act.Find_Imitations_Flag__c = true; |
| | | //t.activities.get(0).act.Activity_PurposeFSE__c = '装机'; |
| | | t.activities.get(0).act.nextPlanDate__c = date.today() + 30; |
| | | t.save(); |
| | | |
| | | //t.report.Status__c = '承认'; |
| | | //t.upsertActIndex = '0'; |
| | | //t.activities.get(0).act.Purpose_TypeEscFSE__c = '休假'; |
| | | //t.activities.get(0).act.Purpose_TypeFSE__c = '例会'; |
| | | //t.activities.get(0).act.Free_Input__c = true; |
| | | //t.save(); |
| | | } |
| | | System.Test.stopTest(); |
| | | } |
| | | |
| | | // @isTest |
| | | // static void test06() { |
| | | // ControllerUtil.EscapeNFM001Trigger = true; |
| | | // init(); |
| | | |
| | | // System.runAs(u1) { |
| | | // //System.Test.startTest(); |
| | | // init2(); |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | |
| | | // Event e = new Event(); |
| | | // e.ActivityDateTime = datetime.now(); |
| | | // e.DurationInMinutes = 0; |
| | | // e.OwnerId = u1.id; |
| | | // insert e; |
| | | |
| | | // PageReference pageRef1 = Page.XinDailyReport; |
| | | // pageRef1.getParameters().put('id', e.id); |
| | | // Test.setCurrentPage(pageRef1); |
| | | // t.init(); |
| | | |
| | | // //System.Test.stopTest(); |
| | | // } |
| | | // } |
| | | |
| | | // @isTest |
| | | // static void test07_01() { |
| | | // static void test12() { |
| | | // ControllerUtil.EscapeNFM001Trigger = true; |
| | | // init(); |
| | | // //System.Test.startTest(); |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // System.runAs(u1) { |
| | | // init2(); |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // // t.getEvent(); |
| | | // t.upsertActVD = ''; |
| | | // t.upsertActVP = ''; |
| | | // t.upsertStartTime = date.today(); |
| | | // t.upsertEndTime = date.today() + 1; |
| | | // // t.noSltList.add(new SelectOption('123456789123456', 'Dummy User')); |
| | | // // t.hosptalList.add(new SelectOption('123456789123456', 'Dummy User')); |
| | | // // t.salesList.add(new SelectOption('123456789123456', 'Dummy User')); |
| | | // // t.outEventList.add(new SelectOption('123456789123456', 'Dummy User')); |
| | | // // t.inEventList.add(new SelectOption('123456789123456', 'Dummy User')); |
| | | // // t.moveList.add(new SelectOption('123456789123456', 'Dummy User')); |
| | | // // t.activitiesSize = 0; |
| | | |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | // t.addActivity(); |
| | | |
| | | // t.report.Status__c = '申請中'; |
| | | // t.report.Reported_Date__c = date.today(); |
| | | // t.repoStartHourText = '9'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '18'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.activities.get(0).actStartHourText = '9'; |
| | | // t.activities.get(0).actStartMinuteText = '00'; |
| | | // t.activities.get(0).actEndHourText = '18'; |
| | | // t.activities.get(0).actEndMinuteText = '00'; |
| | | // t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(0).act.Description__c = '結果'; |
| | | // t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | // t.activities.get(0).act.Purpose_Type2__c = '客户咨询对应'; |
| | | // t.activities.get(0).act.Purpose_Type3__c = '学会or展会对应'; |
| | | // t.activities.get(0).act.Purpose_Type4__c = '信息搜集'; |
| | | // t.activities.get(0).act.Purpose_Type5__c = '产品介绍or推广'; |
| | | // t.activities.get(0).act.Location__c = '戦略科室分類1 診療科1'; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = '引合1'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = '引合2'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = '引合3'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = '引合4'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = '引合5'; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | // t.activities.get(0).planStartHourText = '9'; |
| | | // t.activities.get(0).planStartMinuteText = '00'; |
| | | // t.activities.get(0).planEndHourText = '18'; |
| | | // t.activities.get(0).planEndMinuteText = '00'; |
| | | // t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | // t.activities.get(0).act.Free_Input__c = true; |
| | | // t.activities.get(0).act.Find_Imitations_Flag__c = true; |
| | | // t.save(); |
| | | // } |
| | | // //System.Test.stopTest(); |
| | | // } |
| | | |
| | | // // 取引先などのマスタ検索 |
| | | // @isTest |
| | | // static void test07_02_1() { |
| | | // ControllerUtil.EscapeNFM001Trigger = true; |
| | | // init(); |
| | | // //System.Test.startTest(); |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // System.runAs(u3) { |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // t.report_search.Reporter__c = u1.id; |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // System.assertEquals(u1.id, t.report.Reporter__c); |
| | | // // t.getEvent(); |
| | | @isTest |
| | | static void test13 () { |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | System.runAs(u1) { |
| | | Daily_Report__c dr = new Daily_Report__c(); |
| | | dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | dr.Status__c = '申請中'; |
| | | dr.Reporter__c = u1.Id; |
| | | insert dr; |
| | | |
| | | // t.report.Status__c = '承認'; |
| | | // t.save(); |
| | | Event__c ec = new Event__c( |
| | | Subject__c = 'test', |
| | | StartDateTime__c = Datetime.newInstance(2016, 1, 1, 1, 0, 0), |
| | | DurationInMinutes__c = 60, |
| | | EndDateTime__c = Datetime.newInstance(2016, 1, 1, 2, 0, 0), |
| | | ActivityDate__c = Date.today(), |
| | | Daily_Report__c = dr.Id |
| | | ); |
| | | insert ec; |
| | | |
| | | // t.report.Feed_Back_From_Manager__c = 'OK'; |
| | | // t.report.Submit_Date_New__c = date.today(); |
| | | // t.save(); |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | |
| | | // t.report.Status__c = '非承認'; |
| | | // t.save(); |
| | | // } |
| | | // //System.Test.stopTest(); |
| | | // } |
| | | // @isTest |
| | | // static void test07_02_1_2() { |
| | | // ControllerUtil.EscapeNFM001Trigger = true; |
| | | // init(); |
| | | // //System.Test.startTest(); |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // System.runAs(u3) { |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // t.report_search.Reporter__c = u1.id; |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // System.assertEquals(u1.id, t.report.Reporter__c); |
| | | // // t.getEvent(); |
| | | Event e = new Event(); |
| | | e.ActivityDateTime = datetime.now(); |
| | | e.DurationInMinutes = 0; |
| | | e.OwnerId = u1.id; |
| | | e.IsScheduled__c = true; |
| | | e.whatid__c = accDep.Id; |
| | | e.NextEventC_ID__c = ec.Id; |
| | | insert e; |
| | | |
| | | // t.report.Status__c = '承認'; |
| | | // t.save(); |
| | | PageReference pageRef1 = Page.XinDailyReport; |
| | | pageRef1.getParameters().put('id', e.id); |
| | | Test.setCurrentPage(pageRef1); |
| | | t.init(); |
| | | } |
| | | System.Test.stopTest(); |
| | | |
| | | // t.report.Feed_Back_From_Manager__c = 'OK'; |
| | | // t.report.Submit_Date_New__c = date.today(); |
| | | // t.save(); |
| | | |
| | | // t.report.Status__c = '非承認'; |
| | | // t.save(); |
| | | // } |
| | | // //System.Test.stopTest(); |
| | | // } |
| | | // @isTest |
| | | // static void test07_02_1_3() { |
| | | // ControllerUtil.EscapeNFM001Trigger = true; |
| | | // init(); |
| | | // //System.Test.startTest(); |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // System.runAs(u3) { |
| | | // Xin_SearchVisitorPlace_Campaign blgsvpc = new Xin_SearchVisitorPlace_Campaign(); |
| | | // PageReference pageRef4 = Page.Xin_SearchVisitorPlace_Campaign; |
| | | // pageRef4.getParameters().put('q', ''); |
| | | // Test.setCurrentPage(pageRef4); |
| | | // blgsvpc.search(); |
| | | |
| | | // pageRef4.getParameters().put('q', 'test'); |
| | | // Test.setCurrentPage(pageRef4); |
| | | // blgsvpc.search(); |
| | | // RestContext.response = new RestResponse(); |
| | | // Xin_SearchVisitorPlace_CampaignRest.doPost('test', '東京', '2000/01/01'); |
| | | |
| | | // Xin_SearchVisitorPlace_Training blgsvpt = new Xin_SearchVisitorPlace_Training(); |
| | | // PageReference pageRef5 = Page.Xin_SearchVisitorPlace_Training; |
| | | // pageRef5.getParameters().put('q', ''); |
| | | // Test.setCurrentPage(pageRef5); |
| | | // blgsvpt.search(); |
| | | // } |
| | | // //System.Test.stopTest(); |
| | | // } |
| | | // @isTest |
| | | // static void test07_02_1_4() { |
| | | // ControllerUtil.EscapeNFM001Trigger = true; |
| | | // init(); |
| | | // //System.Test.startTest(); |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // System.runAs(u3) { |
| | | // Xin_SearchVisitorPlace blgsv = new Xin_SearchVisitorPlace(); |
| | | // PageReference pageRef1 = Page.Xin_SearchVisitorPlace; |
| | | // pageRef1.getParameters().put('q', ''); |
| | | // Test.setCurrentPage(pageRef1); |
| | | // blgsv.search(); |
| | | |
| | | // pageRef1.getParameters().put('q', 'test'); |
| | | // Test.setCurrentPage(pageRef1); |
| | | // blgsv.search(); |
| | | // RestContext.response = new RestResponse(); |
| | | // Date Tling = Date.today(); |
| | | // Xin_SearchVisitorPlaceRest.doPost('診療科1', '東京', Date.today() + ''); |
| | | |
| | | // Xin_SearchVisitorPlace_Sales blgsvp = new Xin_SearchVisitorPlace_Sales(); |
| | | // PageReference pageRef2 = Page.Xin_SearchVisitorPlace_Sales; |
| | | // pageRef2.getParameters().put('q', ''); |
| | | // Test.setCurrentPage(pageRef2); |
| | | // blgsvp.search(); |
| | | |
| | | // pageRef2.getParameters().put('q', 'test'); |
| | | // pageRef2.getParameters().put('d', '2000/01/01'); |
| | | // Test.setCurrentPage(pageRef2); |
| | | // blgsvp.search(); |
| | | // RestContext.response = new RestResponse(); |
| | | // Xin_SearchVisitorPlace_SalesRest.doPost('test', '東京', '2000/01/01'); |
| | | |
| | | // Xin_SearchVisitorPlace_Training blgsvpt = new Xin_SearchVisitorPlace_Training(); |
| | | // PageReference pageRef5 = Page.Xin_SearchVisitorPlace_Training; |
| | | // pageRef5.getParameters().put('q', ''); |
| | | // Test.setCurrentPage(pageRef5); |
| | | // blgsvpt.search(); |
| | | // } |
| | | // //System.Test.stopTest(); |
| | | // } |
| | | // // 商談などのマスタ検索 |
| | | // //@isTest |
| | | // static void test07_02_2() { |
| | | // init(); |
| | | |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // System.runAs(u3) { |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // t.report_search.Reporter__c = u1.id; |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // System.assertEquals(u1.id, t.report.Reporter__c); |
| | | // t.report.Status__c = '非承認'; |
| | | // t.save(); |
| | | |
| | | // Xin_SearchOpportunity blgso = new Xin_SearchOpportunity(); |
| | | // PageReference pageRef3 = Page.Xin_SearchOpportunity; |
| | | // pageRef3.getParameters().put('q', ''); |
| | | // pageRef3.getParameters().put('r', ''); |
| | | // Test.setCurrentPage(pageRef3); |
| | | // blgso.search(); |
| | | |
| | | // Account accTmp = [Select Id, Hospital__c from Account where id = : accDep.Id]; |
| | | // List<Opportunity> oppTmp = [Select Id from Opportunity where StageName IN ('引合', '注残', '出荷')]; |
| | | // pageRef3.getParameters().put('q', '::'); |
| | | // pageRef3.getParameters().put('r', accDep.Id); |
| | | // Test.setCurrentPage(pageRef3); |
| | | // blgso.search(); |
| | | // RestContext.response = new RestResponse(); |
| | | // Xin_SearchOpportunityRest.doPost('::', accDep.Id); |
| | | |
| | | // Xin_Maintenance_Contract blgmc = new Xin_Maintenance_Contract(); |
| | | // PageReference pageRef6 = Page.Xin_SearchMaintenanceContract; |
| | | // pageRef6.getParameters().put('q', ''); |
| | | // pageRef6.getParameters().put('r', ''); |
| | | // Test.setCurrentPage(pageRef6); |
| | | // blgmc.search(); |
| | | |
| | | // pageRef6.getParameters().put('q', 'サービス'); |
| | | // pageRef6.getParameters().put('r', accDep.Id); |
| | | // Test.setCurrentPage(pageRef6); |
| | | // blgmc.search(); |
| | | // RestContext.response = new RestResponse(); |
| | | // Xin_Maintenance_ContractRest.doPost('サービス', accDep.Id); |
| | | |
| | | // PageReference pageRef7 = Page.SearchVisitor; |
| | | // pageRef7.getParameters().put('vp', accDepId); |
| | | // Test.setCurrentPage(pageRef7); |
| | | // SearchVisitorController svc = new SearchVisitorController(); |
| | | // svc.rc.MyDr_Flg__c = true; |
| | | // svc.rc.Search_LastName__c = 'testLastName'; |
| | | // svc.rc.FirstName = 'testFirstName'; |
| | | // svc.rc.Account_Visitor_Search__c = accDep.Id; |
| | | // svc.rc.Type__c = 'test'; |
| | | // svc.rc.Doctor_Division1__c = 'test'; |
| | | // svc.regContact(); |
| | | |
| | | // svc.sc.Search_LastName__c = 'testLastName'; |
| | | // svc.sc.Search_FirstName__c = 'testFirstName'; |
| | | // svc.sc.Type__c = 'test'; |
| | | // svc.sc.Doctor_Division1__c = 'test'; |
| | | // svc.sc.MyDr_Flg__c = true; |
| | | // svc.serContact(); |
| | | |
| | | // t.delIndex = '0'; |
| | | // t.deleteActivity(); |
| | | // } |
| | | // } |
| | | |
| | | // // 部长/经理的反馈 编辑可能 |
| | | // @isTest |
| | | // static void test08() { |
| | | // Profile p = [select id from Profile where id = :System.Label.ProfileId_SystemAdmin]; |
| | | |
| | | // u3 = new User(Test_staff__c = true); |
| | | // u3.LastName = '_サンブリッジ'; |
| | | // u3.FirstName = 'う'; |
| | | // u3.Alias = 'う'; |
| | | // u3.Batch_User__c = true; |
| | | // u3.Email = 'olympusTest03@sunbridge.com'; |
| | | // u3.Username = 'olympusTest03@sunbridge.com'; |
| | | // u3.CommunityNickname = 'う'; |
| | | // u3.IsActive = true; |
| | | // u3.EmailEncodingKey = 'ISO-2022-JP'; |
| | | // u3.TimeZoneSidKey = 'Asia/Tokyo'; |
| | | // u3.LocaleSidKey = 'ja_JP'; |
| | | // u3.LanguageLocaleKey = 'ja'; |
| | | // u3.ProfileId = p.id; |
| | | // u3.Job_Category__c = '支援'; |
| | | // u3.Province__c = '東京'; |
| | | // u3.Post__c = '部长'; |
| | | // insert u3; |
| | | |
| | | // u1 = new User(Test_staff__c = true); |
| | | // u1.LastName = '_サンブリッジ'; |
| | | // u1.FirstName = 'あ'; |
| | | // u1.Alias = 'あ'; |
| | | // u1.Batch_User__c = true; |
| | | // u1.Email = 'olympusTest01@sunbridge.com'; |
| | | // u1.Username = 'olympusTest10@sunbridge.com'; |
| | | // u1.CommunityNickname = 'あ1'; |
| | | // u1.IsActive = true; |
| | | // u1.EmailEncodingKey = 'ISO-2022-JP'; |
| | | // u1.TimeZoneSidKey = 'Asia/Tokyo'; |
| | | // u1.LocaleSidKey = 'ja_JP'; |
| | | // u1.LanguageLocaleKey = 'ja'; |
| | | // u1.ProfileId = p.id; |
| | | // u1.Job_Category__c = '销售服务'; |
| | | // u1.Province__c = '東京'; |
| | | // u1.ManagerId = u3.id; |
| | | // u1.Post__c = '部长'; |
| | | // insert u1; |
| | | |
| | | // u2 = new User(Test_staff__c = true); |
| | | // u2.LastName = '_サンブリッジ'; |
| | | // u2.FirstName = 'い'; |
| | | // u2.Alias = 'い'; |
| | | // u2.Batch_User__c = true; |
| | | // u2.Email = 'olympusTest02@sunbridge.com'; |
| | | // u2.Username = 'olympusTest02@sunbridge.com'; |
| | | // u2.CommunityNickname = 'い'; |
| | | // u2.IsActive = true; |
| | | // u2.EmailEncodingKey = 'ISO-2022-JP'; |
| | | // u2.TimeZoneSidKey = 'Asia/Tokyo'; |
| | | // u2.LocaleSidKey = 'ja_JP'; |
| | | // u2.LanguageLocaleKey = 'ja'; |
| | | // u2.ProfileId = p.id; |
| | | // u2.Job_Category__c = '销售推广'; |
| | | // u2.Province__c = '東京'; |
| | | // u2.Post__c = '经理'; |
| | | // insert u2; |
| | | |
| | | // system.runAs(u3) { |
| | | // Daily_Report__c dr = new Daily_Report__c(); |
| | | // dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | // dr.Status__c = '申請中'; |
| | | // dr.Reporter__c = u3.Id; |
| | | // insert dr; |
| | | |
| | | // Datetime dt = Datetime.now(); |
| | | // Event__c e = new Event__c( |
| | | // Subject__c = 'test', |
| | | // StartDateTime__c = Datetime.newInstance(2016, 1, 1, 1, 0, 0), |
| | | // DurationInMinutes__c = 60, |
| | | // EndDateTime__c = Datetime.newInstance(2016, 1, 1, 2, 0, 0), |
| | | // ActivityDate__c = Date.today(), |
| | | // Daily_Report__c = dr.Id |
| | | // ); |
| | | // insert e; |
| | | |
| | | // PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id); |
| | | // System.Test.setCurrentPage(page); |
| | | // XinDailyReportController controller = new XinDailyReportController(); |
| | | // //初始化 |
| | | // controller.init(); |
| | | // System.assertEquals(true, controller.ministerCommentEditFlg); |
| | | // System.assertEquals(true, controller.managerCommentEditFlg); |
| | | // } |
| | | |
| | | // System.runAs(u1) { |
| | | // Daily_Report__c dr = new Daily_Report__c(); |
| | | // dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | // dr.Status__c = '申請中'; |
| | | // dr.Reporter__c = u2.Id; |
| | | // insert dr; |
| | | |
| | | // PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id); |
| | | // System.Test.setCurrentPage(page); |
| | | // XinDailyReportController controller = new XinDailyReportController(); |
| | | // //初始化 |
| | | // controller.init(); |
| | | // System.assertEquals(false, controller.ministerCommentEditFlg); |
| | | // System.assertEquals(true, controller.managerCommentEditFlg); |
| | | |
| | | // controller.activities[0].act.Minister_Comment__c = '111'; |
| | | // controller.saveComment(); |
| | | // } |
| | | |
| | | // System.runAs(u2) { |
| | | // Daily_Report__c dr = new Daily_Report__c(); |
| | | // dr.Reported_Date__c = Date.newInstance(2019, 2, 19); |
| | | // dr.Status__c = '申請中'; |
| | | // dr.Reporter__c = u1.Id; |
| | | // insert dr; |
| | | // Date t = Date.today(); |
| | | // //Date t1 = t.addMonths(6); |
| | | // Event__c ec1 = new Event__c( |
| | | // Daily_Report__c = dr.Id, |
| | | // StartDateTime__c = Datetime.newInstance(t.year(), t.month(), t.day(), 1, 0, 0), |
| | | // EndDateTime__c = Datetime.newInstance(t.year(), t.month(), t.day(), 1, 0, 0), |
| | | // ActivityDate__c = dr.Reported_Date__c, |
| | | // Subject__c = 'eventc1' |
| | | // ); |
| | | // insert ec1; |
| | | // PageReference page = new PageReference('/apex/XinDailyReport?id=' + +ec1.Id); |
| | | // System.Test.setCurrentPage(page); |
| | | // XinDailyReportController controller = new XinDailyReportController(); |
| | | // //初始化 |
| | | // controller.init(); |
| | | // System.assertEquals(true, controller.ministerCommentEditFlg); |
| | | // System.assertEquals(false, controller.managerCommentEditFlg); |
| | | |
| | | // controller.activities[0].act.Manager_Comment__c = '222'; |
| | | // controller.saveComment(); |
| | | // } |
| | | // } |
| | | |
| | | // @isTest |
| | | // static void test9() { |
| | | // Profile p = [select id from Profile where id = :System.Label.ProfileId_SystemAdmin]; |
| | | |
| | | // u3 = new User(Test_staff__c = true); |
| | | // u3.LastName = '_サンブリッジ'; |
| | | // u3.FirstName = 'う'; |
| | | // u3.Alias = 'う'; |
| | | // u3.Batch_User__c = true; |
| | | // u3.Email = 'olympusTest03@sunbridge.com'; |
| | | // u3.Username = 'olympusTest03@sunbridge.com'; |
| | | // u3.CommunityNickname = 'う'; |
| | | // u3.IsActive = true; |
| | | // u3.EmailEncodingKey = 'ISO-2022-JP'; |
| | | // u3.TimeZoneSidKey = 'Asia/Tokyo'; |
| | | // u3.LocaleSidKey = 'ja_JP'; |
| | | // u3.LanguageLocaleKey = 'ja'; |
| | | // u3.ProfileId = p.id; |
| | | // u3.Job_Category__c = '支援'; |
| | | // u3.Province__c = '東京'; |
| | | // u3.Post__c = '部长'; |
| | | // insert u3; |
| | | |
| | | // u1 = new User(Test_staff__c = true); |
| | | // u1.LastName = '_サンブリッジ'; |
| | | // u1.FirstName = 'あ'; |
| | | // u1.Alias = 'あ'; |
| | | // u1.Batch_User__c = true; |
| | | // u1.Email = 'olympusTest01@sunbridge.com'; |
| | | // u1.Username = 'olympusTest10@sunbridge.com'; |
| | | // u1.CommunityNickname = 'あ1'; |
| | | // u1.IsActive = true; |
| | | // u1.EmailEncodingKey = 'ISO-2022-JP'; |
| | | // u1.TimeZoneSidKey = 'Asia/Tokyo'; |
| | | // u1.LocaleSidKey = 'ja_JP'; |
| | | // u1.LanguageLocaleKey = 'ja'; |
| | | // u1.ProfileId = p.id; |
| | | // u1.Job_Category__c = '销售服务'; |
| | | // u1.Province__c = '東京'; |
| | | // u1.ManagerId = u3.id; |
| | | // u1.Post__c = '部长'; |
| | | // insert u1; |
| | | |
| | | // u2 = new User(Test_staff__c = true); |
| | | // u2.LastName = '_サンブリッジ'; |
| | | // u2.FirstName = 'い'; |
| | | // u2.Alias = 'い'; |
| | | // u2.Batch_User__c = true; |
| | | // u2.Email = 'olympusTest02@sunbridge.com'; |
| | | // u2.Username = 'olympusTest02@sunbridge.com'; |
| | | // u2.CommunityNickname = 'い'; |
| | | // u2.IsActive = true; |
| | | // u2.EmailEncodingKey = 'ISO-2022-JP'; |
| | | // u2.TimeZoneSidKey = 'Asia/Tokyo'; |
| | | // u2.LocaleSidKey = 'ja_JP'; |
| | | // u2.LanguageLocaleKey = 'ja'; |
| | | // u2.ProfileId = p.id; |
| | | // u2.Job_Category__c = '销售推广'; |
| | | // u2.Province__c = '東京'; |
| | | // u2.Post__c = '经理'; |
| | | // insert u2; |
| | | |
| | | // System.runAs(u3) { |
| | | // Daily_Report__c dr = new Daily_Report__c(); |
| | | // dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | // dr.Status__c = '申請中'; |
| | | // dr.Reporter__c = u3.Id; |
| | | // insert dr; |
| | | |
| | | // Datetime dt = Datetime.now(); |
| | | // Event__c e = new Event__c( |
| | | // Subject__c = 'test', |
| | | // StartDateTime__c = Datetime.newInstance(2016, 1, 1, 1, 0, 0), |
| | | // DurationInMinutes__c = 60, |
| | | // EndDateTime__c = Datetime.newInstance(2016, 1, 1, 2, 0, 0), |
| | | // ActivityDate__c = Date.today(), |
| | | // Daily_Report__c = dr.Id |
| | | // ); |
| | | // insert e; |
| | | |
| | | // PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id + '&dt=' + String.valueOf(dt)); |
| | | // System.Test.setCurrentPage(page); |
| | | // XinDailyReportController controller = new XinDailyReportController(); |
| | | // //初始化 |
| | | // controller.init(); |
| | | // System.assertEquals(true, controller.ministerCommentEditFlg); |
| | | // System.assertEquals(true, controller.managerCommentEditFlg); |
| | | // } |
| | | |
| | | // System.runAs(u1) { |
| | | // Daily_Report__c dr = new Daily_Report__c(); |
| | | // dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | // dr.Status__c = '申請中'; |
| | | // dr.Reporter__c = u2.Id; |
| | | // insert dr; |
| | | |
| | | // PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id); |
| | | // System.Test.setCurrentPage(page); |
| | | // XinDailyReportController controller = new XinDailyReportController(); |
| | | // //初始化 |
| | | // controller.init(); |
| | | // System.assertEquals(false, controller.ministerCommentEditFlg); |
| | | // System.assertEquals(true, controller.managerCommentEditFlg); |
| | | |
| | | // controller.activities[0].act.Minister_Comment__c = '111'; |
| | | // controller.saveComment(); |
| | | |
| | | // } |
| | | |
| | | // System.runAs(u2) { |
| | | // Daily_Report__c dr = new Daily_Report__c(); |
| | | // dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | // dr.Status__c = '申請中'; |
| | | // dr.Reporter__c = u1.Id; |
| | | // insert dr; |
| | | |
| | | // PageReference page = new PageReference('/apex/XinDailyReport?dt=' + String.valueOf('20190215')); |
| | | // //PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id +'&dt='+String.valueOf('20190215')); |
| | | // System.Test.setCurrentPage(page); |
| | | // XinDailyReportController controller = new XinDailyReportController(); |
| | | // //初始化 |
| | | // controller.init(); |
| | | // } |
| | | // System.runAs(u2) { |
| | | |
| | | |
| | | // PageReference page = new PageReference('/apex/XinDailyReport'); |
| | | // //PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id +'&dt='+String.valueOf('20190215')); |
| | | // System.Test.setCurrentPage(page); |
| | | // XinDailyReportController controller = new XinDailyReportController(); |
| | | // //初始化 |
| | | // controller.init(); |
| | | |
| | | // } |
| | | |
| | | // System.runAs(u2) { |
| | | |
| | | |
| | | // PageReference page = new PageReference('/apex/XinDailyReport?id=00Uabcd'); |
| | | // //PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id +'&dt='+String.valueOf('20190215')); |
| | | // System.Test.setCurrentPage(page); |
| | | // XinDailyReportController controller = new XinDailyReportController(); |
| | | // //初始化 |
| | | // controller.init(); |
| | | |
| | | // } |
| | | |
| | | // System.runAs(u2) { |
| | | |
| | | |
| | | // PageReference page = new PageReference('/apex/XinDailyReport?id=a0Aabcd'); |
| | | // //PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id +'&dt='+String.valueOf('20190215')); |
| | | // System.Test.setCurrentPage(page); |
| | | // XinDailyReportController controller = new XinDailyReportController(); |
| | | // //初始化 |
| | | // controller.init(); |
| | | |
| | | // } |
| | | |
| | | // System.runAs(u2) { |
| | | |
| | | |
| | | // PageReference page = new PageReference('/apex/XinDailyReport?id=UaMabcd'); |
| | | // //PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id +'&dt='+String.valueOf('20190215')); |
| | | // System.Test.setCurrentPage(page); |
| | | // XinDailyReportController controller = new XinDailyReportController(); |
| | | // //初始化 |
| | | // controller.init(); |
| | | |
| | | // } |
| | | // } |
| | | |
| | | // @isTest |
| | | // static void test10() { |
| | | // Profile p = [select id from Profile where id = :System.Label.ProfileId_SystemAdmin]; |
| | | |
| | | // u3 = new User(Test_staff__c = true); |
| | | // u3.LastName = '_サンブリッジ'; |
| | | // u3.FirstName = 'う'; |
| | | // u3.Alias = 'う'; |
| | | // u3.Batch_User__c = true; |
| | | // u3.Email = 'olympusTest03@sunbridge.com'; |
| | | // u3.Username = 'olympusTest03@sunbridge.com'; |
| | | // u3.CommunityNickname = 'う'; |
| | | // u3.IsActive = true; |
| | | // u3.EmailEncodingKey = 'ISO-2022-JP'; |
| | | // u3.TimeZoneSidKey = 'Asia/Tokyo'; |
| | | // u3.LocaleSidKey = 'ja_JP'; |
| | | // u3.LanguageLocaleKey = 'ja'; |
| | | // u3.ProfileId = p.id; |
| | | // u3.Job_Category__c = '支援'; |
| | | // u3.Province__c = '東京'; |
| | | // u3.Post__c = '部长'; |
| | | // insert u3; |
| | | |
| | | // u1 = new User(Test_staff__c = true); |
| | | // u1.LastName = '_サンブリッジ'; |
| | | // u1.FirstName = 'あ'; |
| | | // u1.Alias = 'あ'; |
| | | // u1.Batch_User__c = true; |
| | | // u1.Email = 'olympusTest01@sunbridge.com'; |
| | | // u1.Username = 'olympusTest10@sunbridge.com'; |
| | | // u1.CommunityNickname = 'あ1'; |
| | | // u1.IsActive = true; |
| | | // u1.EmailEncodingKey = 'ISO-2022-JP'; |
| | | // u1.TimeZoneSidKey = 'Asia/Tokyo'; |
| | | // u1.LocaleSidKey = 'ja_JP'; |
| | | // u1.LanguageLocaleKey = 'ja'; |
| | | // u1.ProfileId = p.id; |
| | | // u1.Job_Category__c = '销售服务'; |
| | | // u1.Province__c = '東京'; |
| | | // u1.ManagerId = u3.id; |
| | | // u1.Post__c = '部长'; |
| | | // insert u1; |
| | | |
| | | // u2 = new User(Test_staff__c = true); |
| | | // u2.LastName = '_サンブリッジ'; |
| | | // u2.FirstName = 'い'; |
| | | // u2.Alias = 'い'; |
| | | // u2.Batch_User__c = true; |
| | | // u2.Email = 'olympusTest02@sunbridge.com'; |
| | | // u2.Username = 'olympusTest02@sunbridge.com'; |
| | | // u2.CommunityNickname = 'い'; |
| | | // u2.IsActive = true; |
| | | // u2.EmailEncodingKey = 'ISO-2022-JP'; |
| | | // u2.TimeZoneSidKey = 'Asia/Tokyo'; |
| | | // u2.LocaleSidKey = 'ja_JP'; |
| | | // u2.LanguageLocaleKey = 'ja'; |
| | | // u2.ProfileId = p.id; |
| | | // u2.Job_Category__c = '销售推广'; |
| | | // u2.Province__c = '東京'; |
| | | // u2.Post__c = '经理'; |
| | | // insert u2; |
| | | |
| | | |
| | | |
| | | // System.runAs(u3) { |
| | | // Daily_Report__c dr = new Daily_Report__c(); |
| | | // dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | // dr.Status__c = '申請中'; |
| | | // dr.Reporter__c = u3.Id; |
| | | // insert dr; |
| | | |
| | | // Datetime dt = Datetime.now(); |
| | | // Event__c e = new Event__c( |
| | | // Subject__c = 'test', |
| | | // StartDateTime__c = Datetime.newInstance(2016, 1, 1, 1, 0, 0), |
| | | // DurationInMinutes__c = 60, |
| | | // EndDateTime__c = Datetime.newInstance(2016, 1, 1, 2, 0, 0), |
| | | // ActivityDate__c = Date.today(), |
| | | // Daily_Report__c = dr.Id |
| | | // ); |
| | | // insert e; |
| | | |
| | | // PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id); |
| | | // System.Test.setCurrentPage(page); |
| | | // XinDailyReportController controller = new XinDailyReportController(); |
| | | // //初始化 |
| | | // controller.init(); |
| | | // System.assertEquals(true, controller.ministerCommentEditFlg); |
| | | // System.assertEquals(true, controller.managerCommentEditFlg); |
| | | // } |
| | | |
| | | // System.runAs(u1) { |
| | | // Daily_Report__c dr = new Daily_Report__c(); |
| | | // dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | // dr.Status__c = '申請中'; |
| | | // dr.Reporter__c = u2.Id; |
| | | // insert dr; |
| | | |
| | | // PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id); |
| | | // System.Test.setCurrentPage(page); |
| | | // XinDailyReportController controller = new XinDailyReportController(); |
| | | // //初始化 |
| | | // controller.init(); |
| | | // System.assertEquals(false, controller.ministerCommentEditFlg); |
| | | // System.assertEquals(true, controller.managerCommentEditFlg); |
| | | |
| | | // controller.activities[0].act.Minister_Comment__c = '111'; |
| | | // controller.saveComment(); |
| | | |
| | | // //Event__c event = [select id,Minister_Comment__c from Event__c where id = :e.id]; |
| | | // //System.assertEquals('111', event.Minister_Comment__c); |
| | | // } |
| | | |
| | | // System.runAs(u2) { |
| | | // Daily_Report__c dr = new Daily_Report__c(); |
| | | // dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | // dr.Status__c = '申請中'; |
| | | // dr.Reporter__c = u1.Id; |
| | | // insert dr; |
| | | |
| | | // PageReference page = new PageReference('/apex/XinDailyReport?id=' + dr.Id); |
| | | // System.Test.setCurrentPage(page); |
| | | // XinDailyReportController controller = new XinDailyReportController(); |
| | | // //初始化 |
| | | // controller.init(); |
| | | // System.assertEquals(true, controller.ministerCommentEditFlg); |
| | | // System.assertEquals(false, controller.managerCommentEditFlg); |
| | | |
| | | // controller.activities[0].act.Manager_Comment__c = '222'; |
| | | // controller.saveComment(); |
| | | |
| | | // //Event__c event = [select id,Manager_Comment__c from Event__c where id = :e.id]; |
| | | // //System.assertEquals('222', event.Manager_Comment__c); |
| | | // } |
| | | // } |
| | | |
| | | // @isTest |
| | | // static void test11() { |
| | | // ControllerUtil.EscapeNFM001Trigger = true; |
| | | // init(); |
| | | // //System.Test.startTest(); |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | |
| | | // t.init(); |
| | | // System.runAs(u1) { |
| | | // init2(); |
| | | // t.report_search.Reported_Date__c = date.today(); |
| | | // PageReference ref = t.getDailyReport(); |
| | | // Test.setCurrentPage(ref); |
| | | // t = new XinDailyReportController(); |
| | | // t.init(); |
| | | // // t.getEvent(); |
| | | |
| | | // t.addActivity(); |
| | | |
| | | // t.report.Status__c = '作成中'; |
| | | // t.report.Reported_Date__c = date.today(); |
| | | // t.report.Daily_Report_Data_Type__c = '通常'; |
| | | // t.repoStartHourText = '9'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '18'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.activities.get(0).actStartHourText = '9'; |
| | | // t.activities.get(0).actStartMinuteText = '00'; |
| | | // t.activities.get(0).actEndHourText = '18'; |
| | | // t.activities.get(0).actEndMinuteText = '00'; |
| | | // t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(0).act.Description__c = '結果'; |
| | | // t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | // t.activities.get(0).act.Purpose_Type2__c = '客户咨询对应'; |
| | | // t.activities.get(0).act.Purpose_Type3__c = '学会or展会对应'; |
| | | // t.activities.get(0).act.Purpose_Type4__c = '信息搜集'; |
| | | // t.activities.get(0).act.Purpose_Type5__c = '产品介绍or推广'; |
| | | // t.activities.get(0).act.Location__c = accDepName; |
| | | // t.activities.get(0).act.whatid__c = accDep.Id; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = '引合1'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = '引合2'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = '引合3'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = '引合4'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = '引合5'; |
| | | // t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | // t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | // t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | // t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | // t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | // t.activities.get(0).act.Related_Service1__c = mc1.Name; |
| | | // t.activities.get(0).act.Related_Service2__c = mc2.Name; |
| | | // t.activities.get(0).act.Related_Service1_ID__c = mc1.Id; |
| | | // t.activities.get(0).act.Related_Service2_ID__c = mc2.Id; |
| | | // t.activities.get(0).planStartHourText = '9'; |
| | | // t.activities.get(0).planStartMinuteText = '00'; |
| | | // t.activities.get(0).planEndHourText = '18'; |
| | | // t.activities.get(0).planEndMinuteText = '00'; |
| | | // t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | // //t.activities.get(0).act.Free_Input__c = true; |
| | | // t.activities.get(0).act.Find_Imitations_Flag__c = true; |
| | | // //t.activities.get(0).act.Activity_PurposeFSE__c = '装机'; |
| | | // t.activities.get(0).act.nextPlanDate__c = date.today() + 30; |
| | | // t.save(); |
| | | |
| | | // //t.report.Status__c = '承认'; |
| | | // //t.upsertActIndex = '0'; |
| | | // //t.activities.get(0).act.Purpose_TypeEscFSE__c = '休假'; |
| | | // //t.activities.get(0).act.Purpose_TypeFSE__c = '例会'; |
| | | // //t.activities.get(0).act.Free_Input__c = true; |
| | | // //t.save(); |
| | | // } |
| | | // //System.Test.stopTest(); |
| | | // } |
| | | |
| | | // @isTest |
| | | // static void test12() { |
| | | // ControllerUtil.EscapeNFM001Trigger = true; |
| | | // init(); |
| | | // //System.Test.startTest(); |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // t.upsertActVD = ''; |
| | | // t.upsertActVP = ''; |
| | | // t.upsertStartTime = date.today(); |
| | | // t.upsertEndTime = date.today() + 1; |
| | | // // t.noSltList.add(new SelectOption('123456789123456', 'Dummy User')); |
| | | // // t.hosptalList.add(new SelectOption('123456789123456', 'Dummy User')); |
| | | // // t.salesList.add(new SelectOption('123456789123456', 'Dummy User')); |
| | | // // t.outEventList.add(new SelectOption('123456789123456', 'Dummy User')); |
| | | // // t.inEventList.add(new SelectOption('123456789123456', 'Dummy User')); |
| | | // // t.moveList.add(new SelectOption('123456789123456', 'Dummy User')); |
| | | // // t.activitiesSize = 0; |
| | | |
| | | // } |
| | | |
| | | // @isTest |
| | | // static void test13 () { |
| | | // ControllerUtil.EscapeNFM001Trigger = true; |
| | | // init(); |
| | | // //System.Test.startTest(); |
| | | // System.runAs(u1) { |
| | | // Daily_Report__c dr = new Daily_Report__c(); |
| | | // dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | // dr.Status__c = '申請中'; |
| | | // dr.Reporter__c = u1.Id; |
| | | // insert dr; |
| | | |
| | | // Event__c ec = new Event__c( |
| | | // Subject__c = 'test', |
| | | // StartDateTime__c = Datetime.newInstance(2016, 1, 1, 1, 0, 0), |
| | | // DurationInMinutes__c = 60, |
| | | // EndDateTime__c = Datetime.newInstance(2016, 1, 1, 2, 0, 0), |
| | | // ActivityDate__c = Date.today(), |
| | | // Daily_Report__c = dr.Id |
| | | // ); |
| | | // insert ec; |
| | | |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | |
| | | // Event e = new Event(); |
| | | // e.ActivityDateTime = datetime.now(); |
| | | // e.DurationInMinutes = 0; |
| | | // e.OwnerId = u1.id; |
| | | // e.IsScheduled__c = true; |
| | | // e.whatid__c = accDep.Id; |
| | | // e.NextEventC_ID__c = ec.Id; |
| | | // insert e; |
| | | |
| | | // PageReference pageRef1 = Page.XinDailyReport; |
| | | // pageRef1.getParameters().put('id', e.id); |
| | | // Test.setCurrentPage(pageRef1); |
| | | // t.init(); |
| | | // } |
| | | // //System.Test.stopTest(); |
| | | |
| | | // } |
| | | } |
| | | |
| | | // // 任务和日报管理 2020-05-25 update by vivek start |
| | | // @isTest |
| | | // static void test14 () { |
| | | // ControllerUtil.EscapeNFM001Trigger = true; |
| | | // init(); |
| | | |
| | | // System.runAs(u1) { |
| | | // // init2(); |
| | | // Daily_Report__c dr = new Daily_Report__c(); |
| | | // dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | // // dr.Status__c = '申請中'; |
| | | // dr.Status__c = '申請中'; |
| | | // dr.OwnerId = u1.Id; |
| | | // dr.Reporter__c = u1.Id; |
| | | // insert dr; |
| | | // // Daily_Report__c dr2 = new Daily_Report__c(); |
| | | // // dr2.Reported_Date__c = Date.newInstance(2016, 1, 2); |
| | | // // dr2.Status__c = '作成中'; |
| | | // // dr.OwnerId = u1.Id; |
| | | // // dr2.Reporter__c = u1.Id; |
| | | // // insert dr2; |
| | | @isTest |
| | | static void test14 () { |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | System.runAs(u1) { |
| | | // init2(); |
| | | Daily_Report__c dr = new Daily_Report__c(); |
| | | dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | // dr.Status__c = '申請中'; |
| | | dr.Status__c = '申請中'; |
| | | dr.OwnerId = u1.Id; |
| | | dr.Reporter__c = u1.Id; |
| | | insert dr; |
| | | // Daily_Report__c dr2 = new Daily_Report__c(); |
| | | // dr2.Reported_Date__c = Date.newInstance(2016, 1, 2); |
| | | // dr2.Status__c = '作成中'; |
| | | // dr.OwnerId = u1.Id; |
| | | // dr2.Reporter__c = u1.Id; |
| | | // insert dr2; |
| | | task__c t1 = new task__c(); |
| | | t1.Name = 'test'; |
| | | t1.taskDifferent__c = '主动任务'; |
| | | // insert t1; |
| | | task__c t2 = new task__c(); |
| | | t2.Name = 'test'; |
| | | t2.taskDifferent__c = '主动任务'; |
| | | // insert t2; |
| | | task__c t3 = new task__c(); |
| | | t3.Name = 'test'; |
| | | t3.taskDifferent__c = '主动任务'; |
| | | insert New List<task__c>{t1,t2,t3}; |
| | | |
| | | // task__c t1 = new task__c(); |
| | | // t1.Name = 'test'; |
| | | // t1.taskDifferent__c = '主动任务'; |
| | | // // insert t1; |
| | | // task__c t2 = new task__c(); |
| | | // t2.Name = 'test'; |
| | | // t2.taskDifferent__c = '主动任务'; |
| | | // // insert t2; |
| | | // task__c t3 = new task__c(); |
| | | // t3.Name = 'test'; |
| | | // t3.taskDifferent__c = '主动任务'; |
| | | // insert New List<task__c>{t1,t2,t3}; |
| | | Event e1 = new Event(); |
| | | e1.ActivityDateTime = Datetime.newInstance(2016, 1, 1, 1, 0, 0); |
| | | e1.DurationInMinutes = 60; |
| | | e1.ActivityDate = Date.newInstance(2016, 1, 1); |
| | | e1.OwnerId = u1.id; |
| | | e1.IsScheduled__c = true; |
| | | e1.whatid__c = accDep.Id; |
| | | // e1.NextEventC_ID__c = ec.Id; |
| | | e1.task_id__c = t1.Id; |
| | | // insert e1; |
| | | |
| | | // Event e1 = new Event(); |
| | | // e1.ActivityDateTime = Datetime.newInstance(2016, 1, 1, 1, 0, 0); |
| | | // e1.DurationInMinutes = 60; |
| | | // e1.ActivityDate = Date.newInstance(2016, 1, 1); |
| | | // e1.OwnerId = u1.id; |
| | | // e1.IsScheduled__c = true; |
| | | // e1.whatid__c = accDep.Id; |
| | | // // e1.NextEventC_ID__c = ec.Id; |
| | | // e1.task_id__c = t1.Id; |
| | | // // insert e1; |
| | | Event e2 = new Event(); |
| | | e2.ActivityDateTime = Datetime.newInstance(2016, 1, 1, 2, 0, 0); |
| | | e2.ActivityDate = Date.newInstance(2016, 1, 1); |
| | | e2.DurationInMinutes = 60; |
| | | e2.OwnerId = u1.id; |
| | | e2.IsScheduled__c = true; |
| | | e2.whatid__c = accDep.Id; |
| | | // e2.NextEventC_ID__c = ec.Id; |
| | | e2.task_id__c = t2.Id; |
| | | // insert e2; |
| | | Event e3 = new Event(); |
| | | e3.ActivityDateTime = Datetime.newInstance(2016, 1, 1, 2, 0, 0); |
| | | e3.ActivityDate = Date.newInstance(2016, 1, 1); |
| | | e3.DurationInMinutes = 60; |
| | | e3.OwnerId = u1.id; |
| | | e3.IsScheduled__c = true; |
| | | e3.whatid__c = accDep.Id; |
| | | // e2.NextEventC_ID__c = ec.Id; |
| | | // e3.task_id__c = t3.Id; |
| | | // insert e3; |
| | | insert New List<Event>{e1,e2,e3}; |
| | | |
| | | // Event e2 = new Event(); |
| | | // e2.ActivityDateTime = Datetime.newInstance(2016, 1, 1, 2, 0, 0); |
| | | // e2.ActivityDate = Date.newInstance(2016, 1, 1); |
| | | // e2.DurationInMinutes = 60; |
| | | // e2.OwnerId = u1.id; |
| | | // e2.IsScheduled__c = true; |
| | | // e2.whatid__c = accDep.Id; |
| | | // // e2.NextEventC_ID__c = ec.Id; |
| | | // e2.task_id__c = t2.Id; |
| | | // // insert e2; |
| | | // Event e3 = new Event(); |
| | | // e3.ActivityDateTime = Datetime.newInstance(2016, 1, 1, 2, 0, 0); |
| | | // e3.ActivityDate = Date.newInstance(2016, 1, 1); |
| | | // e3.DurationInMinutes = 60; |
| | | // e3.OwnerId = u1.id; |
| | | // e3.IsScheduled__c = true; |
| | | // e3.whatid__c = accDep.Id; |
| | | // // e2.NextEventC_ID__c = ec.Id; |
| | | // e3.task_id__c = t3.Id; |
| | | // // insert e3; |
| | | // insert New List<Event>{e1,e2,e3}; |
| | | Event__c ec1 = new Event__c( |
| | | Subject__c = 'test', |
| | | StartDateTime__c = Datetime.newInstance(2016, 1, 1, 1, 0, 0), |
| | | DurationInMinutes__c = 60, |
| | | EndDateTime__c = Datetime.newInstance(2016, 1, 1, 2, 0, 0), |
| | | ActivityDate__c = Date.newInstance(2016, 1, 1), |
| | | delayToDate__c = Date.newInstance(2016, 1, 2), |
| | | eventStatus__c = '延期', |
| | | Event_ID__c = e1.Id, |
| | | Daily_Report__c = dr.Id |
| | | ); |
| | | // insert ec1; |
| | | Event__c ec2 = new Event__c( |
| | | Subject__c = 'test', |
| | | StartDateTime__c = Datetime.newInstance(2016, 1, 1, 3, 0, 0), |
| | | DurationInMinutes__c = 60, |
| | | EndDateTime__c = Datetime.newInstance(2016, 1, 1, 4, 0, 0), |
| | | ActivityDate__c = Date.newInstance(2016, 1, 1), |
| | | delayToDate__c = Date.newInstance(2016, 1, 2), |
| | | eventStatus__c = '延期', |
| | | Event_ID__c = e2.Id, |
| | | Daily_Report__c = dr.Id |
| | | ); |
| | | // insert ec2; |
| | | Event__c ec3 = new Event__c( |
| | | Subject__c = 'test', |
| | | StartDateTime__c = Datetime.newInstance(2016, 1, 1, 3, 0, 0), |
| | | DurationInMinutes__c = 60, |
| | | EndDateTime__c = Datetime.newInstance(2016, 1, 1, 4, 0, 0), |
| | | ActivityDate__c = Date.newInstance(2016, 1, 1), |
| | | eventStatus__c = '取消', |
| | | Event_ID__c = e3.Id, |
| | | Daily_Report__c = dr.Id |
| | | ); |
| | | // insert ec3; |
| | | insert New List<Event__c>{ec1,ec2,ec3}; |
| | | |
| | | // Event__c ec1 = new Event__c( |
| | | // Subject__c = 'test', |
| | | // StartDateTime__c = Datetime.newInstance(2016, 1, 1, 1, 0, 0), |
| | | // DurationInMinutes__c = 60, |
| | | // EndDateTime__c = Datetime.newInstance(2016, 1, 1, 2, 0, 0), |
| | | // ActivityDate__c = Date.newInstance(2016, 1, 1), |
| | | // delayToDate__c = Date.newInstance(2016, 1, 2), |
| | | // eventStatus__c = '延期', |
| | | // Event_ID__c = e1.Id, |
| | | // Daily_Report__c = dr.Id |
| | | // ); |
| | | // // insert ec1; |
| | | // Event__c ec2 = new Event__c( |
| | | // Subject__c = 'test', |
| | | // StartDateTime__c = Datetime.newInstance(2016, 1, 1, 3, 0, 0), |
| | | // DurationInMinutes__c = 60, |
| | | // EndDateTime__c = Datetime.newInstance(2016, 1, 1, 4, 0, 0), |
| | | // ActivityDate__c = Date.newInstance(2016, 1, 1), |
| | | // delayToDate__c = Date.newInstance(2016, 1, 2), |
| | | // eventStatus__c = '延期', |
| | | // Event_ID__c = e2.Id, |
| | | // Daily_Report__c = dr.Id |
| | | // ); |
| | | // // insert ec2; |
| | | // Event__c ec3 = new Event__c( |
| | | // Subject__c = 'test', |
| | | // StartDateTime__c = Datetime.newInstance(2016, 1, 1, 3, 0, 0), |
| | | // DurationInMinutes__c = 60, |
| | | // EndDateTime__c = Datetime.newInstance(2016, 1, 1, 4, 0, 0), |
| | | // ActivityDate__c = Date.newInstance(2016, 1, 1), |
| | | // eventStatus__c = '取消', |
| | | // Event_ID__c = e3.Id, |
| | | // Daily_Report__c = dr.Id |
| | | // ); |
| | | // // insert ec3; |
| | | // insert New List<Event__c>{ec1,ec2,ec3}; |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | PageReference pageRef1 = Page.XinDailyReport; |
| | | pageRef1.getParameters().put('id', dr.id); |
| | | Test.setCurrentPage(pageRef1); |
| | | t.init(); |
| | | t.report = dr; |
| | | t.addActivity(); |
| | | |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | // PageReference pageRef1 = Page.XinDailyReport; |
| | | // pageRef1.getParameters().put('id', dr.id); |
| | | // Test.setCurrentPage(pageRef1); |
| | | t.report.Daily_Report_Data_Type__c = '通常'; |
| | | t.repoStartHourText = '9'; |
| | | t.repoStartMinuteText = '00'; |
| | | t.repoEndHourText = '18'; |
| | | t.repoEndMinuteText = '00'; |
| | | t.activities.get(0).actStartHourText = '9'; |
| | | t.activities.get(0).actStartMinuteText = '00'; |
| | | t.activities.get(0).actEndHourText = '18'; |
| | | t.activities.get(0).actEndMinuteText = '00'; |
| | | t.activities.get(0).act = ec1; |
| | | t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(0).act.Description__c = '結果'; |
| | | t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(0).act.Purpose_Type2__c = '客户咨询对应'; |
| | | t.activities.get(0).act.Purpose_Type3__c = '学会or展会对应'; |
| | | t.activities.get(0).act.Purpose_Type4__c = '信息搜集'; |
| | | t.activities.get(0).act.Purpose_Type5__c = '产品介绍or推广'; |
| | | t.activities.get(0).act.Location__c = accDepName; |
| | | t.activities.get(0).act.whatid__c = accDep.Id; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | t.activities.get(0).act.Related_Opportunity1__c = '引合1'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = '引合2'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = '引合3'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = '引合4'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = '引合5'; |
| | | t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | t.activities.get(0).planStartHourText = '9'; |
| | | t.activities.get(0).planStartMinuteText = '00'; |
| | | t.activities.get(0).planEndHourText = '18'; |
| | | t.activities.get(0).planEndMinuteText = '00'; |
| | | t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | //t.activities.get(0).act.Free_Input__c = true; |
| | | t.activities.get(0).act.Find_Imitations_Flag__c = true; |
| | | //t.activities.get(0).act.Activity_PurposeFSE__c = '装机'; |
| | | t.activities.get(0).act.nextPlanDate__c = date.today() + 30; |
| | | // t.save(); |
| | | t.delIndex = '0'; |
| | | |
| | | // System.Test.startTest(); |
| | | // t.cancelSave(); |
| | | // t.delaysave(); |
| | | // t.report.Status__c = '承認'; |
| | | //t.upsertActIndex = '0'; |
| | | //t.activities.get(0).act.Purpose_TypeEscFSE__c = '休假'; |
| | | //t.activities.get(0).act.Purpose_TypeFSE__c = '例会'; |
| | | //t.activities.get(0).act.Free_Input__c = true; |
| | | /*User u = [Select Id,Name,State_Hospital__c,Employee_No__c, |
| | | Department,Job_Category__c,Category4__c,Category6__c,ManagerId, |
| | | Manager.Email,BuchangApprovalManager__c,BuchangApprovalManagerSales__c, |
| | | ProfileId FROM User where id = :u1.id]; |
| | | System.assertEquals(null,u1);*/ |
| | | t.save(); |
| | | // ec2.delayToDate__c = Date.newInstance(2016, 2, 2); |
| | | // t.save(); |
| | | // System.Test.stopTest(); |
| | | } |
| | | // System.runAs(u3) { |
| | | // // PageReference pageRef2 = Page.XinDailyReport; |
| | | // t.report.Reporter__c = u1.Id; |
| | | // t.init(); |
| | | // t.report = dr; |
| | | // t.addActivity(); |
| | | |
| | | // t.report.Daily_Report_Data_Type__c = '通常'; |
| | | // t.report_search.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | // t.report_search.Reporter__c = u1.id; |
| | | // // t.report = dr; |
| | | // // t.reportOwner = u1; |
| | | // t.report.Status__c = '申請中'; |
| | | // t.getDailyReport(); |
| | | // // Test.setCurrentPage(ref); |
| | | |
| | | // t.reportOwner.ManagerId = u3.Id; |
| | | // t.repoStartHourText = '9'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '18'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.activities.get(0).actStartHourText = '9'; |
| | | // t.activities.get(0).actStartMinuteText = '00'; |
| | | // t.activities.get(0).actEndHourText = '18'; |
| | | // t.activities.get(0).actEndMinuteText = '00'; |
| | | // t.activities.get(0).act = ec1; |
| | | // t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | // t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | // t.activities.get(0).act.Description__c = '結果'; |
| | | // t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | // t.activities.get(0).act.Purpose_Type2__c = '客户咨询对应'; |
| | | // t.activities.get(0).act.Purpose_Type3__c = '学会or展会对应'; |
| | | // t.activities.get(0).act.Purpose_Type4__c = '信息搜集'; |
| | | // t.activities.get(0).act.Purpose_Type5__c = '产品介绍or推广'; |
| | | // t.activities.get(0).act.Location__c = accDepName; |
| | | // t.activities.get(0).act.whatid__c = accDep.Id; |
| | | // t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | // t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | // t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | // t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | // t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | // t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | // t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | // t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | // t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | // t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | // t.activities.get(0).act.Related_Opportunity1__c = '引合1'; |
| | | // t.activities.get(0).act.Related_Opportunity2__c = '引合2'; |
| | | // t.activities.get(0).act.Related_Opportunity3__c = '引合3'; |
| | | // t.activities.get(0).act.Related_Opportunity4__c = '引合4'; |
| | | // t.activities.get(0).act.Related_Opportunity5__c = '引合5'; |
| | | // t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | // t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | // t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | // t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | // t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | // t.activities.get(0).planStartHourText = '9'; |
| | | // t.activities.get(0).planStartMinuteText = '00'; |
| | | // t.activities.get(0).planEndHourText = '18'; |
| | | // t.activities.get(0).planEndMinuteText = '00'; |
| | | // t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | // //t.activities.get(0).act.Free_Input__c = true; |
| | | // t.activities.get(0).act.Find_Imitations_Flag__c = true; |
| | | // //t.activities.get(0).act.Activity_PurposeFSE__c = '装机'; |
| | | // t.activities.get(0).act.nextPlanDate__c = date.today() + 30; |
| | | // // t.save(); |
| | | // t.delIndex = '0'; |
| | | // t.report.Feed_Back_From_Manager__c = 'OK'; |
| | | // // t.report.Feed_Back_From_Manager__c = 'OK'; |
| | | // t.report.Submit_Date_New__c = date.today(); |
| | | // // System.assertEquals(t.reportOwner+'2', dr+'1'); |
| | | // System.assertEquals(u1.id, t.report.Reporter__c); |
| | | |
| | | // // System.Test.startTest(); |
| | | // // t.cancelSave(); |
| | | // // t.delaysave(); |
| | | // // t.report.Status__c = '承認'; |
| | | // // t.report.Status__c = '承認'; |
| | | // //t.upsertActIndex = '0'; |
| | | // //t.activities.get(0).act.Purpose_TypeEscFSE__c = '休假'; |
| | | // //t.activities.get(0).act.Purpose_TypeFSE__c = '例会'; |
| | | // //t.activities.get(0).act.Free_Input__c = true; |
| | | // /*User u = [Select Id,Name,State_Hospital__c,Employee_No__c, |
| | | // Department,Job_Category__c,Category4__c,Category6__c,ManagerId, |
| | | // Manager.Email,BuchangApprovalManager__c,BuchangApprovalManagerSales__c, |
| | | // ProfileId FROM User where id = :u1.id]; |
| | | // System.assertEquals(null,u1);*/ |
| | | // // t.upsertActIndex = '0'; |
| | | // // t.activities.get(0).act.Purpose_TypeEscFSE__c = '休假'; |
| | | // // t.activities.get(0).act.Purpose_TypeFSE__c = '例会'; |
| | | // // t.activities.get(0).act.Free_Input__c = true; |
| | | // t.save(); |
| | | // // ec2.delayToDate__c = Date.newInstance(2016, 2, 2); |
| | | // // t.save(); |
| | | // // System.Test.stopTest(); |
| | | // } |
| | | // // System.runAs(u3) { |
| | | // // // PageReference pageRef2 = Page.XinDailyReport; |
| | | // // t.report.Reporter__c = u1.Id; |
| | | // // t.init(); |
| | | // // t.report_search.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | // // t.report_search.Reporter__c = u1.id; |
| | | // // // t.report = dr; |
| | | // // // t.reportOwner = u1; |
| | | // // t.report.Status__c = '申請中'; |
| | | // // t.getDailyReport(); |
| | | // // // Test.setCurrentPage(ref); |
| | | |
| | | // // t.reportOwner.ManagerId = u3.Id; |
| | | // // t.repoStartHourText = '9'; |
| | | // // t.repoStartMinuteText = '00'; |
| | | // // t.repoEndHourText = '18'; |
| | | // // t.repoEndMinuteText = '00'; |
| | | // // t.report.Feed_Back_From_Manager__c = 'OK'; |
| | | // // // t.report.Feed_Back_From_Manager__c = 'OK'; |
| | | // // t.report.Submit_Date_New__c = date.today(); |
| | | // // // System.assertEquals(t.reportOwner+'2', dr+'1'); |
| | | // // System.assertEquals(u1.id, t.report.Reporter__c); |
| | | System.Test.stopTest(); |
| | | |
| | | // // // t.report.Status__c = '承認'; |
| | | // // // t.report.Status__c = '承認'; |
| | | // // // t.upsertActIndex = '0'; |
| | | // // // t.activities.get(0).act.Purpose_TypeEscFSE__c = '休假'; |
| | | // // // t.activities.get(0).act.Purpose_TypeFSE__c = '例会'; |
| | | // // // t.activities.get(0).act.Free_Input__c = true; |
| | | // // t.save(); |
| | | // // } |
| | | // //System.Test.stopTest(); |
| | | } |
| | | |
| | | // } |
| | | // @isTest |
| | | // static void test15 () { |
| | | // ControllerUtil.EscapeNFM001Trigger = true; |
| | | // init(); |
| | | // System.runAs(u1) { |
| | | // XinDailyReportController t = new XinDailyReportController(); |
| | | |
| | | // // init2(); |
| | | // Daily_Report__c dr = new Daily_Report__c(); |
| | | // dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | // dr.Status__c = '申請中'; |
| | | // dr.OwnerId = u1.Id; |
| | | // dr.Reporter__c = u1.Id; |
| | | // insert dr; |
| | | // XinDailyReportController xin1 = new XinDailyReportController(new ApexPages.StandardController(dr)); |
| | | |
| | | // task__c t1 = new task__c(); |
| | | // t1.Name = 'test'; |
| | | // t1.taskDifferent__c = '主动任务'; |
| | | // insert t1; |
| | | @isTest |
| | | static void test14_01 () { |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | System.runAs(u1) { |
| | | // init2(); |
| | | Daily_Report__c dr = new Daily_Report__c(); |
| | | dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | // dr.Status__c = '申請中'; |
| | | dr.Status__c = '申請中'; |
| | | dr.OwnerId = u1.Id; |
| | | dr.Reporter__c = u1.Id; |
| | | insert dr; |
| | | // Daily_Report__c dr2 = new Daily_Report__c(); |
| | | // dr2.Reported_Date__c = Date.newInstance(2016, 1, 2); |
| | | // dr2.Status__c = '作成中'; |
| | | // dr.OwnerId = u1.Id; |
| | | // dr2.Reporter__c = u1.Id; |
| | | // insert dr2; |
| | | OPDPlan__c oPDPlan0 = new OPDPlan__c(); |
| | | oPDPlan0.Status__c = '草案中'; |
| | | oPDPlan0.OPDPlan_ImplementDate__c = Date.today().addDays(1); |
| | | oPDPlan0.NoOpp_Reason__c = 'HCP对应'; |
| | | OPDPlan__c oPDPlan1 = new OPDPlan__c(); |
| | | oPDPlan1.Status__c = '草案中'; |
| | | oPDPlan1.OPDPlan_ImplementDate__c = Date.today().addDays(1); |
| | | oPDPlan1.NoOpp_Reason__c = 'HCP对应'; |
| | | OPDPlan__c oPDPlan2 = new OPDPlan__c(); |
| | | oPDPlan2.Status__c = '草案中'; |
| | | oPDPlan2.OPDPlan_ImplementDate__c = Date.today().addDays(1); |
| | | oPDPlan2.NoOpp_Reason__c = 'HCP对应'; |
| | | OPDPlan__c oPDPlan3 = new OPDPlan__c(); |
| | | oPDPlan3.Status__c = '草案中'; |
| | | oPDPlan3.OPDPlan_ImplementDate__c = Date.today().addDays(1); |
| | | oPDPlan3.NoOpp_Reason__c = 'HCP对应'; |
| | | insert New List<OPDPlan__c>{oPDPlan0,oPDPlan1,oPDPlan2,oPDPlan3}; |
| | | task__c t1 = new task__c(); |
| | | t1.Name = 'test'; |
| | | t1.taskDifferent__c = '主动任务'; |
| | | // insert t1; |
| | | task__c t2 = new task__c(); |
| | | t2.Name = 'test'; |
| | | t2.taskDifferent__c = '主动任务'; |
| | | t2.Opd_Plan__c = oPDPlan0.Id; |
| | | // insert t2; |
| | | task__c t3 = new task__c(); |
| | | t3.Name = 'test'; |
| | | t3.taskDifferent__c = '主动任务'; |
| | | task__c t4 = new task__c(); |
| | | t4.Name = 'test'; |
| | | t4.taskDifferent__c = '主动任务'; |
| | | t4.Opd_Plan__c = oPDPlan1.Id; |
| | | task__c t5 = new task__c(); |
| | | t5.Name = 'test'; |
| | | t5.taskDifferent__c = '主动任务'; |
| | | t4.Opd_Plan__c = oPDPlan2.Id; |
| | | task__c t6 = new task__c(); |
| | | t6.Name = 'test'; |
| | | t6.taskDifferent__c = '主动任务'; |
| | | t6.Opd_Plan__c = oPDPlan3.Id; |
| | | insert New List<task__c>{t1,t2,t3,t4,t5,t6}; |
| | | |
| | | // Event e1 = new Event(); |
| | | // e1.ActivityDateTime = Datetime.newInstance(2016, 1, 1, 1, 0, 0); |
| | | // e1.DurationInMinutes = 60; |
| | | // e1.ActivityDate = Date.newInstance(2016, 1, 1); |
| | | // e1.OwnerId = u1.id; |
| | | // e1.IsScheduled__c = true; |
| | | // e1.whatid__c = accDep.Id; |
| | | // // e1.NextEventC_ID__c = ec.Id; |
| | | // e1.task_id__c = t1.Id; |
| | | // insert e1; |
| | | Event e1 = new Event(); |
| | | e1.ActivityDateTime = Datetime.newInstance(2016, 1, 1, 1, 0, 0); |
| | | e1.DurationInMinutes = 60; |
| | | e1.ActivityDate = Date.newInstance(2016, 1, 1); |
| | | e1.OwnerId = u1.id; |
| | | e1.IsScheduled__c = true; |
| | | e1.whatid__c = accDep.Id; |
| | | // e1.NextEventC_ID__c = ec.Id; |
| | | // e1.task_id__c = t1.Id; |
| | | // insert e1; |
| | | |
| | | // Event__c ec1 = new Event__c( |
| | | // Subject__c = 'test', |
| | | // StartDateTime__c = Datetime.newInstance(2016, 1, 1, 1, 0, 0), |
| | | // DurationInMinutes__c = 60, |
| | | // EndDateTime__c = Datetime.newInstance(2016, 1, 1, 2, 0, 0), |
| | | // ActivityDate__c = Date.newInstance(2016, 1, 1), |
| | | // delayToDate__c = Date.newInstance(2016, 1, 2), |
| | | // eventStatus__c = '取消', |
| | | // Event_ID__c = e1.Id, |
| | | // Daily_Report__c = dr.Id, |
| | | // nextPlanTimePurpose__c = 'test1,test2,test3,test4,test5,test6' |
| | | // ); |
| | | // insert ec1; |
| | | |
| | | // PageReference pageRef1 = Page.XinDailyReport; |
| | | // pageRef1.getParameters().put('id', dr.id); |
| | | // Test.setCurrentPage(pageRef1); |
| | | // t.IsAlertInputDep = true; |
| | | // t.Alertlines = 'test'; |
| | | Event e2 = new Event(); |
| | | e2.ActivityDateTime = Datetime.newInstance(2016, 1, 1, 2, 0, 0); |
| | | e2.ActivityDate = Date.newInstance(2016, 1, 1); |
| | | e2.DurationInMinutes = 60; |
| | | e2.OwnerId = u1.id; |
| | | e2.IsScheduled__c = true; |
| | | e2.whatid__c = accDep.Id; |
| | | // e2.NextEventC_ID__c = ec.Id; |
| | | e2.task_id__c = t2.Id; |
| | | // insert e2; |
| | | Event e3 = new Event(); |
| | | e3.ActivityDateTime = Datetime.newInstance(2016, 1, 1, 2, 0, 0); |
| | | e3.ActivityDate = Date.newInstance(2016, 1, 1); |
| | | e3.DurationInMinutes = 60; |
| | | e3.OwnerId = u1.id; |
| | | e3.IsScheduled__c = true; |
| | | e3.whatid__c = accDep.Id; |
| | | // e2.NextEventC_ID__c = ec.Id; |
| | | // e3.task_id__c = t3.Id; |
| | | // insert e3; |
| | | |
| | | Event e4 = new Event(); |
| | | e4.ActivityDateTime = Datetime.newInstance(2016, 1, 1, 2, 0, 0); |
| | | e4.ActivityDate = Date.newInstance(2016, 1, 1); |
| | | e4.DurationInMinutes = 60; |
| | | e4.OwnerId = u1.id; |
| | | e4.IsScheduled__c = true; |
| | | e4.whatid__c = accDep.Id; |
| | | // e2.NextEventC_ID__c = ec.Id; |
| | | e4.task_id__c = t4.Id; |
| | | |
| | | Event e5 = new Event(); |
| | | e5.ActivityDateTime = Datetime.newInstance(2016, 1, 1, 2, 0, 0); |
| | | e5.ActivityDate = Date.newInstance(2016, 1, 1); |
| | | e5.DurationInMinutes = 60; |
| | | e5.OwnerId = u1.id; |
| | | e5.IsScheduled__c = true; |
| | | e5.whatid__c = accDep.Id; |
| | | // e2.NextEventC_ID__c = ec.Id; |
| | | e5.task_id__c = t5.Id; |
| | | |
| | | Event e6 = new Event(); |
| | | e6.ActivityDateTime = Datetime.newInstance(2016, 1, 1, 2, 0, 0); |
| | | e6.ActivityDate = Date.newInstance(2016, 1, 1); |
| | | e6.DurationInMinutes = 60; |
| | | e6.OwnerId = u1.id; |
| | | e6.IsScheduled__c = true; |
| | | e6.whatid__c = accDep.Id; |
| | | // e2.NextEventC_ID__c = ec.Id; |
| | | e6.task_id__c = t6.Id; |
| | | insert New List<Event>{e1,e2,e3,e4,e5,e6}; |
| | | |
| | | Event__c ec1 = new Event__c( |
| | | Subject__c = 'test', |
| | | StartDateTime__c = Datetime.newInstance(2016, 1, 1, 1, 0, 0), |
| | | DurationInMinutes__c = 60, |
| | | EndDateTime__c = Datetime.newInstance(2016, 1, 1, 2, 0, 0), |
| | | ActivityDate__c = Date.newInstance(2016, 1, 1), |
| | | delayToDate__c = Date.newInstance(2016, 1, 1), |
| | | eventStatus__c = '延期', |
| | | Event_ID__c = e1.Id, |
| | | Daily_Report__c = dr.Id |
| | | ); |
| | | // insert ec1; |
| | | Event__c ec2 = new Event__c( |
| | | Subject__c = 'test', |
| | | StartDateTime__c = Datetime.newInstance(2016, 1, 1, 3, 0, 0), |
| | | DurationInMinutes__c = 60, |
| | | EndDateTime__c = Datetime.newInstance(2016, 1, 1, 4, 0, 0), |
| | | ActivityDate__c = Date.newInstance(2016, 1, 1), |
| | | delayToDate__c = Date.newInstance(2016, 2, 1), |
| | | eventStatus__c = '延期', |
| | | Event_ID__c = e2.Id, |
| | | Daily_Report__c = dr.Id |
| | | ); |
| | | // insert ec2; |
| | | Event__c ec3 = new Event__c( |
| | | Subject__c = 'test', |
| | | StartDateTime__c = Datetime.newInstance(2016, 1, 1, 3, 0, 0), |
| | | DurationInMinutes__c = 60, |
| | | EndDateTime__c = Datetime.newInstance(2016, 1, 1, 4, 0, 0), |
| | | ActivityDate__c = Date.newInstance(2016, 1, 1), |
| | | delayToDate__c = Date.newInstance(2016, 2, 1), |
| | | eventStatus__c = '取消', |
| | | Event_ID__c = e3.Id, |
| | | Daily_Report__c = dr.Id |
| | | ); |
| | | |
| | | Event__c ec4 = new Event__c( |
| | | Subject__c = 'test', |
| | | StartDateTime__c = Datetime.newInstance(2016, 1, 1, 3, 0, 0), |
| | | DurationInMinutes__c = 60, |
| | | EndDateTime__c = Datetime.newInstance(2016, 1, 1, 4, 0, 0), |
| | | ActivityDate__c = Date.newInstance(2016, 1, 1), |
| | | delayToDate__c = Date.newInstance(2016, 1, 1), |
| | | eventStatus__c = '取消', |
| | | Event_ID__c = e4.Id, |
| | | Daily_Report__c = dr.Id |
| | | ); |
| | | |
| | | Event__c ec5 = new Event__c( |
| | | Subject__c = 'test', |
| | | StartDateTime__c = Datetime.newInstance(2016, 1, 1, 3, 0, 0), |
| | | DurationInMinutes__c = 60, |
| | | EndDateTime__c = Datetime.newInstance(2016, 1, 1, 4, 0, 0), |
| | | ActivityDate__c = Date.newInstance(2016, 1, 1), |
| | | delayToDate__c = Date.newInstance(2016, 1, 1), |
| | | eventStatus__c = '延期', |
| | | Event_ID__c = e5.Id, |
| | | Daily_Report__c = dr.Id |
| | | ); |
| | | Event__c ec6 = new Event__c( |
| | | Subject__c = 'test', |
| | | StartDateTime__c = Datetime.newInstance(2016, 1, 1, 3, 0, 0), |
| | | DurationInMinutes__c = 60, |
| | | EndDateTime__c = Datetime.newInstance(2016, 1, 1, 4, 0, 0), |
| | | ActivityDate__c = Date.newInstance(2016, 1, 1), |
| | | delayToDate__c = Date.newInstance(2016, 1, 2), |
| | | eventStatus__c = '延期', |
| | | Event_ID__c = e6.Id, |
| | | Daily_Report__c = dr.Id |
| | | ); |
| | | // insert ec3; |
| | | insert New List<Event__c>{ec1,ec2,ec3,ec4,ec5,ec6}; |
| | | |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | PageReference pageRef1 = Page.XinDailyReport; |
| | | pageRef1.getParameters().put('id', dr.id); |
| | | Test.setCurrentPage(pageRef1); |
| | | t.init(); |
| | | t.report = dr; |
| | | t.addActivity(); |
| | | |
| | | t.report.Daily_Report_Data_Type__c = '通常'; |
| | | t.repoStartHourText = '9'; |
| | | t.repoStartMinuteText = '00'; |
| | | t.repoEndHourText = '18'; |
| | | t.repoEndMinuteText = '00'; |
| | | t.activities.get(0).actStartHourText = '9'; |
| | | t.activities.get(0).actStartMinuteText = '00'; |
| | | t.activities.get(0).actEndHourText = '18'; |
| | | t.activities.get(0).actEndMinuteText = '00'; |
| | | t.activities.get(0).act = ec1; |
| | | t.activities.get(0).act.Activity_Type2__c = '病院'; |
| | | t.activities.get(0).act.Purpose__c = '目的(計画)'; |
| | | t.activities.get(0).act.Description__c = '結果'; |
| | | t.activities.get(0).act.Purpose_Type__c = '礼节性拜访'; |
| | | t.activities.get(0).act.Purpose_Type2__c = '客户咨询对应'; |
| | | t.activities.get(0).act.Purpose_Type3__c = '学会or展会对应'; |
| | | t.activities.get(0).act.Purpose_Type4__c = '信息搜集'; |
| | | t.activities.get(0).act.Purpose_Type5__c = '产品介绍or推广'; |
| | | t.activities.get(0).act.Location__c = accDepName; |
| | | t.activities.get(0).act.whatid__c = accDep.Id; |
| | | t.activities.get(0).act.Visitor1__c = '取引先責任者1'; |
| | | t.activities.get(0).act.Visitor1_ID__c = con1.id; |
| | | t.activities.get(0).act.Visitor2__c = '取引先責任者2'; |
| | | t.activities.get(0).act.Visitor2_ID__c = con2.id; |
| | | t.activities.get(0).act.Visitor3__c = '取引先責任者3'; |
| | | t.activities.get(0).act.Visitor3_ID__c = con3.id; |
| | | t.activities.get(0).act.Visitor4__c = '取引先責任者4'; |
| | | t.activities.get(0).act.Visitor4_ID__c = con4.id; |
| | | t.activities.get(0).act.Visitor5__c = '取引先責任者5'; |
| | | t.activities.get(0).act.Visitor5_ID__c = con5.id; |
| | | t.activities.get(0).act.Related_Opportunity1__c = '引合1'; |
| | | t.activities.get(0).act.Related_Opportunity2__c = '引合2'; |
| | | t.activities.get(0).act.Related_Opportunity3__c = '引合3'; |
| | | t.activities.get(0).act.Related_Opportunity4__c = '引合4'; |
| | | t.activities.get(0).act.Related_Opportunity5__c = '引合5'; |
| | | t.activities.get(0).act.Related_Opportunity1_ID__c = opp1.Id; |
| | | t.activities.get(0).act.Related_Opportunity2_ID__c = opp2.Id; |
| | | t.activities.get(0).act.Related_Opportunity3_ID__c = opp3.Id; |
| | | t.activities.get(0).act.Related_Opportunity4_ID__c = opp4.Id; |
| | | t.activities.get(0).act.Related_Opportunity5_ID__c = opp5.Id; |
| | | t.activities.get(0).planStartHourText = '9'; |
| | | t.activities.get(0).planStartMinuteText = '00'; |
| | | t.activities.get(0).planEndHourText = '18'; |
| | | t.activities.get(0).planEndMinuteText = '00'; |
| | | t.activities.get(0).planPurposeText = '次の活動予定目的(計画)'; |
| | | //t.activities.get(0).act.Free_Input__c = true; |
| | | t.activities.get(0).act.Find_Imitations_Flag__c = true; |
| | | //t.activities.get(0).act.Activity_PurposeFSE__c = '装机'; |
| | | t.activities.get(0).act.nextPlanDate__c = date.today() + 30; |
| | | // t.save(); |
| | | t.delIndex = '0'; |
| | | |
| | | // System.Test.startTest(); |
| | | // t.cancelSave(); |
| | | // t.delaysave(); |
| | | // t.report.Status__c = '承認'; |
| | | //t.upsertActIndex = '0'; |
| | | //t.activities.get(0).act.Purpose_TypeEscFSE__c = '休假'; |
| | | //t.activities.get(0).act.Purpose_TypeFSE__c = '例会'; |
| | | //t.activities.get(0).act.Free_Input__c = true; |
| | | /*User u = [Select Id,Name,State_Hospital__c,Employee_No__c, |
| | | Department,Job_Category__c,Category4__c,Category6__c,ManagerId, |
| | | Manager.Email,BuchangApprovalManager__c,BuchangApprovalManagerSales__c, |
| | | ProfileId FROM User where id = :u1.id]; |
| | | System.assertEquals(null,u1);*/ |
| | | t.save(); |
| | | // ec2.delayToDate__c = Date.newInstance(2016, 2, 2); |
| | | // t.save(); |
| | | // System.Test.stopTest(); |
| | | } |
| | | // System.runAs(u3) { |
| | | // // PageReference pageRef2 = Page.XinDailyReport; |
| | | // t.report.Reporter__c = u1.Id; |
| | | // t.init(); |
| | | // t.report = dr; |
| | | // t.addActivity(); |
| | | // //t.activities.get(0).act.Free_Input__c = true; |
| | | // t.activities.get(0).act.Find_Imitations_Flag__c = true; |
| | | // //t.activities.get(0).act.Activity_PurposeFSE__c = '装机'; |
| | | // t.activities.get(0).act.nextPlanDate__c = date.today() + 30; |
| | | // t.delIndex = '0'; |
| | | // // System.Test.startTest(); |
| | | // // t.save(); |
| | | // t.cancelSave(); |
| | | // t.delaysave(); |
| | | // // t.report.Status__c = '承認'; |
| | | // //t.upsertActIndex = '0'; |
| | | // //t.activities.get(0).act.Purpose_TypeEscFSE__c = '休假'; |
| | | // //t.activities.get(0).act.Purpose_TypeFSE__c = '例会'; |
| | | // //t.activities.get(0).act.Free_Input__c = true; |
| | | // t.save(); |
| | | // // System.Test.stopTest(); |
| | | // t.deleteActivity(); |
| | | // t.calcelActivity(); |
| | | // } |
| | | // t.report_search.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | // t.report_search.Reporter__c = u1.id; |
| | | // // t.report = dr; |
| | | // // t.reportOwner = u1; |
| | | // t.report.Status__c = '申請中'; |
| | | // t.getDailyReport(); |
| | | // // Test.setCurrentPage(ref); |
| | | |
| | | // t.reportOwner.ManagerId = u3.Id; |
| | | // t.repoStartHourText = '9'; |
| | | // t.repoStartMinuteText = '00'; |
| | | // t.repoEndHourText = '18'; |
| | | // t.repoEndMinuteText = '00'; |
| | | // t.report.Feed_Back_From_Manager__c = 'OK'; |
| | | // // t.report.Feed_Back_From_Manager__c = 'OK'; |
| | | // t.report.Submit_Date_New__c = date.today(); |
| | | // // System.assertEquals(t.reportOwner+'2', dr+'1'); |
| | | // System.assertEquals(u1.id, t.report.Reporter__c); |
| | | |
| | | // } |
| | | // // t.report.Status__c = '承認'; |
| | | // // t.report.Status__c = '承認'; |
| | | // // t.upsertActIndex = '0'; |
| | | // // t.activities.get(0).act.Purpose_TypeEscFSE__c = '休假'; |
| | | // // t.activities.get(0).act.Purpose_TypeFSE__c = '例会'; |
| | | // // t.activities.get(0).act.Free_Input__c = true; |
| | | // t.save(); |
| | | // } |
| | | System.Test.stopTest(); |
| | | } |
| | | @isTest |
| | | static void test15 () { |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | System.Test.startTest(); |
| | | XinDailyReportControllerTest.settTestData(); |
| | | System.runAs(u1) { |
| | | XinDailyReportController t = new XinDailyReportController(); |
| | | |
| | | // init2(); |
| | | Daily_Report__c dr = new Daily_Report__c(); |
| | | dr.Reported_Date__c = Date.newInstance(2016, 1, 1); |
| | | dr.Status__c = '申請中'; |
| | | dr.OwnerId = u1.Id; |
| | | dr.Reporter__c = u1.Id; |
| | | insert dr; |
| | | XinDailyReportController xin1 = new XinDailyReportController(new ApexPages.StandardController(dr)); |
| | | |
| | | task__c t1 = new task__c(); |
| | | t1.Name = 'test'; |
| | | t1.taskDifferent__c = '主动任务'; |
| | | insert t1; |
| | | |
| | | Event e1 = new Event(); |
| | | e1.ActivityDateTime = Datetime.newInstance(2016, 1, 1, 1, 0, 0); |
| | | e1.DurationInMinutes = 60; |
| | | e1.ActivityDate = Date.newInstance(2016, 1, 1); |
| | | e1.OwnerId = u1.id; |
| | | e1.IsScheduled__c = true; |
| | | e1.whatid__c = accDep.Id; |
| | | // e1.NextEventC_ID__c = ec.Id; |
| | | e1.task_id__c = t1.Id; |
| | | insert e1; |
| | | |
| | | Event__c ec1 = new Event__c( |
| | | Subject__c = 'test', |
| | | StartDateTime__c = Datetime.newInstance(2016, 1, 1, 1, 0, 0), |
| | | DurationInMinutes__c = 60, |
| | | EndDateTime__c = Datetime.newInstance(2016, 1, 1, 2, 0, 0), |
| | | ActivityDate__c = Date.newInstance(2016, 1, 1), |
| | | delayToDate__c = Date.newInstance(2016, 1, 2), |
| | | eventStatus__c = '取消', |
| | | Event_ID__c = e1.Id, |
| | | Daily_Report__c = dr.Id, |
| | | nextPlanTimePurpose__c = 'test1,test2,test3,test4,test5,test6' |
| | | ); |
| | | insert ec1; |
| | | |
| | | PageReference pageRef1 = Page.XinDailyReport; |
| | | pageRef1.getParameters().put('id', dr.id); |
| | | Test.setCurrentPage(pageRef1); |
| | | t.IsAlertInputDep = true; |
| | | t.Alertlines = 'test'; |
| | | t.init(); |
| | | t.report = dr; |
| | | t.addActivity(); |
| | | //t.activities.get(0).act.Free_Input__c = true; |
| | | t.activities.get(0).act.Find_Imitations_Flag__c = true; |
| | | //t.activities.get(0).act.Activity_PurposeFSE__c = '装机'; |
| | | t.activities.get(0).act.nextPlanDate__c = date.today() + 30; |
| | | t.delIndex = '0'; |
| | | // System.Test.startTest(); |
| | | // t.save(); |
| | | t.cancelSave(); |
| | | t.delaysave(); |
| | | // t.report.Status__c = '承認'; |
| | | //t.upsertActIndex = '0'; |
| | | //t.activities.get(0).act.Purpose_TypeEscFSE__c = '休假'; |
| | | //t.activities.get(0).act.Purpose_TypeFSE__c = '例会'; |
| | | //t.activities.get(0).act.Free_Input__c = true; |
| | | t.save(); |
| | | // System.Test.stopTest(); |
| | | t.deleteActivity(); |
| | | t.calcelActivity(); |
| | | } |
| | | System.Test.stopTest(); |
| | | } |
| | | |
| | | // //2021-06-30 mzy add |
| | | // @isTest |
| | | // static void test16 () { |
| | | // // レコードタイプ取得 |
| | | // RecordType hospitalRec = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | // RecordType sectionRec = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 消化科']; |
| | | // RecordType departmentRec = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '診療科 消化科']; |
| | | // @isTest |
| | | // static void test16 () { |
| | | // // レコードタイプ取得 |
| | | // System.Test.startTest(); |
| | | // XinDailyReportControllerTest.settTestData(); |
| | | // RecordType hospitalRec = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | // RecordType sectionRec = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 消化科']; |
| | | // RecordType departmentRec = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '診療科 消化科']; |
| | | |
| | | // // 病院作成 |
| | | // Account hospital = new Account(); |
| | | // hospital.RecordTypeId = hospitalRec.Id; |
| | | // hospital.Name = 'TestHospital'; |
| | | // insert hospital; |
| | | // // 病院作成 |
| | | // Account hospital = new Account(); |
| | | // hospital.RecordTypeId = hospitalRec.Id; |
| | | // hospital.Name = 'TestHospital'; |
| | | // insert hospital; |
| | | |
| | | // // 病院を作ると戦略科室は、トリガーによって作られている |
| | | // Account section = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Parent.Id = :hospital.Id and RecordTypeId = :sectionRec.Id limit 1]; |
| | | // // 病院を作ると戦略科室は、トリガーによって作られている |
| | | // Account section = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Parent.Id = :hospital.Id and RecordTypeId = :sectionRec.Id limit 1]; |
| | | |
| | | // // 診療科1を作成 |
| | | // Account depart1 = new Account(); |
| | | // depart1.RecordTypeId = departmentRec.Id; |
| | | // depart1.Name = '*'; |
| | | // depart1.Department_Name__c = 'TestDepart'; |
| | | // depart1.ParentId = section.Id; |
| | | // depart1.Department_Class__c = section.Id; |
| | | // depart1.Hospital__c = hospital.Id; |
| | | // depart1.AgentCode_Ext__c = '9999997'; |
| | | // insert depart1; |
| | | // // 診療科1を作成 |
| | | // Account depart1 = new Account(); |
| | | // depart1.RecordTypeId = departmentRec.Id; |
| | | // depart1.Name = '*'; |
| | | // depart1.Department_Name__c = 'TestDepart'; |
| | | // depart1.ParentId = section.Id; |
| | | // depart1.Department_Class__c = section.Id; |
| | | // depart1.Hospital__c = hospital.Id; |
| | | // depart1.AgentCode_Ext__c = '9999997'; |
| | | // insert depart1; |
| | | |
| | | // ControllerUtil.EscapeNFM001Trigger = true; |
| | | // init(); |
| | | // Date t = Date.today(); |
| | | // System.runAs(u1) { |
| | | // XinDailyReportController tCon = new XinDailyReportController(); |
| | | // ControllerUtil.EscapeNFM001Trigger = true; |
| | | // Date t = Date.today(); |
| | | // System.runAs(u1) { |
| | | // XinDailyReportController tCon = new XinDailyReportController(); |
| | | |
| | | // // init2(); |
| | | // Daily_Report__c dr = new Daily_Report__c(); |
| | | // dr.Reported_Date__c = Date.newInstance(t.year(), t.month(), t.day()); |
| | | // dr.Status__c = '申请中'; |
| | | // dr.OwnerId = u1.Id; |
| | | // dr.Reporter__c = u1.Id; |
| | | // dr.Working_Time_From__c = Datetime.newInstance(t.year(), t.month(), t.day(), 1, 0, 0); |
| | | // dr.Working_Time_To__c = Datetime.newInstance(t.year(), t.month(), t.day(), 10, 0, 0); |
| | | // insert dr; |
| | | // XinDailyReportController xin1 = new XinDailyReportController(new ApexPages.StandardController(dr)); |
| | | // xin1.noSltList = new List<SelectOption>(); |
| | | // xin1.hosptalList = new List<SelectOption>(); |
| | | // xin1.salesList = new List<SelectOption>(); |
| | | // xin1.outEventList = new List<SelectOption>(); |
| | | // xin1.inEventList = new List<SelectOption>(); |
| | | // xin1.moveList = new List<SelectOption>(); |
| | | // xin1.vacationList = new List<SelectOption>(); |
| | | // // init2(); |
| | | // Daily_Report__c dr = [select Id,Status__c,Reporter__c,Reported_Date__c from Daily_Report__c limit 1]; |
| | | // XinDailyReportController xin1 = new XinDailyReportController(new ApexPages.StandardController(dr)); |
| | | // xin1.noSltList = new List<SelectOption>(); |
| | | // xin1.hosptalList = new List<SelectOption>(); |
| | | // xin1.salesList = new List<SelectOption>(); |
| | | // xin1.outEventList = new List<SelectOption>(); |
| | | // xin1.inEventList = new List<SelectOption>(); |
| | | // xin1.moveList = new List<SelectOption>(); |
| | | // xin1.vacationList = new List<SelectOption>(); |
| | | |
| | | // OPDPlan__c oPDPlan0 = new OPDPlan__c(); |
| | | // oPDPlan0.Status__c = '审批中'; |
| | | // oPDPlan0.OPDType__c = '事件'; |
| | | // oPDPlan0.PlanProdDetail__c ='CV-290*4; GI-290镜子*1; GI-290镜子CF*1;'; |
| | | // oPDPlan0.Account_Laboratory__c =depart1.Id; |
| | | // oPDPlan0.OPDPlan_ImplementDate__c = Date.today(); |
| | | // oPDPlan0.OPDPlan_ImplementDate_temp__c = Date.today(); |
| | | // oPDPlan0.NoOpp_Reason__c = 'HCP对应'; |
| | | // oPDPlan0.RentalReson__c = '无法进入手术室'; |
| | | // oPDPlan0.AttachmentCertificate__c = '0001.png'; |
| | | // insert oPDPlan0; |
| | | // OPDPlan__c oPDPlan0 = new OPDPlan__c(); |
| | | // oPDPlan0.Status__c = '审批中'; |
| | | // oPDPlan0.OPDType__c = '事件'; |
| | | // oPDPlan0.PlanProdDetail__c ='CV-290*4; GI-290镜子*1; GI-290镜子CF*1;'; |
| | | // oPDPlan0.Account_Laboratory__c =depart1.Id; |
| | | // oPDPlan0.OPDPlan_ImplementDate__c = Date.today(); |
| | | // oPDPlan0.OPDPlan_ImplementDate_temp__c = Date.today(); |
| | | // oPDPlan0.NoOpp_Reason__c = 'HCP对应'; |
| | | // oPDPlan0.RentalReson__c = '无法进入手术室'; |
| | | // oPDPlan0.AttachmentCertificate__c = '0001.png'; |
| | | // insert oPDPlan0; |
| | | |
| | | |
| | | // task__c t1 = new task__c(); |
| | | // t1.Name = 'test'; |
| | | // t1.taskDifferent__c = '主动任务'; |
| | | // t1.Opd_Plan__c = oPDPlan0.Id; |
| | | // t1.taskStatus__c = ''; |
| | | // insert t1; |
| | | // task__c t1 = new task__c(); |
| | | // t1.Name = 'test'; |
| | | // t1.taskDifferent__c = '主动任务'; |
| | | // t1.Opd_Plan__c = oPDPlan0.Id; |
| | | // t1.taskStatus__c = ''; |
| | | // insert t1; |
| | | |
| | | // Event e1 = new Event(); |
| | | // e1.ActivityDateTime = Datetime.newInstance(t.year(), t.month(), t.day(), 1, 0, 0); |
| | | // e1.DurationInMinutes = 60; |
| | | // e1.ActivityDate = Date.newInstance(t.year(), t.month(), t.day()); |
| | | // e1.OwnerId = u1.id; |
| | | // e1.IsScheduled__c = true; |
| | | // e1.whatid__c = accDep.Id; |
| | | // e1.CancelReason__c = '无合适病例(适合病例流失)OPD取消'; |
| | | // e1.task_id__c = t1.Id; |
| | | // e1.Opd_Plan__c = oPDPlan0.Id; |
| | | // insert e1; |
| | | // Event e1 = new Event(); |
| | | // e1.ActivityDateTime = Datetime.newInstance(t.year(), t.month(), t.day(), 1, 0, 0); |
| | | // e1.DurationInMinutes = 60; |
| | | // e1.ActivityDate = Date.newInstance(t.year(), t.month(), t.day()); |
| | | // e1.OwnerId = u1.id; |
| | | // e1.IsScheduled__c = true; |
| | | // e1.whatid__c = accDep.Id; |
| | | // e1.CancelReason__c = '无合适病例(适合病例流失)OPD取消'; |
| | | // e1.task_id__c = t1.Id; |
| | | // e1.Opd_Plan__c = oPDPlan0.Id; |
| | | // insert e1; |
| | | |
| | | // Event__c ec1 = new Event__c( |
| | | // Subject__c = 'test', |
| | | // StartDateTime__c = Datetime.newInstance(t.year(), t.month(), t.day(), 1, 0, 0), |
| | | // DurationInMinutes__c = 60, |
| | | // EndDateTime__c = Datetime.newInstance(t.year(), t.month(), t.day(), 2, 0, 0), |
| | | // ActivityDate__c = Date.newInstance(t.year(), t.month(), t.day()), |
| | | // delayToDate__c = Date.newInstance(t.year(), t.month(), t.day() +1), |
| | | // eventStatus__c = '取消', |
| | | // Event_ID__c = e1.Id, |
| | | // Daily_Report__c = dr.Id, |
| | | // nextPlanTimePurpose__c = 'test1,test2,test3,test4,test5,test6' |
| | | // ); |
| | | // insert ec1; |
| | | // Event__c ec1 = new Event__c( |
| | | // Subject__c = 'test', |
| | | // StartDateTime__c = Datetime.newInstance(t.year(), t.month(), t.day(), 1, 0, 0), |
| | | // DurationInMinutes__c = 60, |
| | | // EndDateTime__c = Datetime.newInstance(t.year(), t.month(), t.day(), 2, 0, 0), |
| | | // ActivityDate__c = Date.newInstance(t.year(), t.month(), t.day()), |
| | | // delayToDate__c = Date.newInstance(t.year(), t.month(), t.day() +1), |
| | | // eventStatus__c = '取消', |
| | | // Event_ID__c = e1.Id, |
| | | // Daily_Report__c = dr.Id, |
| | | // nextPlanTimePurpose__c = 'test1,test2,test3,test4,test5,test6' |
| | | // ); |
| | | // insert ec1; |
| | | |
| | | // PageReference pageRef1 = Page.XinDailyReport; |
| | | // pageRef1.getParameters().put('id', dr.id); |
| | | // Test.setCurrentPage(pageRef1); |
| | | // tCon.IsAlertInputDep = true; |
| | | // tCon.Alertlines = 'test'; |
| | | // tCon.init(); |
| | | // tCon.report = dr; |
| | | // tCon.addActivity(); |
| | | // //t.activities.get(0).act.Free_Input__c = true; |
| | | // tCon.activities.get(0).act.Find_Imitations_Flag__c = true; |
| | | // //t.activities.get(0).act.Activity_PurposeFSE__c = '装机'; |
| | | // tCon.activities.get(0).act.nextPlanDate__c = date.today() + 30; |
| | | // tCon.delIndex = '0'; |
| | | // // System.Test.startTest(); |
| | | // // t.save(); |
| | | // tCon.cancelSave(); |
| | | // tCon.delaysave(); |
| | | // // t.report.Status__c = '承認'; |
| | | // //t.upsertActIndex = '0'; |
| | | // //t.activities.get(0).act.Purpose_TypeEscFSE__c = '休假'; |
| | | // //t.activities.get(0).act.Purpose_TypeFSE__c = '例会'; |
| | | // //t.activities.get(0).act.Free_Input__c = true; |
| | | // tCon.save(); |
| | | // // System.Test.stopTest(); |
| | | // tCon.deleteActivity(); |
| | | // tCon.calcelActivity(); |
| | | // } |
| | | // PageReference pageRef1 = Page.XinDailyReport; |
| | | // pageRef1.getParameters().put('id', dr.id); |
| | | // Test.setCurrentPage(pageRef1); |
| | | // tCon.IsAlertInputDep = true; |
| | | // tCon.Alertlines = 'test'; |
| | | // tCon.init(); |
| | | // tCon.report = dr; |
| | | // tCon.addActivity(); |
| | | // //t.activities.get(0).act.Free_Input__c = true; |
| | | // tCon.activities.get(0).act.Find_Imitations_Flag__c = true; |
| | | // //t.activities.get(0).act.Activity_PurposeFSE__c = '装机'; |
| | | // tCon.activities.get(0).act.nextPlanDate__c = date.today() + 30; |
| | | // tCon.delIndex = '0'; |
| | | // // System.Test.startTest(); |
| | | // // t.save(); |
| | | // tCon.cancelSave(); |
| | | // tCon.delaysave(); |
| | | // // t.report.Status__c = '承認'; |
| | | // //t.upsertActIndex = '0'; |
| | | // //t.activities.get(0).act.Purpose_TypeEscFSE__c = '休假'; |
| | | // //t.activities.get(0).act.Purpose_TypeFSE__c = '例会'; |
| | | // //t.activities.get(0).act.Free_Input__c = true; |
| | | // tCon.save(); |
| | | // // System.Test.stopTest(); |
| | | // tCon.deleteActivity(); |
| | | // tCon.calcelActivity(); |
| | | // } |
| | | // System.Test.stopTest(); |
| | | |
| | | // } |
| | | // } |
| | | // @isTest |
| | | // static void test17 () { |
| | | // System.Test.startTest(); |
| | | // XinDailyReportControllerTest.settTestData(); |
| | | // // レコードタイプ取得 |
| | | // RecordType hospitalRec = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | // RecordType sectionRec = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 消化科']; |
| | |
| | | // insert depart1; |
| | | |
| | | // ControllerUtil.EscapeNFM001Trigger = true; |
| | | // init(); |
| | | // Date t = Date.today(); |
| | | // System.runAs(u1) { |
| | | // XinDailyReportController tCon = new XinDailyReportController(); |
| | |
| | | // oPDPlan0.AttachmentCertificate__c = '0001.png'; |
| | | // insert oPDPlan0; |
| | | |
| | | // Daily_Report__c dr = new Daily_Report__c(); |
| | | // dr.Reported_Date__c = Date.newInstance(t.year(), t.month(), t.day()); |
| | | // dr.Status__c = '作成中'; |
| | | // dr.OwnerId = u1.Id; |
| | | // dr.Reporter__c = u1.Id; |
| | | // dr.Working_Time_From__c = Datetime.newInstance(t.year(), t.month(), t.day(), 1, 0, 0); |
| | | // dr.Working_Time_To__c = Datetime.newInstance(t.year(), t.month(), t.day(), 10, 0, 0); |
| | | // insert dr; |
| | | |
| | | // Daily_Report__c dr = [select Id,Status__c,Reporter__c,Reported_Date__c from Daily_Report__c limit 1]; |
| | | // task__c t1 = new task__c(); |
| | | // t1.Name = 'test'; |
| | | // t1.taskDifferent__c = '主动任务'; |
| | |
| | | // tCon.deleteActivity(); |
| | | // tCon.calcelActivity(); |
| | | // } |
| | | // System.Test.stopTest(); |
| | | |
| | | // } |
| | | //2021-06-30 mzy add |