fix(authorization): 修复下级团队认种数重复减去自己认种数的 BUG
问题描述: - 社区/省公司/市公司的初始考核判断错误 - 原因: referral-service 返回的 totalTeamPlantingCount 已经是"下级团队认种数"(不含自己) 但 authorization-service 又减了一次 selfPlantingCount,导致结果偏小 示例: - D25121400003: 自己认种12棵,下级认种14棵 - 修复前: subordinateTeamPlantingCount = 14 - 12 = 2 (错误!) - 修复后: subordinateTeamPlantingCount = 14 (正确) 影响范围: - 社区权益初始考核 (10棵门槛) - 省公司权益初始考核 - 市公司权益初始考核 (100棵门槛) - 所有使用 subordinateTeamPlantingCount 的业务逻辑 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
13d1bedb73
commit
ed47e7ab2d
|
|
@ -47,9 +47,12 @@ class TeamStatisticsAdapter implements TeamStatistics {
|
|||
private readonly provinceCityDistribution: Record<string, Record<string, number>> | null,
|
||||
) {}
|
||||
|
||||
/** 下级团队认种数(不包括自己) */
|
||||
/** 下级团队认种数(不包括自己)
|
||||
* 注意:referral-service 返回的 totalTeamPlantingCount 已经是"下级团队认种数",
|
||||
* 不包括自己的认种数,所以直接返回即可,不需要再减 selfPlantingCount
|
||||
*/
|
||||
get subordinateTeamPlantingCount(): number {
|
||||
return Math.max(0, this.totalTeamPlantingCount - this.selfPlantingCount);
|
||||
return this.totalTeamPlantingCount;
|
||||
}
|
||||
|
||||
getProvinceTeamCount(provinceCode: string): number {
|
||||
|
|
|
|||
Loading…
Reference in New Issue