liangxiaozhen
2023-08-06 1d17c4022a928eacff7309016cde76f29ad257fb
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 QuolifiedApplySPOController {
    @AuraEnabled
    public static InitData init(String recordId){
        InitData res  = new initData();
        ID myUserID = UserInfo.getUserId();
        try {
            Account report = [SELECT Id,Is_Active__c FROM Account WHERE Id = :recordId];
            User userinfo = [SELECT id,ProfileId,Job_Category__c FROM User WHERE Id = :myUserID LIMIT 1];
            res.IsActive = report.Is_Active__c;
            res.ProfileId = userinfo.ProfileId;
            res.JobCategory = userinfo.Job_Category__c;
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return res;
    }
 
    @AuraEnabled
    public static String updata(String recordId){
        Account rac = new Account();
        try {
            rac.Id = recordId;
            rac.Quolified_Approve_Status__c = '已提交至SPO';
            rac.If_Qualifying__c = true;
            rac.If_Need_Quolified__c = true;
            update rac;
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return 'ok';
    }
 
    public class InitData{
        @AuraEnabled
        public string IsActive;
        @AuraEnabled
        public string ProfileId;
        @AuraEnabled
        public string JobCategory;
    }
}