文章管理点击量查询逻辑更改

This commit is contained in:
zkr_liushenlu 2021-04-02 12:24:18 +08:00
parent 1dbbb76eb3
commit ea0708c095
1 changed files with 7 additions and 1 deletions

View File

@ -506,7 +506,13 @@ public class ArticleServiceImpl implements ArticleService {
for (PublishedArticleInfo publishedArticleInfo : articleList) {
String articleId = publishedArticleInfo.getArticleId();
Map<String, String> countJsonMap = rManager.hGetAll("company_articleInfo_Id" + articleId);
String clickTotal = rManager.query("company_clickTotal_articleId" + articleId);
if (StringUtils.isBlank(clickTotal)) {
rManager.save("company_clickTotal_articleId" + articleId, countJsonMap.get("visitorCount"));
publishedArticleInfo.setVisitorCount(countJsonMap.get("visitorCount"));
} else {
publishedArticleInfo.setVisitorCount(clickTotal);
}
publishedArticleInfo.setShareCount(countJsonMap.get("sharedCount"));
}
LOGGER.info("查询文章列表的业务层方法结束!");