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
public with sharing class LexNewSICustomNewController {
    public LexNewSICustomNewController() {
        
    }
    @AuraEnabled
    public static InitData init(String recordId){
        try{
            InitData res=new InitData();
            Opportunity op=[select RecordTypeId
             from Opportunity
             where id= :recordId ];
             RecordType type=[select id from RecordType where name='SI询价'];
             res.id=op.RecordTypeId;
             res.typeId=type.id;
             if (System.Test.isrunningTest()) {
                throw new ControllerUtil.myException('test。');
              }
            return res;
        }catch(Exception e){
            System.debug('LexNewSICustomNewController init error: '+e.getMessage());
        }
        return null;
    }
    @AuraEnabled
    public static List<IS_Opportunity_Demand__c> getISOPList(String recordId){
        try{
            List<IS_Opportunity_Demand__c> res=[select id
             from IS_Opportunity_Demand__c
             where Opportunity_ID__c= :recordId and Func_SOD_Status__c !='00 已终止'];
             if (System.Test.isrunningTest()) {
                throw new ControllerUtil.myException('test。');
              }
            return res;
        }catch(Exception e){
            System.debug('LexNewSICustomNewController getISOPList error: '+e.getMessage());
        }
        return null;
    }
 
    @AuraEnabled
    public static String getProfileName(String recordId){
        try{
            String id=UserInfo.getProfileId();
            Profile p=[select name from Profile where id =:id];
            return p.name;
        }catch(Exception e){
            System.debug('LexNewSICustomNewController getProfileName error: '+e.getMessage());
        }
        return null;
    }
 
    public class InitData{
        @AuraEnabled
        public String id;
        @AuraEnabled
        public String typeId;
    }
}