diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/impl/UserFreightBalanceRestServiceImpl.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/impl/UserFreightBalanceRestServiceImpl.java index 6a753006..17b84f02 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/impl/UserFreightBalanceRestServiceImpl.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/user/impl/UserFreightBalanceRestServiceImpl.java @@ -114,7 +114,7 @@ public class UserFreightBalanceRestServiceImpl implements UserFreightBalanceRest // 构建国家代码到国旗URL的映射 Map countryFlagMap = buildCountryFlagMap(appCountryCode); - return pagedResult.convert(dto -> { + PageResult result = pagedResult.convert(dto -> { UserFreightBalanceCO co = userFreightBalanceConvertor.toUserFreightBalanceCO(dto); co.setBalance(dto.getBalance()); co.setIsFollow(userProfileGateway.checkFollow(appExtCommand.getReqUserId(), dto.getUserId())); @@ -142,6 +142,9 @@ public class UserFreightBalanceRestServiceImpl implements UserFreightBalanceRest } return co; }); + + result.setRecords(result.getRecords().stream().sorted(Comparator.comparing(UserFreightBalanceCO::getTransactionCount).reversed()).collect(Collectors.toList())); + return result; } /**