From a5b41afa581e241597d7b5e0e5ea2a69ffc2a7b2 Mon Sep 17 00:00:00 2001 From: yangwei <867012372@qq.com> Date: Thu, 12 Jun 2025 17:36:57 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=E4=BF=AE=E5=A4=8D=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E6=AF=94=E5=AF=B9=E6=9F=A5=E8=AF=A2=E9=87=8D=E5=A4=8D=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/service/impl/AiLabelServiceImpl.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/dk-modules/system/src/main/java/org/dromara/system/service/impl/AiLabelServiceImpl.java b/dk-modules/system/src/main/java/org/dromara/system/service/impl/AiLabelServiceImpl.java index b42756c..749d1d9 100644 --- a/dk-modules/system/src/main/java/org/dromara/system/service/impl/AiLabelServiceImpl.java +++ b/dk-modules/system/src/main/java/org/dromara/system/service/impl/AiLabelServiceImpl.java @@ -23,10 +23,7 @@ import org.dromara.system.domain.AiLabel; import org.dromara.system.mapper.AiLabelMapper; import org.dromara.system.service.IAiLabelService; -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.Collection; +import java.util.*; import java.util.stream.Collectors; /** @@ -184,8 +181,17 @@ public class AiLabelServiceImpl implements IAiLabelService { @Override public List selectLabelList() { + List sysPostVos = sysPostService.selectPostAll(); + + List postIdList = Optional.ofNullable(sysPostVos) + .orElse(Collections.emptyList()) + .stream() + .map(SysPostVo::getPostId) + .distinct() + .toList(); + List aiLabelList = aiLabelPostService.getAiLabelList(); - return aiLabelList.stream() + return aiLabelList.stream().filter(p-> postIdList.contains(p.getPostId())) .map(aiLabel -> { AiLabelVo aiLabelVo = new AiLabelVo(); aiLabelVo.setLabelId(aiLabel.getLabelId());