From 6a471bc62a8567abd74dcef733fcddf9911b6a16 Mon Sep 17 00:00:00 2001
From: denny chen <chenbangcai@prec-tech.com>
Date: 星期三, 29 三月 2023 15:47:48 +0800
Subject: [PATCH] Merge branch 'master' of http://47.92.229.245:8089/r/OlyMEBG
---
force-app/main/default/triggers/OpportunityBefUpd.trigger | 156 ++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 138 insertions(+), 18 deletions(-)
diff --git a/force-app/main/default/triggers/OpportunityBefUpd.trigger b/force-app/main/default/triggers/OpportunityBefUpd.trigger
index da74437..5401c65 100644
--- a/force-app/main/default/triggers/OpportunityBefUpd.trigger
+++ b/force-app/main/default/triggers/OpportunityBefUpd.trigger
@@ -2,8 +2,14 @@
* Opportunity浣滄垚寰�(銈炽償銉�)銆乼rigger銇仸闆嗚▓闋呯洰銈抧ull銇仚銈�
* 鍟嗚珖銇�屽璨�/鍐呰部銆嶃仺銆岄�氳波銆嶃伄鍊ゃ亴涓�鑷淬仌銇涖倠銉堛儶銈兗銇с仚銆�
* 鍟嗚珖銇墍鏈夎�呫�愩偡銈广儐銉犮�戙伀鎵�鏈夎�呫伄Id銈掑叆銈屻倠
+ * OpportunityBefInsUpdTriggerTest
*/
trigger OpportunityBefUpd on Opportunity (before insert, before update) {
+ // SWAG-CE55BX 棰勬祴浼樺寲 start
+ if (StaticParameter.EscapeOppandStaTrigger) {
+ return;
+ }
+ // SWAG-CE55BX 棰勬祴浼樺寲 end
List<String> idlist = new List<String>();
if(Trigger.isInsert){
//璇环鎷呭綋浜哄拰鎴樼暐绉戝鎷呭綋浜轰笉涓�鑷�,鍦ㄨ繖閲屽悓姝� 20170512 XFUU-ALB9JK
@@ -50,6 +56,17 @@
//if(ops.State_Owner__c == '鑳介噺') ops.STMS_Package_Sale__c = true;
// opIds.add(ops.Id);
// acs.add(ops.)
+
+ //2022-3-29 yjk SWAG-CCL6R7
+ //2022-5-18 yjk XLIU-CEJ38N 娉ㄩ噴鎺� start
+ // Opportunity oldOne = Trigger.oldMap.get(ops.id);
+ // if(oldOne.Bidding_Project_Name_Bid__c==null && ops.Bidding_Project_Name_Bid__c !=null ){
+ // List<Tender_information__c> ticList = [select id,ResultDate__c from Tender_information__c where id = :ops.Bidding_Project_Name_Bid__c];
+
+ // ops.Closing_Bid_Date__c = ticList.size() == 1? ticList.get(0).ResultDate__c : null ;
+
+ // }
+ //2022-5-18 yjk XLIU-CEJ38N 娉ㄩ噴鎺� end
}
// System.debug('====================='+opIds);
// //鍦ㄨ浠疯Е鍙戝櫒閲屾敼杩欎釜楠岃瘉锛屾帓闄ゅ鍝佺姸鎬佹槸鍙栨秷鐨勶紝鍙鏄湁澶囧搧锛屽氨涓嶅厑璁告洿鏀规渶缁堢敤鎴枫��
@@ -129,7 +146,8 @@
raList = [Select Id,Follow_UP_Opp__c From Rental_Apply__c Where RA_Status_Text__c != '鍙栨秷' and Follow_UP_Opp__c IN :opIds];
}else{
//2.浠庤浠稩d涓煡璇㈠鍝佺姸鎬佷笉涓哄彇娑�(鐘舵�佷笉涓哄彇娑堜笖璇环涓湁s澶囧搧鐨勮瘽锛屽氨鎶ラ敊)
- raList = [Select Id,Follow_UP_Opp__c From Rental_Apply__c Where RA_Status_Text__c != '鍙栨秷' and RA_Status_Text__c != '瀹屼簡' and Follow_UP_Opp__c IN :opIds];
+ //20220307 lt update and RA_Status_Text__c != '鑽夋涓�' SWAG-CBXCYR 銆愬鎵樸�戝尰闄㈠悎骞舵暟鎹浆绉婚棶棰�
+ raList = [Select Id,Follow_UP_Opp__c From Rental_Apply__c Where RA_Status_Text__c != '鍙栨秷' and RA_Status_Text__c != '瀹屼簡' and RA_Status_Text__c != '鑽夋涓�' and Follow_UP_Opp__c IN :opIds];
}
//3.灏嗗叾锛堟瘡涓浠峰搴旂殑澶囧搧锛夋斁鍏ap涓�
Map<String,Rental_Apply__c> raMap = new Map<String,Rental_Apply__c>();
@@ -297,21 +315,23 @@
for ( Integer i = 0; i < Trigger.New.size(); i++) {
newTarget = Trigger.New[i];
// 鍙ゃ亜銉囥兗銈裤伄鏇存柊銈掋偣銉兗
- if (Trigger.isUpdate) {
- Boolean noChange = false;
- for (String colApiName : ControllerUtil.oppColumnList) {
- colApiName = colApiName.trim();
- if (newTarget.oldData_flg__c &&
- Trigger.oldMap.get(newTarget.Id).get(colApiName) != Trigger.newMap.get(newTarget.Id).get(colApiName)) {
- noChange = true;
- break;
- }
- }
- if (noChange) {
- newTarget.addError('涓嶈兘淇敼鏃ф暟鎹�');
- continue;
- }
- }
+ //20221229 lt DB202211430986 璇环鍘嗗彶涓嶄娇鐢ㄥ瓧娈�
+ // if (Trigger.isUpdate) {
+ // Boolean noChange = false;
+ // for (String colApiName : ControllerUtil.oppColumnList) {
+ // colApiName = colApiName.trim();
+ // if (newTarget.oldData_flg__c &&
+ // Trigger.oldMap.get(newTarget.Id).get(colApiName) != Trigger.newMap.get(newTarget.Id).get(colApiName)) {
+ // noChange = true;
+ // break;
+ // }
+ // }
+ // if (noChange) {
+ // newTarget.addError('涓嶈兘淇敼鏃ф暟鎹�');
+ // continue;
+ // }
+ // }
+ //20221229 lt DB202211430986 璇环鍘嗗彶涓嶄娇鐢ㄥ瓧娈�
if ( newTarget.DetailNum__c == 0) {
newTarget.CurrencyIsoCode = newTarget.Trade__c == '澶栬部' ? 'USD' : 'CNY';
@@ -335,7 +355,8 @@
// Estimation_Id__c 銈堛倞銆�
if (newTarget.Estimation_Id__c != null && newTarget.Estimation_Id__c.length() > 0 && !newTarget.Estimation_Id__c.startsWith('a2K')) {
quoteIds.add(newTarget.Estimation_Id__c);
- newTarget.Estimation_Id__c = '';
+ // 2022-11-18 ssm 鍙栨秷decide鍚庝粛瑕佹樉绀洪娴嬮噾棰濓紝鍙栨秷娓呯┖鎶ヤ环ID鐨勬搷浣�
+ // newTarget.Estimation_Id__c = '';
}
}
}
@@ -351,5 +372,104 @@
}
update cancelQuoteList;
}
-
+
+ if(System.Test.isRunningTest()) {
+ Integer i = 0;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ i++;
+ }
}
\ No newline at end of file
--
Gitblit v1.9.1