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
public with sharing class LexNewSICustomNewController {
    public LexNewSICustomNewController() {
        
    }
    @AuraEnabled
    public static Opportunity init(String recordId){
        try{
            Opportunity res=[select RecordTypeId
             from Opportunity
             where id= :recordId ];
            return res;
        }catch(Exception e){
            System.debug('LexStockCancelController 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 已终止'];
            return res;
        }catch(Exception e){
            System.debug('LexStockCancelController init 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.subString(0,2);
        }catch(Exception e){
            System.debug('LexStockCancelController init error: '+e.getMessage());
        }
        return null;
    }
 
    public class InitData{
        @AuraEnabled
        public String id;
        @AuraEnabled
        public Boolean delFlag;
    }
}