| | |
| | | olympus_calendar.Date__c = Date.valueOf('2017-04-10'); |
| | | olympus_calendar.OwnerId = user.Id; |
| | | insert olympus_calendar; |
| | | ProductTypes__c producttyoe = WeeklyReportCmp.getProduct(product_types.Id); |
| | | } |
| | | |
| | | @isTest public static void getProductListTest() { |
| | |
| | | String Product_Category = ''; |
| | | String Result = ''; |
| | | String Opportunity = ''; |
| | | //fy 20220505 |
| | | String SupportNeedsc =''; |
| | | |
| | | Department_Cateogy = 'GI'; |
| | | Purpose_Type = '询价挖掘-会议对应'; |
| | |
| | | Product_Category = product_types.Id; |
| | | Result = '一般'; |
| | | Opportunity = agency_opportunity.Id; |
| | | report_id = WeeklyReportCmp.saveAgencyReport(Department_Cateogy, Purpose_Type, Agency_Report_Header, Agency_Hospital, Person_In_Charge2, doctor, Submit_date, Product_Category,'','', Result, Opportunity,'','','','',Submit_date); |
| | | //fy 20220505 |
| | | SupportNeedsc = '维修备品'; //fy 20220505 SupportNeedsc |
| | | report_id = WeeklyReportCmp.saveAgencyReport(Department_Cateogy, Purpose_Type,SupportNeedsc, Agency_Report_Header, Agency_Hospital, Person_In_Charge2, doctor, Submit_date, Product_Category,'','', Result, Opportunity,'还没申请预算','15','16','2017-04-10',Submit_date); |
| | | |
| | | Agency_Report__c data = [select Id, Department_Cateogy__c, Purpose_Type__c, Agency_Report_Header__c, Agency_Hospital__c, |
| | | Person_In_Charge2__c, doctor2__c, Submit_date__c, Product_Category__c, Result__c, Opportunity__c from Agency_Report__c where Id=:report_id]; |
| | |
| | | String Product_Category = ''; |
| | | String Result = ''; |
| | | String Opportunity = ''; |
| | | //fy 20220505 |
| | | String SupportNeedsc =''; |
| | | |
| | | Department_Cateogy = 'GI'; |
| | | Purpose_Type = '询价挖掘-会议对应'; |
| | |
| | | Product_Category = product_types.Id; |
| | | Result = 'result_test'; |
| | | Opportunity = agency_opportunity.Id; |
| | | |
| | | //fy 20220505 |
| | | SupportNeedsc ='维修备品'; |
| | | Test.startTest(); |
| | | // 週報編集 |
| | | Department_Cateogy = 'BF'; |
| | | report_id = WeeklyReportCmp.editAgencyReport(report_id, Department_Cateogy, Purpose_Type, Agency_Report_Header, Agency_Hospital, Person_In_Charge2, doctor, Submit_date, Product_Category,'','', Result, Opportunity,'','','','',Submit_date); |
| | | //fy 20220505 |
| | | report_id = WeeklyReportCmp.editAgencyReport(report_id, Department_Cateogy, Purpose_Type,SupportNeedsc, Agency_Report_Header, Agency_Hospital, Person_In_Charge2, doctor, Submit_date, Product_Category,'','', Result, Opportunity,'','','','',Submit_date); |
| | | Agency_Report__c data = [select Id, Department_Cateogy__c, Purpose_Type__c, Agency_Report_Header__c, Agency_Hospital__c, |
| | | Person_In_Charge2__c, doctor2__c, Submit_date__c, Product_Category__c, Result__c, Opportunity__c from Agency_Report__c where Id=:report_id]; |
| | | System.assertEquals(Department_Cateogy, data.Department_Cateogy__c); |
| | | |
| | | Department_Cateogy = 'GYN'; |
| | | report_id = WeeklyReportCmp.editAgencyReport(report_id, Department_Cateogy, Purpose_Type, Agency_Report_Header, Agency_Hospital, Person_In_Charge2, doctor, Submit_date, Product_Category,'','', Result, Opportunity,'','','','',Submit_date); |
| | | //fy 20220505 |
| | | report_id = WeeklyReportCmp.editAgencyReport(report_id, Department_Cateogy, Purpose_Type,SupportNeedsc, Agency_Report_Header, Agency_Hospital, Person_In_Charge2, doctor, Submit_date, Product_Category,'','', Result, Opportunity,'','','','',Submit_date); |
| | | data = [select Id, Department_Cateogy__c, Purpose_Type__c, Agency_Report_Header__c, Agency_Hospital__c, |
| | | Person_In_Charge2__c, doctor2__c, Submit_date__c, Product_Category__c, Result__c, Opportunity__c from Agency_Report__c where Id=:report_id]; |
| | | System.assertEquals(Department_Cateogy, data.Department_Cateogy__c); |
| | | |
| | | Department_Cateogy = 'GS'; |
| | | report_id = WeeklyReportCmp.editAgencyReport(report_id, Department_Cateogy, Purpose_Type, Agency_Report_Header, Agency_Hospital, Person_In_Charge2, doctor, Submit_date, Product_Category,'','', Result, Opportunity,'','','','',Submit_date); |
| | | //fy 20220505 |
| | | report_id = WeeklyReportCmp.editAgencyReport(report_id, Department_Cateogy, Purpose_Type,SupportNeedsc, Agency_Report_Header, Agency_Hospital, Person_In_Charge2, doctor, Submit_date, Product_Category,'','', Result, Opportunity,'','','','',Submit_date); |
| | | data = [select Id, Department_Cateogy__c, Purpose_Type__c, Agency_Report_Header__c, Agency_Hospital__c, |
| | | Person_In_Charge2__c, doctor2__c, Submit_date__c, Product_Category__c, Result__c, Opportunity__c from Agency_Report__c where Id=:report_id]; |
| | | System.assertEquals(Department_Cateogy, data.Department_Cateogy__c); |
| | | |
| | | Department_Cateogy = 'URO'; |
| | | report_id = WeeklyReportCmp.editAgencyReport(report_id, Department_Cateogy, Purpose_Type, Agency_Report_Header, Agency_Hospital, Person_In_Charge2, doctor, Submit_date, Product_Category,'','', Result, Opportunity,'','','','',Submit_date); |
| | | //fy 20220505 |
| | | report_id = WeeklyReportCmp.editAgencyReport(report_id, Department_Cateogy, Purpose_Type,SupportNeedsc, Agency_Report_Header, Agency_Hospital, Person_In_Charge2, doctor, Submit_date, Product_Category,'','', Result, Opportunity,'','','','',Submit_date); |
| | | data = [select Id, Department_Cateogy__c, Purpose_Type__c, Agency_Report_Header__c, Agency_Hospital__c, |
| | | Person_In_Charge2__c, doctor2__c, Submit_date__c, Product_Category__c, Result__c, Opportunity__c from Agency_Report__c where Id=:report_id]; |
| | | System.assertEquals(Department_Cateogy, data.Department_Cateogy__c); |
| | | |
| | | Department_Cateogy = 'ENT'; |
| | | report_id = WeeklyReportCmp.editAgencyReport(report_id, Department_Cateogy, Purpose_Type, Agency_Report_Header, Agency_Hospital, Person_In_Charge2, doctor, Submit_date, Product_Category,'','', Result, Opportunity,'','','','',Submit_date); |
| | | //fy 20220505 |
| | | report_id = WeeklyReportCmp.editAgencyReport(report_id, Department_Cateogy, Purpose_Type,SupportNeedsc, Agency_Report_Header, Agency_Hospital, Person_In_Charge2, doctor, Submit_date, Product_Category,'','', Result, Opportunity,'','','','',Submit_date); |
| | | data = [select Id, Department_Cateogy__c, Purpose_Type__c, Agency_Report_Header__c, Agency_Hospital__c, |
| | | Person_In_Charge2__c, doctor2__c, Submit_date__c, Product_Category__c, Result__c, Opportunity__c from Agency_Report__c where Id=:report_id]; |
| | | System.assertEquals(Department_Cateogy, data.Department_Cateogy__c); |
| | | |
| | | Department_Cateogy = 'ET'; |
| | | report_id = WeeklyReportCmp.editAgencyReport(report_id, Department_Cateogy, Purpose_Type, Agency_Report_Header, Agency_Hospital, Person_In_Charge2, doctor, Submit_date, Product_Category,'','', Result, Opportunity,'','','','',Submit_date); |
| | | //fy 20220505 |
| | | report_id = WeeklyReportCmp.editAgencyReport(report_id, Department_Cateogy, Purpose_Type,SupportNeedsc, Agency_Report_Header, Agency_Hospital, Person_In_Charge2, doctor, Submit_date, Product_Category,'','', Result, Opportunity,'','','','',Submit_date); |
| | | data = [select Id, Department_Cateogy__c, Purpose_Type__c, Agency_Report_Header__c, Agency_Hospital__c, |
| | | Person_In_Charge2__c, doctor2__c, Submit_date__c, Product_Category__c, Result__c, Opportunity__c from Agency_Report__c where Id=:report_id]; |
| | | System.assertEquals(Department_Cateogy, data.Department_Cateogy__c); |
| | | |
| | | Department_Cateogy = 'OTH'; |
| | | report_id = WeeklyReportCmp.editAgencyReport(report_id, Department_Cateogy, Purpose_Type, Agency_Report_Header, Agency_Hospital, Person_In_Charge2, doctor, Submit_date, Product_Category,'','', Result, Opportunity,'','','','',Submit_date); |
| | | //fy 20220505 |
| | | report_id = WeeklyReportCmp.editAgencyReport(report_id, Department_Cateogy, Purpose_Type,SupportNeedsc, Agency_Report_Header, Agency_Hospital, Person_In_Charge2, doctor, Submit_date, Product_Category,'','', Result, Opportunity,'还没申请预算','15','16','2017-04-10',Submit_date); |
| | | data = [select Id, Department_Cateogy__c, Purpose_Type__c, Agency_Report_Header__c, Agency_Hospital__c, |
| | | Person_In_Charge2__c, doctor2__c, Submit_date__c, Product_Category__c, Result__c, Opportunity__c from Agency_Report__c where Id=:report_id]; |
| | | System.assertEquals(Department_Cateogy, data.Department_Cateogy__c); |
| | |
| | | String reports = WeeklyReportCmp.processData('"担当,活动日,医院,科室,拜访人,产品区分1,产品区分2,产品区分3,活动区分,结果\r\ntest1经销商 責任者,2019/9/25,test1医院,普外科,test1医院先生,EUS系统,170系统,CHF胆道镜,信息收集-日常拜访,\r\n经销商活动管理 测试,2019/9/26,test1医院,呼吸科,DDDDD,170系统,EUS系统,CHF胆道镜,信息收集-日常拜访,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,耳鼻喉科,DDDDD,170系统,EUS系统,CHF胆道镜,信息收集-日常拜访,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,ET耗材,DDDDD,170系统,EUS系统,CHF胆道镜,信息收集-日常拜访,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,消化科,DDDDD,170系统,EUS系统,CHF胆道镜,信息收集-日常拜访,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,妇科,DDDDD,170系统,EUS系统,CHF胆道镜,信息收集-日常拜访,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,其他,DDDDD,170系统,EUS系统,CHF胆道镜,信息收集-日常拜访,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,泌尿科,DDDDD,170系统,EUS系统,CHF胆道镜,信息收集-日常拜访,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,其他,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-OPD,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,妇科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-OPD,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,消化科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-OPD,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,ET耗材,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-OPD,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,耳鼻喉科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-OPD,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,呼吸科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-OPD,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,普外科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-OPD,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,泌尿科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-OPD,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,泌尿科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-SIS,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,普外科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-SIS,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,呼吸科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-SIS,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,耳鼻喉科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-SIS,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,ET耗材,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-SIS,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,消化科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-SIS,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,妇科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-SIS,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,其他,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-SIS,满意\r\n','',null); |
| | | // System.assertEquals(reports,''); |
| | | } |
| | | |
| | | WeeklyReportCmp week = new WeeklyReportCmp(); |
| | | List<contact> contacts = week.selectMAgencyPerson(); |
| | | List<Agency_Report__c> data1 =WeeklyReportCmp.getReportsByDate('2019-9-23','2019-9-25'); |
| | | String processDataawsid = WeeklyReportCmp.processDataAWSId('"担当,活动日,医院,科室,拜访人,产品区分1,产品区分2,产品区分3,活动区分,结果\r\ntest1经销商 責任者,2019/9/25,test1医院,普外科,test1医院先生,EUS系统,170系统,CHF胆道镜,信息收集-日常拜访,\r\n经销商活动管理 测试,2019/9/26,test1医院,呼吸科,DDDDD,170系统,EUS系统,CHF胆道镜,信息收集-日常拜访,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,耳鼻喉科,DDDDD,170系统,EUS系统,CHF胆道镜,信息收集-日常拜访,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,ET耗材,DDDDD,170系统,EUS系统,CHF胆道镜,信息收集-日常拜访,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,消化科,DDDDD,170系统,EUS系统,CHF胆道镜,信息收集-日常拜访,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,妇科,DDDDD,170系统,EUS系统,CHF胆道镜,信息收集-日常拜访,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,其他,DDDDD,170系统,EUS系统,CHF胆道镜,信息收集-日常拜访,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,泌尿科,DDDDD,170系统,EUS系统,CHF胆道镜,信息收集-日常拜访,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,其他,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-OPD,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,妇科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-OPD,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,消化科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-OPD,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,ET耗材,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-OPD,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,耳鼻喉科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-OPD,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,呼吸科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-OPD,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,普外科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-OPD,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,泌尿科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-OPD,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,泌尿科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-SIS,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,普外科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-SIS,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,呼吸科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-SIS,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,耳鼻喉科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-SIS,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,ET耗材,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-SIS,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,消化科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-SIS,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,妇科,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-SIS,满意\r\n经销商活动管理 测试,2019/9/26,test1医院,其他,DDDDD,170系统,EUS系统,CHF胆道镜,询价挖掘-SIS,满意\r\n'); |
| | | // List<Contact> conList = [select id,name from Contact where name = 'test1经销商 責任者']; |
| | | // Date d = Date.valueOf('2019-9-25'); |
| | | // List<OlympusCalendar__c> olympusDateList = [select Id,Date__c,FirstDayOfWeek__c,DayOfTheWeek__c from OlympusCalendar__c where Date__c= :d ]; |