liuyn
2024-03-11 a87f1c3df03078814ee97ad0c8ac200a232419e9
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
public with sharing class lexSolutionProgrammaController {
    @AuraEnabled
    public static InitData initForNewSolutionProgramma(String recordId){
        InitData res = new InitData();
        try {
            SolutionProjectRequirements__c so = [
                select
                Status__c,
                GirWindowDirectorApproved__c,
                HospitalOwner__c
                from SolutionProjectRequirements__c where Id =: recordId
            ];
            res.girWindowDirectorApproved = so.GirWindowDirectorApproved__c;
            res.hospitalOwnerId = so.HospitalOwner__c;
            res.status = so.Status__c;
            res.profileId = UserInfo.getProfileId();
            res.m2profileId = [select Id from Profile where Name =: lexLightingButtonConstant.M2_PROFILE_NAME].Id;
        } catch (Exception e) {
            System.debug(e.getMessage());
        }
        return res;
    }
    @AuraEnabled
    public static InitData initForNewSolutionClosingAttachment(String recordId){
        InitData res = new InitData();
        try {
            Solution_Programme__c so = [
                select
                Scheme_Type__c
                from Solution_Programme__c where Id =: recordId
            ];
            res.schemeType = so.Scheme_Type__c;
        } catch (Exception e) {
            System.debug(e.getMessage());
        }
        return res;
    }
    public class InitData{
        @AuraEnabled
        public String status;
        @AuraEnabled
        public Boolean girWindowDirectorApproved;
        @AuraEnabled
        public String hospitalOwnerId;
        @AuraEnabled
        public String profileId;
        @AuraEnabled
        public String m2profileId;
        @AuraEnabled
        public String schemeType;
    }
}