/**
 * *
    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 lexRentalFixtureSetAssignController {
    
    @AuraEnabled
    public static InitData init(String recordId){
        InitData res = new InitData();
        try {
            Rental_Apply__c ra = [SELECT Id, Campaign__c, Campaign__r.Status, Repair__c, Repair_Final_Inspection_Date_F__c, RC_return_to_office__c,
                                    Status__c, Rental_Apply_Equipment_Set_Cnt__c, demo_purpose2__c FROM Rental_Apply__c where Id = :recordId];
            
            res.ra = ra;
            System.debug('ra.Campaign__c=='+ra.Campaign__c);
            if(ra.Campaign__c != null){
                String campId = ra.Campaign__c;
                Campaign camp = [SELECT Id, Status FROM Campaign Where Id = :campId];
                res.CampaignStatus = camp.Status;
            }
            System.debug('res==='+res);
            return res;
        }
        catch (Exception e) {
            System.debug('lexRentalFixtureSetAssignControllerError==='+e);
        }
        return null;
    }


    public class InitData{
        @AuraEnabled
        public Rental_Apply__c ra;
        @AuraEnabled
        public String CampaignStatus;
    }
}