更新 商铺统计利润算法

增加买手售后订单 增加备注
This commit is contained in:
chfei committed 2026-10-09 17:14:54 +08:00
1 parent 87e13e6544
commit 31b78e12b5
12 files changed
+208 -40

No files matched your search

+60 -21
View File
@@ -101,36 +101,59 @@ internal class ShopTest
//shopService.GetShopOrderAmountRange(id, DateTime.Now.AddDays(-10));
}
private static IEnumerable<DateTime> CaseArray
{
get
{
DateTime startDate = DateTime.Parse("2026/08/01");
DateTime endDate = DateTime.Parse("2026/10/08");
for (DateTime d = startDate; d <= endDate; d = d.AddDays(1))
{
yield return d;
}
}
}
[Test]
[TestCaseSource(nameof(CaseArray))]
public void StatsDataRangeShopSalesOrderTest(DateTime date)
{
var shopService = _container.Resolve<ShopRevenueStatisticsService>();
Console.WriteLine($"开始:{date.ToLongDateString()}");
try
{
shopService.ShopDailyStats(date);
}
catch
{
Console.WriteLine($"错误:{date.ToLongDateString()}");
}
}
[Test]
public void GetShopSalesOrderTest()
{
var shopService = _container.Resolve<ShopRevenueStatisticsService>();
DateTime startDate = DateTime.Parse("2026/08/01");
DateTime endDate = DateTime.Parse("2026/10/07");
DateTime date = startDate;
while (date <= endDate)
DateTime date = DateTime.Parse("2026/10/01");
Console.WriteLine($"开始:{date.ToLongDateString()}");
try
{
Console.WriteLine($"开始:{date.ToLongDateString()}");
try
{
shopService.ShopDailyStats(date);
}
catch
{
Console.WriteLine($"错误:{date.ToLongDateString()}");
}
date = date.AddDays(1);
shopService.ShopDailyStats(date, [
1960967267443626508,
]);
}
catch
{
Console.WriteLine($"错误:{date.ToLongDateString()}");
}
}
}
[Test]
public void GetBuyerDailyStatsTest()
{
var shopService = _container.Resolve<ShopRevenueStatisticsService>();
shopService.BuyerDailyStats(DateTime.Parse("2026/10/02"), [1960967267443620449]);
}
[Test]
public void UpdateStatsTest()
{
@@ -177,4 +200,20 @@ internal class ShopTest
}
Console.WriteLine(sb.ToString());
}
[Test]
public void GetShopOrderDetailsTest()
{
var shopService = _container.Resolve<ShopRevenueStatisticsService>();
var ret = shopService.GetShopOrderDetails(DateTime.Parse("2026/10/01"), DateTime.Parse("2026/10/01"), shopIds: [
"1960967267443626517",
]);
foreach (var item in ret)
{
Console.WriteLine($"{item.OrderId} {item.OutAmount}");
}
}
}