From 04d3b818a04dc711ac1153402cb900c6d43ac571 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Mon, 22 Dec 2025 15:28:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=96=B0=E5=A2=9E=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E6=9F=A5=E8=AF=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../command/activity/query/RankingListQryExe.java | 9 +++++++++ .../activity/query/WeekKingQueenActivityExe.java | 2 +- .../service/sys/impl/ActivityConfigServiceImpl.java | 12 ++++++++++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/RankingListQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/RankingListQryExe.java index 7d8499be..e0a17b31 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/RankingListQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/RankingListQryExe.java @@ -1,5 +1,6 @@ package com.red.circle.other.app.command.activity.query; +import com.red.circle.framework.core.asserts.ResponseAssert; import com.red.circle.other.app.convertor.user.RankingActivityConvertor; import com.red.circle.other.app.convertor.user.UserProfileAppConvertor; import com.red.circle.other.app.dto.clientobject.activity.RankingActivityRecordCO; @@ -14,6 +15,8 @@ import com.red.circle.other.domain.ranking.RankingDimension; import com.red.circle.other.infra.database.mongo.entity.activity.RankingActivityRecord; import com.red.circle.other.infra.database.mongo.entity.activity.WeekKingQueenCount; import com.red.circle.other.infra.gateway.RankingActivityGateway; +import com.red.circle.other.inner.endpoint.sys.SysActivityConfigClient; +import com.red.circle.other.inner.model.dto.sys.ActivityConfigDTO; import com.red.circle.other.inner.model.dto.user.UserProfileDTO; import com.red.circle.tool.core.date.ZonedDateTimeAsiaRiyadhUtils; import com.red.circle.tool.core.num.NumUtils; @@ -42,12 +45,18 @@ public class RankingListQryExe { private final RankingActivityConvertor convertor; private final UserProfileGateway userProfileGateway; private final UserProfileAppConvertor userProfileAppConvertor; + private final SysActivityConfigClient sysActivityConfigClient; public RankingListCO execute(RankingListQueryCmd cmd) { // 获取枚举 RankingActivityType activityType = RankingActivityType.getByCode(cmd.getActivityType()); RankingCycleType cycleType = cmd.getCycleType() != null ? RankingCycleType.getByCode(cmd.getCycleType()) : RankingCycleType.WEEKLY; + ActivityConfigDTO activityConfigDTO = ResponseAssert.requiredSuccess(sysActivityConfigClient.effectiveActivityByTemplate(-1L, activityType.name())); + if (activityConfigDTO != null && cycleType == RankingCycleType.WEEKLY && activityConfigDTO.status() == 2) { + cmd.setCycleKey( ZonedDateTimeAsiaRiyadhUtils.getLastWeekMonday().format(DateTimeFormatter.ofPattern("yyyyMMdd")) ); + } + // 查询排行榜列表 List records = rankingActivityGateway.getRankingList( cmd.getReqSysOrigin().getOrigin(), diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/WeekKingQueenActivityExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/WeekKingQueenActivityExe.java index a3d6a3a6..a1db6c98 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/WeekKingQueenActivityExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/WeekKingQueenActivityExe.java @@ -43,7 +43,7 @@ public class WeekKingQueenActivityExe { query.setTemplateId(Long.parseLong(templateId)); } - ActivityConfigDTO activityConfigDTO = ResponseAssert.requiredSuccess(sysActivityConfigClient.effectiveActivityConf(query)); + ActivityConfigDTO activityConfigDTO = ResponseAssert.requiredSuccess(sysActivityConfigClient.effectiveActivityByTemplate(query.getTemplateId(), "")); if (activityConfigDTO == null) { return null; diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/service/sys/impl/ActivityConfigServiceImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/service/sys/impl/ActivityConfigServiceImpl.java index c4e2e2c1..d05c1799 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/service/sys/impl/ActivityConfigServiceImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/service/sys/impl/ActivityConfigServiceImpl.java @@ -240,9 +240,17 @@ public class ActivityConfigServiceImpl implements ActivityConfigService { } public ActivityConfig getShowcaseActivityConf(Long templateId, String activityType) { + if (activityType.isBlank() && (templateId == null || templateId <= 0)) { + return null; + } + Criteria criteria = Criteria.where("showcase").is(true); - criteria.and("templateId").is(templateId); - criteria.and("activityType").is(activityType); + if (templateId != null && templateId > 0) { + criteria.and("templateId").is(templateId); + } + if (!activityType.isBlank()) { + criteria.and("activityType").is(activityType); + } return mongoTemplate.findOne(Query.query(criteria) .with(Sort.by(Sort.Order.desc("id")))