From 11fcf9502a82e09bb885a8d2d1be013f28f221af Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 2 Apr 2026 18:55:49 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=91=E5=B8=81=E4=BB=A3=E7=90=86=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E5=9B=BD=E5=AE=B6=E5=8C=BA=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 9d96215b2c62f0103384643fbb4c7b5cc398d31c) --- .../user/impl/UserFreightBalanceRestServiceImpl.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 17b84f02..72df16f2 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 @@ -71,10 +71,15 @@ public class UserFreightBalanceRestServiceImpl implements UserFreightBalanceRest } // 根据国家编码过滤数据 - List filteredRecords = freightPageResult.getRecords().stream() + List records = freightPageResult.getRecords().stream() .filter(dto -> isCountrySupported(userProfile.getId(), dto.getUserId())) - .collect(Collectors.toList()); - + .toList(); + List userProfiles = userProfileGateway.listByUserIds(records.stream().map(UserFreightBalanceDTO::getUserId).collect(Collectors.toSet())); + Set countryCodeSet = userProfiles.stream().map(UserProfile::getCountryCode).collect(Collectors.toSet()); + List filteredRecords = records.stream() + .filter(e -> countryCodeSet.contains(userProfile.getCountryCode())) + .collect(Collectors.toList()); + if (filteredRecords.isEmpty()) { return PageResult.newPageResult(20); }