From 598237a5817c09f0c7cfce257ccf6d48cdf628bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=9D=BE?= <8605635+zhang3064194730@user.noreply.gitee.com> Date: Sat, 15 Mar 2025 14:20:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 ++++ .../czg/service/product/service/impl/UProductServiceImpl.java | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 5c8565db..924580e2 100644 --- a/.gitignore +++ b/.gitignore @@ -56,3 +56,7 @@ build/ /cash-service/account-service/src/main/resources/rebel.xml /cash-api/account-server/src/main/resources/rebel.xml /logs/ +/cash-api/account-server/src/main/resources/application-zs.yml +/cash-api/order-server/src/main/resources/application-zs.yml +/cash-api/product-server/src/main/resources/application-zs.yml +/cash-api/system-server/src/main/resources/application-zs.yml diff --git a/cash-service/product-service/src/main/java/com/czg/service/product/service/impl/UProductServiceImpl.java b/cash-service/product-service/src/main/java/com/czg/service/product/service/impl/UProductServiceImpl.java index 6e747347..74e29b6e 100644 --- a/cash-service/product-service/src/main/java/com/czg/service/product/service/impl/UProductServiceImpl.java +++ b/cash-service/product-service/src/main/java/com/czg/service/product/service/impl/UProductServiceImpl.java @@ -81,7 +81,7 @@ public class UProductServiceImpl extends ServiceImpl imp }); Map productKv = productAllList.stream().collect(Collectors.toMap(ShopProductVo::getId, shopProductVo -> shopProductVo)); List prodGroupIdList = groupList.stream().map(ShopGroupProductVo::getId).distinct().toList(); - List relationList = prodGroupRelationMapper.selectListByQueryAs(query().select(ProdGroupRelation::getProdGroupId, ProdGroupRelation::getProductId).in(ProdGroupRelation::getProdGroupId, prodGroupIdList), ProdGroupRelationDTO.class); + List relationList = prodGroupIdList.isEmpty() ? new ArrayList<>() : prodGroupRelationMapper.selectListByQueryAs(query().select(ProdGroupRelation::getProdGroupId, ProdGroupRelation::getProductId).in(ProdGroupRelation::getProdGroupId, prodGroupIdList), ProdGroupRelationDTO.class); Map> relationKv = relationList.stream().collect(Collectors.groupingBy(ProdGroupRelationDTO::getProdGroupId, Collectors.mapping(ProdGroupRelationDTO::getProductId, Collectors.toList()))); for (ShopGroupProductVo group : groupList) { List productIdList = relationKv.get(group.getId()); @@ -167,4 +167,4 @@ public class UProductServiceImpl extends ServiceImpl imp return dayOfWeek.getDisplayName(TextStyle.FULL, Locale.ENGLISH); } -} \ No newline at end of file +}