提交 a705b760 authored 作者: chaoyanjun's avatar chaoyanjun

--no commit message

上级 4435e9f1
......@@ -29,6 +29,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
......@@ -121,7 +122,7 @@ public class RecommendLabelRelationServiceImpl extends BaseServiceImpl<Recommend
recommendLabelRelation.setRecommendId(recommendId);
List<RecommendLabelRelation> voList = this.select(recommendLabelRelation);
if(voList != null && voList.size() > 0){
List<RecommendLabelRelation> list = voList.stream().limit(num).collect(Collectors.toList());
List<RecommendLabelRelation> list = voList.stream().sorted(Comparator.comparing(RecommendLabelRelation :: getSort)).limit(num).collect(Collectors.toList());
return list.stream().map(vo ->{
RecommendLabelRelationVo recommendLabelRelationVo = new RecommendLabelRelationVo();
BeanUtils.copyProperties(vo,recommendLabelRelationVo);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论