From dcb80d9b8531e05aa6e5eb0fdf39aa89f3f509fd Mon Sep 17 00:00:00 2001 From: claw_bot Date: Tue, 10 Mar 2026 10:18:23 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=80=BB=E8=B5=84=E4=BA=A7?= =?UTF-8?q?=E6=8D=A2=E7=AE=97=E6=97=A5=E5=BF=97=EF=BC=8C=E6=96=B9=E4=BE=BF?= =?UTF-8?q?=E6=8E=92=E6=9F=A5=E5=B8=81=E7=A7=8D=E8=BD=AC=E6=8D=A2=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AssetManager.Services/PortfolioService.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/AssetManager.Services/PortfolioService.cs b/AssetManager.Services/PortfolioService.cs index 95f553f..05ecfca 100644 --- a/AssetManager.Services/PortfolioService.cs +++ b/AssetManager.Services/PortfolioService.cs @@ -199,6 +199,7 @@ public class PortfolioService : IPortfolioService } string targetCurrency = user.DefaultCurrency ?? "CNY"; + _logger.LogInformation("用户 {UserId} 默认本位币: {Currency}", userId, targetCurrency); decimal totalValueInTargetCurrency = 0; decimal totalCostInTargetCurrency = 0; decimal totalTodayProfitInTargetCurrency = 0; @@ -247,6 +248,10 @@ public class PortfolioService : IPortfolioService decimal currentInTarget = await _exchangeRateService.ConvertAmountAsync(currentPositionValue, pos.Currency, targetCurrency); decimal costInTarget = await _exchangeRateService.ConvertAmountAsync(costPositionValue, pos.Currency, targetCurrency); decimal todayProfitInTarget = await _exchangeRateService.ConvertAmountAsync(todayProfit, pos.Currency, targetCurrency); + + _logger.LogInformation("标的 {StockCode} 换算: {Amount} {From} → {Converted} {To},汇率: {Rate}", + pos.StockCode, currentPositionValue, pos.Currency, currentInTarget, targetCurrency, + currentPositionValue > 0 ? currentInTarget / currentPositionValue : 0); totalValueInTargetCurrency += currentInTarget; totalCostInTargetCurrency += costInTarget;