From 27a045e08217ec771b012f6df68f581fdee1abed Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 21 Jan 2026 01:25:46 -0800 Subject: [PATCH] =?UTF-8?q?fix(contribution):=20=E5=9C=A8=E7=AE=97?= =?UTF-8?q?=E5=8A=9B=E6=98=8E=E7=BB=86=E4=BA=8B=E4=BB=B6=E4=B8=AD=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20regionCode=20=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改 SystemContributionRecordCreatedEvent 事件,将 systemAccountType 拆分为 accountType 和 regionCode 两个独立字段,以便 mining-admin-service 正确同步按省市细分的算力明细记录 Co-Authored-By: Claude Opus 4.5 --- .../services/contribution-calculation.service.ts | 1 + .../events/system-contribution-record-created.event.ts | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/services/contribution-service/src/application/services/contribution-calculation.service.ts b/backend/services/contribution-service/src/application/services/contribution-calculation.service.ts index 665a9582..568af828 100644 --- a/backend/services/contribution-service/src/application/services/contribution-calculation.service.ts +++ b/backend/services/contribution-service/src/application/services/contribution-calculation.service.ts @@ -378,6 +378,7 @@ export class ContributionCalculationService { const recordEvent = new SystemContributionRecordCreatedEvent( savedRecord.id, sys.accountType, + sys.regionCode, // 传递区域代码 sourceAdoptionId, sourceAccountSequence, sys.rate.value.toNumber(), diff --git a/backend/services/contribution-service/src/domain/events/system-contribution-record-created.event.ts b/backend/services/contribution-service/src/domain/events/system-contribution-record-created.event.ts index 58100ce4..6ca1b87b 100644 --- a/backend/services/contribution-service/src/domain/events/system-contribution-record-created.event.ts +++ b/backend/services/contribution-service/src/domain/events/system-contribution-record-created.event.ts @@ -8,7 +8,8 @@ export class SystemContributionRecordCreatedEvent { constructor( public readonly recordId: bigint, // 明细记录ID - public readonly systemAccountType: string, // 系统账户类型(组合键) + public readonly accountType: string, // 系统账户类型(OPERATION/PROVINCE/CITY/HEADQUARTERS) + public readonly regionCode: string | null, // 区域代码(省/市代码,如 440000, 440100) public readonly sourceAdoptionId: bigint, // 来源认种ID public readonly sourceAccountSequence: string, // 认种人账号 public readonly distributionRate: number, // 分配比例 @@ -22,7 +23,8 @@ export class SystemContributionRecordCreatedEvent { return { eventType: SystemContributionRecordCreatedEvent.EVENT_TYPE, recordId: this.recordId.toString(), - systemAccountType: this.systemAccountType, + accountType: this.accountType, + regionCode: this.regionCode, sourceAdoptionId: this.sourceAdoptionId.toString(), sourceAccountSequence: this.sourceAccountSequence, distributionRate: this.distributionRate,