19626
2023-06-26 cb676d5d9631864b9fd634f9b3052a17c41ed345
force-app/main/default/classes/lexSolutionProjectRequirementsController.cls
@@ -24,12 +24,44 @@
    }
    @AuraEnabled
    public static InitData initForClosingCaseFlowButton(String recordId){
        InitData res = new InitData();
        try {
            SolutionProjectRequirements__c so = [
                select
                Status__c
                from SolutionProjectRequirements__c where Id =: recordId
            ];
            res.status = so.Status__c;
            res.profileId = UserInfo.getProfileId();
            res.m2ProfileId = lexLightingButtonConstant.M2_PROFILE_NAME;
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return res;
    }
    @AuraEnabled
    public static string updateSubmitSolutionForApprovalButton(String recordId){
        SolutionProjectRequirements__c so = new SolutionProjectRequirements__c();
        try {
            so.Id = recordId;
            so.Submint_TF__c = true;
            so.Submitter__c = UserInfo.getUserId();
            update so;
            return '';
        } catch (Exception e) {
            return e.getMessage();
        }
    }
    @AuraEnabled
    public static string updateForClosingCaseFlowButton(String recordId){
        SolutionProjectRequirements__c so = new SolutionProjectRequirements__c();
        try {
            so.Id = recordId;
            so.Status__c = '07结案';
            update so;
            return '';
        } catch (Exception e) {
@@ -53,6 +85,35 @@
        }
        return accList;
    }
    @AuraEnabled
    public static List<Solution_Programme__c> queryForSolutionProgramme(String recordId){
        List<Solution_Programme__c> so = new List<Solution_Programme__c>();
        try {
            so = [
                select id,
                Scheme_Type__c,
                ApprovalClosingProgramme__c
                from Solution_Programme__c where SolutionProjectRequirements__c =: recordId and Scheme_Type__c = '结案'
            ];
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return so;
    }
    @AuraEnabled
    public static List<solutionClosingAttachment__c> queryForAttachments1(String solprogrammeId){
        List<solutionClosingAttachment__c> so = new List<solutionClosingAttachment__c>();
        try {
            so = [
                select id,name from solutionClosingAttachment__c where Solution_Programme__c =: solprogrammeId
            ];
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return so;
    }
    class InitData{
        @AuraEnabled
        public String status;
@@ -68,5 +129,9 @@
        public String userName;
        @AuraEnabled
        public String productLeader;
        @AuraEnabled
        public String profileId;
        @AuraEnabled
        public String m2ProfileId;
    }
}