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
public with sharing class lexNewOpportunityController {
    public lexNewOpportunityController() {
        
    }
    @AuraEnabled
    public static InitData init(String recordId){
        InitData res = new InitData();
        try {
            // String i=Schema.SObjectType.Opportunity.getRecordTypeInfosByName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_FOLLOW_THE_STAGE).getRecordTypeId();
            List<recordType> r=[SELECT Id from recordType where name='引合'];
            res.recordTypeId=r.get(0).Id;
            List<Account> accl=[SELECT Hospital__c,Department_Class__c,Department_Class_Wd__c,OCM_man_province_HP__c from Account where id=:recordId];
            res.hospitalC=accl.get(0).Hospital__c;
            res.departmentClassC=accl.get(0).Department_Class__c;
            res.departmentClassWdC=accl.get(0).Department_Class_Wd__c;
            String userId=UserInfo.getUserId();
            List<User> ul=[SELECT Province_Text__c from user where id=:userId];
            res.provinceTextC=ul.get(0).Province_Text__c;
            res.OCMManProvinceHPC=accl.get(0).OCM_man_province_HP__c;
            return res;
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
    }
    public class InitData{
        @AuraEnabled public String recordTypeId;
        @AuraEnabled public String recordTypeId2;
        @AuraEnabled public String hospitalC;
        @AuraEnabled public String departmentClassC;
            @AuraEnabled public String departmentClassWdC;
        @AuraEnabled public String provinceTextC;
        @AuraEnabled public String OCMManProvinceHPC;
        
    }
}