|
@@ -93,6 +93,10 @@ public class CfCommissionService {
|
|
|
/** 团队分润池规则编码(cf_earn_rule.code,分润 v2 §3.1:成本 × T% 池内瓜分) */
|
|
/** 团队分润池规则编码(cf_earn_rule.code,分润 v2 §3.1:成本 × T% 池内瓜分) */
|
|
|
public static final String RULE_TEAM_POOL = "F03c";
|
|
public static final String RULE_TEAM_POOL = "F03c";
|
|
|
|
|
|
|
|
|
|
+ /** 存量重算补差 ref_type(F03 规则重定义,走 adjust 免三道闸) */
|
|
|
|
|
+ public static final String REF_TYPE_F03A_RECALC = "F03a_recalc";
|
|
|
|
|
+ public static final String REF_TYPE_F03B_RECALC = "F03b_recalc";
|
|
|
|
|
+
|
|
|
/** F03a 团队口径最大层级(§4.1.1:团队 8 层以内) */
|
|
/** F03a 团队口径最大层级(§4.1.1:团队 8 层以内) */
|
|
|
private static final int TEAM_DEPTH = 8;
|
|
private static final int TEAM_DEPTH = 8;
|
|
|
|
|
|
|
@@ -468,9 +472,10 @@ public class CfCommissionService {
|
|
|
if (buyerFamilyId != null && buyerFamilyId.equals(parent.getFamilyId())) {
|
|
if (buyerFamilyId != null && buyerFamilyId.equals(parent.getFamilyId())) {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- // 档位权重(与 F03a 直推档位同一口径:团队 8 层滚动一年 P 点 → rate_percent)
|
|
|
|
|
- int teamPp = cfReferralService.getTeamAnnualPpoints(parentId, TEAM_DEPTH);
|
|
|
|
|
- CfDirectSalesTier tier = cfReferralService.matchDirectSalesTier(teamPp);
|
|
|
|
|
|
|
+ // F03c 冻结口径(保持不变):旧8层等权团队P点 → 冻结快照表 rate_percent。
|
|
|
|
|
+ // 不受 F03a 新档位表/新业绩口径影响。
|
|
|
|
|
+ int teamPpLegacy = cfReferralService.getTeamAnnualPpointsLegacy(parentId, TEAM_DEPTH);
|
|
|
|
|
+ CfDirectSalesTier tier = cfReferralService.matchDirectSalesTierFromSnapshot(teamPpLegacy);
|
|
|
int weight = (tier == null || tier.getRatePercent() == null) ? 0 : tier.getRatePercent();
|
|
int weight = (tier == null || tier.getRatePercent() == null) ? 0 : tier.getRatePercent();
|
|
|
int layer = ref.getLevel() != null ? ref.getLevel() : candidates.size() + 1;
|
|
int layer = ref.getLevel() != null ? ref.getLevel() : candidates.size() + 1;
|
|
|
candidates.add(new TeamPoolCandidate(parentId, resolveMemberId(parentId), layer, weight));
|
|
candidates.add(new TeamPoolCandidate(parentId, resolveMemberId(parentId), layer, weight));
|
|
@@ -797,8 +802,9 @@ public class CfCommissionService {
|
|
|
private int salesRatePercent(Long referrerId, String ruleCode) {
|
|
private int salesRatePercent(Long referrerId, String ruleCode) {
|
|
|
int tierRate;
|
|
int tierRate;
|
|
|
if (RULE_DIRECT_SALES.equals(ruleCode)) {
|
|
if (RULE_DIRECT_SALES.equals(ruleCode)) {
|
|
|
- int teamAnnualPpoints = cfReferralService.getTeamAnnualPpoints(referrerId, TEAM_DEPTH);
|
|
|
|
|
- CfDirectSalesTier tier = cfReferralService.matchDirectSalesTier(teamAnnualPpoints);
|
|
|
|
|
|
|
+ // F03 规则重定义(2026-11-29):业绩=个人100%+团队逐层递减90%→0%(基于下线再销售P点)
|
|
|
|
|
+ int f03aPpoints = cfReferralService.getF03aTierPpoints(referrerId, null);
|
|
|
|
|
+ CfDirectSalesTier tier = cfReferralService.matchDirectSalesTier(f03aPpoints);
|
|
|
tierRate = (tier == null || tier.getRatePercent() == null) ? 0 : tier.getRatePercent();
|
|
tierRate = (tier == null || tier.getRatePercent() == null) ? 0 : tier.getRatePercent();
|
|
|
} else {
|
|
} else {
|
|
|
int selfAnnualPpoints = cfReferralService.getSelfAnnualPpoints(referrerId);
|
|
int selfAnnualPpoints = cfReferralService.getSelfAnnualPpoints(referrerId);
|