党员活动 文档中心获取地址

This commit is contained in:
517612449@qq.com
2022-07-07 08:44:33 +08:00
parent cc69c73b78
commit f3fe12a8ea

View File

@ -51,13 +51,13 @@ public class EventStyleServiceImpl extends ServiceImpl<EventStyleMapper, EventSt
query.eq(EventStyle::getBanner, "0").eq(EventStyle::getStatus, "1").orderByAsc(EventStyle::getSort);
}
list = this.list(query);
List<String> imageIdList = list.stream().map(EventStyle::getImage).collect(Collectors.toList());
List<String> imageIdList = list.stream().map(EventStyle::getImage).distinct().collect(Collectors.toList());
BaseResponse<List<DocumentDataVO>> queryReturn = documentCenterService.queryReturn(imageIdList);
log.info("文档中心返回:{}", queryReturn.toString());
PartyEventExceptionEnum.FRAME_EXCEPTION_NO_IMAGE_INFO_FAIL.customValid(!queryReturn.isSuccess());
Map<String, DocumentDataVO> collect = queryReturn.getData().stream().collect(Collectors.toMap(DocumentDataVO::getObjectId, Function.identity()));
Map<String, DocumentDataVO> collect = queryReturn.getData().stream().collect(Collectors.toMap(DocumentDataVO::getObjectId, Function.identity(),(o1,o2) -> o1));
list.forEach(l -> l.setFilePath(collect.get(l.getImage()).getFilePath()));
list.forEach(l -> l.setFilePath(collect.get(l.getImage()) == null ? "" : collect.get(l.getImage()).getFilePath()));
return list;
}