public with sharing class ISOpportunityDemand {
    // 查询SI项目需求表
    @AuraEnabled
    public static InitData initISOpportunityController(String recordId) {
        InitData res = new initData();
        try{
            IS_Opportunity_Demand__c report = [SELECT Id,Data_Check_TF__c,Func_SOD_Status__c FROM IS_Opportunity_Demand__c WHERE Id = :recordId LIMIT 1];
            res.Id = report.Id;
            res.checkTf = report.Data_Check_TF__c;
            res.sodStatus = report.Func_SOD_Status__c;
            // res.cadUpload = report.CAD_Upload_Date__c;
            res.submitLabel = System.Label.ProfileId_SystemAdmin;
            System.debug(LoggingLevel.INFO, '*** zq: ' + res);
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** zq: ' + e);
        }
        return res;
    }

    public class InitData{
        @AuraEnabled
        public String Id;
        @AuraEnabled
        public Boolean checkTf;
        @AuraEnabled
        public String sodStatus;
        // @AuraEnabled
        // public String cadUpload;
        @AuraEnabled
        public String submitLabel;

    }

    //提交按钮
    @AuraEnabled
    public static String submit(String recordId) {
       try {
        // Request_tedner_doc__c rac = [SELECT 	Id,Status__c,Submit_check_flag__c,RecordTypeId,Submit_time__c,Request_target__c,Document_format__c,Bid_distributor__c,Product_discription__c,Tedner_date__c,Tender_active_day__c,tender_inactive_date__c,Tender_request_reason__c FROM Request_tedner_doc__c WHERE Id = :recordId LIMIT 1];
        IS_Opportunity_Demand__c rac = [SELECT Id,Submint_TF__c FROM IS_Opportunity_Demand__c WHERE Id = :recordId LIMIT 1];
        rac.Id = rac.Id;
        rac.Submint_TF__c = true;
        update rac;
        return '1';
       } catch (Exception ex) {
        System.debug(LoggingLevel.INFO, '*** zq: ' + ex);
        // return ex;
        // return ex.getMessage();
        return ex.getDmlMessage(0);
       }
    }
}