|
@@ -104,9 +104,21 @@ public class ActivityInviteService implements ActivityInviteGate {
|
|
|
* <p>
|
|
* <p>
|
|
|
* 场景:被邀请人已通过入驻审核,后补填邀请码 → 邀请人应获得奖励。
|
|
* 场景:被邀请人已通过入驻审核,后补填邀请码 → 邀请人应获得奖励。
|
|
|
* 活动未开启则不发放。幂等由 uk_invitee 唯一索引保障。
|
|
* 活动未开启则不发放。幂等由 uk_invitee 唯一索引保障。
|
|
|
|
|
+ * <p>
|
|
|
|
|
+ * 重要:必须验证入驻状态为 APPROVED,避免仅因高级会员身份而误发奖励。
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
public void grantRewardForApprovedUser(Long inviterId, Long inviteeId) {
|
|
public void grantRewardForApprovedUser(Long inviterId, Long inviteeId) {
|
|
|
|
|
+ // 验证入驻状态:必须是 APPROVED 才发放奖励
|
|
|
|
|
+ Long approvedCount = businessLicenseMapper.selectCount(
|
|
|
|
|
+ new LambdaQueryWrapper<BusinessLicense>()
|
|
|
|
|
+ .eq(BusinessLicense::getUserId, inviteeId)
|
|
|
|
|
+ .eq(BusinessLicense::getReviewStatus, LicenseStatus.APPROVED.name()));
|
|
|
|
|
+ if (approvedCount == null || approvedCount == 0) {
|
|
|
|
|
+ log.warn("被邀请人入驻状态非APPROVED,跳过补填发奖: inviteeId={}", inviteeId);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
ActivityInviteConfig config = getConfig();
|
|
ActivityInviteConfig config = getConfig();
|
|
|
if (!isActive(config)) {
|
|
if (!isActive(config)) {
|
|
|
log.info("邀请有礼活动未开启,跳过已入驻补填发奖: inviter={}, invitee={}", inviterId, inviteeId);
|
|
log.info("邀请有礼活动未开启,跳过已入驻补填发奖: inviter={}, invitee={}", inviterId, inviteeId);
|
|
@@ -238,6 +250,8 @@ public class ActivityInviteService implements ActivityInviteGate {
|
|
|
* 入驻审核通过后发放邀请人奖励(依赖活动配置,不再区分触发模式)。
|
|
* 入驻审核通过后发放邀请人奖励(依赖活动配置,不再区分触发模式)。
|
|
|
* <p>
|
|
* <p>
|
|
|
* 活动未开启则不发放。幂等由 uk_invitee 唯一索引保障。
|
|
* 活动未开启则不发放。幂等由 uk_invitee 唯一索引保障。
|
|
|
|
|
+ * <p>
|
|
|
|
|
+ * 重要:必须二次验证入驻状态为 APPROVED,避免仅因高级会员身份而误发奖励。
|
|
|
*/
|
|
*/
|
|
|
@Transactional
|
|
@Transactional
|
|
|
public void onLicenseApproved(Long userId) {
|
|
public void onLicenseApproved(Long userId) {
|
|
@@ -247,6 +261,16 @@ public class ActivityInviteService implements ActivityInviteGate {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 二次验证入驻状态:必须是 APPROVED 才发放奖励
|
|
|
|
|
+ Long approvedCount = businessLicenseMapper.selectCount(
|
|
|
|
|
+ new LambdaQueryWrapper<BusinessLicense>()
|
|
|
|
|
+ .eq(BusinessLicense::getUserId, userId)
|
|
|
|
|
+ .eq(BusinessLicense::getReviewStatus, LicenseStatus.APPROVED.name()));
|
|
|
|
|
+ if (approvedCount == null || approvedCount == 0) {
|
|
|
|
|
+ log.warn("被邀请人入驻状态非APPROVED,跳过邀请奖励: inviteeId={}", userId);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
ActivityInviteConfig config = getConfig();
|
|
ActivityInviteConfig config = getConfig();
|
|
|
if (!isActive(config)) {
|
|
if (!isActive(config)) {
|
|
|
log.info("邀请有礼活动未开启,跳过入驻发奖: invitee={}", userId);
|
|
log.info("邀请有礼活动未开启,跳过入驻发奖: invitee={}", userId);
|