public with sharing class EquipmentRentalPicturePDFController { @AuraEnabled public static InitData init(String recordId){ InitData res = new InitData(); try { Rental_Apply__c ra = [SELECT Id, Shipment_requested_cnt__c from Rental_Apply__c where Id = :recordId]; if(ra.Shipment_requested_cnt__c > 0){ List 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 : (setLength/10) +1 ; res.raesList = raeSet; } res.ShipmentRequestedCnt = Integer.valueOf(ra.Shipment_requested_cnt__c); } catch (Exception e) { System.debug(LoggingLevel.INFO, '****e:' + e); } return res; } public class InitData{ @AuraEnabled public String Id; @AuraEnabled public Integer pagelength; @AuraEnabled public Integer ShipmentRequestedCnt; @AuraEnabled public List raesList; } }