19626
2023-06-26 cb676d5d9631864b9fd634f9b3052a17c41ed345
force-app/main/default/classes/OpportunityLightingButtonController.cls
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-04-12 11:16:07
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-06-05 13:59:58
 * @LastEditTime: 2023-06-25 13:10:39
 */
public with sharing class OpportunityLightingButtonController {
    @AuraEnabled
@@ -458,6 +458,42 @@
        }
        return res;
    }
    @AuraEnabled
    public static InitData initForSpecilaApplyCreateButton(String recordId){
        InitData res = new InitData();
        try {
            Opportunity opp = [
                select
                Forecast_this_month__c
                from Opportunity where Id =: recordId
            ];
            res.oppForecastStatus = opp.Forecast_this_month__c;
            res.recordTypeId = Schema.SObjectType.OpportunitySpecialApply__c.getRecordTypeInfosByName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_SPECIL_APPLY_CREATE).getRecordTypeId();
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return res;
    }
    @AuraEnabled
    public static InitData initForSpecilaApplyCreateAchButton(String recordId){
        InitData res = new InitData();
        try {
            Statu_Achievements__c ach = [
                select
                Id,
                Monthly_forecast_shipping__c,
                Opportunity__c
                from Statu_Achievements__c where Id =: recordId
            ];
            res.oppId = ach.Opportunity__c;
            res.oppForecastStatus = ach.Monthly_forecast_shipping__c;
            res.recordTypeId = Schema.SObjectType.OpportunitySpecialApply__c.getRecordTypeInfosByName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_SPECIL_APPLY_CREATE_ACH).getRecordTypeId();
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return res;
    }
    @AuraEnabled
    public static string updateForAgencyAuthorizeButton(String recordId){
        try {
@@ -846,5 +882,9 @@
        public String reportForCNYId;
        @AuraEnabled
        public String reportForUSDId;
        @AuraEnabled
        public String oppForecastStatus;
        @AuraEnabled
        public String oppId;
    }
}