binxie
2023-06-16 da42e2995c00293af89c71fe5ba6e16cbb77e1b3
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);
            }
            //查询客户信息(名称,省,县)