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
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:
@@ -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
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user