fix
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 22s
Docker Build & Deploy / Deploy to Production (push) Successful in 6s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s

This commit is contained in:
SunCheng
2026-02-20 22:07:09 +08:00
parent 3c3172fc81
commit a7414c792e
11 changed files with 498 additions and 201 deletions

View File

@@ -224,7 +224,51 @@ public class BudgetApplication(
StartDate = startDate,
NoLimit = result.NoLimit,
IsMandatoryExpense = result.IsMandatoryExpense,
UsagePercentage = result.Limit > 0 ? result.Current / result.Limit * 100 : 0
UsagePercentage = result.Limit > 0 ? result.Current / result.Limit * 100 : 0,
Details = result.Details != null ? MapToSavingsDetailDto(result.Details) : null
};
}
/// <summary>
/// 映射存款明细数据到DTO
/// </summary>
private static SavingsDetailDto MapToSavingsDetailDto(Service.Budget.SavingsDetail details)
{
return new SavingsDetailDto
{
IncomeItems = details.IncomeItems.Select(item => new BudgetDetailItemDto
{
Id = item.Id,
Name = item.Name,
Type = item.Type,
BudgetLimit = item.BudgetLimit,
ActualAmount = item.ActualAmount,
EffectiveAmount = item.EffectiveAmount,
CalculationNote = item.CalculationNote,
IsOverBudget = item.IsOverBudget,
IsArchived = item.IsArchived,
ArchivedMonths = item.ArchivedMonths
}).ToList(),
ExpenseItems = details.ExpenseItems.Select(item => new BudgetDetailItemDto
{
Id = item.Id,
Name = item.Name,
Type = item.Type,
BudgetLimit = item.BudgetLimit,
ActualAmount = item.ActualAmount,
EffectiveAmount = item.EffectiveAmount,
CalculationNote = item.CalculationNote,
IsOverBudget = item.IsOverBudget,
IsArchived = item.IsArchived,
ArchivedMonths = item.ArchivedMonths
}).ToList(),
Summary = new SavingsCalculationSummaryDto
{
TotalIncomeBudget = details.Summary.TotalIncomeBudget,
TotalExpenseBudget = details.Summary.TotalExpenseBudget,
PlannedSavings = details.Summary.PlannedSavings,
CalculationFormula = details.Summary.CalculationFormula
}
};
}