public class ESignController {
    @AuraEnabled
    public static InitData ESignController (String recordId){
        InitData res = new initData();
        try{
            eSignForm__c report = [SELECT Id,Group_purchase_PCL__c,OCM_man_province_cus__c,HPSignUpStatus__c,Sales_Root_Formula__c,HPSignUpDate__c  FROM eSignForm__c WHERE Id = :recordId LIMIT 1];
            res.Id = report.Id;
            // res.RCManagerId = report.RC_ManagerId__c;
            res.GrouppurchasePCL = report.Group_purchase_PCL__c;
            res.OCMManProvinceCus = report.OCM_man_province_cus__c;
            res.HPSignUpStatus = report.HPSignUpStatus__c;
            res.SalesRootFormula = report.Sales_Root_Formula__c;
            res.HPSignUpDate = report.HPSignUpDate__c;
            res.profileId = UserInfo.getProfileId();
            System.debug(LoggingLevel.INFO, '*** res: ' + res);
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }

    //检索OCSM管理省 上的营业管理部担当
    // var sql = "select id, Name, SalesManage__c from OCM_Management_Province__c where Name = "+"\'"+Group_purchase_PCL+"\'";
    // var ocsmResult = sforce.connection.query(sql);
    // var ocsm = ocsmResult.getArray("records");
    @AuraEnabled
    public static List<OCM_Management_Province__c> OcsmResult(String GrouppurchasePCL) {
        try { 
            list<OCM_Management_Province__c>  result = [SELECT Id, Name, SalesManage__c FROM OCM_Management_Province__c  WHERE Name = :GrouppurchasePCL];
            System.debug(LoggingLevel.INFO, '*** kebukeyi: ' + result);
            return result;
        } catch (Exception ex) {
            System.debug(LoggingLevel.INFO, '*** xingbuxing: ' + ex);
        }
        return null;
    }

    public class InitData{
        @AuraEnabled
        public String Id;
        // @AuraEnabled
        // public String RCManagerId;
        @AuraEnabled
        public Boolean GrouppurchasePCL;
        @AuraEnabled
        public String OCMManProvinceCus;
        @AuraEnabled
        public String HPSignUpStatus;
        @AuraEnabled
        public String SalesRootFormula;
        @AuraEnabled
        public Date HPSignUpDate;
        @AuraEnabled
        public String profileId;
    }

        //获取当前登录人的 id
        @AuraEnabled
        public static UserResult UserInfo_Owner() {
            UserResult result = new UserResult();
            ID myUserID = UserInfo.getUserId();
            try { 
                User tempUser = [select id from user where id = : myUserID ];
                result.id = tempUser.id;
            } catch (exception e) {
                result.result = e.getMessage();
            }
            return result;
        }

        public class UserResult {
            @AuraEnabled
            public string result;
            public UserResult( ) {
                result = 'Success';
            }
            @AuraEnabled
            public string id;
        }
}