From 0a3e88dc08f35654ffe020b51463e1f0e5dffd34 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 4 Dec 2025 10:46:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E8=A1=8C=E6=A6=9C=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/command/activity/query/RankingListQryExe.java | 9 +++++---- .../other/app/command/activity/query/UserRankQryExe.java | 5 +++-- .../app/convertor/user/RankingActivityConvertor.java | 3 ++- .../clientobject/activity/RankingActivityRecordCO.java | 3 +-- .../app/dto/clientobject/activity/UserRankInfoCO.java | 3 +-- 5 files changed, 12 insertions(+), 11 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 fe097857..7d8499be 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 @@ -16,6 +16,7 @@ import com.red.circle.other.infra.database.mongo.entity.activity.WeekKingQueenCo import com.red.circle.other.infra.gateway.RankingActivityGateway; 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; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -141,7 +142,7 @@ public class RankingListQryExe { } else { // 用户不在榜单中,显示为0 rankInfo.setRank(0); - rankInfo.setQuantity(0L); + rankInfo.setQuantity("0"); rankInfo.setIsRanked(false); } @@ -152,7 +153,7 @@ public class RankingListQryExe { cmd.getCycleKey() ); - userRecord.ifPresent(rankingActivityRecord -> rankInfo.setQuantity(rankingActivityRecord.getQuantity())); + userRecord.ifPresent(rankingActivityRecord -> rankInfo.setQuantity(NumUtils.formatLong(rankingActivityRecord.getQuantity()))); return rankInfo; @@ -184,7 +185,7 @@ public class RankingListQryExe { UserRankInfoCO rankInfo = new UserRankInfoCO(); rankInfo.setUserId(cmd.getReqUserId()); rankInfo.setRank(0); - rankInfo.setQuantity(0L); + rankInfo.setQuantity("0"); rankInfo.setIsRanked(false); return rankInfo; } @@ -204,7 +205,7 @@ public class RankingListQryExe { UserRankInfoCO rankInfo = new UserRankInfoCO(); rankInfo.setUserId(record.getUserId()); rankInfo.setRank(rank); - rankInfo.setQuantity(record.getQuantity()); + rankInfo.setQuantity(NumUtils.formatLong(record.getQuantity())); rankInfo.setIsRanked(rank <= cmd.getTopN()); return rankInfo; diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/UserRankQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/UserRankQryExe.java index a4985034..1286d4fc 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/UserRankQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/query/UserRankQryExe.java @@ -6,6 +6,7 @@ import com.red.circle.other.infra.database.mongo.entity.activity.RankingActivity import com.red.circle.other.infra.gateway.RankingActivityGateway; import com.red.circle.other.domain.ranking.RankingActivityType; import com.red.circle.other.domain.ranking.RankingCycleType; +import com.red.circle.tool.core.num.NumUtils; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -43,7 +44,7 @@ public class UserRankQryExe { if (userRecord.isEmpty()) { // 用户未参与 rankInfo.setRank(0); - rankInfo.setQuantity(0L); + rankInfo.setQuantity("0"); rankInfo.setIsRanked(false); return rankInfo; } @@ -61,7 +62,7 @@ public class UserRankQryExe { ); rankInfo.setRank(rank); - rankInfo.setQuantity(record.getQuantity()); + rankInfo.setQuantity(NumUtils.formatLong(record.getQuantity())); rankInfo.setIsRanked(rank > 0); return rankInfo; diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/user/RankingActivityConvertor.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/user/RankingActivityConvertor.java index 9c746d30..83ecffca 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/user/RankingActivityConvertor.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/user/RankingActivityConvertor.java @@ -2,6 +2,7 @@ package com.red.circle.other.app.convertor.user; import com.red.circle.other.app.dto.clientobject.activity.RankingActivityRecordCO; import com.red.circle.other.infra.database.mongo.entity.activity.RankingActivityRecord; +import com.red.circle.tool.core.num.NumUtils; import org.springframework.stereotype.Component; /** @@ -21,7 +22,7 @@ public class RankingActivityConvertor { RankingActivityRecordCO co = new RankingActivityRecordCO(); co.setUserId(record.getUserId()); co.setUserSex(record.getUserSex()); - co.setQuantity(record.getQuantity()); + co.setQuantity(NumUtils.formatLong(record.getQuantity())); co.setExtData(record.getExtData()); // 设置活动类型信息 diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/activity/RankingActivityRecordCO.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/activity/RankingActivityRecordCO.java index 30164b4e..80cd31b4 100644 --- a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/activity/RankingActivityRecordCO.java +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/activity/RankingActivityRecordCO.java @@ -50,8 +50,7 @@ public class RankingActivityRecordCO implements Serializable { /** * 统计数值 */ - @JsonSerialize(using = ToStringSerializer.class) - private Long quantity; + private String quantity; /** * 活动类型编码 diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/activity/UserRankInfoCO.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/activity/UserRankInfoCO.java index dbb2be71..f1c76f4b 100644 --- a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/activity/UserRankInfoCO.java +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/activity/UserRankInfoCO.java @@ -44,8 +44,7 @@ public class UserRankInfoCO implements Serializable { /** * 统计数值 */ - @JsonSerialize(using = ToStringSerializer.class) - private Long quantity; + private String quantity; /** * 是否已上榜