From 342a66f9408dbf81a86486d162564a1524255e57 Mon Sep 17 00:00:00 2001 From: chfei Date: Fri, 7 Aug 2026 23:13:02 +0800 Subject: [PATCH] =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E7=BB=9F=E8=AE=A1=20?= =?UTF-8?q?=E6=80=BB=E9=94=80=E5=94=AE=E9=A2=9D=E7=9A=84=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E8=AE=A1=E7=AE=97bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/ShopRevenueStatisticsService.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/29WxOrderWpf/Ctrls/Statistics/Services/ShopRevenueStatisticsService.cs b/29WxOrderWpf/Ctrls/Statistics/Services/ShopRevenueStatisticsService.cs index c0eba8a..f3569ff 100644 --- a/29WxOrderWpf/Ctrls/Statistics/Services/ShopRevenueStatisticsService.cs +++ b/29WxOrderWpf/Ctrls/Statistics/Services/ShopRevenueStatisticsService.cs @@ -112,20 +112,20 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Services var valid = list.Where(IsValidOrder).ToList(); var refunded = list.Where(IsRefunded).ToList(); - decimal salesAmount = list.Sum(r => (decimal)(r.OrderPrice)) / 100m; + decimal salesAmount = valid.Sum(r => (decimal)(r.OrderPrice)) / 100m;//有效订单总金额 decimal profit = valid.Concat(refunded).Sum(r => (decimal)(r.Profit)) / 100m; decimal refundAmount = refunded.Sum(r => (decimal)(r.OrderPrice)) / 100m; decimal platformFeeTotal = valid.Sum(r => (decimal)(r.PredictCommissionFee)) / 100m; decimal commission = valid.Sum(r => (decimal)(r.CommissionAmount)) / 100m; decimal purchaseAmount = valid.Sum(r => (decimal)(r.OutAmount)) / 100m; - decimal buyerPaymentAmount = list.Sum(r => (decimal)(r.OutAmount)) / 100m; //买手号付款金额(采购金额) + decimal buyerPaymentAmount = valid.Sum(r => (decimal)(r.OutAmount)) / 100m; //买手号付款金额(采购金额) decimal buyerRefundAmount = refunded.Sum(r => (decimal)(r.OutAmount)) / 100m; //买手号退款金额(采购退款金额) decimal buyerRefundSuccessedAmount = refunded.Where(IsBuyerRefundSuccessful).Sum(r => (decimal)(r.BuyerRefundAmount)) / 100m; //买手号退款成功金额 int validOrderCount = valid.Select(r => r.OrderId).Distinct().Count(); // 总订单数(退款率分母)= 已付款订单 + 已退款订单,不含未付款的 10/250 - int totalOrderCount = list.Where(r => IsPaidOrder(r) || IsRefunded(r)).Select(r => r.OrderId).Distinct().Count(); + int totalOrderCount = list.Count(); int refundOrderCount = refunded.Select(r => r.OrderId).Distinct().Count(); return new ShopRevenueSummary @@ -205,7 +205,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Services int orderCount = valid.Select(r => r.OrderId).Distinct().Count(); decimal profit = valid.Concat(refunded).Sum(r => (decimal)(r.Profit)) / 100m; //与 GetSummary 一致:有效+退款订单利润 decimal purchaseAmount = valid.Sum(r => (decimal)(r.OutAmount)) / 100m; //与 GetSummary 一致:买手付款金额(采购金额) - decimal buyerPaymentAmount = list.Sum(r => (decimal)(r.OutAmount)) / 100m; //买手号付款金额(采购金额) + decimal buyerPaymentAmount = valid.Sum(r => (decimal)(r.OutAmount)) / 100m; //买手号付款金额(采购金额) return new ShopStatisticsItem { ShopName = string.IsNullOrEmpty(g.Key) ? "未知店铺" : g.Key, @@ -242,7 +242,7 @@ namespace _29WxOrderWpf.Ctrls.Statistics.Services decimal profit = valid.Concat(refunded).Sum(r => (decimal)(r.Profit)) / 100m; //与 GetSummary 一致:有效+退款订单利润 decimal purchaseAmount = valid.Sum(r => (decimal)(r.OutAmount)) / 100m; //与 GetSummary 一致:买手付款金额(采购金额) int orderCount = valid.Select(r => r.OrderId).Distinct().Count(); - decimal buyerPaymentAmount = list.Sum(r => (decimal)(r.OutAmount)) / 100m; //买手号付款金额(采购金额) + decimal buyerPaymentAmount = valid.Sum(r => (decimal)(r.OutAmount)) / 100m; //买手号付款金额(采购金额) return new ShopPeriodStatisticsItem {