From cd063bae7506e671ff66bc23915ae9f811064923 Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期四, 13 四月 2023 17:51:43 +0800
Subject: [PATCH] 修改按钮4.13.1

---
 force-app/main/default/classes/OpportunityLightingButtonController.cls |   14 ++++++++------
 force-app/main/default/classes/LightingButtonConstant.cls              |    7 +++++++
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/force-app/main/default/classes/LightingButtonConstant.cls b/force-app/main/default/classes/LightingButtonConstant.cls
index c68ab80..dac8ac7 100644
--- a/force-app/main/default/classes/LightingButtonConstant.cls
+++ b/force-app/main/default/classes/LightingButtonConstant.cls
@@ -69,6 +69,13 @@
     public static final String USER_ACCESS_EDIT = '_Edit';
     //userAccess鍙傛暟鍚庣紑_Read
     public static final String USER_ACCESS_READ = '_Read';
+    //浠诲姟鐨勫悕瀛椻�樹腑鏍囩粨鏋滅‘璁も��
+    public static final String TASK_NAME_BY_CONFIRMATION_OF_WINNING_BID = '涓爣缁撴灉纭';
+    //璇环鐨凜onfirmationofAward__c瀛楁鍊尖�極LY涓爣鈥�
+    public static final String OPPORTUNITY_CONFIRMATION_OF_AWARD_OLY_WIN_BID = 'OLY涓爣';
+     //璇环鐨凜onfirmationofAward__c瀛楁鍊尖�樼珵浜夊鎵嬩腑鏍団��
+     public static final String OPPORTUNITY_CONFIRMATION_OF_AWARD_LOSE_BID = '绔炰簤瀵规墜涓爣';
+    public static final String PREDICTED_DATE_STATUS = '瀹℃壒涓�';
     public static final String CN_YES = '鏄�';
     public static final String CN_NO = '鍚�';
     public static final String VOC_NAME = 'VOC';
diff --git a/force-app/main/default/classes/OpportunityLightingButtonController.cls b/force-app/main/default/classes/OpportunityLightingButtonController.cls
index 45124f4..9af0a4a 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-04-13 17:02:46
+ * @LastEditTime: 2023-04-13 17:50:20
  */
 public with sharing class OpportunityLightingButtonController {
     @AuraEnabled
@@ -205,7 +205,7 @@
         try {
             Opportunity opp = new Opportunity();
             opp.Id = recordId;
-            opp.ConfirmationofAward__c = '绔炰簤瀵规墜涓爣';
+            opp.ConfirmationofAward__c = LightingButtonConstant.OPPORTUNITY_CONFIRMATION_OF_AWARD_LOSE_BID;
             update opp;
             return null;
         } catch (Exception e) {
@@ -219,7 +219,7 @@
     public static string updateForOLYwinBidButton(String recordId){
         try {
             Opportunity opp = [select ConfirmationofAward__c,Closing_Bid_Date__c from Opportunity where Id =: recordId];
-            opp.ConfirmationofAward__c = 'OLY涓爣';
+            opp.ConfirmationofAward__c = LightingButtonConstant.OPPORTUNITY_CONFIRMATION_OF_AWARD_OLY_WIN_BID;
             if (opp.Closing_Bid_Date__c == null) {
                 opp.Closing_Bid_Date__c = Date.today();
             }
@@ -239,7 +239,7 @@
             rac = [
                 select 
                 id 
-                from InquiryPredictsDateChange__c where Predicted_Date_Status__c = '瀹℃壒涓�' and Opportunity__c =:recordId];
+                from InquiryPredictsDateChange__c where Predicted_Date_Status__c = :LightingButtonConstant.PREDICTED_DATE_STATUS and Opportunity__c =:recordId];
         } catch (Exception e) {
             System.debug('e:****' + e);
         }
@@ -249,10 +249,11 @@
     public static List<task__c> queryForLoseBidButton(String recordId){
         List<task__c> tasks = null;
         try {
+            String obscureName = '%' + LightingButtonConstant.TASK_NAME_BY_CONFIRMATION_OF_WINNING_BID + '%';
             tasks = [
                 select
                 taskStatus__c
-                from task__c where OpportunityId__c =: recordId and name like '%涓爣缁撴灉纭%'];
+                from task__c where OpportunityId__c =: recordId and name like :obscureName];
         } catch (Exception e) {
             System.debug('e:****' + e);
         }
@@ -262,10 +263,11 @@
     public static List<task__c> queryForOLYwinBidButton(String recordId){
         List<task__c> tasks = null;
         try {
+            String obscureName = '%' + LightingButtonConstant.TASK_NAME_BY_CONFIRMATION_OF_WINNING_BID + '%';
             tasks = [
                 select
                 taskStatus__c
-                from task__c where OpportunityId__c =: recordId and name like '%涓爣缁撴灉纭%'];
+                from task__c where OpportunityId__c =: recordId and name like :obscureName];
         } catch (Exception e) {
             System.debug('e:****' + e);
         }

--
Gitblit v1.9.1