|
@ -23,10 +23,7 @@ import org.dromara.system.domain.AiLabel; |
|
|
import org.dromara.system.mapper.AiLabelMapper; |
|
|
import org.dromara.system.mapper.AiLabelMapper; |
|
|
import org.dromara.system.service.IAiLabelService; |
|
|
import org.dromara.system.service.IAiLabelService; |
|
|
|
|
|
|
|
|
import java.util.Comparator; |
|
|
import java.util.*; |
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
import java.util.Collection; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -184,8 +181,17 @@ public class AiLabelServiceImpl implements IAiLabelService { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public List<AiLabelVo> selectLabelList() { |
|
|
public List<AiLabelVo> selectLabelList() { |
|
|
|
|
|
List<SysPostVo> sysPostVos = sysPostService.selectPostAll(); |
|
|
|
|
|
|
|
|
|
|
|
List<Long> postIdList = Optional.ofNullable(sysPostVos) |
|
|
|
|
|
.orElse(Collections.emptyList()) |
|
|
|
|
|
.stream() |
|
|
|
|
|
.map(SysPostVo::getPostId) |
|
|
|
|
|
.distinct() |
|
|
|
|
|
.toList(); |
|
|
|
|
|
|
|
|
List<AiLabelPostVo> aiLabelList = aiLabelPostService.getAiLabelList(); |
|
|
List<AiLabelPostVo> aiLabelList = aiLabelPostService.getAiLabelList(); |
|
|
return aiLabelList.stream() |
|
|
return aiLabelList.stream().filter(p-> postIdList.contains(p.getPostId())) |
|
|
.map(aiLabel -> { |
|
|
.map(aiLabel -> { |
|
|
AiLabelVo aiLabelVo = new AiLabelVo(); |
|
|
AiLabelVo aiLabelVo = new AiLabelVo(); |
|
|
aiLabelVo.setLabelId(aiLabel.getLabelId()); |
|
|
aiLabelVo.setLabelId(aiLabel.getLabelId()); |
|
|