1
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 25s
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 25s
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:
@@ -48,8 +48,8 @@ public class BudgetService(
|
|||||||
|
|
||||||
if (archive != null)
|
if (archive != null)
|
||||||
{
|
{
|
||||||
var periodRange = GetPeriodRange(DateTime.Now, BudgetPeriodType.Month, referenceDate);
|
var (start, end) = GetPeriodRange(DateTime.Now, BudgetPeriodType.Month, referenceDate);
|
||||||
return archive.Content.Select(c => new BudgetResult
|
return [.. archive.Content.Select(c => new BudgetResult
|
||||||
{
|
{
|
||||||
Name = c.Name,
|
Name = c.Name,
|
||||||
Type = c.Type,
|
Type = c.Type,
|
||||||
@@ -60,9 +60,9 @@ public class BudgetService(
|
|||||||
NoLimit = c.NoLimit,
|
NoLimit = c.NoLimit,
|
||||||
IsMandatoryExpense = c.IsMandatoryExpense,
|
IsMandatoryExpense = c.IsMandatoryExpense,
|
||||||
Description = c.Description,
|
Description = c.Description,
|
||||||
PeriodStart = periodRange.start,
|
PeriodStart = start,
|
||||||
PeriodEnd = periodRange.end,
|
PeriodEnd = end,
|
||||||
}).ToList();
|
})];
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.LogWarning("获取预算列表时发现归档数据缺失,Year: {Year}, Month: {Month}", year, month);
|
logger.LogWarning("获取预算列表时发现归档数据缺失,Year: {Year}, Month: {Month}", year, month);
|
||||||
@@ -87,7 +87,13 @@ public class BudgetService(
|
|||||||
referenceDate,
|
referenceDate,
|
||||||
budgets));
|
budgets));
|
||||||
|
|
||||||
return dtos.Where(dto => dto != null).Cast<BudgetResult>().ToList();
|
dtos = dtos
|
||||||
|
.OrderByDescending(x => x.IsMandatoryExpense)
|
||||||
|
.ThenBy(x => x.Type)
|
||||||
|
.ThenByDescending(x => x.Current)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
return [.. dtos.Where(dto => dto != null).Cast<BudgetResult>()];
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<BudgetResult?> GetSavingsBudgetAsync(int year, int month, BudgetPeriodType type)
|
public async Task<BudgetResult?> GetSavingsBudgetAsync(int year, int month, BudgetPeriodType type)
|
||||||
@@ -299,7 +305,7 @@ public class BudgetService(
|
|||||||
for (int i = 1; i <= 12; i++)
|
for (int i = 1; i <= 12; i++)
|
||||||
{
|
{
|
||||||
var currentMonthDate = new DateTime(startDate.Year, i, 1);
|
var currentMonthDate = new DateTime(startDate.Year, i, 1);
|
||||||
|
|
||||||
if (currentMonthDate.Year > now.Year || (currentMonthDate.Year == now.Year && i > now.Month))
|
if (currentMonthDate.Year > now.Year || (currentMonthDate.Year == now.Year && i > now.Month))
|
||||||
{
|
{
|
||||||
result.Trend.Add(null);
|
result.Trend.Add(null);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ public class BudgetController(
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
return (await budgetService.GetListAsync(referenceDate))
|
return (await budgetService.GetListAsync(referenceDate))
|
||||||
|
.OrderByDescending(b => b.IsMandatoryExpense)
|
||||||
.OrderBy(b => b.Category)
|
.OrderBy(b => b.Category)
|
||||||
.ThenBy(b => b.Type)
|
.ThenBy(b => b.Type)
|
||||||
.ThenByDescending(b => b.Limit > 0 ? b.Current / b.Limit : 0)
|
.ThenByDescending(b => b.Limit > 0 ? b.Current / b.Limit : 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user