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) {