public with sharing class MonthlyClaimsChangeController { @AuraEnabled public static InitData init(String recordId) { InitData res = new initData(); try { Account report = [SELECT Id,DealerTypeSum__c,MonthlyPayment__c,Name FROM Account WHERE Id = :recordId]; res.RecordTypeId = Schema.SObjectType.Advance_Payment__c.getRecordTypeInfosByDeveloperName().get('MonthlyPaymentChange').getRecordTypeId(); res.MonthlyPayment = report.MonthlyPayment__c; res.DealerTypeSum = report.DealerTypeSum__c; res.Name = report.Name; List sql = [SELECT id,Status__c FROM Advance_Payment__c WHERE Account__c = :recordId and RecordTypeId = :res.RecordTypeId and Status__c in ('草案中','已提交','批准中')]; res.records = sql; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } return res; } public class InitData{ @AuraEnabled public Boolean MonthlyPayment; @AuraEnabled public String DealerTypeSum; @AuraEnabled public String Name; @AuraEnabled public String RecordTypeId; @AuraEnabled public List records; } }