From 3c0b4f59584999259e5c12a6c216b80566a9f6c1 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 20 Nov 2025 18:12:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=A9=E6=88=B4=E9=81=93=E5=85=B7=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/UserRunProfileServiceImpl.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/service/user/profile/impl/UserRunProfileServiceImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/service/user/profile/impl/UserRunProfileServiceImpl.java index dc5f9e37..d3893803 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/service/user/profile/impl/UserRunProfileServiceImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/service/user/profile/impl/UserRunProfileServiceImpl.java @@ -5,6 +5,7 @@ import com.mongodb.BasicDBObject; import com.red.circle.other.infra.database.mongo.entity.user.profile.UserRunProfile; import com.red.circle.other.infra.database.mongo.entity.user.profile.UserSpecialId; import com.red.circle.other.infra.database.mongo.service.user.profile.UserRunProfileService; +import com.red.circle.other.inner.enums.material.BadgeConfigTypeEnum; import com.red.circle.other.inner.model.dto.material.UseBadgeDTO; import com.red.circle.other.inner.model.dto.material.UsePropsDTO; import com.red.circle.tool.core.collection.CollectionUtils; @@ -320,7 +321,9 @@ public class UserRunProfileServiceImpl implements UserRunProfileService { mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(id)), new Update() .set("updateTime", TimestampUtils.now()) - .set("wearBadge", filterBadgeNotAvailable(wearBadges)), + .set("wearBadge", filterBadgeNotAvailable(wearBadges)) + .set("wearHonor", filterHonorNotAvailable(wearBadges)) + , UserRunProfile.class); } @@ -360,12 +363,24 @@ public class UserRunProfileServiceImpl implements UserRunProfileService { private List filterBadgeNotAvailable(List wearBadge) { if (CollectionUtils.isNotEmpty(wearBadge)) { - return wearBadge.stream().filter(badge -> checkAvailable(badge.getExpireTime())) + return wearBadge.stream() + .filter(badge -> !BadgeConfigTypeEnum.isHonorType(badge.getType())) + .filter(badge -> checkAvailable(badge.getExpireTime())) .collect(Collectors.toList()); } return wearBadge; } + private List filterHonorNotAvailable(List wearBadge) { + if (CollectionUtils.isNotEmpty(wearBadge)) { + return wearBadge.stream() + .filter(badge -> BadgeConfigTypeEnum.isHonorType(badge.getType())) + .filter(badge -> checkAvailable(badge.getExpireTime())) + .collect(Collectors.toList()); + } + return wearBadge; + } + @Override public UserRunProfile getById(Long id) { return mongoTemplate.findOne(Query.query(Criteria.where("id").is(id)), UserRunProfile.class);