提交 dcfc0b57 作者: zgz

资讯分页列表加序号

上级 4c44b0c7
...@@ -198,6 +198,11 @@ public class InformationServiceImpl implements InformationService { ...@@ -198,6 +198,11 @@ public class InformationServiceImpl implements InformationService {
} }
Map<String, List<DisplayInfo>> mapList = groupedByLabelMark(dataList); Map<String, List<DisplayInfo>> mapList = groupedByLabelMark(dataList);
mapList.forEach((relationName, displayInfos) -> { mapList.forEach((relationName, displayInfos) -> {
Integer num = 0;
for (DisplayInfo obj : displayInfos) {
num++;
obj.setIndex(num + ".");
}
HashMap map = new HashMap(); HashMap map = new HashMap();
map.put("relationName",relationName); map.put("relationName",relationName);
map.put("infoList",displayInfos); map.put("infoList",displayInfos);
...@@ -213,13 +218,16 @@ public class InformationServiceImpl implements InformationService { ...@@ -213,13 +218,16 @@ public class InformationServiceImpl implements InformationService {
List<LabelModelVo> labelModelVos = commonService.subjectModelBindLabels(subjectIdList); List<LabelModelVo> labelModelVos = commonService.subjectModelBindLabels(subjectIdList);
Map<String, List<LabelModelVo>> modelMap = labelModelVos.stream().collect(Collectors.groupingBy(LabelModelVo::getSubjectId)); Map<String, List<LabelModelVo>> modelMap = labelModelVos.stream().collect(Collectors.groupingBy(LabelModelVo::getSubjectId));
List<SpecialInformation> records = specialInformationIPage.getRecords(); List<SpecialInformation> records = specialInformationIPage.getRecords();
Integer num = 0;
for (SpecialInformation specialInformation : records) { for (SpecialInformation specialInformation : records) {
num++;
DisplayInfo info = new DisplayInfo(); DisplayInfo info = new DisplayInfo();
BeanUtils.copyProperties(specialInformation, info); BeanUtils.copyProperties(specialInformation, info);
info.setPublishDate(EsDateUtil.esFieldDateMapping(info.getPublishDate())); info.setPublishDate(EsDateUtil.esFieldDateMapping(info.getPublishDate()));
//标签处理 //标签处理
List<LabelModelVo> modelVoList = modelMap.get(info.getSubjectId()); List<LabelModelVo> modelVoList = modelMap.get(info.getSubjectId());
formatLabel(modelVoList, info); formatLabel(modelVoList, info);
info.setIndex(num + ".");
dataList.add(info); dataList.add(info);
} }
return Result.OK(dataList); return Result.OK(dataList);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论