高章伟
2023-03-03 d8dc84a3d56df839895f1c417a4d9cbee763d262
force-app/main/default/classes/OpdAmountBatchTest.cls
@@ -27,6 +27,13 @@
        section.ParentId                  = company.Id;
        section.Hospital_Department_Class__c = company.Id;
        upsert section;
        Account section1 = new Account();
        section1.RecordTypeId = rectSct[0].Id;
        section1.Name         = '*';
        section1.Department_Class_Label__c = '其他';
        section1.ParentId                  = company.Id;
        section1.Hospital_Department_Class__c = company.Id;
        upsert section1;
        Account depart = new Account();
        depart.RecordTypeId = rectDpt[0].Id;
        depart.Name         = '*';
@@ -48,6 +55,9 @@
        acc2.OPD_OTV_S190__c = 6;
        acc2.OPD_STMS__c = 7;
        acc2.OPD_GW__c = 8;
        acc2.LostPrices__c=9;
        acc2.Dealer_Final_Price__c=10;
        acc2.HospitalTransactionAmount__c=11;
        update acc2;
        System.Test.StartTest();
@@ -63,7 +73,10 @@
                                                           OPD_amount_EUME2__c,
                                                           OPD_amount_OTVS190__c,
                                                           OPD_amount_USG400__c,
                                                           OPD_amount_GW__c
                                                           OPD_amount_GW__c,
                                                           LostPricesqt__c,
                                                           Dealer_Final_Priceqt__c,
                                                           HospitalTransactionAmountqt__c
                                                      from Account_Number_of_target__c
                                                     where Account__c = :section.Id];
        //System.assertEquals(0, atList[0].OPD_amount_290Miro__c);
@@ -104,6 +117,13 @@
        section.ParentId                  = company.Id;
        section.Hospital_Department_Class__c = company.Id;
        upsert section;
        Account section1 = new Account();
        section1.RecordTypeId = rectSct[0].Id;
        section1.Name         = '*';
        section1.Department_Class_Label__c = '其他';
        section1.ParentId                  = company.Id;
        section1.Hospital_Department_Class__c = company.Id;
        upsert section1;
        Account depart = new Account();
        depart.RecordTypeId = rectDpt[0].Id;
        depart.Name         = '*';
@@ -125,6 +145,9 @@
        acc2.OPD_OTV_S190__c = 6;
        acc2.OPD_STMS__c = 7;
        acc2.OPD_GW__c = 8;
        acc2.LostPrices__c=9;
        acc2.Dealer_Final_Price__c=10;
        acc2.HospitalTransactionAmount__c=11;
        update acc2;
        System.Test.StartTest();
@@ -140,7 +163,10 @@
                                                           OPD_amount_EUME2__c,
                                                           OPD_amount_OTVS190__c,
                                                           OPD_amount_USG400__c,
                                                           OPD_amount_GW__c
                                                           OPD_amount_GW__c,
                                                           LostPricesqt__c,
                                                           Dealer_Final_Priceqt__c,
                                                           HospitalTransactionAmountqt__c
                                                      from Account_Number_of_target__c
                                                     where Account__c = :section.Id];
        //System.assertEquals(0, atList[0].OPD_amount_290Miro__c);
@@ -181,6 +207,13 @@
        section.ParentId                  = company.Id;
        section.Hospital_Department_Class__c = company.Id;
        upsert section;
        Account section1 = new Account();
        section1.RecordTypeId = rectSct[0].Id;
        section1.Name         = '*';
        section1.Department_Class_Label__c = '其他';
        section1.ParentId                  = company.Id;
        section1.Hospital_Department_Class__c = company.Id;
        upsert section1;
        Account depart = new Account();
        depart.RecordTypeId = rectDpt[0].Id;
        depart.Name         = '*';
@@ -202,6 +235,9 @@
        acc2.OPD_OTV_S190__c = 6;
        acc2.OPD_STMS__c = 7;
        acc2.OPD_GW__c = 8;
        acc2.LostPrices__c=9;
        acc2.Dealer_Final_Price__c=10;
        acc2.HospitalTransactionAmount__c=11;
        update acc2;
        System.Test.StartTest();
@@ -217,7 +253,10 @@
                                                           OPD_amount_EUME2__c,
                                                           OPD_amount_OTVS190__c,
                                                           OPD_amount_USG400__c,
                                                           OPD_amount_GW__c
                                                           OPD_amount_GW__c,
                                                           LostPricesqt__c,
                                                           Dealer_Final_Priceqt__c,
                                                           HospitalTransactionAmountqt__c
                                                      from Account_Number_of_target__c
                                                     where Account__c = :section.Id];
        //System.assertEquals(0, atList[0].OPD_amount_290Miro__c);
@@ -266,6 +305,13 @@
        section.ParentId                     = company.Id;
        section.Hospital_Department_Class__c = company.Id;
        upsert section;
        Account section1 = new Account();
        section1.RecordTypeId = caseSct[0].Id;
        section1.Name         = '*';
        section1.Department_Class_Label__c = '其他';
        section1.ParentId                  = company.Id;
        section1.Hospital_Department_Class__c = company.Id;
        upsert section1;
        System.Test.StartTest();
        Id execBTId = Database.executeBatch(new OpdAmountBatch(company.Id,PerformDate), 20);
@@ -318,6 +364,14 @@
        section.Hospital_Department_Class__c = company.Id;
        upsert section;
        Account section1 = new Account();
        section1.RecordTypeId = caseSct[0].Id;
        section1.Name         = '*';
        section1.Department_Class_Label__c = '其他';
        section1.ParentId                  = company.Id;
        section1.Hospital_Department_Class__c = company.Id;
        upsert section1;
        System.Test.StartTest();
        Id execBTId = Database.executeBatch(new OpdAmountBatch(company.Id,PerformDate), 20);
        System.Test.StopTest();