From d8dc84a3d56df839895f1c417a4d9cbee763d262 Mon Sep 17 00:00:00 2001
From: 高章伟 <gaozhangwei@prec-tech.com>
Date: 星期五, 03 三月 2023 14:50:59 +0800
Subject: [PATCH] gzw 测试环境代码更新

---
 force-app/main/default/classes/RentalFixtureSetAssignController.cls |   39 +++++++++++++++++++++++++--------------
 1 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/force-app/main/default/classes/RentalFixtureSetAssignController.cls b/force-app/main/default/classes/RentalFixtureSetAssignController.cls
index e7e3efe..af3c046 100644
--- a/force-app/main/default/classes/RentalFixtureSetAssignController.cls
+++ b/force-app/main/default/classes/RentalFixtureSetAssignController.cls
@@ -290,16 +290,18 @@
         // update銇犮亼浣跨敤銇欍倠
         List<Rental_Apply_Equipment_Set__c> mfUpdate = new List<Rental_Apply_Equipment_Set__c>();
         Savepoint sp = Database.setSavepoint();
+        List<String> statusList = System.Label.StatusProcessState.split(',');
 
         try {
             Boolean updRAFlg = false;
             Rental_Apply__c raUpd = [
                     SELECT Id, Shipment_request_Cnt__c,
                            Asset_loaner_start_day__c,
-                           // Campaign__c,
-                           // Campaign__r.IF_Approved__c,
-                           // Campaign__r.Meeting_Approved_No__c,
-                           Asset_loaner_closed_day__c
+                           Asset_loaner_closed_day__c,
+                           Campaign__c,
+                           Campaign__r.IF_Approved__c,
+                           Campaign__r.Meeting_Approved_No__c,
+                           Campaign__r.Approved_Status__c   //2022 sx obpm澶囧搧鍐宠鐘舵�佺浉鍏充慨鏀�
                       FROM Rental_Apply__c
                      WHERE Id = :parentId
                        FOR Update];
@@ -315,10 +317,14 @@
             }
 
             //20220228 sx obpm淇敼 鏄惁鐢宠鍐宠鍕剧潃娌℃湁鍐宠缂栧彿涓嶈兘杩涜鎿嶄綔
-            // if( raUpd.Campaign__c!= null && raUpd.Campaign__r.IF_Approved__c && raUpd.Campaign__r.Meeting_Approved_No__c == null){
-            //     throw new ControllerUtil.myException('宸茬敵璇峰喅瑁佷絾鍐宠缂栫爜涓虹┖');
-            // }
-
+            if( raUpd.Campaign__c!= null && raUpd.Campaign__r.IF_Approved__c && raUpd.Campaign__r.Meeting_Approved_No__c == null){
+                throw new ControllerUtil.myException('宸茬敵璇峰喅瑁佷絾鍐宠缂栫爜涓虹┖');
+            }
+            //20220315 sx obpm obpm澶囧搧鍐宠鐘舵�佺浉鍏充慨鏀� start
+            else if( raUpd.Campaign__c!= null && raUpd.Campaign__r.IF_Approved__c && raUpd.Campaign__r.Meeting_Approved_No__c != null && statusList.contains(raUpd.Campaign__r.Approved_Status__c) ){
+                throw new ControllerUtil.myException('宸茬敵璇峰喅瑁佷絾鍐宠鐘舵�佷笉绗﹀悎鏉′欢');
+            }
+            //20220315 sx obpm obpm澶囧搧鍐宠鐘舵�佺浉鍏充慨鏀� end
             Integer indexNum = 1;
             // 20210708 ljh SFDC-C47CLV add start
             Set<Id> raeIdset = new Set<Id>();
@@ -895,7 +901,7 @@
                 }
             }
         }
-        update queueList;
+        FixtureUtil.withoutUpdate(queueList);
         List<String> nodusequencekeylist = new List<String>(new Set<String>(sequencekeylist));
         List<Rental_Apply_Sequence__c> updateSequenceList = new List<Rental_Apply_Sequence__c>();
         List<Rental_Apply_Sequence__c> applysequenceList = [SELECT Id,ExternalKey__c,Demo_Purpose2__c,
@@ -934,7 +940,7 @@
                     
                 }
             }
-            update updateSequenceList;
+            FixtureUtil.withoutUpdate(updateSequenceList);
         }
         
     }
@@ -1055,6 +1061,9 @@
                 applyObj.campaignType = parentObj.CampaignType__c;
                 obj = getdefultInfo(raesd,applyObj,bieCunFangDi);
             }else{
+                // Modify by Liu 20220908 Solution鏈儴璇鹃瀵瑰簲 start
+                salesdepartments = salesdepartments.replace('16.Solution鏈儴', '16.娑堝寲路鍛煎惛棰嗗煙瑙e喅鏂规鏈儴');
+                // Modify by Liu 20220908 Solution鏈儴璇鹃瀵瑰簲 end
                 obj = getSpecialInfo(raesd,parentObj,salesdepartments,equipmenttypes);
             }
             System.debug(LoggingLevel.INFO, '*11** index: ' + index);
@@ -1201,9 +1210,11 @@
 
         updateList.addAll(queueList);
         System.debug(LoggingLevel.INFO, '***old updateList: ' + updateList.size());
+        System.debug(LoggingLevel.INFO, '***old updateList.detail: ' + updateList);
         updateList = Batch_QueueAllDetail.getSortDetailList(updateList);
         System.debug(LoggingLevel.INFO, '*** updateList: ' + updateList.size());
-        update updateList;
+        System.debug(LoggingLevel.INFO, '*** updateList.detail: ' + updateList);
+        FixtureUtil.withoutUpdate(updateList);
         
         System.debug(LoggingLevel.INFO, '*** allsequenceList: ' + allsequenceList.size());
         List<Rental_Apply_Sequence__c> oldSequenceList = [SELECT Id,ExternalKey__c,Fixture_Model_No__c FROM Rental_Apply_Sequence__c
@@ -1220,11 +1231,11 @@
         List<Rental_Apply_Sequence__c> olddleteSequenceList = [SELECT Id,ExternalKey__c,Fixture_Model_No__c FROM Rental_Apply_Sequence__c
                                                         WHERE Apply_Set_Detail__c IN:changeddetailIds];
 
-        delete olddleteSequenceList;
+        FixtureUtil.withoutDelete(olddleteSequenceList);
         if(updateList.size() + count + oldSequenceList.size() + allsequenceList.size() > 9900){
             throw new ControllerUtil.myException('褰撳墠鎺掗槦鏁版嵁閲忚繃澶э紝璇烽�夋嫨鍗曚釜涓讳綋鎿嶄綔');
         }
-        insert allsequenceList;
+        FixtureUtil.withoutInsert(allsequenceList);
         List<String> newSequenceIds = new List<String>();
         for(Rental_Apply_Sequence__c se:allsequenceList){
             newSequenceIds.add(se.Id);
@@ -1273,7 +1284,7 @@
             throw new ControllerUtil.myException('褰撳墠鎺掗槦鏁版嵁閲忚繃澶э紝璇烽�夋嫨鍗曚釜涓讳綋鎿嶄綔');
         }
         System.debug(LoggingLevel.INFO, '*** newSequenceList: ' + newSequenceList);
-        upsert newSequenceList;
+        FixtureUtil.withoutUpsertObjects(newSequenceList);
 
     }
 

--
Gitblit v1.9.1