From eff6cf17d00aa23c629d4acfc9bf2ba6851cd07b Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Fri, 12 Sep 2025 19:26:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E6=9C=9F=E6=A0=BC=E5=BC=8F=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/activity/room/WeekKingQueenController.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/activity/room/WeekKingQueenController.java b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/activity/room/WeekKingQueenController.java index 9bf1177f..7d5800be 100644 --- a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/activity/room/WeekKingQueenController.java +++ b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/activity/room/WeekKingQueenController.java @@ -11,6 +11,8 @@ import com.red.circle.other.app.dto.clientobject.sys.ActivityConfigVO; import com.red.circle.other.app.dto.cmd.activity.WeekKingQueenRankingQueryCmd; import com.red.circle.other.app.service.activity.WeekKingQueenService; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; import java.util.*; import java.util.stream.Collectors; @@ -43,6 +45,8 @@ public class WeekKingQueenController extends BaseController { private final WeekKingQueenService weekKingQueenService; private final WeekKingQueenCountService weekKingQueenCountService; private final UserProfileGateway userProfileGateway; + private static final DateTimeFormatter oldFormatter = DateTimeFormatter.ofPattern("yyyyMMdd"); + private static final DateTimeFormatter newFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); /** * 排行榜. @@ -75,12 +79,15 @@ public class WeekKingQueenController extends BaseController { List result = new ArrayList<>(); for (Map.Entry> entry : groupMap.entrySet()) { WeekKingQueenGroupVO vo = new WeekKingQueenGroupVO(); - vo.setGroup(entry.getKey()); + + // 转换 group 格式 + vo.setGroup(LocalDate.parse(entry.getKey(), oldFormatter).format(newFormatter)); // 遍历同一周的数据,把 WEALTH / CHARM 分开 for (WeekKingQueenCount e : entry.getValue()) { WeekKingQueenHistoryVO historyVO = new WeekKingQueenHistoryVO(); BeanUtils.copyProperties(e, historyVO); + historyVO.setGroup(LocalDate.parse(entry.getKey(), oldFormatter).format(newFormatter)); UserProfile userProfile = profileMap.get(e.getUserId()); if (userProfile != null) {