Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tanpu-community
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
探普后端
tanpu-community
Commits
e0ae4af4
Commit
e0ae4af4
authored
Jul 21, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix
parent
a17858d2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
RankService.java
...rc/main/java/com/tanpu/community/service/RankService.java
+6
-0
VisitSummaryService.java
...java/com/tanpu/community/service/VisitSummaryService.java
+3
-0
No files found.
community-service/src/main/java/com/tanpu/community/service/RankService.java
View file @
e0ae4af4
...
...
@@ -7,6 +7,7 @@ import com.tanpu.community.api.enums.TopicStatusEnum;
import
com.tanpu.community.dao.entity.community.ThemeEntity
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.util.ConvertUtil
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -66,6 +67,11 @@ public class RankService {
}
for
(
TopicHotQo
topic
:
topicHotQos
)
{
List
<
String
>
themeIds
=
themeService
.
queryThemeIdsByTopic
(
topic
.
getTopicId
());
if
(
CollectionUtils
.
isEmpty
(
themeIds
)){
topic
.
setViewCount
(
0
);
topic
.
setDisscussCount
(
0
);
continue
;
}
//浏览量
Integer
topicPV
=
visitSummaryService
.
queryTopicDetailVisit
(
topic
.
getTopicId
());
Integer
themePV
=
visitSummaryService
.
queryThemeVisit
(
themeIds
);
...
...
community-service/src/main/java/com/tanpu/community/service/VisitSummaryService.java
View file @
e0ae4af4
...
...
@@ -46,6 +46,9 @@ public class VisitSummaryService {
// 查询主题 浏览量
public
Integer
queryThemeVisit
(
List
<
String
>
themes
)
{
if
(
CollectionUtils
.
isEmpty
(
themes
)){
return
0
;
}
return
visitSummaryMapper
.
selectCount
(
new
LambdaQueryWrapper
<
VisitSummaryEntity
>()
.
in
(
VisitSummaryEntity:
:
getRefId
,
themes
)
.
eq
(
VisitSummaryEntity:
:
getRefType
,
VisitTypeEnum
.
TOPIC_PAGE_VIEW
.
getCode
()));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment