19626
2023-10-23 1727a4f4d02e429475608e60f142a63bc24127bc
force-app/main/default/classes/XinDailyReportControllerTest.cls
@@ -50,7 +50,7 @@
     */
    @TestSetup
    private static void init() {
        NFM001Controller.isRunning = false;
        NFM001Controller.isRunning = true;
        loginId = UserInfo.getUserId();
        id pid = UserInfo.getProfileId();
        // id pid = System.Label.ProfileId_2S1;
@@ -1206,11 +1206,10 @@
            System.Test.stopTest();
        }
    }
    @isTest
    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();
@@ -1219,6 +1218,7 @@
            PageReference ref = t.getDailyReport();
            Test.setCurrentPage(ref);
            t = new XinDailyReportController();
            Test.startTest();
            t.init();
            //          t.getEvent();
            //          t.report.Reporter__c = u1.id;
@@ -1228,7 +1228,7 @@
            t.repoStartMinuteText = '00';
            t.repoEndHourText = '18';
            t.repoEndMinuteText = '00';
            t.report.Status__c = '申請中';
            t.report.Status__c = null;
            t.activities.get(0).actStartHourText = '9';
            t.activities.get(0).actStartMinuteText = '00';
            t.activities.get(0).actEndHourText = '18';
@@ -1261,6 +1261,7 @@
            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;
@@ -1296,14 +1297,22 @@
            String strDate = d.year() + '/' + d.month() + '/' + d.day();
            Datetime dt = datetime.now();
            String strDatetime = '2000/01/01 10:10';
            String strDatetime = '2000/01/01 10:10:00';
            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', '戦略科室分類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();
            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, t.activities.get(0).act.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, t.activities.get(0).act.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, t.activities.get(0).act.id, 'OPD', '戦略科室分類1 診療科1test', strDate,'','','','','','');
            Add_Report.addReportAc(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'OPD', '戦略科室分類1 診療科1test', strDate,'');
            Add_Report.addClaim(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'OPD', '戦略科室分類1 診療科1test', strDate,'');
            Add_Report.addReportEx(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'OPD', '戦略科室分類1 診療科1test', con1.id, strDate,'');
            Add_Report.addReportIm(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'OPD', '戦略科室分類1 診療科1test', strDate,'');
            Add_Report.addRA(u1.id, t.report.id, t.report.id, t.activities.get(0).act.id, 'OPD', '戦略科室分類1 診療科1test', strDate,'','');
            if (opId != 'false') t.activities.get(0).act.OPD_ID__c = opId;
            t.save();
            Test.stopTest();
        }
    }