/// <summary> /// 获取门店统计信息 /// </summary> /// <param name="request"></param> /// <returns></returns> public async Task <ResponseBase> ProcessAction(GetShopStatisticsRequest request) { List <ShopStatisticsView> shopStatistics = null; if (request.Province > 0) { shopStatistics = await _shopStatisticsBll.GetShopStatistics(ShopStatisticsTypeEnum.City); if (shopStatistics != null) { shopStatistics = shopStatistics.Where(p => p.Province == request.Province).ToList(); } } else { shopStatistics = await _shopStatisticsBll.GetShopStatistics(ShopStatisticsTypeEnum.Province); } if (shopStatistics == null) { shopStatistics = new List <ShopStatisticsView>(); } var statisticsView = new GetShopStatisticsView(shopStatistics, shopStatistics.Sum(p => p.ShopCount)); return(ResponseBase.Success(statisticsView)); }
public async Task <ResponseBase> GetShopStatistics([FromBody] GetShopStatisticsRequest request) { try { var action = new GetShopStatisticsAction(_shopStatisticsBll); return(await action.ProcessAction(request)); } catch (Exception ex) { Log.Error(request, ex, this.GetType()); return(new ResponsePagingBase().GetResponseCodeError()); } }