19626
2023-04-14 a8b723c94c8a9569ad565878d23434d6a56bebe8
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
public with sharing class rentalApplyEquipmentRentalPDFController {
    public rentalApplyEquipmentRentalPDFController() {
        
    }
    @AuraEnabled
    public static InitData initJumptoPDFButton(String recordId) {
        InitData res = new InitData();
        try {
            List<Rental_Apply_Equipment_Set__c> raeSet = [SELECT Id from Rental_Apply_Equipment_Set__c where Rental_Apply__c = :recordId and Yi_Shipment_request__c > 0 and RAES_Status__c != '取消'];
            Integer setLength = raeSet.size();
            res.pageLength = Math.mod(setLength,10)== 0 ? setLength/10 : Math.round(setLength) +1 ;
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '****e:' + e);
        }
        return res;
    }
 
    public class InitData{
        @AuraEnabled
        public String Id;
        @AuraEnabled
        public Integer pageLength;
    }
    
}