public with sharing class buttonMaintenanceContractEstimateCtl {
 
    @AuraEnabled
    public static InitData init(String recordId){
        InitData res = new initData();
        try{
            Maintenance_Contract_Estimate__c report =  [SELECT Process_Status__c,Id FROM Maintenance_Contract_Estimate__c WHERE Id =: recordId LIMIT 1];
            System.debug(LoggingLevel.INFO, '*** opp: ' + report);
            res.ProcessStatusC = report.Process_Status__c;         
            res.Id = report.Id;
            res.sessionId = UserInfo.getSessionId();

            System.debug(LoggingLevel.INFO, '*** res: ' + res);
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }   

     // 根据ID修改维修合同
     @AuraEnabled
     public static void updateMaintenanceContract(String recordId){
         try {
            Maintenance_Contract_Estimate__c maintenanceContract = new Maintenance_Contract_Estimate__c();
            maintenanceContract.Id = recordId;
            maintenanceContract.Process_Status__c = '中止';
            update maintenanceContract;
         } catch (Exception e) {
             System.debug(LoggingLevel.INFO, '*** e: ' + e);
         }
     }

    public class InitData{
        @AuraEnabled
        public String Id;
        @AuraEnabled
        public String ProcessStatusC;   
        @AuraEnabled
        public String sessionId;   
     }
}