Commit aff5e4c2 by 田超

Merge branch 'fixbug/1026670' into 'master'

bug: [1026670] 匹配资讯浏览量为空

See merge request rays/pcloud-book!1060
parents e5ce699f efcc51cb
...@@ -2111,6 +2111,8 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -2111,6 +2111,8 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
} }
// 将未选择服务的数据补充资讯 // 将未选择服务的数据补充资讯
setAppletNews4Week(rightsSettingId, rightsType, wechatUserId, needFillAppletNews,bookId,cityCode,agentId); setAppletNews4Week(rightsSettingId, rightsType, wechatUserId, needFillAppletNews,bookId,cityCode,agentId);
//填充资讯的浏览量
fillNewsBrowseCount(needFillAppletNews);
/* /*
List<Long> rightsSettingItemIds = List<Long> rightsSettingItemIds =
...@@ -2135,6 +2137,34 @@ public class RightsSettingBizImpl implements RightsSettingBiz { ...@@ -2135,6 +2137,34 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
return list; return list;
} }
private void fillNewsBrowseCount(List<RightsSettingItem> needFillAppletNews) {
log.info("填充资讯浏览量:{}", needFillAppletNews);
List<Long> appletNewsIds = new ArrayList<>();
needFillAppletNews.stream().forEach(rightsSettingItem -> {
if (!ListUtils.isEmpty(rightsSettingItem.getAppletNewsDTOS())) {
appletNewsIds.addAll(rightsSettingItem.getAppletNewsDTOS().stream().map(e -> e.getId()).collect(Collectors.toList()));
}
});
if (ListUtils.isEmpty(appletNewsIds)) {
return;
}
Map<Long, AppletNewsDTO> appletMap = appletNewsBiz.getByIds(appletNewsIds);
if (MapUtils.isEmpty(appletMap)) {
return;
}
needFillAppletNews.stream().forEach(rightsSettingItem -> {
List<AppletNewsDTO> appletNewsDTOS = rightsSettingItem.getAppletNewsDTOS();
if (ListUtils.isEmpty(appletNewsDTOS)) {
return;
}
appletNewsDTOS.stream().forEach(appletNewsDTO -> {
if (null == appletMap.get(appletNewsDTO.getId())) {
appletNewsDTO.setBrowseCount(appletMap.get(appletNewsDTO.getId()).getBrowseCount());
}
});
});
}
private void fillPageParam(List<RightsSettingItem> list, Integer currentPage, Integer numPerPage) { private void fillPageParam(List<RightsSettingItem> list, Integer currentPage, Integer numPerPage) {
if (Objects.nonNull(currentPage)&&Objects.nonNull(numPerPage)){ if (Objects.nonNull(currentPage)&&Objects.nonNull(numPerPage)){
for (RightsSettingItem rightsSettingItem : list) { for (RightsSettingItem rightsSettingItem : list) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment