binxie
2024-01-16 1b08402678deb31bba4a347bfd388eba8360cbc1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
@isTest
public with sharing class LexOPDSupplementaryControllerTest {
    @isTest
    static void testMethod1(){
        RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ];
        List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName IN ('Department_GI', 'Department_BF') order by DeveloperName desc];
        // 病院を作る
            Account hospital = new Account();
            hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id;
            hospital.Name = 'test hospital';
            insert hospital;
        // 戦略科室を得る
        Account[] strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_OTH'];
            // 診療科を作る
        Account dep = new Account();
        dep.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_OTH'].id;
        dep.Name = 'test dep';
        dep.AgentCode_Ext__c = '9999998';
        dep.ParentId = strategicDep[0].Id;
        dep.Department_Class__c = strategicDep[0].Id;
        dep.Hospital__c = hospital.Id;
        insert dep;
        Opportunity opp1 = new Opportunity(
            Name='testOpp1',
            StageName='引合',
            CloseDate=Date.today(),
            AccountId=dep.Id,
            Competitor__c ='A',
            Click_Close_Date__c = null,
            RecordType = rectOpp
            );
        insert opp1;
        OPDPlan__c opd = new OPDPlan__c();
        opd.Status__c = '草案中';
        opd.OPDPlan_ImplementDate__c = Date.today().addDays(5);
        opd.NoOpp_Reason__c = 'HCP对应';
        opd.OPDType__c = '科室';
 
        insert opd;
 
        LexOPDSupplementaryController.init('123');
        LexOPDSupplementaryController.init(opd.Id);
        LexOPDSupplementaryController.getTheOPDPlan('真的');
        LexOPDSupplementaryController.getTheOPDPlan(opd.Id);
        LexOPDSupplementaryController.init2(opd.Id);
        LexOPDSupplementaryController.init2('1231233');
        LexOPDSupplementaryController.NewAndUpdateOPDStatus(opd.Id);
        LexOPDSupplementaryController.NewAndUpdateOPDStatus('12323232');
        LexOPDSupplementaryController.init3('12323232');
        LexOPDSupplementaryController.init3(opd.Id);
        LexOPDSupplementaryController.reapplyFindOPD('12323232');
        LexOPDSupplementaryController.reapplyFindOPD(opd.Id);
        LexOPDSupplementaryController.initNewOPDButton(dep.Id);
        LexOPDSupplementaryController.initNewOPDButton('12323');
        LexOPDSupplementaryController.initCancleSumbit('123');
        LexOPDSupplementaryController.initCancleSumbit(opd.Id);
        LexOPDSupplementaryController.initReportSubmit('123');
        LexOPDSupplementaryController.initReportSubmit(opd.Id);
        LexOPDSupplementaryController.cloneOPD(opd.Id);
        LexOPDSupplementaryController.cloneOPD('123');
        LexOPDSupplementaryController.getRecordTypeByNameAndSobject('办事处','Account');
        LexOPDSupplementaryController.getRecordTypeByNameAndSobject('123','12323');
 
        //LexOPDPostPoneController
        LexOPDPostPoneController.init('123');
        LexOPDPostPoneController.init(opd.Id);
        LexOPDPostPoneController.findRecordId();
 
 
    }
}