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
public with sharing class QuolifiedApplySPOController {
    @AuraEnabled
    public static InitData init(String recordId){
        InitData res  = new initData();
        ID myUserID = UserInfo.getUserId();
        Profile p = [select Id,Name from Profile where id =:System.Label.ProfileId_SystemAdmin];
        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 = p.Name;
            res.jobCategory = userinfo.Job_Category__c;
            res.zran = myUserID == System.Label.zhangran ? true : false;
        } catch (Exception e) {
        }
        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;
            return 'ok';
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
    }
 
    public class InitData{
        @AuraEnabled
        public string isActive;
        @AuraEnabled
        public string profileId;
        @AuraEnabled
        public string jobCategory;
        @AuraEnabled
        public Boolean zran;
    }
}