public with sharing class AccountDelayApplyController {
    @AuraEnabled
    public static InitData init(String recordId){
        InitData res  = new initData();

        try {
            Account report = [SELECT Id,Name,Is_Active__c,Grade__c,Alias_Name2__c,Abbreviation__c,Attribute_Type__c
                                    ,Postal_Code__c,Speciality_Type__c,State_Master__c,Town__c,City_Master__c,Address__c,Street__c
                                    ,Field3_companyname__c,WhetherRiskPassing__c,RejectionReason__c,AssociatedHospital__c,Site
                                        FROM Account WHERE Id = :recordId];
            List<Account_Delay_Apply__c> AccQuery = [SELECT id FROM Account_Delay_Apply__c WHERE Is_Active__c = '申请中' and Hospital__c = :recordId];
            res.accId = report.Id;
            res.accname = report.Name;
            res.status = report.Is_Active__c;
            res.accgrade = report.Grade__c;
            res.AliasName2 = report.Alias_Name2__c;
            res.Abbreviation = report.Abbreviation__c;
            res.AttributeType = report.Attribute_Type__c;
            res.PostalCode = report.Postal_Code__c;
            res.SpecialityType = report.Speciality_Type__c;
            res.StateMaster = report.State_Master__c;
            res.Town = report.Town__c;
            res.CityMaster = report.City_Master__c;
            res.Address = report.Address__c;
            res.Street = report.Street__c;
            res.Field3companyname = report.Field3_companyname__c;
            res.WhetherRiskPassing = report.WhetherRiskPassing__c;
            res.RejectionReason = report.RejectionReason__c;
            res.AssociatedHospital = report.AssociatedHospital__c;
            res.Site = report.Site;
            res.shengId = report.State_Master__c;
            res.shiId = report.City_Master__c;

            res.AccSize = AccQuery;
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return res;
    }

    public class InitData{
        @AuraEnabled
        public String accId;
        @AuraEnabled
        public String accname;
        @AuraEnabled
        public String status;
        @AuraEnabled
        public String accgrade;
        @AuraEnabled
        public String AliasName2;
        @AuraEnabled
        public String Abbreviation;
        @AuraEnabled
        public String AttributeType;
        @AuraEnabled
        public String PostalCode;
        @AuraEnabled
        public String SpecialityType;
        @AuraEnabled
        public String StateMaster;
        @AuraEnabled
        public String Town;
        @AuraEnabled
        public String CityMaster;
        @AuraEnabled
        public String Address;
        @AuraEnabled
        public String Street;
        @AuraEnabled
        public String Field3companyname;
        @AuraEnabled
        public String WhetherRiskPassing;
        @AuraEnabled
        public String RejectionReason;
        @AuraEnabled
        public String AssociatedHospital;
        @AuraEnabled
        public String Site;
        @AuraEnabled
        public String shengId;
        @AuraEnabled
        public String shiId;
        @AuraEnabled
        public List<Account_Delay_Apply__c> AccSize;
    }
}