1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**********************************************************************
 * 
 *
 * 备品借出申请
 * 取消按钮
 * 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;
 
}
}