From 56cab641be7c6c0aaab0ae2ca7eeaee9be6d5a69 Mon Sep 17 00:00:00 2001
From: LiJinHuan <lijinhuan@prec-tech.com>
Date: 星期五, 11 三月 2022 18:52:54 +0800
Subject: [PATCH] 【委托】【phase5上线课题132】-紧急-耗材ET展箱借用目的没有锁定已过期库存

---
 force-app/main/default/classes/IsValidLicenseBatch.cls               |    5 ++++-
 force-app/main/default/classes/ConsumDefaultSelectController.cls     |   16 +---------------
 force-app/main/default/classes/ConsumAutoSelectBatch.cls             |   16 +++++++++-------
 force-app/main/default/classes/ConsumDefaultSelectControllerTest.cls |    8 +++++---
 4 files changed, 19 insertions(+), 26 deletions(-)

diff --git a/force-app/main/default/classes/ConsumAutoSelectBatch.cls b/force-app/main/default/classes/ConsumAutoSelectBatch.cls
index 58b7a42..8e37ca3 100644
--- a/force-app/main/default/classes/ConsumAutoSelectBatch.cls
+++ b/force-app/main/default/classes/ConsumAutoSelectBatch.cls
@@ -10,9 +10,11 @@
     // 2021-03-05  mzy  WLIG-BYHD79  SFDC鐜batch鍚堝苟璋冩煡  start
     global ConsumAutoSelectBatch( ) {
     }
-    global ConsumAutoSelectBatch(Boolean NeedExecute) {
-        this.IsNeedExecute = NeedExecute;
-    }
+    // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� start
+    // global ConsumAutoSelectBatch(Boolean NeedExecute) {
+    //     this.IsNeedExecute = NeedExecute;
+    // }
+    // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� end
     // 2021-03-05  mzy  WLIG-BYHD79  SFDC鐜batch鍚堝苟璋冩煡  end
 
     /**
@@ -100,10 +102,10 @@
         }
 
         //2021-03-05  mzy  WLIG-BYHD79  SFDC鐜batch鍚堝苟璋冩煡  start
-        if(!Test.isRunningTest() &&IsNeedExecute==true){
-            //batch閲岃皟鐢ㄤ笅涓�涓猙atch鏃讹紝甯屾湜璺熷師鏈夌殑Schedule閲岄潰浼犵殑鏉℃暟淇濇寔涓�鑷�
-            Id execBTId = Database.executebatch(new SetOlympusCalendarWorkDayBatch(true),200);
-        }
+        // if(!Test.isRunningTest() &&IsNeedExecute==true){
+        //     //batch閲岃皟鐢ㄤ笅涓�涓猙atch鏃讹紝甯屾湜璺熷師鏈夌殑Schedule閲岄潰浼犵殑鏉℃暟淇濇寔涓�鑷�
+        //     Id execBTId = Database.executebatch(new SetOlympusCalendarWorkDayBatch(true),200);
+        // }
         //2021-03-05  mzy  WLIG-BYHD79  SFDC鐜batch鍚堝苟璋冩煡 end
     }
 
diff --git a/force-app/main/default/classes/ConsumDefaultSelectController.cls b/force-app/main/default/classes/ConsumDefaultSelectController.cls
index cbec5a9..dd9f053 100644
--- a/force-app/main/default/classes/ConsumDefaultSelectController.cls
+++ b/force-app/main/default/classes/ConsumDefaultSelectController.cls
@@ -27,7 +27,6 @@
         myComponentController.columnLeftRW.put('You_Xiao_Ku_Cun_Jia__c', 'r');
         myComponentController.columnLeftRW.put('You_Xiao_Qi_Ku_Cun_Jia__c', 'r');
         myComponentController.columnLeftRW.put('Yi_Guo_Qi_Ku_Cun_Jia__c', 'r');
-        myComponentController.columnLeftRW.put('demo_purpose2__c', 'r'); // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add start
         return selectedDataSql;
     }
 
@@ -70,7 +69,6 @@
                 , 'Select_Time__c'
                 , 'GroupKey_F__c'
                 , 'Asset__c'
-                , 'demo_purpose2__c' // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add start
                 , 'Shipment_request_time2__c'
                 , 'Consum_Start_Date_After_15_Day__c'
                 , 'Consum_Apply_Equipment_Set__r.Model_No__c'
@@ -690,14 +688,10 @@
                 wherStr2 += ' (';
                 wherStr += '(Fixture_Model_No_F__c  = \'' + String.escapeSingleQuotes(caesdobj.Consum_Apply_Equipment_Set__r.Model_No__c) + '\'';
                 wherStr2 += 'Fixture_Model_No_F__c  = \'' + String.escapeSingleQuotes(caesdobj.Consum_Apply_Equipment_Set__r.Model_No__c) + '\'';
-                // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add start
                 if (parentObj.demo_purpose2__c != '鍔ㄧ墿瀹為獙' 
                     //2021-04-30  mzy 澶囧搧璇鹃-1577 start
                     &&parentObj.demo_purpose2__c != 'ET灞曠') {
-                    //2021-04-30  mzy 澶囧搧璇鹃-1577 end
-                // if (caesdobj.demo_purpose2__c != '鍔ㄧ墿瀹為獙' 
-                //     && caesdobj.demo_purpose2__c != 'ET灞曠') {
-                // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add end    
+                    //2021-04-30  mzy 澶囧搧璇鹃-1577 end    
                     // Date d1 = caesdobj.Consum_Start_Date_After_15_Day__c == null ? td : caesdobj.Consum_Start_Date_After_15_Day__c;
                     // wherStr += ' AND Consumable_Guaranteen_end__c >= ' + d1.year() + '-' + String.valueOf(d1.month()).leftPad(2,'0') + '-' + String.valueOf(d1.day()).leftPad(2,'0') + ' )';
                     wherStr2 += ' AND (Consumable_Guaranteen_end__c >= ' + td.year() + '-' + String.valueOf(td.month()).leftPad(2,'0') + '-' + String.valueOf(td.day()).leftPad(2,'0');
@@ -780,14 +774,10 @@
                                 && (caesdobj.Consumable_Guaranteen_end_F__c == null
                                     // || caesdobj.Consumable_Guaranteen_end_F__c >= fDateMap.get(key)) {
                                     || caesdobj.Consumable_Guaranteen_end_F__c >= d
-                                    // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add start
                                     || parentObj.demo_purpose2__c == '鍔ㄧ墿瀹為獙'
                                     //2021-04-30  mzy 澶囧搧璇鹃-1577 start
                                     || parentObj.demo_purpose2__c == 'ET灞曠'
                                     //2021-04-30  mzy 澶囧搧璇鹃-1577 end
-                                    // || caesdobj.demo_purpose2__c == '鍔ㄧ墿瀹為獙'
-                                    // || caesdobj.demo_purpose2__c == 'ET灞曠'
-                                    // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add end
                                    )
                         ) {
                             if (caesdobj.Select_Time__c == null) {
@@ -804,14 +794,10 @@
                                         && (caesdobj.Consumable_Guaranteen_end_F__c == null
                                             // || caesdobj.Consumable_Guaranteen_end_F__c >= fDateMap.get(key)) {
                                             || caesdobj.Consumable_Guaranteen_end_F__c > d
-                                            // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add start
                                             || parentObj.demo_purpose2__c == '鍔ㄧ墿瀹為獙'
                                             //2021-04-30  mzy 澶囧搧璇鹃-1577 start
                                             || parentObj.demo_purpose2__c == 'ET灞曠'
                                             //2021-04-30  mzy 澶囧搧璇鹃-1577 end
-                                            // || caesdobj.demo_purpose2__c == '鍔ㄧ墿瀹為獙'
-                                            // || caesdobj.demo_purpose2__c == 'ET灞曠'
-                                            // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add end
                                             )
                                     ) {
                                         caesdobj.Asset__c = assBean.assId;
diff --git a/force-app/main/default/classes/ConsumDefaultSelectControllerTest.cls b/force-app/main/default/classes/ConsumDefaultSelectControllerTest.cls
index 9c82f60..56d0be9 100644
--- a/force-app/main/default/classes/ConsumDefaultSelectControllerTest.cls
+++ b/force-app/main/default/classes/ConsumDefaultSelectControllerTest.cls
@@ -77,6 +77,7 @@
 
         PageReference ref = new PageReference('/apex/ConsumDefaultSelectController?pt_recid=' + ca.Id);
         Test.setCurrentPage(ref);
+        Test.startTest(); // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add
         ConsumDefaultSelectController controller = new ConsumDefaultSelectController();
         CreateRelationListPagingCmpCtrl cmp = new CreateRelationListPagingCmpCtrl();
         cmp.pageController = controller;
@@ -85,7 +86,7 @@
         controller.searchOpp();
         System.assertEquals(1, controller.viewlist.size());
 
-        Test.startTest();
+        // Test.startTest();// 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� 
         controller.setShipment_request();
         Test.stopTest();
 
@@ -129,15 +130,16 @@
 
         PageReference ref = new PageReference('/apex/ConsumDefaultSelectController?pt_recid=' + ca.Id);
         Test.setCurrentPage(ref);
+        Test.startTest();// 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add 
         ConsumDefaultSelectController controller = new ConsumDefaultSelectController();
         CreateRelationListPagingCmpCtrl cmp = new CreateRelationListPagingCmpCtrl();
         cmp.pageController = controller;
         controller.myComponentController.init();
+        
         controller.init();
         controller.searchOpp();
         System.assertEquals(1, controller.viewlist.size());
-
-        Test.startTest();
+        // Test.startTest();// 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛�  
         controller.copyNum();
         controller.save();
         Test.stopTest();
diff --git a/force-app/main/default/classes/IsValidLicenseBatch.cls b/force-app/main/default/classes/IsValidLicenseBatch.cls
index 5fff537..1ef52fd 100644
--- a/force-app/main/default/classes/IsValidLicenseBatch.cls
+++ b/force-app/main/default/classes/IsValidLicenseBatch.cls
@@ -39,7 +39,10 @@
 		//2021-03-05  mzy  WLIG-BYHD79  SFDC鐜batch鍚堝苟璋冩煡  start
         if(!Test.isRunningTest() &&IsNeedExecute==true){
             //batch閲岃皟鐢ㄤ笅涓�涓猙atch鏃讹紝甯屾湜璺熷師鏈夌殑Schedule閲岄潰浼犵殑鏉℃暟淇濇寔涓�鑷�
-            Id execBTId = Database.executebatch(new ConsumAutoSelectBatch(true));
+            // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� start
+            // Id execBTId = Database.executebatch(new ConsumAutoSelectBatch(true));
+            Id execBTId = Database.executebatch(new SetOlympusCalendarWorkDayBatch(true),200);
+            // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� end
         }
         //2021-03-05  mzy  WLIG-BYHD79  SFDC鐜batch鍚堝苟璋冩煡 end
 	}

--
Gitblit v1.9.1