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;