From 559771a80cf779dc13a84ecd2f178e6ca5a8353a Mon Sep 17 00:00:00 2001
From: FUYU <fuyu@prec-tech.com>
Date: 星期五, 19 五月 2023 15:52:16 +0800
Subject: [PATCH] 备份省目标录入

---
 force-app/main/default/triggers/NFM007.trigger |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/force-app/main/default/triggers/NFM007.trigger b/force-app/main/default/triggers/NFM007.trigger
index 7959c43..e90f597 100644
--- a/force-app/main/default/triggers/NFM007.trigger
+++ b/force-app/main/default/triggers/NFM007.trigger
@@ -1,4 +1,9 @@
 trigger NFM007 on Opportunity (before update, after update) {         // after insert 銈掕�冩叜銇椼仾銇�
+    // SWAG-CE55BX 棰勬祴浼樺寲 start
+    if (StaticParameter.EscapeOppandStaTrigger) {
+        return;
+    }
+    // SWAG-CE55BX 棰勬祴浼樺寲 end
     if (StaticParameter.EscapeNFM007Trigger) {
 System.debug('Escape銆丒scapeNFM007Trigger:::::' + StaticParameter.EscapeNFM007Trigger);
         return;
@@ -41,7 +46,14 @@
                     
                     // SAPWIN銇儨銈裤兂銇у嫊銇忋仒銈冦仾銇忋�佹墜鍕曘仹銉併偋銉冦偗鈬掍繚瀛樸仩銇嬨倝銆乯s鐒$悊
                     if (Trigger.oldMap.get(opp.Id).get('SAP_Send_OK__c') == false && opp.SAP_Send_OK__c == true) {
-                       
+                       //SWAG-CG88AG銆愬鎵樸�戞彁鍑轰环鏍肩敵璇锋槸鍦ㄥ崗璁湁鏁堟湡鍐咃紝鍏佽WIN fy start 
+                       if(string.isNotBlank(opp.Estimation_No__c)){
+                            Boolean judge = OpportunityWebService.judgeIsAssistantAppliedOutTime(opp.Estimation_No__c);
+                            if(!judge){
+                                opp.addError('缁忛攢鍟嗗崗璁凡杩囨湡锛岃閲嶆柊鍋氭姤浠疯绠楀拰鍚堝悓鐢宠');
+                            }
+                       }
+                       //SWAG-CG88AG銆愬鎵樸�戞彁鍑轰环鏍肩敵璇锋槸鍦ㄥ崗璁湁鏁堟湡鍐咃紝鍏佽WIN fy end 
                         //CHAN-BCNCRB XHL If_Have_EPT1__c
                         if (opp.If_Have_EPT1__c == true && opp.If_UploadT1Detailed__c == false) {
                             opp.addError('璇环浜у搧涓寘鍚獷P-T1浜у搧锛屼絾娌′笂浼燭1娓呭崟锛屾棤娉曡繘琛孲AP涓婁紶锛圵IN锛夛紝璇蜂笂浼燭1娓呭崟');
@@ -283,7 +295,18 @@
         insert iflog;
         iflog = [Select Id, Name from BatchIF_Log__c where Id = :iflog.Id];
         System.debug(Logginglevel.DEBUG, 'NFM007_' + iflog.Name + ' start');                  // callout 銇腑 end 銇甽og銈掑嚭銇椼伨銇�
-        NFM007Controller.callout(iflog.Id, oppIds, purposeOfAdviceMap);
+        
+        // 20220921 ljh SWAG-CG2A7S update start
+        // NFM007Controller.callout(iflog.Id, oppIds, purposeOfAdviceMap);
+        String uid = UserInfo.getUserId();
+        String iUid = System.Label.interfaceUserID;
+        if (uid.substring(0,15) == iUid.substring(0,15)) {
+            NFM007Controller.calloutNotfuture(iflog.Id, oppIds, purposeOfAdviceMap);
+        }else{
+            NFM007Controller.callout(iflog.Id, oppIds, purposeOfAdviceMap);
+        }
+        // 20220921 ljh SWAG-CG2A7S update end
+        
     }
 
     if(System.Test.isRunningTest()){

--
Gitblit v1.9.1