/** * * ODescription: GAuthor: sun xia @Date: 2023-07-11 15:31:56 GIastEditors: sun xia @IastEditTime: 2023-07-11 15:31:56 * */ public with sharing class LexNewTransferApplyController { @AuraEnabled public static InitData init(String recordId){ InitData res = new InitData(); try{ List raList = [SELECT Id, Name from Rental_Apply__c where id = :recordId]; if(raList.size()>0){ Rental_Apply__c ra = raList[0]; res.raId = ra.Id; res.raName = ra.Name; List raSet = [SELECT Id,Name,Lost_item_giveup__c,Arrival_in_wh__c,Arrival_wh_Result_Agency__c ,Rental_Apply_Equipment_Set__r.First_RAESD__r.Arrival_in_wh__c, Rental_Apply__r.RecordType.DeveloperName,Lost_Item_return__c,Is_Body__c,Asset__c,Rental_Apply__c,OneToOne_Flag__c, Rental_Apply_Equipment_Set__r.First_RAESD__r.Arrival_wh_Result_Agency__c, Rental_Apply_Equipment_Set__r.First_RAESD__r.Lost_item_giveup__c, Check_lost_Item__c,Check_lost_Item_Final__c,Rental_Apply_Equipment_Set__r.First_You_Xiao_Ku_Cun__c, Rental_Apply_Equipment_Set__r.First_RAESD__r.Arrival_wh_time__c,Arrival_wh_time__c FROM Rental_Apply_Equipment_Set_Detail__c WHERE Rental_Apply__c = :recordId AND Cancel_Select__c = false ]; res.rae = raSet; } }catch(Exception e){ System.debug(LoggingLevel.INFO, '****e:' + e); } return res; } @AuraEnabled public static String getRecordId(){ InitData res = new InitData(); RecordType re = [SELECT Id, Name, DeveloperName, isActive FROM RecordType WHERE DeveloperName = 'AgencyToCenter' AND SobjectType = 'TransferApply__c' AND isActive = true]; return re.Id; } @AuraEnabled public static InitData reportData(String recordId){ InitData res =new InitData(); try { String reportId = [select Id from Report where DeveloperName ='transfer_Rental_report'].Id; res.reportId = reportId; String mCEName = [select Name from Rental_Apply__c where Id = :recordId].Name; res.rentalApplyName = mCEName; } catch (Exception e) { System.debug('==LexNewTransferApplyController==='+e.getMessage()); } return res; } public class InitData{ @AuraEnabled public String raId; //借出申请Id @AuraEnabled public String raName; //借出申请Name @AuraEnabled public List rae; @AuraEnabled public String rentalApplyName; @AuraEnabled public String reportId; } }