| | |
| | | |
| | | System.debug('fiscalYear = ' + fiscalYear); |
| | | if (fiscalYear == 'thisYear') { |
| | | AggregateResult[] saleAmountList = [ |
| | | SELECT sum(Sale_amount__c) saleAmount |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE CreatedDate >= :thisDatetime AND CreatedDate < :nextDatetime |
| | | ]; |
| | | AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(thisDatetime, nextDatetime); |
| | | topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount'))); |
| | | System.debug('topInfo.saleAmount = ' + topInfo.saleAmount); |
| | | arList = [ |
| | | SELECT count(id), Consumable_order__r.Order_ForHospital__r.name hospitalName, sum(Sale_amount__c) thisAmount |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE |
| | | CreatedDate >= :thisDatetime |
| | | AND CreatedDate < :nextDatetime |
| | | AND Consumable_order__r.Order_ForHospital__r.name != '' |
| | | GROUP BY Consumable_order__r.Order_ForHospital__r.Name |
| | | ORDER BY sum(Sale_amount__c) DESC |
| | | LIMIT 10 |
| | | ]; |
| | | arList = LexConsumableAccountSOQL.getAccountBySales(thisDatetime, nextDatetime); |
| | | } else if (fiscalYear == 'lastYear') { |
| | | AggregateResult[] saleAmountList = [ |
| | | SELECT sum(Sale_amount__c) saleAmount |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE CreatedDate >= :lastDatetime AND CreatedDate < :thisDatetime2 |
| | | ]; |
| | | AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(lastDatetime, thisDatetime2); |
| | | topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount'))); |
| | | System.debug('topInfo.saleAmount = ' + topInfo.saleAmount); |
| | | arList = [ |
| | | SELECT count(id), Consumable_order__r.Order_ForHospital__r.name hospitalName, sum(Sale_amount__c) thisAmount |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE |
| | | CreatedDate >= :lastDatetime |
| | | AND CreatedDate < :thisDatetime2 |
| | | AND Consumable_order__r.Order_ForHospital__r.name != '' |
| | | GROUP BY Consumable_order__r.Order_ForHospital__r.Name |
| | | ORDER BY sum(Sale_amount__c) DESC |
| | | LIMIT 10 |
| | | ]; |
| | | arList = LexConsumableAccountSOQL.getAccountBySales(lastDatetime, thisDatetime2); |
| | | } else { |
| | | AggregateResult[] saleAmountList = [ |
| | | SELECT sum(Sale_amount__c) saleAmount |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE CreatedDate >= :lastDatetime AND CreatedDate < :nextDatetime |
| | | ]; |
| | | AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(lastDatetime, nextDatetime); |
| | | topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount'))); |
| | | System.debug('topInfo.saleAmount = ' + topInfo.saleAmount); |
| | | arList = [ |
| | | SELECT count(id), Consumable_order__r.Order_ForHospital__r.name hospitalName, sum(Sale_amount__c) thisAmount |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE |
| | | CreatedDate >= :lastDatetime |
| | | AND CreatedDate < :nextDatetime |
| | | AND Consumable_order__r.Order_ForHospital__r.name != '' |
| | | GROUP BY Consumable_order__r.Order_ForHospital__r.Name |
| | | ORDER BY sum(Sale_amount__c) DESC |
| | | LIMIT 10 |
| | | ]; |
| | | arList = LexConsumableAccountSOQL.getAccountBySales(lastDatetime, nextDatetime); |
| | | } |
| | | |
| | | //查询客户信息(名称,省,县) |
| | |
| | | |
| | | System.debug('fiscalYear = ' + fiscalYear); |
| | | if (fiscalYear == 'thisYear') { |
| | | AggregateResult[] saleAmountList = [ |
| | | SELECT sum(Sale_amount__c) saleAmount |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE CreatedDate >= :thisDatetime AND CreatedDate < :nextDatetime |
| | | ]; |
| | | AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(thisDatetime, nextDatetime); |
| | | topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount'))); |
| | | System.debug('topInfo.saleAmount = ' + topInfo.saleAmount); |
| | | arList = [ |
| | | SELECT count(id), Consumable_order__r.Order_ForHospital__r.name hospitalName, sum(Sale_amount__c) thisAmount |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE |
| | | CreatedDate >= :thisDatetime |
| | | AND CreatedDate < :nextDatetime |
| | | AND Consumable_order__r.Order_ForHospital__r.name != '' |
| | | GROUP BY Consumable_order__r.Order_ForHospital__r.Name |
| | | ORDER BY sum(Sale_amount__c) DESC |
| | | LIMIT 10 |
| | | ]; |
| | | arList = LexConsumableAccountSOQL.getAccountBySales(thisDatetime, nextDatetime); |
| | | } else if (fiscalYear == 'lastYear') { |
| | | AggregateResult[] saleAmountList = [ |
| | | SELECT sum(Sale_amount__c) saleAmount |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE CreatedDate >= :lastDatetime AND CreatedDate < :thisDatetime2 |
| | | ]; |
| | | AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(lastDatetime, thisDatetime2); |
| | | topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount'))); |
| | | System.debug('topInfo.saleAmount = ' + topInfo.saleAmount); |
| | | arList = [ |
| | | SELECT count(id), Consumable_order__r.Order_ForHospital__r.name hospitalName, sum(Sale_amount__c) thisAmount |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE |
| | | CreatedDate >= :lastDatetime |
| | | AND CreatedDate < :thisDatetime2 |
| | | AND Consumable_order__r.Order_ForHospital__r.name != '' |
| | | GROUP BY Consumable_order__r.Order_ForHospital__r.Name |
| | | ORDER BY sum(Sale_amount__c) DESC |
| | | LIMIT 10 |
| | | ]; |
| | | arList = LexConsumableAccountSOQL.getAccountBySales(lastDatetime, thisDatetime2); |
| | | } else { |
| | | AggregateResult[] saleAmountList = [ |
| | | SELECT sum(Sale_amount__c) saleAmount |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE CreatedDate >= :lastDatetime AND CreatedDate < :nextDatetime |
| | | ]; |
| | | AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(lastDatetime, nextDatetime); |
| | | topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount'))); |
| | | System.debug('topInfo.saleAmount = ' + topInfo.saleAmount); |
| | | arList = [ |
| | | SELECT count(id), Consumable_order__r.Order_ForHospital__r.name hospitalName, sum(Sale_amount__c) thisAmount |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE |
| | | CreatedDate >= :lastDatetime |
| | | AND CreatedDate < :nextDatetime |
| | | AND Consumable_order__r.Order_ForHospital__r.name != '' |
| | | GROUP BY Consumable_order__r.Order_ForHospital__r.Name |
| | | ORDER BY sum(Sale_amount__c) DESC |
| | | LIMIT 10 |
| | | ]; |
| | | arList = LexConsumableAccountSOQL.getAccountBySales(lastDatetime, nextDatetime); |
| | | } |
| | | //查询客户信息(名称,省,县) |
| | | List<String> accountList = new List<String>(); |