From 76f5cbdae649884d7f8ccc27c89fa89990081601 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 11 Dec 2025 21:10:02 +0800 Subject: [PATCH] =?UTF-8?q?cpValue=20=E7=9B=B8=E5=90=8C=E6=97=B6=E6=8C=89?= =?UTF-8?q?=E7=85=A7=E6=97=B6=E9=97=B4=E6=AD=A3=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../other/inner/model/dto/user/CpSimpleUserProfileCO.java | 3 +++ .../rds/service/user/user/impl/CpRelationshipServiceImpl.java | 2 ++ .../gateway/user/UserRunProfileTransportGatewayImpl.java | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/user/CpSimpleUserProfileCO.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/user/CpSimpleUserProfileCO.java index 46a1cb9c..d87cd603 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/user/CpSimpleUserProfileCO.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/user/CpSimpleUserProfileCO.java @@ -8,6 +8,7 @@ import lombok.experimental.Accessors; import java.io.Serial; import java.io.Serializable; import java.math.BigDecimal; +import java.sql.Timestamp; /** * CP简化用户资料 @@ -77,4 +78,6 @@ public class CpSimpleUserProfileCO implements Serializable { */ private String firstDay; + private Timestamp createTime; + } diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/impl/CpRelationshipServiceImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/impl/CpRelationshipServiceImpl.java index d9a4e096..59e1fef5 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/impl/CpRelationshipServiceImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/user/user/impl/CpRelationshipServiceImpl.java @@ -2,6 +2,7 @@ package com.red.circle.other.infra.database.rds.service.user.user.impl; import com.red.circle.framework.mybatis.constant.PageConstant; +import com.red.circle.framework.mybatis.entity.TimestampBaseEntity; import com.red.circle.framework.mybatis.service.impl.BaseServiceImpl; import com.red.circle.tool.core.collection.CollectionUtils; import com.red.circle.tool.core.date.LocalDateUtils; @@ -85,6 +86,7 @@ public class CpRelationshipServiceImpl extends return query() .eq(CpRelationship::getUserId, userId) .eq(CpRelationship::getStatus, CpRelationshipStatus.NORMAL.name()) + .orderByAsc(TimestampBaseEntity::getCreateTime) .list(); } diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java index 8cdc9768..b0e844a1 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/UserRunProfileTransportGatewayImpl.java @@ -368,11 +368,13 @@ public class UserRunProfileTransportGatewayImpl implements UserRunProfileTranspo .setCpUserAvatar(cpUser.getUserAvatar()) .setCpUserNickname(cpUser.getUserNickname()) .setCpValue(cpValue) + .setCreateTime(cpRelationship.getCreateTime()) .setDays(days) .setFirstDay(firstDay); }) .filter(Objects::nonNull) - .sorted(Comparator.comparing(CpSimpleUserProfileCO::getCpValue).reversed()) + .sorted(Comparator.comparing(CpSimpleUserProfileCO::getCpValue).reversed() + .thenComparing(CpSimpleUserProfileCO::getCreateTime)) .toList(); userRunProfile.setCpList(cpList);