利润统计 增加快递费筛选
快递费 页面支持导出全部
This commit is contained in:
1 parent
71614f64e4
commit
78a64aa661
10 files changed
+268
-126
No files matched your search
@@ -108,7 +108,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Services
|
||||
decimal buyerPaymentAmount = ToYuan(list.Sum(a => a.TotalPurchase));
|
||||
decimal buyerRefundAmount = ToYuan(list.Sum(a => a.TotalRefund));
|
||||
decimal buyerRefundSuccessedAmount = ToYuan(list.Sum(a => a.DoneRefund));
|
||||
|
||||
decimal packageAmount = ToYuan(list.Sum(a => a.PackageAmount));
|
||||
int validOrderCount = list.Sum(a => a.OrderCount); // 新接口 OrderCount 不含退款订单
|
||||
int refundOrderCount = list.Sum(a => a.RefundOrderCount);
|
||||
int totalOrderCount = validOrderCount + refundOrderCount;
|
||||
@@ -128,6 +128,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Services
|
||||
BuyerPaymentAmount = buyerPaymentAmount,
|
||||
BuyerRefundAmount = buyerRefundAmount,
|
||||
BuyerRefundSuccessedAmount = buyerRefundSuccessedAmount,
|
||||
PackageAmount = packageAmount
|
||||
};
|
||||
}
|
||||
|
||||
@@ -248,7 +249,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Services
|
||||
decimal profit = ToYuan(list.Sum(a => a.ProfitAmount));
|
||||
decimal buyerPaymentAmount = ToYuan(list.Sum(a => a.TotalPurchase));
|
||||
int orderCount = list.Sum(a => a.OrderCount);
|
||||
|
||||
decimal packageAmount = ToYuan(list.Sum(a => a.PackageAmount));
|
||||
return new ShopStatisticsItem
|
||||
{
|
||||
ShopName = ResolveShopName(shopId),
|
||||
@@ -260,7 +261,8 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Services
|
||||
PlatformFeeTotal = ToYuan(list.Sum(a => a.PlatformFee)),
|
||||
Commission = 0m, // 新接口无“达人佣金”字段,保留占位
|
||||
AvgOrderAmount = orderCount == 0 ? 0m : salesAmount / orderCount,
|
||||
AverageProfitRate = buyerPaymentAmount == 0m ? 0m : profit / buyerPaymentAmount * 100m
|
||||
AverageProfitRate = buyerPaymentAmount == 0m ? 0m : profit / buyerPaymentAmount * 100m,
|
||||
PackageAmount = packageAmount
|
||||
};
|
||||
}
|
||||
|
||||
@@ -385,7 +387,13 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Services
|
||||
// 顺序请求:签名中的 time/code 由当前时间生成,并发请求有被判重复签名的风险。
|
||||
var summaryStats = await RequestStatsAsync(query, ShopStatsGroupType.Summary);
|
||||
var trend = await RequestTrendAsync(query);
|
||||
|
||||
if (query.StatPackages)
|
||||
{
|
||||
foreach (var item in summaryStats)
|
||||
{
|
||||
item.ProfitAmount -= item.PackageAmount;
|
||||
}
|
||||
}
|
||||
return new ShopRevenueStatisticsResult
|
||||
{
|
||||
Summary = ShopStatsAggregator.GetSummary(summaryStats),
|
||||
@@ -399,7 +407,13 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Services
|
||||
{
|
||||
// 按天/周/月粒度取数;接口不返回整段汇总,卡片由返回的周期记录在客户端合计
|
||||
var stats = await RequestStatsAsync(query, ToGroupType(periodType));
|
||||
|
||||
if (query.StatPackages)
|
||||
{
|
||||
foreach (var item in stats)
|
||||
{
|
||||
item.ProfitAmount -= item.PackageAmount;
|
||||
}
|
||||
}
|
||||
return new ShopPeriodStatisticsResult
|
||||
{
|
||||
Summary = ShopStatsAggregator.GetSummary(stats),
|
||||
|
||||
Reference in new issue
Block a user