public with sharing class lexMaintenanceContractUrlController {
    
    @AuraEnabled
    public static ReturnData initOne(String recordId){
        ReturnData returnData = new ReturnData();
        String reportId = '';
        List<Report> reportList= [select Id from Report where DeveloperName ='Repair_maitenance_list_bottun' limit 1];
        if(reportList.size()>0) {
            reportId = reportList[0].Id;
        }
        returnData.reportId = reportId;

        String mCEName = [select id from Maintenance_Contract__c where Id = :recordId].id;
        returnData.mCEName = mCEName;

        return returnData;
        
    }
    @AuraEnabled
    public static ReturnData initTwo(String recordId){
        ReturnData returnData = new ReturnData();
         String reportId = '';
        // List<Report> reportList= [select Id from Report where DeveloperName ='Service_contract_bottun_New' limit 1];
        List<Report> reportList= [select Id from Report where DeveloperName ='NewConRate0607' limit 1];
        if(reportList.size()>0) {
            reportId = reportList[0].Id;
        }
        returnData.reportId = reportId;

        String mCEName = [select id from Maintenance_Contract__c where Id = :recordId].id;
        returnData.mCEName = mCEName;

        return returnData;
        
    }
    @AuraEnabled
    public static ReturnData initThree(String recordId){
        ReturnData returnData = new ReturnData();
         String reportId = '';
        List<Report> reportList= [select Id from Report where DeveloperName ='fault' limit 1];
        if(reportList.size()>0) {
            reportId = reportList[0].Id;
        }
        returnData.reportId = reportId;

        String mCEName = [select id from Repair__c where Id = :recordId].id;
        returnData.mCEName = mCEName;

        return returnData;
        
    }
    @AuraEnabled
    public static ReturnData initFour(String recordId){
        ReturnData returnData = new ReturnData();
         String reportId = '';
        List<Report> reportList= [select Id from Report where DeveloperName ='Loaner_request_history' limit 1];
        if(reportList.size()>0) {
            reportId = reportList[0].Id;
        }
        returnData.reportId = reportId;

        String mCEName = [select id,Hospital_ID__c from Rental_Apply__c where Id = :recordId].Hospital_ID__c;
        returnData.mCEName = mCEName;

        return returnData;
        
    }
    @AuraEnabled
    public static ReturnData lexCustomNewContract(String recordId){
        ReturnData returnData = new ReturnData();
        RecordType re = [select id  from RecordType where name = '服务合同'];
        Maintenance_Contract__c mc = [select id ,name ,Hospital__c,Department_Class__c,Department__c,Service_Contract_Staff__c
                                            ,Estimate_Target__c,Dealer__c,AccDealerBlacklist__c
                                             from Maintenance_Contract__c where id = :recordId];
        returnData.recordtypeId  = re.id;                                     
        returnData.name  = mc.name;
        returnData.hospital  = mc.Hospital__c;
        returnData.department_Class  = mc.Department_Class__c;
        returnData.department  = mc.Department__c;
        returnData.service_Contract_Staff  = mc.Service_Contract_Staff__c;
        returnData.estimate_Target  = mc.Estimate_Target__c;
        returnData.dealer  = mc.Dealer__c;
        returnData.accDealerBlacklist = mc.AccDealerBlacklist__c;
        return returnData;
        
    }
    public class ReturnData{
        @AuraEnabled
        public String reportId; 
        @AuraEnabled
        public String mCEName; 
        @AuraEnabled
        public String name; 
        @AuraEnabled
        public Id hospital; 
        @AuraEnabled
        public Id department_Class; 
        @AuraEnabled
        public Id department; 
        @AuraEnabled
        public Id service_Contract_Staff; 
        @AuraEnabled
        public String estimate_Target; 
        @AuraEnabled
        public Id dealer; 
        @AuraEnabled
        public Id recordtypeId; 
        @AuraEnabled
        public String accDealerBlacklist; 
    }
}