统计页面 修改店铺选择,增加店铺搜索Combobox
This commit is contained in:
1 parent
b6b72e6bc3
commit
f12a7f14ea
16 files changed
+1801
-41
No files matched your search
@@ -431,8 +431,8 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Services
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 按天从缓存拼装完整范围,再按所选店铺过滤(ShopKey 为空 = 全部店铺)
|
||||
return FilterByShop(GetCachedRows(startDay, endDay), query.ShopKey);
|
||||
// 3. 按天从缓存拼装完整范围,再按所选店铺过滤(ShopKeys 为空 = 全部店铺)
|
||||
return FilterByShop(GetCachedRows(startDay, endDay), query.ShopKeys);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -477,21 +477,24 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Services
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>按所选店铺过滤明细:ShopKey 为空返回全部;否则按店铺名(ShopName)精确匹配。</summary>
|
||||
private static List<ShopRevenueStatisticsRow> FilterByShop(List<ShopRevenueStatisticsRow> rows, string shopKey)
|
||||
/// <summary>按所选店铺过滤明细:ShopKeys 为空/Null 返回全部;否则按店铺名(ShopName)精确匹配。</summary>
|
||||
private static List<ShopRevenueStatisticsRow> FilterByShop(List<ShopRevenueStatisticsRow> rows, List<string> shopKeys)
|
||||
{
|
||||
if (rows == null)
|
||||
return new List<ShopRevenueStatisticsRow>();
|
||||
|
||||
if (string.IsNullOrEmpty(shopKey))
|
||||
if (shopKeys == null || shopKeys.Count == 0)
|
||||
return new List<ShopRevenueStatisticsRow>(rows);
|
||||
|
||||
var shop = GetShopOptions().FirstOrDefault(a => a.AppKey == shopKey);
|
||||
if (shop == null || string.IsNullOrEmpty(shop.ShopName))
|
||||
var shops = GetShopOptions()
|
||||
.Where(a => shopKeys.Contains(a.AppKey))
|
||||
.Where(a => !string.IsNullOrEmpty(a.ShopName))
|
||||
.ToList();
|
||||
if (shops.Count == 0)
|
||||
return new List<ShopRevenueStatisticsRow>();
|
||||
|
||||
return rows
|
||||
.Where(r => string.Equals(r.ShopName, shop.ShopName, StringComparison.OrdinalIgnoreCase))
|
||||
.Where(r => shops.Any(s => string.Equals(r.ShopName, s.ShopName, StringComparison.OrdinalIgnoreCase)))
|
||||
.ToList();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user