From fd9df05c48c09b4d7f39a3b401882bda226dedea Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期二, 31 十月 2023 20:38:18 +0800
Subject: [PATCH] 近期修改

---
 force-app/main/default/classes/Add_ReportTest.cls |  460 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 459 insertions(+), 1 deletions(-)

diff --git a/force-app/main/default/classes/Add_ReportTest.cls b/force-app/main/default/classes/Add_ReportTest.cls
index f4284f5..25d79c5 100644
--- a/force-app/main/default/classes/Add_ReportTest.cls
+++ b/force-app/main/default/classes/Add_ReportTest.cls
@@ -1,11 +1,469 @@
 @isTest
 private class Add_ReportTest {
+    private static String loginId {get; set;}
+    private static User u1 {get; set;}
+    private static User u2 {get; set;}
+    private static User u3 {get; set;}
+    private static Account accHP {get; set;}
+    private static Account accDepClass {get; set;}
+    private static Account accDep {get; set;}
+    private static Contact con1 {get; set;}
+    private static Contact con2 {get; set;}
+    private static Contact con3 {get; set;}
+    private static Contact con4 {get; set;}
+    private static Contact con5 {get; set;}
+    private static Opportunity opp1 {get; set;}
+    private static Opportunity opp2 {get; set;}
+    private static Opportunity opp3 {get; set;}
+    private static Opportunity opp4 {get; set;}
+    private static Opportunity opp5 {get; set;}
+    private static Maintenance_Contract__c mc1 {get; set;}
+    private static Maintenance_Contract__c mc2 {get; set;}
+    private static String accDepId {get; set;}
+    private static String accDepName {get; set;}
+
+    
+    /**
+     * 鍒濇湡鍑︾悊.
+     */
     @TestSetup
     private static void init() {
+        NFM001Controller.isRunning = true;
+        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];
+        u3 = new User(Test_staff__c = true);
+        u3.LastName = '_銈点兂銉栥儶銉冦偢';
+        u3.Batch_User__c = true;
+        u3.FirstName = '銇�';
+        u3.Alias = '銇�';
+        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 = pid;
+        u3.Job_Category__c = '鏀彺';
+        u3.Province__c = '鏉变含';
 
+
+        u1 = new User(Test_staff__c = true);
+        u1.LastName = '_銈点兂銉栥儶銉冦偢';
+        u1.FirstName = '銇�';
+        u1.Batch_User__c = true;
+        u1.Alias = '銇�';
+        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 = pid;
+        u1.Job_Category__c = '閿�鍞湇鍔�';
+        u1.Province__c = '鏉变含';
+        u1.ManagerId = u3.id;
+
+
+        u2 = new User(Test_staff__c = true);
+        u2.LastName = '_銈点兂銉栥儶銉冦偢';
+        u2.FirstName = '銇�';
+        u2.Batch_User__c = true;
+        u2.Alias = '銇�';
+        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 = pid;
+        u2.Job_Category__c = '閿�鍞帹骞�';
+        u2.Province__c = '鏉变含';
+        insert New List<user>{u1,u2,u3};
+
+
+        //RecordType rtDepClass = [select id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName =:'Department_Class_ENT'];           // 鑰抽蓟鍠夌
+
+        //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(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';
+            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;
+
+            accHP = new Account();
+            accHP.Name = '鐥呴櫌1';
+            accHP.Grade__c = '涓�鑸�';
+            accHP.OCM_Category__c = '涓�鑸�';
+            accHP.Attribute_Type__c = '淇濋櫤鐪�';
+            accHP.Speciality_Type__c = '绶忓悎鐥呴櫌';
+            accHP.Is_Active__c = '鏈夊姽';
+            accHP.State_Master__c = al.id;
+            accHP.City_Master__c = al2.id;
+            accHP.RecordTypeId = '01210000000QemG';
+            accHP.Valid_To__c = Date.today() + 2;
+            accHP.FSE_GI_Main_Leader__c = UserInfo.getUserId();
+            accHP.FSE_SP_Main_Leader__c = UserInfo.getUserId();
+            insert accHP;
+            /*
+            accDepClass = new Account();
+            accDepClass.Name = '鎴︾暐绉戝鍒嗛1';
+            accDepClass.Department_Class_Label__c = '鑰抽蓟鍠夌';
+            accDepClass.Hospital_Department_Class__c = accHP.id;
+            accDepClass.ParentId = accHP.id;
+            accDepClass.RecordTypeId = rtDepClass.id;
+            insert accDepClass;
+            */
+            accDepClass = [select Id from Account where ParentId = :accHP.Id and Department_Class_Label__c = '鑰抽蓟鍠夌'];
+
+            accDep = new Account();
+            accDep.Name = '瑷虹檪绉�1';
+            accDep.Department_Class_Label__c = '瑷虹檪绉�1';
+            accDep.Hospital__c = accHP.id;
+            accDep.ParentId = accDepClass.id;
+            accDep.Department_Class__c = accDepClass.id;
+            accDep.Department_Name__c = '瑷虹檪绉�1';
+            accDep.CurrencyIsoCode = 'CNY';
+            accDep.RecordTypeId = '01210000000Qfm2';
+            accDep.FSE_GI_Main_Leader__c = UserInfo.getUserId();
+            accDep.FSE_SP_Main_Leader__c = UserInfo.getUserId();
+
+            insert accDep;
+            accDepId = accDep.Id;
+            accDep = [select Name from Account where Id = :accDep.Id];
+            accDepName = accDep.Name;
+        // 鍙栧紩鍏堣铂浠昏�呫伄浣忔墍銈掓暟寮忛爡鐩伀澶夋洿銇偤銆佸綋瑭查爡鐩倰鍓婇櫎
+        // 鐪併伄鍙傜収鍏堛伅鐥呴櫌銇綇鎵�銇仾銇c仧銇熴倎銆併偒銉愩儸銉冦偢銉嗐偣銉堛倰琛屻亞銇伅
+        // 鎵�灞炪仚銈嬬梾闄€伄璩炪倰澶夋洿銇椼仸瀹熸柦銇椼仸銇忋仩銇曘亜銆俠y 瀹楀儚(鐪�)
+            List<Contact> conList = new List<Contact>();
+            con1 = new Contact();
+            con1.Firstname = 'ZZ1';
+            con1.LastName = '鍙栧紩鍏堣铂浠昏��1';
+            con1.RecordTypeId = '01210000000QfWd';
+            con1.AccountId = accDep.Id;
+        //        con1.State__c = '鍖椾含甯�';
+            con2 = new Contact();
+            con2.Firstname = 'ZZ2';
+            con2.LastName = '鍙栧紩鍏堣铂浠昏��2';
+            con2.RecordTypeId = '01210000000QfWd';
+            con2.AccountId = accDep.Id;
+        //        con2.State__c = '鍖椾含甯�';
+            con3 = new Contact();
+            con3.Firstname = 'ZZ3';
+            con3.LastName = '鍙栧紩鍏堣铂浠昏��3';
+            con3.RecordTypeId = '01210000000QfWd';
+            con3.AccountId = accDep.Id;
+        //        con3.State__c = '鍖椾含甯�';
+            con4 = new Contact();
+            con4.Firstname = 'ZZ4';
+            con4.LastName = '鍙栧紩鍏堣铂浠昏��4';
+            con4.RecordTypeId = '01210000000QfWd';
+            con4.AccountId = accDep.Id;
+        //        con4.State__c = '鍖椾含甯�';
+            con5 = new Contact();
+            con5.Firstname = 'ZZ5';
+            con5.LastName = '鍙栧紩鍏堣铂浠昏��5';
+            con5.RecordTypeId = '01210000000QfWd';
+            con5.AccountId = accDep.Id;
+        //        con5.State__c = '鍖椾含甯�';
+            conList.add(con1);
+            conList.add(con2);
+            conList.add(con3);
+            conList.add(con4);
+            conList.add(con5);
+            insert conList;
+            List<Opportunity> oppList = new List<Opportunity>();
+            opp1 = new Opportunity();
+            opp1.Name = '寮曞悎1';
+            opp1.AccountId = accDep.Id;
+            opp1.Opportunity_Category__c = 'ENT';
+            opp1.Trade__c = '澶栬部';
+            opp1.StageName = '寮曞悎';
+            opp1.CurrencyIsoCode = 'CNY';
+            opp1.Close_Forecasted_Date__c = date.today().addMonths(1);
+            opp1.CloseDate = date.today().addMonths(1);
+            opp1.Opportunity_stage__c = '纭畾浜嗗鎵嬪弬鏁�';
+            opp1.Competitor__c = 'E';
+            opp1.Sales_Root__c = 'OCM鐩存帴璨╁2';
+            opp1.Hospital__c = accHP.id;
+            opp1.Department_Class__c = accDepClass.id;
+            opp1.StageName = '寮曞悎';
+            opp2 = new Opportunity();
+            opp2.Name = '寮曞悎2';
+            opp2.AccountId = accDep.Id;
+            opp2.Opportunity_Category__c = 'ENT';
+            opp2.Trade__c = '澶栬部';
+            opp2.StageName = '寮曞悎';
+            opp2.Opportunity_stage__c = '纭畾浜嗗鎵嬪弬鏁�';
+            opp2.CurrencyIsoCode = 'CNY';
+            opp2.Close_Forecasted_Date__c = date.today().addMonths(1);
+            opp2.CloseDate = date.today().addMonths(1);
+            opp2.Competitor__c = 'E';
+            opp2.Sales_Root__c = 'OCM鐩存帴璨╁2';
+            opp2.Hospital__c = accHP.id;
+            opp2.Department_Class__c = accDepClass.id;
+            opp2.StageName = '寮曞悎';
+            opp3 = new Opportunity();
+            opp3.Name = '寮曞悎3';
+            opp3.AccountId = accDep.Id;
+            opp3.Opportunity_Category__c = 'ENT';
+            opp3.Trade__c = '澶栬部';
+            opp3.StageName = '寮曞悎';
+            opp3.Opportunity_stage__c = '纭畾浜嗗鎵嬪弬鏁�';
+            opp3.CurrencyIsoCode = 'CNY';
+            opp3.Close_Forecasted_Date__c = date.today().addMonths(1);
+            opp3.CloseDate = date.today().addMonths(1);
+            opp3.Competitor__c = 'E';
+            opp3.Sales_Root__c = 'OCM鐩存帴璨╁2';
+            opp3.Hospital__c = accHP.id;
+            opp3.Department_Class__c = accDepClass.id;
+            opp3.StageName = '寮曞悎';
+            opp4 = new Opportunity();
+            opp4.Name = '寮曞悎4';
+            opp4.AccountId = accDep.Id;
+            opp4.Opportunity_Category__c = 'ENT';
+            opp4.Trade__c = '澶栬部';
+            opp4.StageName = '寮曞悎';
+            opp4.CurrencyIsoCode = 'CNY';
+            opp4.Opportunity_stage__c = '纭畾浜嗗鎵嬪弬鏁�';
+            opp4.Close_Forecasted_Date__c = date.today().addMonths(1);
+            opp4.CloseDate = date.today().addMonths(1);
+            opp4.Competitor__c = 'E';
+            opp4.Sales_Root__c = 'OCM鐩存帴璨╁2';
+            opp4.Hospital__c = accHP.id;
+            opp4.Department_Class__c = accDepClass.id;
+            opp4.StageName = '寮曞悎';
+            opp5 = new Opportunity();
+            opp5.Name = '寮曞悎5';
+            opp5.AccountId = accDep.Id;
+            opp5.Opportunity_Category__c = 'ENT';
+            opp5.Trade__c = '澶栬部';
+            opp5.StageName = '寮曞悎';
+            opp5.CurrencyIsoCode = 'CNY';
+            opp5.Close_Forecasted_Date__c = date.today().addMonths(1);
+            opp5.CloseDate = date.today().addMonths(1);
+            opp5.Competitor__c = 'E';
+            opp5.Sales_Root__c = 'OCM鐩存帴璨╁2';
+            opp5.Opportunity_stage__c = '纭畾浜嗗鎵嬪弬鏁�';
+            opp5.Hospital__c = accHP.id;
+            opp5.Department_Class__c = accDepClass.id;
+            opp5.StageName = '寮曞悎';
+            oppList.add(opp1);
+            oppList.add(opp2);
+            oppList.add(opp3);
+            oppList.add(opp4);
+            oppList.add(opp5);
+            insert oppList;
+            System.debug('opp1.Name:' + opp1.Name);
+
+            accompanying_report__c ar = new accompanying_report__c();
+            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.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.Reporter__c = u1.id;
+            dr.OwnerId = u1.Id;
+            insert dr;
+            Event__c ec = new Event__c(Daily_Report__c=dr.Id, StartDateTime__c=System.now(), EndDateTime__c=System.now(), Subject__c='Subject', Location__c='Location', ActivityDate__c=Date.today());
+            insert ec;
+            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 test01() {
+    static void test01_08_01() {
+        User user = [select Id from User where Username = 'olympusTest10@sunbridge.com'];
+        System.runAs(user) {
+            Add_ReportTest.settTestData();
+            XinDailyReportController t = new XinDailyReportController();
+            t.init();
+
+            t.report_search.Reported_Date__c = date.today();
+            PageReference ref = t.getDailyReport();
+            Test.setCurrentPage(ref);
+            Test.startTest();
+            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 = null;
+            // 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:00';
+            System.debug('strDatetime' + strDatetime);
+           Event__c ec = [select Id from Event__c limit 1];
+            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);
+            Add_Report.addReportPr(u1.id, t.report.id, t.report.id, ec.id, 'OPD', '鎴︾暐绉戝鍒嗛1 瑷虹檪绉�1test', con1.id, con2.id, con3.id, con4.id, con5.id,'', strDate);
+            Add_Report.addReportNT(u1.id, t.report.id, t.report.id, ec.id, 'OPD', '鎴︾暐绉戝鍒嗛1 瑷虹檪绉�1test', con1.id, con2.id, con3.id, con4.id, con5.id,'','', strDate);
+            Add_Report.addReportOn(u1.id, t.report.id, t.report.id, ec.id, 'On_Call', '鎴︾暐绉戝鍒嗛1 瑷虹檪绉�1test', strDate,'','1','1','2','1','');
+            Add_Report.addReportAc(u1.id, t.report.id, t.report.id, ec.id, 'Visit_Report__c', '鎴︾暐绉戝鍒嗛1 瑷虹檪绉�1test', strDate,'');
+            
+            Report__c re = [select Id from Report__c limit 1];
+            re.Manual_Name__c = '123';
+            update re;
+            Add_Report.addClaim(u1.id,re.id, t.report.id,ec.id, 'QIS_Report__c', '鎴︾暐绉戝鍒嗛1 瑷虹檪绉�1test', strDate,'');
+            Daily_Report__c dr = [select Id from Daily_Report__c limit 1];
+            Add_Report.addReportEx(u1.id,  '', re.id, ec.id, 'OPD', '鎴︾暐绉戝鍒嗛1 瑷虹檪绉�1test', con1.id, strDate,'');
+            Add_Report.addReportIm(u1.id, '', dr.id, ec.id, 'OPD', '鎴︾暐绉戝鍒嗛1 瑷虹檪绉�1test', strDate,'');
+            Add_Report.addReportEx(u1.id,  re.id, re.id, ec.id, 'OPD', '鎴︾暐绉戝鍒嗛1 瑷虹檪绉�1test', con1.id, strDate,'');
+            Add_Report.addReportIm(u1.id, re.id, dr.id, ec.id, 'OPD', '鎴︾暐绉戝鍒嗛1 瑷虹檪绉�1test', strDate,'');
+            Add_Report.addRA(u1.id, re.id, dr.id, ec.id, 'Rental_Apply', '鎴︾暐绉戝鍒嗛1 瑷虹檪绉�1test', strDate,'','');
+            // Add_Report.getProduct2(dr.Id);
+            // Add_Report.getProduct2US(dr.Id);
+            // Add_Report.getReportId(dr.Id,'2023-07-01');
+            // Add_Report.checkAccountMatch('123',dr.Id);
+            // Add_Report.getAccountForJs(dr.Id);
+            if (opId != 'false') t.activities.get(0).act.OPD_ID__c = opId;
+            t.save();
+            Test.stopTest();
+        }
+    }
+
+    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;
         
     }
+
 }
\ No newline at end of file

--
Gitblit v1.9.1