From b60178b596318cb90d439358d9066ce423ce968d Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Tue, 12 May 2026 10:36:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8B=8B=E7=AB=A0=E6=9F=A5=E8=AF=A2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enums/material/BadgeConfigTypeEnum.java | 7 ++++++- .../material/query/UserBadgeTableQryExe.java | 3 +-- .../badge/impl/BadgeConfigServiceImpl.java | 16 +++++++++++----- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/enums/material/BadgeConfigTypeEnum.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/enums/material/BadgeConfigTypeEnum.java index 91555b1b..97db7143 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/enums/material/BadgeConfigTypeEnum.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/enums/material/BadgeConfigTypeEnum.java @@ -42,7 +42,12 @@ public enum BadgeConfigTypeEnum { /** * 家族徽章. */ - FAMILY; + FAMILY, + + /** + * 活动 成就 管理员 + */ + ALL; public boolean eq(String name) { return Objects.equals(this.name(), name); diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/material/query/UserBadgeTableQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/material/query/UserBadgeTableQryExe.java index 39b2d361..a97ad03c 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/material/query/UserBadgeTableQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/material/query/UserBadgeTableQryExe.java @@ -45,8 +45,7 @@ public class UserBadgeTableQryExe { public List execute(UserBadgeQueryCmd cmd) { List badgeConfigs = badgeConfigService - .listBadgeConfig(Objects.isNull(cmd.getType()) - ? BadgeConfigTypeEnum.ACHIEVEMENT : cmd.getType()); + .listBadgeConfig(cmd.getType()); if (CollectionUtils.isEmpty(badgeConfigs)) { return Lists.newArrayList(); diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/badge/impl/BadgeConfigServiceImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/badge/impl/BadgeConfigServiceImpl.java index 32cfd3c6..76ca90d6 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/badge/impl/BadgeConfigServiceImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/badge/impl/BadgeConfigServiceImpl.java @@ -14,11 +14,8 @@ import com.red.circle.other.inner.model.cmd.sys.GiveBadgeConfigQryCmd; import com.red.circle.other.inner.model.cmd.sys.SysBadgeConfigQryCmd; import com.red.circle.tool.core.collection.CollectionUtils; import com.red.circle.tool.core.text.StringUtils; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; + +import java.util.*; import java.util.stream.Collectors; import org.springframework.stereotype.Service; @@ -97,6 +94,15 @@ public class BadgeConfigServiceImpl extends BaseServiceImpl listBadgeConfig(BadgeConfigTypeEnum type) { + if (type == BadgeConfigTypeEnum.ALL) { + return query() + .in(BadgeConfig::getType, Arrays.asList(BadgeConfigTypeEnum.ACTIVITY, BadgeConfigTypeEnum.ACHIEVEMENT, BadgeConfigTypeEnum.ADMINISTRATOR)) + .eq(BadgeConfig::getDel, Boolean.FALSE) + .orderByAsc(BadgeConfig::getBadgeLevel) + .last(PageConstant.formatLimit(300)) + .list(); + } + return query().eq(BadgeConfig::getType, type) .eq(BadgeConfig::getDel, Boolean.FALSE) .orderByAsc(BadgeConfig::getBadgeLevel)