From 00e147ec892cb1e89d0698787a8c60da1014cdb7 Mon Sep 17 00:00:00 2001
From: binxie <137736985@qq.com>
Date: 星期一, 26 六月 2023 17:42:22 +0800
Subject: [PATCH] Community升级

---
 force-app/main/default/classes/LexInventoryViewController.cls |   76 +++++++++++++++++--------------------
 1 files changed, 35 insertions(+), 41 deletions(-)

diff --git a/force-app/main/default/classes/LexInventoryViewController.cls b/force-app/main/default/classes/LexInventoryViewController.cls
index 3a36902..130028e 100644
--- a/force-app/main/default/classes/LexInventoryViewController.cls
+++ b/force-app/main/default/classes/LexInventoryViewController.cls
@@ -32,7 +32,7 @@
     // };
 
     public static String[] proLimitAndDate = new List<String>{};
-    private static Map<String, Date> productkucun = new Map<String, Date>();
+    public static Map<String, Date> productkucun = new Map<String, Date>();
     public static List<SelectOption> categoryOptionList { get; set; }
     @AuraEnabled
     public static Map<String, String> categoryOptionMap { get; set; }
@@ -49,7 +49,7 @@
     public static String category1 { get; set; }
     public static Boolean editAble { get; set; }
     // 缁忛攢鍟嗗湪搴撲骇鍝両D
-    public static List<String> orderDetZaikuList = new List<String>();
+    public static List<String> orderDetZaikuList { get; set; }
     // 浜у搧 ID
     public static String ESetId { get; set; }
     public static String idCheck { get; set; }
@@ -69,6 +69,7 @@
     // add by rentx 2021-3-10
 
     public LexInventoryViewController() {
+        orderDetZaikuList = new List<String>();
         consumableorderdetailsRecords = new List<ConsumableorderdetailsInfo>();
         consumableorderdetailsRecordsview = new List<List<ConsumableorderdetailsInfo>>();
         editAble = false;
@@ -83,12 +84,6 @@
         // pagesize = Integer.valueof(system.label.orderdetLimitsize);
         // currentpage = 0;
     }
-
-    @AuraEnabled
-    public static ResponseBodyLWC init2(Integer pageSizeLWC, Integer pageTokenLWC, String sortFieldLWC, String sortOrderLWC) {
-        return new ResponseBodyLWC('Error', 500, '娴嬭瘯 init2', '');
-    }
-
     @AuraEnabled
     public static ResponseBodyLWC init(Integer pageSizeLWC, Integer pageTokenLWC, String sortFieldLWC, String sortOrderLWC) {
         pageSize = pageSizeLWC;
@@ -103,12 +98,6 @@
         categoryOptionMap = new Map<String, String>();
         category4OptionMap = new Map<String, String>();
         category5OptionMap = new Map<String, String>();
-
-        // sortKey = '2';
-        // preSortKey = '2';
-        // sortOrderAsc = false;
-        // sortOrder = new List<String>(8);
-        // sortOrder = new List<String>{ ' ', '', ' ', ' ', '', '', '', '鈫�' };
 
         // 鍙栫敤鎴稩D
         String userId = UserInfo.getUserId();
@@ -250,9 +239,7 @@
                 }
                 if (newMidPieceMap.containsKey(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex)) {
                     ConsumableorderdetailsInfo Jstage = newMidPieceMap.get(
-                            CountDel[i].Consumable_Product__c +
-                            CountDel[i].Box_Piece__c +
-                            tex
+                            CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex
                         )
                         .clone();
                     Jstage.allnumber = Jstage.allnumber + 1;
@@ -415,23 +402,27 @@
         data.put('userWorkLocation', userWorkLocation);
         data.put('agencyProType', agencyProType);
         data.put('pageRecords', pageRecords);
+        data.put('consumableorderdetailsRecords', consumableorderdetailsRecords);
         data.put('hasHos', hasHos);
+        data.put('productLimtAndDate', proLimitAndDate);
+        data.put('productkucun', productkucun);
         res.status = 'Success';
         res.code = 200;
         System.debug('res = ' + res);
+        System.debug('productkucun = ' + productkucun);
         return res;
     }
     @AuraEnabled
-    public static ResponseBodyLWC categoryAllload(String category3LWC,String agencyProTypeLWC) {
+    public static ResponseBodyLWC categoryAllload(String category3LWC, String agencyProTypeLWC) {
         ResponseBodyLWC res = new ResponseBodyLWC();
         Map<String, object> data = new Map<String, object>();
         res.entity = data;
-        category3 =  category3LWC;
-        agencyProType =  '%' + agencyProTypeLWC + '%';
+        category3 = category3LWC;
+        agencyProType = '%' + agencyProTypeLWC + '%';
 
-        System.debug('category3LWC===>'+category3LWC);
-        System.debug('agencyProType===>'+agencyProType);
-        
+        System.debug('category3LWC===>' + category3LWC);
+        System.debug('agencyProType===>' + agencyProType);
+
         AggregateResult[] category4List = [
             SELECT Count(id), Category4_text__c c4c
             FROM Product2__c
@@ -475,8 +466,8 @@
             category5OptionList.add(new SelectOption(deliverycnt5, deliverycnt5));
             category5OptionMap.put(deliverycnt5, deliverycnt5);
         }
-        System.debug('绫诲埆4'+category4OptionList);
-        System.debug('绫诲埆5'+category5OptionList);
+        System.debug('绫诲埆4' + category4OptionList);
+        System.debug('绫诲埆5' + category5OptionList);
         data.put('category4OptionMap', category4OptionMap);
         data.put('category5OptionMap', category5OptionMap);
         res.status = 'Success';
@@ -537,13 +528,19 @@
         Integer pageSizeLWC,
         Integer pageTokenLWC,
         String sortFieldLWC,
-        String sortOrderLWC
+        String sortOrderLWC,
+        Map<String, Date> productkucunLWC
     ) {
         try {
+            System.debug('orderDetZaikuListLWC===>' + orderDetZaikuListLWC);
+            System.debug('productkucun===>' + productkucun);
             pageSize = pageSizeLWC;
             pageToken = pageTokenLWC;
             sortField = sortFieldLWC;
             sortOrder = sortOrderLWC;
+            productkucun = new Map<String, Date>();
+            orderDetZaikuList = new List<String>();
+            productkucun = productkucunLWC;
 
             orderDetZaikuList = orderDetZaikuListLWC;
             sqlagencyProType = '%' + agencyProType + '%';
@@ -606,7 +603,7 @@
             // if (String.isNotBlank(sortField) && String.isNotBlank(sortOrder)) {
             //     if(sortFieldLWC != 'limitCount'){
             //         soql += ' ORDER BY ' + sortField + ' ' + sortOrder;
-                    
+
             //     }
             // }
             System.debug('soql = ' + soql);
@@ -630,9 +627,7 @@
                     }
                     if (newMidBoxMap.containsKey(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex)) {
                         ConsumableorderdetailsInfo Jstage = newMidBoxMap.get(
-                                CountDel[i].Consumable_Product__c +
-                                CountDel[i].Box_Piece__c +
-                                tex
+                                CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex
                             )
                             .clone();
                         Jstage.allnumber = Jstage.allnumber + 1;
@@ -662,9 +657,7 @@
                     }
                     if (newMidPieceMap.containsKey(CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex)) {
                         ConsumableorderdetailsInfo Jstage = newMidPieceMap.get(
-                                CountDel[i].Consumable_Product__c +
-                                CountDel[i].Box_Piece__c +
-                                tex
+                                CountDel[i].Consumable_Product__c + CountDel[i].Box_Piece__c + tex
                             )
                             .clone();
                         Jstage.allnumber = Jstage.allnumber + 1;
@@ -780,11 +773,11 @@
             paginatedAccounts.recordEnd = totalCount >= recordEnd ? recordEnd : totalCount;
             paginatedAccounts.totalRecords = totalCount;
 
-            List<ConsumableorderdetailsInfo> pageRecordsCompare = new List<ConsumableorderdetailsInfo>(); 
+            List<ConsumableorderdetailsInfo> pageRecordsCompare = new List<ConsumableorderdetailsInfo>();
             System.debug('queryList = ' + JSON.serialize(queryList));
             for (Integer i = 0; i < queryList.size(); i++) {
-                for(ConsumableorderdetailsInfo ci : pageRecords){
-                    if(queryList[i].Id == ci.Prod.Id){
+                for (ConsumableorderdetailsInfo ci : pageRecords) {
+                    if (queryList[i].Id == ci.Prod.Id) {
                         System.debug('queryList[i].Id =' + queryList[i].Id);
                         System.debug('ci.Prod.Id =' + queryList[i].Id);
                         pageRecordsCompare.add(ci);
@@ -938,10 +931,10 @@
     //     }
     //     pageRecords.sort();
     // }
-  
 
     //妫�绱ql鏂囧仛鎴�
     private static String makeSoql(String CateName, String CateCode, String Category3, String Category4, String Category5) {
+        System.debug('orderDetZaikuList = ' + orderDetZaikuList);
         String sqlTail = '(\'';
         for (Integer i = 0; i < orderDetZaikuList.size(); i++) {
             if (i < orderDetZaikuList.size() - 1) {
@@ -1016,10 +1009,10 @@
     // }
 
     //鍒锋柊褰撳墠椤�
-    public static PageReference refreshPageSize() {
-        makeCurrentPageRecords();
-        return null;
-    }
+    // public static PageReference refreshPageSize() {
+    //     makeCurrentPageRecords();
+    //     return null;
+    // }
 
     //缂栬緫褰撳墠椤靛唴瀹�
     public static void makeCurrentPageRecords() {
@@ -1057,6 +1050,7 @@
     }
 
     // Data Bean
+    @TestVisible
     class ConsumableorderdetailsInfo implements Comparable {
         @AuraEnabled
         public Consumable_order_details2__c esd { get; set; }

--
Gitblit v1.9.1