From da42e2995c00293af89c71fe5ba6e16cbb77e1b3 Mon Sep 17 00:00:00 2001
From: binxie <137736985@qq.com>
Date: 星期五, 16 六月 2023 17:24:31 +0800
Subject: [PATCH] backup code

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

diff --git a/force-app/main/default/classes/LexConsumableAccountController.cls b/force-app/main/default/classes/LexConsumableAccountController.cls
index 9925a02..21d519d 100644
--- a/force-app/main/default/classes/LexConsumableAccountController.cls
+++ b/force-app/main/default/classes/LexConsumableAccountController.cls
@@ -244,20 +244,29 @@
             AggregateResult[] arList = null;
 
             System.debug('fiscalYear = ' + fiscalYear);
+            System.debug('thisYear = ' + thisYear);
+            System.debug('lastYear = ' + lastYear);
+
             if (fiscalYear == 'thisYear') {
                 AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(thisDatetime, nextDatetime);
-                topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
-                System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
+                if(saleAmountList[0].get('saleAmount') != null){
+                    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')));
-                System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
+                if(saleAmountList[0].get('saleAmount') != null){
+                    topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+                    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')));
-                System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
+                if(saleAmountList[0].get('saleAmount') != null){
+                    topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount')));
+                    System.debug('topInfo.saleAmount = ' + topInfo.saleAmount);
+                }
                 arList = LexConsumableAccountSOQL.getAccountBySales(lastDatetime, nextDatetime);
             }
             //鏌ヨ瀹㈡埛淇℃伅锛堝悕绉帮紝鐪侊紝鍘匡級

--
Gitblit v1.9.1