自动佩戴修复

This commit is contained in:
tianfeng 2025-12-18 20:07:42 +08:00
parent a8061d4a10
commit bae054b23c
2 changed files with 10 additions and 4 deletions

View File

@ -110,7 +110,7 @@ public class RankingRewardGrantCmdExe {
for (RankingRewardSnapshot.RewardItem reward : rewards) {
try {
if ("PROPS".equals(reward.getType())) {
grantProps(userId, reward);
// grantProps(userId, reward);
} else if ("BADGE".equals(reward.getType())) {
grantBadge(userId, reward);
}
@ -180,7 +180,7 @@ public class RankingRewardGrantCmdExe {
BadgeOperateEvent event = new BadgeOperateEvent()
.setUserId(userId)
.setBadgeId(Long.valueOf(reward.getContent()))
.setDays(1L)
.setDays(7L)
.setOperationType(BadgeOperateEvent.OperationType.WEAR.name());
userMqMessageService.sendBadgeOperateEvent(event);
@ -219,7 +219,7 @@ public class RankingRewardGrantCmdExe {
}
List<RankingRewardSnapshot.RewardItem> rewards = new ArrayList<>();
int index = rank - 1;
if (CollectionUtils.isNotEmpty(badgeList) && index < badgeList.size()) {

View File

@ -12,6 +12,8 @@ import com.red.circle.mq.rocket.business.streams.BadgeOperateSink;
import com.red.circle.other.app.util.DistributedLockUtil;
import com.red.circle.other.domain.gateway.user.UserProfileGateway;
import com.red.circle.other.domain.model.user.UserProfile;
import com.red.circle.other.infra.common.props.UserBadgeCommon;
import com.red.circle.other.infra.database.mongo.service.user.profile.UserRunProfileService;
import com.red.circle.other.infra.database.rds.entity.badge.BadgeBackpack;
import com.red.circle.other.infra.database.rds.entity.badge.BadgeConfig;
import com.red.circle.other.infra.database.rds.service.badge.BadgeBackpackService;
@ -40,6 +42,8 @@ public class BadgeOperateListener implements MessageListener {
private final BadgeConfigService badgeConfigService;
private final BadgeBackpackService badgeBackpackService;
private final MessageEventProcess messageEventProcess;
private final UserRunProfileService userRunProfileService;
private final UserBadgeCommon userBadgeCommon;
private final UserProfileGateway userProfileGateway;
private final DistributedLockUtil distributedLockUtil;
@ -139,7 +143,9 @@ public class BadgeOperateListener implements MessageListener {
}
Set<Long> saveWear = wearBadge.stream().map(UserUseBadgeDTO::getId)
.filter(id -> !badgeId.equals(id)).collect(Collectors.toSet());
userProfileGateway.updateUserWearBadge(userId, userProfile.getOriginSys(), saveWear);
userRunProfileService.updateUserWearBadgesOverlay(userId,
userBadgeCommon.listUseBadge(userId, userProfile.getSysOriginChild(), saveWear)
);
}
private BadgeBackpack buildSaveUserBadgeBackpack(Long badgeId, Long userId, Long days) {