From 8b80e455247f385903da783aff4d0eebcaeff317 Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 5 Jan 2026 19:55:23 -0800 Subject: [PATCH] =?UTF-8?q?fix(authorization):=20=E7=81=AB=E6=9F=B4?= =?UTF-8?q?=E4=BA=BA=E6=8E=92=E5=90=8D=E8=BF=87=E6=BB=A4=E5=B7=B2=E6=92=A4?= =?UTF-8?q?=E9=94=80=E6=8E=88=E6=9D=83=E7=9A=84=E8=80=83=E6=A0=B8=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - findRankingsByMonthAndRegion 和 findRankingsByMonthAndRoleType 增加过滤条件 - 排除 authorization.status = 'REVOKED' 的记录 - 解决同一用户因有多条授权记录(含已撤销)而重复显示的问题 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../repositories/monthly-assessment.repository.impl.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/services/authorization-service/src/infrastructure/persistence/repositories/monthly-assessment.repository.impl.ts b/backend/services/authorization-service/src/infrastructure/persistence/repositories/monthly-assessment.repository.impl.ts index 62a7e21d..058a9ac3 100644 --- a/backend/services/authorization-service/src/infrastructure/persistence/repositories/monthly-assessment.repository.impl.ts +++ b/backend/services/authorization-service/src/infrastructure/persistence/repositories/monthly-assessment.repository.impl.ts @@ -190,6 +190,10 @@ export class MonthlyAssessmentRepositoryImpl implements IMonthlyAssessmentReposi assessmentMonth: month.value, roleType: roleType, regionCode: regionCode.value, + // 过滤掉已撤销授权的考核记录 + authorization: { + status: { not: 'REVOKED' }, + }, }, orderBy: [{ exceedRatio: 'desc' }, { completedAt: 'asc' }], }) @@ -204,6 +208,10 @@ export class MonthlyAssessmentRepositoryImpl implements IMonthlyAssessmentReposi where: { assessmentMonth: month.value, roleType: roleType, + // 过滤掉已撤销授权的考核记录 + authorization: { + status: { not: 'REVOKED' }, + }, }, orderBy: [{ exceedRatio: 'desc' }, { completedAt: 'asc' }], })