fix(pre-planting): 预种省/市区域 API 传 treeCount=0,不计入考核
预种 1 份 = 1/5 棵树,如果将 portionCount 作为 treeCount 传给 authorization-service,会导致省/市公司月度考核进度被多算 5 倍。 修正:传 treeCount=0,预种阶段不累计考核棵数。 等 5 份合成 1 棵完整树后,由合成流程负责累计 1 棵的考核进度。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1c71cda2ec
commit
545e897c1f
|
|
@ -196,9 +196,9 @@ export class PrePlantingRewardService {
|
||||||
] = await Promise.all([
|
] = await Promise.all([
|
||||||
this.referralClient.getReferralChain(accountSequence),
|
this.referralClient.getReferralChain(accountSequence),
|
||||||
this.authorizationClient.getCommunityDistribution(accountSequence),
|
this.authorizationClient.getCommunityDistribution(accountSequence),
|
||||||
this.authorizationClient.getProvinceAreaDistribution(provinceCode, portionCount),
|
this.authorizationClient.getProvinceAreaDistribution(provinceCode),
|
||||||
this.authorizationClient.getProvinceTeamDistribution(accountSequence),
|
this.authorizationClient.getProvinceTeamDistribution(accountSequence),
|
||||||
this.authorizationClient.getCityAreaDistribution(cityCode, portionCount),
|
this.authorizationClient.getCityAreaDistribution(cityCode),
|
||||||
this.authorizationClient.getCityTeamDistribution(accountSequence),
|
this.authorizationClient.getCityTeamDistribution(accountSequence),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,19 +65,18 @@ export class PrePlantingAuthorizationClient {
|
||||||
* 省区域权益分配对象
|
* 省区域权益分配对象
|
||||||
*
|
*
|
||||||
* [2026-02-28] 修复:
|
* [2026-02-28] 修复:
|
||||||
* 1. 传 treeCount 参数(authorization-service 必需,用于省公司月度考核累计)
|
* 1. 传 treeCount=0(预种阶段不计入省公司月度考核,等合成1棵树后再累计)
|
||||||
* 2. 正确解析 { distributions: [{accountSequence, ...}] } 返回格式(之前错误地期望 { accountSequence })
|
* 2. 正确解析 { distributions: [{accountSequence, ...}] } 返回格式(之前错误地期望 { accountSequence })
|
||||||
* 3. fallback 路径添加 padStart(6,'0'),确保生成 7 位标准格式(如 9440000 而非 944)
|
* 3. fallback 路径添加 padStart(6,'0'),确保生成 7 位标准格式(如 9440000 而非 944)
|
||||||
*/
|
*/
|
||||||
async getProvinceAreaDistribution(
|
async getProvinceAreaDistribution(
|
||||||
provinceCode: string,
|
provinceCode: string,
|
||||||
portionCount: number = 1,
|
|
||||||
): Promise<RewardDistributionResult> {
|
): Promise<RewardDistributionResult> {
|
||||||
try {
|
try {
|
||||||
const response = await firstValueFrom(
|
const response = await firstValueFrom(
|
||||||
this.httpService.get<{ distributions: AreaDistributionItem[] }>(
|
this.httpService.get<{ distributions: AreaDistributionItem[] }>(
|
||||||
`${this.baseUrl}/internal/authorization/province-area-reward-distribution`,
|
`${this.baseUrl}/internal/authorization/province-area-reward-distribution`,
|
||||||
{ params: { provinceCode, treeCount: portionCount } },
|
{ params: { provinceCode, treeCount: 0 } },
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -141,19 +140,18 @@ export class PrePlantingAuthorizationClient {
|
||||||
* 市区域权益分配对象
|
* 市区域权益分配对象
|
||||||
*
|
*
|
||||||
* [2026-02-28] 修复:与省区域同样的三个问题
|
* [2026-02-28] 修复:与省区域同样的三个问题
|
||||||
* 1. 传 treeCount 参数
|
* 1. 传 treeCount=0(预种阶段不计入市公司月度考核,等合成1棵树后再累计)
|
||||||
* 2. 正确解析 { distributions: [...] } 返回格式
|
* 2. 正确解析 { distributions: [...] } 返回格式
|
||||||
* 3. fallback 路径添加 padStart(6,'0'),确保生成 7 位标准格式(如 8440100 而非 84401)
|
* 3. fallback 路径添加 padStart(6,'0'),确保生成 7 位标准格式(如 8440100 而非 84401)
|
||||||
*/
|
*/
|
||||||
async getCityAreaDistribution(
|
async getCityAreaDistribution(
|
||||||
cityCode: string,
|
cityCode: string,
|
||||||
portionCount: number = 1,
|
|
||||||
): Promise<RewardDistributionResult> {
|
): Promise<RewardDistributionResult> {
|
||||||
try {
|
try {
|
||||||
const response = await firstValueFrom(
|
const response = await firstValueFrom(
|
||||||
this.httpService.get<{ distributions: AreaDistributionItem[] }>(
|
this.httpService.get<{ distributions: AreaDistributionItem[] }>(
|
||||||
`${this.baseUrl}/internal/authorization/city-area-reward-distribution`,
|
`${this.baseUrl}/internal/authorization/city-area-reward-distribution`,
|
||||||
{ params: { cityCode, treeCount: portionCount } },
|
{ params: { cityCode, treeCount: 0 } },
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue