From b329ab986e250bb27e46ace97cf208f3b26d145a Mon Sep 17 00:00:00 2001
From: FUYU <fuyu@prec-tech.com>
Date: 星期一, 18 十二月 2023 17:38:15 +0800
Subject: [PATCH] 修改复制(不带产品按钮)

---
 force-app/main/default/triggers/NFM001.trigger |   32 +++++++++++++++++++++++++++-----
 1 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/force-app/main/default/triggers/NFM001.trigger b/force-app/main/default/triggers/NFM001.trigger
index 8a23f70..c2de55e 100644
--- a/force-app/main/default/triggers/NFM001.trigger
+++ b/force-app/main/default/triggers/NFM001.trigger
@@ -159,7 +159,7 @@
                 }
             }
             // OCM_Category__c銇仱銇勩仸鐥呴櫌銇椼亱銇ゃ亱銇c仸銇亜銇熴倎銆佽ê鐧傜銈堛倞澶夋洿銇亗銈娿亪銇亜
-            if (Trigger.oldMap.get(a.Id).get('OCM_Category__c') != a.OCM_Category__c && needSendRectMap.get(a.RecordTypeId) == '鐥呴櫌' && isChanged == false) {
+            if (null!=a.OCSMField2__c||(Trigger.oldMap.get(a.Id).get('OCM_Category__c') != a.OCM_Category__c && needSendRectMap.get(a.RecordTypeId) == '鐥呴櫌' && isChanged == false)) {
                 isChanged = true;
                 NFM001Controller.debug_msg = 'OCM_Category__c';
                 needChild = true;
@@ -286,6 +286,7 @@
 //            }
 //            if (accUpdList.size() > 0) update accUpdList;
 //        }
+System.debug('*****************'+accIds.size());
     if (accIds.size() > 0) {
         NFM001Controller.debug_msg = accIds.size() + ',' + NFM001Controller.debug_msg;
         // MessageGroupNumber 銇帯鐣�
@@ -295,8 +296,14 @@
         insert iflog;
         iflog = [Select Id, Name from BatchIF_Log__c where Id = :iflog.Id];
         System.debug(Logginglevel.DEBUG, 'NFM001_' + iflog.Name + ' start');                  // callout 銇腑 end 銇甽og銈掑嚭銇椼伨銇�
-        NFM001Controller.callout(iflog.Id, accIds, purposeOfAdviceMap, needSendRectMap);
-        
+        //NFM624瑙﹀彂001鍜�201鎺ュ彛 20221102 LY start 
+        //NFM001Controller.callout(iflog.Id, accIds, purposeOfAdviceMap, needSendRectMap);
+        if(UserInfo.getUserId().equals(System.Label.interfaceUserID)){
+            NFM001Controller.calloutNotFuture(iflog.Id, accIds, purposeOfAdviceMap, needSendRectMap);
+        } else {
+            NFM001Controller.callout(iflog.Id, accIds, purposeOfAdviceMap, needSendRectMap);
+        }
+        //NFM624瑙﹀彂001鍜�201鎺ュ彛 20221102 LY end 
         // LHJ 鍚慡PO浼燦FM201 Start
         NFM201Controller.debug_msg = accIds.size() + ',' + NFM201Controller.debug_msg;
         BatchIF_Log__c iflog201 = new BatchIF_Log__c();
@@ -306,10 +313,25 @@
         iflog201 = [Select Id, Name from BatchIF_Log__c where Id = :iflog201.Id];
         System.debug(Logginglevel.DEBUG, 'NFM201_' + iflog201.Name + ' start');                  // callout 銇腑 end 銇甽og銈掑嚭銇椼伨銇�
         //NFM201Controller.callout(iflog201.Id, accIds, purposeOfAdviceMap, needSendRectMap);
-        if(!Test.isRunningTest()){
-        NFM201Controller.callout(iflog201.Id, accIds, purposeOfAdviceMap, needSendRectMap, needQuolifiedMap);
+        if(!System.Test.isRunningTest()){
+            //NFM624瑙﹀彂001鍜�201鎺ュ彛 20221102 LY start
+            //NFM201Controller.callout(iflog201.Id, accIds, purposeOfAdviceMap, needSendRectMap, needQuolifiedMap);
+            if(UserInfo.getUserId().equals(System.Label.interfaceUserID)){
+                NFM201Controller.calloutNotFuture(iflog201.Id, accIds, purposeOfAdviceMap, needSendRectMap, needQuolifiedMap);
+            } else {
+                NFM201Controller.callout(iflog201.Id, accIds, purposeOfAdviceMap, needSendRectMap, needQuolifiedMap);
+            }
+            //NFM624瑙﹀彂001鍜�201鎺ュ彛 20221102 LY end
         }
         // LHJ End
+        //NFM201Controller.debug_msg = accIds.size() + ',' + NFM201Controller.debug_msg;
+        // BatchIF_Log__c iflog601 = new BatchIF_Log__c();
+        // iflog601.Type__c = 'NFM601';
+        // iflog601.Log__c  = 'callout start\n'+accIds+'\n';
+        // insert iflog601;
+        // if(!System.Test.isRunningTest()){
+        //     NFM601Controller.callout(iflog601.Id, accIds);
+        // }
     }
     // LHJ 20190321 CBPR 鍙戦�佸尰闄㈣祫璐ㄥ鎵瑰悗锛屽皢鏍囧織缃负False
     if (Trigger.isUpdate) {

--
Gitblit v1.9.1