From 1312ba82d4c880bdb5357d28e0d4af5b285f610f Mon Sep 17 00:00:00 2001
From: 高章伟 <gaozhangwei@prec-tech.com>
Date: 星期四, 10 三月 2022 15:54:39 +0800
Subject: [PATCH] 最近一月修改内容

---
 force-app/main/default/classes/ConsumDefaultSelectController.cls |   51 +++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 43 insertions(+), 8 deletions(-)

diff --git a/force-app/main/default/classes/ConsumDefaultSelectController.cls b/force-app/main/default/classes/ConsumDefaultSelectController.cls
index 88495aa..cbec5a9 100644
--- a/force-app/main/default/classes/ConsumDefaultSelectController.cls
+++ b/force-app/main/default/classes/ConsumDefaultSelectController.cls
@@ -27,6 +27,7 @@
         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;
     }
 
@@ -69,6 +70,7 @@
                 , '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'
@@ -272,7 +274,10 @@
                     Consum_Apply_Equipment_Set_Detail__c caesd = (Consum_Apply_Equipment_Set_Detail__c)info.sobj;
                     if (caesd.Qu_Xiao_Fen_Pei_Shu_Liang_Jia__c != null
                             && caesd.Qu_Xiao_Fen_Pei_Shu_Liang_Jia__c > 0) {
-                        String key = caesd.GroupKey_F__c;
+                        // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add start
+                        // String key = caesd.GroupKey_F__c;
+                        String key = caesd.GroupKey_F__c+caesd.Fixture_Model_No__c;
+                        // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add end
                         System.debug(caesd.Consumable_Guaranteen_end_F__c);
                         System.debug(key);
                         if(caesd.Qu_Xiao_Fen_Pei_Shu_Liang_Jia__c>caesd.Jie_Chu_Fen_Pei_Jia__c){
@@ -317,6 +322,7 @@
             carsdList = [SELECT Id
                         , Select_Time__c
                         , GroupKey_F__c
+                        , Fixture_Model_No__c // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add
                      FROM Consum_Apply_Equipment_Set_Detail__c
                     WHERE Consum_Apply__c = :parentId
                       AND Cancel_Select__c = False
@@ -324,11 +330,22 @@
                     ORDER BY Degree_Of_Importance__c DESC];
             Map<String, List<Consum_Apply_Equipment_Set_Detail__c>> caesdListMap = new Map<String, List<Consum_Apply_Equipment_Set_Detail__c>>();
             for (Consum_Apply_Equipment_Set_Detail__c caesd : carsdList) {
-                if (caesdListMap.containsKey(caesd.GroupKey_F__c) == false) {
-                    caesdListMap.put(caesd.GroupKey_F__c, new List<Consum_Apply_Equipment_Set_Detail__c>());
+                // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add start
+                String key = caesd.GroupKey_F__c+caesd.Fixture_Model_No__c;
+                // if (caesdListMap.containsKey(caesd.GroupKey_F__c) == false) {
+                //     caesdListMap.put(caesd.GroupKey_F__c, new List<Consum_Apply_Equipment_Set_Detail__c>());
+                // }
+                // System.debug(caesd.GroupKey_F__c);
+                // caesdListMap.get(caesd.GroupKey_F__c).add(caesd);
+                List<Consum_Apply_Equipment_Set_Detail__c> tempCaesdL;
+                if(caesdListMap.containsKey(key)){
+                    tempCaesdL = caesdListMap.get(key);
+                }else{
+                    tempCaesdL = new List<Consum_Apply_Equipment_Set_Detail__c>();
                 }
-                System.debug(caesd.GroupKey_F__c);
-                caesdListMap.get(caesd.GroupKey_F__c).add(caesd);
+                tempCaesdL.add(caesd);                        
+                caesdListMap.put(key,tempCaesdL);
+                // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add end
             }
             System.debug(caesdListMap);
             List<Consum_Apply_Equipment_Set_Detail__c> caesdList = new List<Consum_Apply_Equipment_Set_Detail__c>();
@@ -572,7 +589,7 @@
                 final String soqlStr = 'Select {0} {1} ';
                 String soql1 = String.format(soqlStr, new String[] {myComponentController.strColumus , selectedDataSql1});
                 selectedData = Consum_ApplyUtil.withoutQueryList(soql1);
-
+                System.debug('zheli:'+selectedData.size());
                 if (String.isNotBlank(wherStr1) && String.isBlank(wherStr)) {
                     wherStr = wherStr1;
                 }
@@ -595,18 +612,23 @@
                 Map<String, Consum_Apply_Equipment_Set_Detail__c> keyMap = new Map<String, Consum_Apply_Equipment_Set_Detail__c>();
                 Boolean haveChange = false;
                 Set<String> modelKeySet = new Set<String>();
+                System.debug('zheli598:'+selectedData.size());
                 for (SObject sobj : selectedData) {
                     Consum_Apply_Equipment_Set_Detail__c caesdobj = (Consum_Apply_Equipment_Set_Detail__c) sobj;
                     if (caesdobj.Asset__c == null) {
                         continue;
                     }
-                    String key = caesdobj.GroupKey_F__c;
+                    // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add start
+                    // String key = caesdobj.GroupKey_F__c;
+                    String key = caesdobj.GroupKey_F__c+caesdobj.Fixture_Model_No__c;
+                    // 20220309 ljh  SFDC-CC73U5 132 鍔ㄧ墿瀹為獙&ET灞曠 閿佸畾宸茶繃鏈熷簱瀛� add end
                     if (keyMap.containsKey(key)) {
                         Consum_Apply_Equipment_Set_Detail__c caesd = keyMap.get(key);
                         keyMap.get(key).Request_Num_Jia__c ++;
                         if (caesdobj.Select_Time__c != null) {
                             keyMap.get(key).Jie_Chu_Fen_Pei_Jia__c += 1;
                         }
+                        System.debug('zheli598:'+selectedData.size());
                         continue;
                     }
                     keyMap.put(key, caesdobj);
@@ -631,6 +653,7 @@
                     //viewList[viewList.size() - 1].additionalInfoMap.put('Substitute_Select_Again__c', String.valueOf(caesdobj.Substitute_Select_Again__c));
                 }
             }
+            System.debug('zheli634:'+viewList.size());
             if (savetype == '1') {
                 ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '淇濆瓨鎴愬姛'));
             }
@@ -667,10 +690,14 @@
                 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    
                     // 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');
@@ -693,7 +720,7 @@
         // if (String.isNotBlank(parentObj.Internal_asset_location_F__c)) {
             wherStr += ' AND Internal_asset_location__c = \'涓婃捣 澶囧搧涓績\'';
             wherStr2 += ' AND Internal_asset_location__c = \'涓婃捣 澶囧搧涓績\'';
-        // }
+        // } 
         if (String.isNotBlank(parentObj.Salesdepartment__c)) {
             wherStr += ' AND (Salesdepartment__c = \'' + parentObj.Salesdepartment__c + '\' OR Salesdepartment__c = \'0.澶囧搧涓績\')';
             wherStr2 += ' AND (Salesdepartment__c = \'' + parentObj.Salesdepartment__c + '\' OR Salesdepartment__c = \'0.澶囧搧涓績\')';
@@ -753,10 +780,14 @@
                                 && (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) {
@@ -773,10 +804,14 @@
                                         && (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;

--
Gitblit v1.9.1