fix(contribution): 在算力明细事件中添加 regionCode 字段

修改 SystemContributionRecordCreatedEvent 事件,将 systemAccountType
拆分为 accountType 和 regionCode 两个独立字段,以便 mining-admin-service
正确同步按省市细分的算力明细记录

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-21 01:25:46 -08:00
parent 6de365e707
commit 27a045e082
2 changed files with 5 additions and 2 deletions

View File

@ -378,6 +378,7 @@ export class ContributionCalculationService {
const recordEvent = new SystemContributionRecordCreatedEvent(
savedRecord.id,
sys.accountType,
sys.regionCode, // 传递区域代码
sourceAdoptionId,
sourceAccountSequence,
sys.rate.value.toNumber(),

View File

@ -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,