1
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 26s
Docker Build & Deploy / Deploy to Production (push) Successful in 13s
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 26s
Docker Build & Deploy / Deploy to Production (push) Successful in 13s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
This commit is contained in:
@@ -18,8 +18,6 @@ public interface IBudgetService
|
|||||||
|
|
||||||
Task<string?> GetArchiveSummaryAsync(int year, int month);
|
Task<string?> GetArchiveSummaryAsync(int year, int month);
|
||||||
|
|
||||||
Task UpdateArchiveSummaryAsync(int year, int month, string? summary);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取指定周期的存款预算信息
|
/// 获取指定周期的存款预算信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -153,21 +151,6 @@ public class BudgetService(
|
|||||||
return archive?.Summary;
|
return archive?.Summary;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task UpdateArchiveSummaryAsync(int year, int month, string? summary)
|
|
||||||
{
|
|
||||||
var archive = await budgetArchiveRepository.GetArchiveAsync(year, month);
|
|
||||||
if (archive == null)
|
|
||||||
{
|
|
||||||
await ArchiveBudgetsAsync(year, month);
|
|
||||||
archive = await budgetArchiveRepository.GetArchiveAsync(year, month);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (archive != null)
|
|
||||||
{
|
|
||||||
archive.Summary = summary;
|
|
||||||
await budgetArchiveRepository.UpdateAsync(archive);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task<BudgetStatsDto> CalculateCategoryStatsAsync(
|
private async Task<BudgetStatsDto> CalculateCategoryStatsAsync(
|
||||||
List<BudgetResult> budgets,
|
List<BudgetResult> budgets,
|
||||||
@@ -436,6 +419,11 @@ public class BudgetService(
|
|||||||
content: htmlReport,
|
content: htmlReport,
|
||||||
type: MessageType.Html,
|
type: MessageType.Html,
|
||||||
url: "/balance?tab=message");
|
url: "/balance?tab=message");
|
||||||
|
|
||||||
|
// 同时保存到归档总结
|
||||||
|
var first = archives.First();
|
||||||
|
first.Summary = htmlReport;
|
||||||
|
await budgetArchiveRepository.UpdateAsync(first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<template>
|
<!-- eslint-disable vue/no-v-html -->
|
||||||
|
<template>
|
||||||
<div class="page-container-flex">
|
<div class="page-container-flex">
|
||||||
<van-nav-bar title="预算管理" placeholder>
|
<van-nav-bar title="预算管理" placeholder>
|
||||||
<template #right>
|
<template #right>
|
||||||
@@ -15,7 +16,7 @@
|
|||||||
/>
|
/>
|
||||||
<van-icon
|
<van-icon
|
||||||
v-if="isArchive"
|
v-if="isArchive"
|
||||||
name="records-o"
|
name="comment-o"
|
||||||
size="20"
|
size="20"
|
||||||
title="已归档月份总结"
|
title="已归档月份总结"
|
||||||
style="margin-right: 12px"
|
style="margin-right: 12px"
|
||||||
@@ -245,31 +246,14 @@
|
|||||||
v-model="showSummaryPopup"
|
v-model="showSummaryPopup"
|
||||||
title="月份归档总结"
|
title="月份归档总结"
|
||||||
:subtitle="`${selectedDate.getFullYear()}年${selectedDate.getMonth() + 1}月`"
|
:subtitle="`${selectedDate.getFullYear()}年${selectedDate.getMonth() + 1}月`"
|
||||||
height="50%"
|
height="70%"
|
||||||
>
|
>
|
||||||
<div style="padding: 16px;">
|
<div style="padding: 16px;">
|
||||||
<van-field
|
<div
|
||||||
v-model="archiveSummary"
|
class="rich-html-content"
|
||||||
rows="6"
|
v-html="archiveSummary || '<p style=\'text-align:center;color:var(--van-text-color-3)\'>暂无总结</p>'"
|
||||||
autosize
|
|
||||||
label="总结语"
|
|
||||||
type="textarea"
|
|
||||||
:placeholder="`请输入${selectedDate.getFullYear()}年${selectedDate.getMonth() + 1}月预算执行的总结或感悟...`"
|
|
||||||
show-word-limit
|
|
||||||
maxlength="500"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<template #footer>
|
|
||||||
<van-button
|
|
||||||
block
|
|
||||||
round
|
|
||||||
type="primary"
|
|
||||||
:loading="isSavingSummary"
|
|
||||||
@click="handleSaveSummary"
|
|
||||||
>
|
|
||||||
保存总结
|
|
||||||
</van-button>
|
|
||||||
</template>
|
|
||||||
</PopupContainer>
|
</PopupContainer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -524,26 +508,6 @@ const showArchiveSummary = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSaveSummary = async () => {
|
|
||||||
if (isSavingSummary.value) return
|
|
||||||
isSavingSummary.value = true
|
|
||||||
try {
|
|
||||||
const res = await updateArchiveSummary({
|
|
||||||
referenceDate: selectedDate.value.toISOString(),
|
|
||||||
summary: archiveSummary.value
|
|
||||||
})
|
|
||||||
if (res.success) {
|
|
||||||
showToast('已保存')
|
|
||||||
showSummaryPopup.value = false
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.error('保存总结失败', err)
|
|
||||||
showToast('保存总结失败')
|
|
||||||
} finally {
|
|
||||||
isSavingSummary.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleDelete = async (budget) => {
|
const handleDelete = async (budget) => {
|
||||||
try {
|
try {
|
||||||
await showConfirmDialog({
|
await showConfirmDialog({
|
||||||
|
|||||||
@@ -84,24 +84,6 @@ public class BudgetController(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 更新归档总结
|
|
||||||
/// </summary>
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<BaseResponse> UpdateArchiveSummaryAsync([FromBody] UpdateArchiveSummaryDto dto)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await budgetService.UpdateArchiveSummaryAsync(dto.ReferenceDate.Year, dto.ReferenceDate.Month, dto.Summary);
|
|
||||||
return BaseResponse.Done();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
logger.LogError(ex, "更新归档总结失败");
|
|
||||||
return $"更新归档总结失败: {ex.Message}".Fail();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取指定周期的存款预算信息
|
/// 获取指定周期的存款预算信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user