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( const recordEvent = new SystemContributionRecordCreatedEvent(
savedRecord.id, savedRecord.id,
sys.accountType, sys.accountType,
sys.regionCode, // 传递区域代码
sourceAdoptionId, sourceAdoptionId,
sourceAccountSequence, sourceAccountSequence,
sys.rate.value.toNumber(), sys.rate.value.toNumber(),

View File

@ -8,7 +8,8 @@ export class SystemContributionRecordCreatedEvent {
constructor( constructor(
public readonly recordId: bigint, // 明细记录ID 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 sourceAdoptionId: bigint, // 来源认种ID
public readonly sourceAccountSequence: string, // 认种人账号 public readonly sourceAccountSequence: string, // 认种人账号
public readonly distributionRate: number, // 分配比例 public readonly distributionRate: number, // 分配比例
@ -22,7 +23,8 @@ export class SystemContributionRecordCreatedEvent {
return { return {
eventType: SystemContributionRecordCreatedEvent.EVENT_TYPE, eventType: SystemContributionRecordCreatedEvent.EVENT_TYPE,
recordId: this.recordId.toString(), recordId: this.recordId.toString(),
systemAccountType: this.systemAccountType, accountType: this.accountType,
regionCode: this.regionCode,
sourceAdoptionId: this.sourceAdoptionId.toString(), sourceAdoptionId: this.sourceAdoptionId.toString(),
sourceAccountSequence: this.sourceAccountSequence, sourceAccountSequence: this.sourceAccountSequence,
distributionRate: this.distributionRate, distributionRate: this.distributionRate,