From 5fc01100f9155bceead23a3cc04b8a33970e90cf Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期六, 12 十月 2024 16:16:56 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderEvaluateServiceImpl.java | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderEvaluateServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderEvaluateServiceImpl.java index 9ae877c..eef9031 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderEvaluateServiceImpl.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TOrderEvaluateServiceImpl.java @@ -120,12 +120,18 @@ List<Integer> tagIds = tagList.stream().map(TEvaluationTagVO::getId).collect(Collectors.toList()); // 统计标签使用数量 List<TEvaluationTagVO> counts = orderEvaluateTagMapper.getCountByTagIds(tagIds); + List<Integer> ids = counts.stream().map(TEvaluationTagVO::getId).collect(Collectors.toList()); tagList.forEach(tag -> { - counts.forEach(count -> { - if (tag.getId().equals(count.getId())) { - tag.setTagCount(count.getTagCount()); - } - }); + if(ids.contains(tag.getId())){ + counts.forEach(count -> { + if (tag.getId().equals(count.getId())) { + tag.setTagCount(count.getTagCount()); + } + }); + }else{ + tag.setTagCount(0); + } + }); tagList = tagList.stream().sorted(Comparator.comparing(TEvaluationTagVO::getTagCount).reversed()).collect(Collectors.toList()); // 统计有图,好评,中差评数量 -- Gitblit v1.7.1