19626
2023-06-06 b28b7983fd65d7e3da0e6a57ba1754899f036971
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
public with sharing class lexOpportunitySpecialApplyController {
    @AuraEnabled
    public static InitData initForSpecSubmitButton(String recordId){
        InitData res = new InitData();
        try {
            OpportunitySpecialApply__c opp = [
                select
                Apply_Reason__c,
                Is_upload_file__c,
                Status__c
                from OpportunitySpecialApply__c where Id =: recordId
            ];
            res.applyReason = opp.Apply_Reason__c;
            res.isUploadFile = opp.Is_upload_file__c;
            res.status = opp.Status__c;
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return res;
    }
   @AuraEnabled
   public static string updateForSpecSubmitButton(String recordId){
    OpportunitySpecialApply__c opp = new OpportunitySpecialApply__c();
    try {
        opp.Id = recordId;
        opp.Status__c = lexLightingButtonConstant.STATUS_OPPORTUNITY_SPECIAL_APPLY_SUBMIT;
        update opp;
        return '';
    } catch (Exception e) {
        return e.getMessage();
    }
   } 
    public class InitData{
        @AuraEnabled
        public String applyReason;
        @AuraEnabled
        public Boolean isUploadFile;
        @AuraEnabled
        public String status;
    }
}