From 36d15f189de2e83ce2576715dac30c3c260388dd Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期五, 14 七月 2023 14:47:50 +0800
Subject: [PATCH] fixconflict

---
 force-app/main/default/classes/LexConsumableAccountController.cls |   99 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 99 insertions(+), 0 deletions(-)

diff --git a/force-app/main/default/classes/LexConsumableAccountController.cls b/force-app/main/default/classes/LexConsumableAccountController.cls
index 781fa20..9d0ef2a 100644
--- a/force-app/main/default/classes/LexConsumableAccountController.cls
+++ b/force-app/main/default/classes/LexConsumableAccountController.cls
@@ -43,11 +43,15 @@
             pageSize = pageSizeLWC;
             pageToken = pageTokenLWC > 2000 ? 2000 : pageTokenLWC;
 
+<<<<<<< HEAD
             User Useracc = [
                 SELECT accountid, UserPro_Type__c
                 FROM user
                 WHERE id = :UserInfo.getUserId()
             ];
+=======
+            User Useracc = [SELECT accountid, UserPro_Type__c FROM user WHERE id = :UserInfo.getUserId()];
+>>>>>>> LEXCommunityLiJun
             accountId = [SELECT id, Name FROM account WHERE id = :Useracc.accountid].id;
             agencyProType = Useracc.UserPro_Type__c;
             if (String.isBlank(Useracc.UserPro_Type__c)) {
@@ -148,6 +152,7 @@
             Date thisDatetime2 = Date.newInstance(thisYear, 4, 1);
             Date nextDatetime = Date.newInstance(nextYear, 4, 1);
 
+<<<<<<< HEAD
             AggregateResult[] arList = null;
 
             System.debug('fiscalYear = ' + fiscalYear);
@@ -203,6 +208,69 @@
             System.debug('accountList = ' + accountList);
             System.debug('topInfo = ' + topInfo);
 
+=======
+            //AggregateResult[] arList = null;
+            AggregateResult[] arList = new List<AggregateResult>();
+            System.debug('fiscalYear = ' + fiscalYear);
+            if (fiscalYear == 'thisYear') {
+                AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(thisDatetime, nextDatetime);
+                Object saleAmountObject = saleAmountList[0].get('saleAmount');
+                topInfo.saleAmount = saleAmountObject != null ? Decimal.valueOf(String.valueOf(saleAmountObject)) : Decimal.valueOf('0');
+                //topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+                System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
+                arList = LexConsumableAccountSOQL.getAccountBySales(thisDatetime, nextDatetime);
+            } else if (fiscalYear == 'lastYear') {
+                AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(lastDatetime, thisDatetime2);
+                //topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+                Object saleAmountObject = saleAmountList[0].get('saleAmount');
+                topInfo.saleAmount = saleAmountObject != null ? Decimal.valueOf(String.valueOf(saleAmountObject)) : Decimal.valueOf('0');
+                System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
+                arList = LexConsumableAccountSOQL.getAccountBySales(lastDatetime, thisDatetime2);
+            } else {
+                AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(lastDatetime, nextDatetime);
+                //topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+                Object saleAmountObject = saleAmountList[0].get('saleAmount');
+                topInfo.saleAmount = saleAmountObject != null ? Decimal.valueOf(String.valueOf(saleAmountObject)) : Decimal.valueOf('0');
+                System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
+                arList = LexConsumableAccountSOQL.getAccountBySales(lastDatetime, nextDatetime);
+            }
+
+            // Map<String,Decimal> mapTemp = new Map<String,Decimal>();
+            // for (AggregateResult ar : arList) {
+            //     if(!mapTemp.get(String.valueOf(ar.get('hospitalName')))){
+            //         mapTemp.put(String.valueOf(ar.get('hospitalName'),Decimal.valueOf(String.valueOf(ar.get('thisAmount')))));
+            //     }else {
+            //         Decimal decimal = mapTemp.get(String.valueOf(ar.get('hospitalName')));
+            //         decimal += Decimal.valueOf(String.valueOf(ar.get('thisAmount')));
+            //         mapTemp.put(String.valueOf(ar.get('hospitalName'),decimal));
+            //     }
+            // }
+            // System.debug('mapTemp = ' + mapTemp);
+            // //鎺掑簭Decimal浠庡ぇ鍒板皬
+            // List<Decimal> decimalList = new List<Decimal>(mapTemp.values());
+            // decimalList.sort((a, b) => b.compareTo(a));
+            // Map<String, Decimal> sortedMap = new Map<String, Decimal>();
+            // for (String key : mapTemp.keySet()) {
+            //     sortedMap.put(key, mapTemp.get(key));
+            // }
+            
+            // System.debug('Sorted Map: ' + sortedMap);
+
+            //鏌ヨ瀹㈡埛淇℃伅锛堝悕绉帮紝鐪侊紝鍘匡級
+            System.debug('arList = ' + arList);
+            List<String> accountList = new List<String>();
+            for (AggregateResult ar : arList) {
+                System.debug('thisAmount = ' + String.valueOf(ar.get('thisAmount')));
+                if(String.valueOf(ar.get('thisAmount')) != '0.0'){
+                    accountList.add(String.valueOf(ar.get('Order_ForHospital__c')));
+                    topInfo.deList.add(Decimal.valueOf(String.valueOf(ar.get('thisAmount'))));  
+                }
+            }
+
+            System.debug('accountList = ' + accountList);
+            System.debug('topInfo = ' + topInfo);
+
+>>>>>>> LEXCommunityLiJun
             List<Account> acList = [
                 SELECT
                     id,
@@ -267,7 +335,12 @@
             Date thisDatetime2 = Date.newInstance(thisYear, 4, 1);
             Date nextDatetime = Date.newInstance(nextYear, 4, 1);
 
+<<<<<<< HEAD
             AggregateResult[] arList = null;
+=======
+            //AggregateResult[] arList = null;
+            AggregateResult[] arList = new List<AggregateResult>();
+>>>>>>> LEXCommunityLiJun
 
             System.debug('fiscalYear = ' + fiscalYear);
             System.debug('thisYear = ' + thisYear);
@@ -276,21 +349,39 @@
             if (fiscalYear == 'thisYear') {
                 AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(thisDatetime, nextDatetime);
                 if (saleAmountList[0].get('saleAmount') != null) {
+<<<<<<< HEAD
                     topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+=======
+                    //topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+                    Object saleAmountObject = saleAmountList[0].get('saleAmount');
+                    topInfo.saleAmount = saleAmountObject != null ? Decimal.valueOf(String.valueOf(saleAmountObject)) : Decimal.valueOf('0');
+>>>>>>> LEXCommunityLiJun
                     System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
                 }
                 arList = LexConsumableAccountSOQL.getAccountBySales(thisDatetime, nextDatetime);
             } else if (fiscalYear == 'lastYear') {
                 AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(lastDatetime, thisDatetime2);
                 if (saleAmountList[0].get('saleAmount') != null) {
+<<<<<<< HEAD
                     topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+=======
+                    //topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+                    Object saleAmountObject = saleAmountList[0].get('saleAmount');
+                    topInfo.saleAmount = saleAmountObject != null ? Decimal.valueOf(String.valueOf(saleAmountObject)) : Decimal.valueOf('0');
+>>>>>>> LEXCommunityLiJun
                     System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
                 }
                 arList = LexConsumableAccountSOQL.getAccountBySales(lastDatetime, thisDatetime2);
             } else {
                 AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(lastDatetime, nextDatetime);
                 if (saleAmountList[0].get('saleAmount') != null) {
+<<<<<<< HEAD
                     topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+=======
+                    //topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+                    Object saleAmountObject = saleAmountList[0].get('saleAmount');
+                    topInfo.saleAmount = saleAmountObject != null ? Decimal.valueOf(String.valueOf(saleAmountObject)) : Decimal.valueOf('0');
+>>>>>>> LEXCommunityLiJun
                     System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
                 }
                 arList = LexConsumableAccountSOQL.getAccountBySales(lastDatetime, nextDatetime);
@@ -372,7 +463,11 @@
             List<Account> allSelectAccount = Database.query(soql);
 
             totalCount = allSelectAccount.size();
+<<<<<<< HEAD
             String nullFL = sortOrder.toLowerCase() == 'asc' ? 'NULLS FIRST' : 'NULLS LAST';
+=======
+            String nullFL = sortOrder.toLowerCase() == 'asc' ? 'NULLS FIRST': 'NULLS LAST';
+>>>>>>> LEXCommunityLiJun
             if (String.isNotBlank(sortField)) {
                 soql += ' order by ' + sortField + ' ' + sortOrder + ' ' + nullFL;
             }
@@ -454,4 +549,8 @@
             deList = new List<Decimal>();
         }
     }
+<<<<<<< HEAD
 }
+=======
+}
+>>>>>>> LEXCommunityLiJun

--
Gitblit v1.9.1