/********************************************************************** * * * 备品借出申请 * 取消按钮 * author:kkbes * { } *************************************************************************/ public with sharing class RentalApplyCancleButtonController { //初始化方法,返回需要的数据 @AuraEnabled public static InitData initRentalApplyCanle(String recordId){ InitData res=new initData(); try{ //从js走初始化方法,接收传过来的Id,用sql返回找到的指定id的对象 Rental_Apply__c rentalApply=[select Id,RA_Status__c,Yi_loaner_arranged__c from Rental_Apply__c where Id= : recordId LIMIT 1 ]; //数据映射 res.RAStatus=rentalApply.RA_Status__c; res.YiLoanerArranged=rentalApply.Yi_loaner_arranged__c; res.Id=rentalApply.Id; } catch (Exception e) { System.debug(Logginglevel.info,'*******e'+e); } return res; } public class InitData{ @AuraEnabled public String RAStatus; @AuraEnabled public Decimal YiLoanerArranged; @AuraEnabled public String Id; } }