From d268ecdf6b69cd1fec197951d7a914e93ddbdd5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E8=87=AA=E8=BE=BE?= <980324341@qq.com> Date: Thu, 22 Oct 2026 10:28:12 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E9=80=9A=E7=9F=A5):=20task=5Ffailed=20?= =?UTF-8?q?=E5=B8=A6=20ref=5Fjson=20=E5=AE=9A=E4=BD=8D=E9=94=9A=E7=82=B9?= =?UTF-8?q?=EF=BC=8C=E6=98=8E=E7=BB=86=E5=8F=AF=E7=82=B9=E7=9B=B4=E8=BE=BE?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 用户原话「都没体现哪个任务id/店铺/用户,咋排查」:通知表只有 title/content, 失败任务又按「用户×模块×自然日」聚合成一条,明细被 5 个 taskNo 预览 + 512 字截断吃掉。 - V162 给 biz_user_notification 加 ref_json(TEXT,可重跑迁移,存量不回填) - 扫描器把桶内每个失败任务写成锚点(taskId/taskNo/moduleType/reason/updatedAt/ deviceId),上限 20 条;品牌任务无 task_no 用 # 兜底,保证至少一条可定位 - 详情接口回传 refs;同键刷新时锚点变化也更新,且不重新点亮已读 - 后台铃铛「展开明细」渲染成可点行,跳任务中心 ?taskNo= 自动开详情抽屉 - 新增判据 taskFailedAdminNotificationCarriesUidAndTaskNoAnchor:管理端正文必须含 uid、每个桶的 ref_json 至少一条非空 taskNo --- admin-frontend-vue/src/api/notifications.ts | 13 +++ .../src/components/NotificationBell.vue | 32 ++++++++ .../src/layout/notification-bell-model.ts | 19 +++++ .../pages/task-center/TaskCenterBoardPage.vue | 15 +++- .../tests/baselines/source-pin-ledger.json | 4 +- .../tests/notification-bell.test.ts | 16 ++++ .../model/entity/UserNotificationEntity.java | 2 + .../model/vo/NotificationItemVo.java | 3 + .../model/vo/NotificationRefVo.java | 29 +++++++ .../service/NotificationDispatchService.java | 11 ++- .../service/NotificationScanScheduler.java | 56 ++++++++++--- .../service/NotificationService.java | 55 ++++++++++++- .../db/V162__notification_ref_json.sql | 51 ++++++++++++ .../NotificationDispatchServiceTest.java | 12 +-- .../NotificationScanSchedulerTest.java | 79 +++++++++++++++---- 15 files changed, 361 insertions(+), 36 deletions(-) create mode 100644 backend-java/src/main/java/com/nanri/aiimage/modules/notification/model/vo/NotificationRefVo.java create mode 100644 backend-java/src/main/resources/db/V162__notification_ref_json.sql diff --git a/admin-frontend-vue/src/api/notifications.ts b/admin-frontend-vue/src/api/notifications.ts index 6b52333ba..c05670dcd 100644 --- a/admin-frontend-vue/src/api/notifications.ts +++ b/admin-frontend-vue/src/api/notifications.ts @@ -13,6 +13,17 @@ export const ADMIN_NOTIFICATION_SEVERITY_LABELS: Readonly。任务详情接口按它查。 */ + taskNo: string + moduleType?: string | null + reason?: string | null + updatedAt?: string | null + deviceId?: string | null +} + /** 单条通知(后台铃铛)。 */ export interface AdminNotificationItem { id: number @@ -22,6 +33,8 @@ export interface AdminNotificationItem { severity?: string title: string content: string + /** 可点的定位锚点;旧后端/历史行没有这一列时为空。 */ + refs?: AdminNotificationRef[] | null read: boolean readAt: string | null createdAt: string | null diff --git a/admin-frontend-vue/src/components/NotificationBell.vue b/admin-frontend-vue/src/components/NotificationBell.vue index b9f9ac1e9..238be7423 100644 --- a/admin-frontend-vue/src/components/NotificationBell.vue +++ b/admin-frontend-vue/src/components/NotificationBell.vue @@ -140,6 +140,18 @@ {{ formatTime(item.createdAt) }}
{{ item.content }}
+
+ +
  • 另有 {{ detailTotal - details.length }} 条未列出,可缩小日期范围后查看 @@ -175,14 +187,17 @@