From cb676d5d9631864b9fd634f9b3052a17c41ed345 Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期一, 26 六月 2023 09:04:26 +0800
Subject: [PATCH] 修改按钮

---
 force-app/main/default/classes/OpportunityLightingButtonController.cls |   42 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 41 insertions(+), 1 deletions(-)

diff --git a/force-app/main/default/classes/OpportunityLightingButtonController.cls b/force-app/main/default/classes/OpportunityLightingButtonController.cls
index 0f25b22..b7d7a02 100644
--- a/force-app/main/default/classes/OpportunityLightingButtonController.cls
+++ b/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;
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1