From 023d71ac339f5be41cbed2ecfd6f99aa3de5403b Mon Sep 17 00:00:00 2001 From: hailin Date: Thu, 26 Feb 2026 01:44:02 -0800 Subject: [PATCH] =?UTF-8?q?feat(authorization):=20=E6=8F=90=E9=AB=98?= =?UTF-8?q?=E7=9C=81=E5=9B=A2=E9=98=9F=E6=9D=83=E7=9B=8A=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E6=BF=80=E6=B4=BB=E9=97=A8=E6=A7=9B=E8=87=B33000=E6=A3=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 省团队(AUTH_PROVINCE_COMPANY)初始激活门槛: 500棵 → 3000棵 当前各角色初始激活门槛汇总: - 社区(COMMUNITY): 100棵(上次已调整: 10→100) - 市团队(AUTH_CITY_COMPANY): 500棵(上次已调整: 100→500) - 省团队(AUTH_PROVINCE_COMPANY): 3000棵(本次调整: 500→3000) - 市区域(CITY_COMPANY): 10000棵(未变) - 省区域(PROVINCE_COMPANY): 50000棵(未变) 变更说明: - 仅调整初始激活门槛,月度阶梯考核目标不变 - 已激活用户不受影响(祖父条款),仅对新申请的授权生效 - 数据库已有记录的 initialTargetTreeCount 保持旧值不变 - 需在服务器重新部署 authorization-service 后生效 修改文件: - assessment-config.vo.ts: 核心门槛配置 500→3000 - authorization-application.service.ts: AUTH_PROVINCE_TARGET 常量及注释同步 - authorization.dto.ts: DTO 注释同步 - authorization.response.ts: ApiProperty 注释同步 - DEVELOPMENT_GUIDE.md: 文档说明同步 Co-Authored-By: Claude Opus 4.6 --- backend/services/authorization-service/DEVELOPMENT_GUIDE.md | 4 ++-- .../src/api/dto/response/authorization.response.ts | 2 +- .../src/application/dto/authorization.dto.ts | 2 +- .../application/services/authorization-application.service.ts | 4 ++-- .../src/domain/value-objects/assessment-config.vo.ts | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/services/authorization-service/DEVELOPMENT_GUIDE.md b/backend/services/authorization-service/DEVELOPMENT_GUIDE.md index a2216724..df0b9103 100644 --- a/backend/services/authorization-service/DEVELOPMENT_GUIDE.md +++ b/backend/services/authorization-service/DEVELOPMENT_GUIDE.md @@ -37,8 +37,8 @@ Authorization Service 是 RWA 榴莲皇后平台的授权管理微服务,负 - 省公司团队权益:20 USDT/棵 初始考核: -- 伞下团队认种总量达到500棵后权益自动生效 -- 考核的500棵权益归上级省公司所有(无上级则归总部社区账户) +- 伞下团队认种总量达到3000棵后权益自动生效 +- 考核的3000棵权益归上级省公司所有(无上级则归总部社区账户) ``` ### 2. 授权市公司功能 diff --git a/backend/services/authorization-service/src/api/dto/response/authorization.response.ts b/backend/services/authorization-service/src/api/dto/response/authorization.response.ts index 5fee76b6..506b2348 100644 --- a/backend/services/authorization-service/src/api/dto/response/authorization.response.ts +++ b/backend/services/authorization-service/src/api/dto/response/authorization.response.ts @@ -35,7 +35,7 @@ export class AuthorizationResponse { @ApiProperty({ description: '是否豁免占比考核' }) exemptFromPercentageCheck: boolean - @ApiProperty({ description: '初始考核目标(社区10,市100,省500)' }) + @ApiProperty({ description: '初始考核目标(社区100,市500,省3000)' }) initialTargetTreeCount: number @ApiProperty({ description: '当前团队认种数量' }) diff --git a/backend/services/authorization-service/src/application/dto/authorization.dto.ts b/backend/services/authorization-service/src/application/dto/authorization.dto.ts index 152fd48e..51a91ff6 100644 --- a/backend/services/authorization-service/src/application/dto/authorization.dto.ts +++ b/backend/services/authorization-service/src/application/dto/authorization.dto.ts @@ -13,7 +13,7 @@ export interface AuthorizationDTO { requireLocalPercentage: number exemptFromPercentageCheck: boolean // 考核进度字段 - initialTargetTreeCount: number // 初始考核目标(社区10,市100,省500) + initialTargetTreeCount: number // 初始考核目标(社区100,市500,省3000) currentTreeCount: number // 当前团队认种数量 monthlyTargetTreeCount: number // 月度考核目标(社区固定10) createdAt: Date diff --git a/backend/services/authorization-service/src/application/services/authorization-application.service.ts b/backend/services/authorization-service/src/application/services/authorization-application.service.ts index 174b82b9..7b4f4e09 100644 --- a/backend/services/authorization-service/src/application/services/authorization-application.service.ts +++ b/backend/services/authorization-service/src/application/services/authorization-application.service.ts @@ -1669,7 +1669,7 @@ export class AuthorizationApplicationService { for (const authProvince of expiredAuthProvinces) { const accountSequence = authProvince.userId.accountSequence - const AUTH_PROVINCE_TARGET = 500 // 省团队授权固定目标:500棵 + const AUTH_PROVINCE_TARGET = 3000 // 省团队授权固定目标:3000棵 // 使用 getTreesForAssessment 获取正确的考核数据 const treesForAssessment = authProvince.getTreesForAssessment(now) @@ -2382,7 +2382,7 @@ export class AuthorizationApplicationService { const rawSubordinateCount = stats?.subordinateTeamPlantingCount ?? 0 // 修复竞态条件:减去本次认种数量来还原"认种前"的下级团队数 const currentTeamCount = Math.max(0, rawSubordinateCount - treeCount) - const initialTarget = nearestAuthProvince.getInitialTarget() // 500棵 + const initialTarget = nearestAuthProvince.getInitialTarget() // 3000棵 this.logger.debug( `[getProvinceTeamRewardDistribution] rawSubordinateCount=${rawSubordinateCount}, treeCount=${treeCount}, currentTeamCount(before)=${currentTeamCount}`, diff --git a/backend/services/authorization-service/src/domain/value-objects/assessment-config.vo.ts b/backend/services/authorization-service/src/domain/value-objects/assessment-config.vo.ts index d25321e2..e319dc7d 100644 --- a/backend/services/authorization-service/src/domain/value-objects/assessment-config.vo.ts +++ b/backend/services/authorization-service/src/domain/value-objects/assessment-config.vo.ts @@ -11,7 +11,7 @@ export class AssessmentConfig { } static forAuthProvince(): AssessmentConfig { - return new AssessmentConfig(500, MonthlyTargetType.LADDER) + return new AssessmentConfig(3000, MonthlyTargetType.LADDER) } static forProvince(): AssessmentConfig {