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;
        } 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;
    }
}