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
30ed778b
Commit
30ed778b
authored
Jul 30, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
b6945a14
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
TopicMapper.java
...com/tanpu/community/dao/mapper/community/TopicMapper.java
+1
-1
RankService.java
...rc/main/java/com/tanpu/community/service/RankService.java
+5
-3
No files found.
community-service/src/main/java/com/tanpu/community/dao/mapper/community/TopicMapper.java
View file @
30ed778b
...
...
@@ -16,6 +16,6 @@ import java.util.List;
* @since 2021-07-22
*/
public
interface
TopicMapper
extends
BaseMapper
<
TopicEntity
>
{
@Select
(
"select * from topic where id>#{startId} and delete_tag=0 order by id asc limit #{size}"
)
@Select
(
"select * from topic where id>#{startId} and delete_tag=0
and is_conceal=0
order by id asc limit #{size}"
)
List
<
TopicEntity
>
selectGtIdPageable
(
@Param
(
"startId"
)
Long
startId
,
@Param
(
"size"
)
Integer
size
);
}
community-service/src/main/java/com/tanpu/community/service/RankService.java
View file @
30ed778b
...
...
@@ -110,17 +110,19 @@ public class RankService {
}
List
<
TopicRankQo
>
topicRankQos
=
ConvertUtil
.
topicEntityToHotQos
(
topicEntities
);
List
<
String
>
topicIds
=
topicRankQos
.
stream
().
map
(
TopicRankQo:
:
getTopicId
).
collect
(
Collectors
.
toList
());
Map
<
String
,
Integer
>
countMapByTargetIds
=
visitLogService
.
getCountMapByTargetIds
(
topicIds
,
VisitTypeEnum
.
TOPIC_PAGE_VIEW
);
Map
<
String
,
Integer
>
topicViewMap
=
visitLogService
.
getCountMapByTargetIds
(
topicIds
,
VisitTypeEnum
.
TOPIC_PAGE_VIEW
);
for
(
TopicRankQo
topic
:
topicRankQos
)
{
List
<
String
>
themeIds
=
themeService
.
queryThemeIdsByTopic
(
topic
.
getTopicId
());
if
(
CollectionUtils
.
isEmpty
(
themeIds
))
{
topic
.
setViewCount
(
countMapByTargetIds
.
getOrDefault
(
topic
.
getTopicId
(),
0
));
topic
.
setViewCount
(
topicViewMap
.
getOrDefault
(
topic
.
getTopicId
(),
0
));
topic
.
setDisscussCount
(
0
);
topic
.
setThemeWeight
(
0
);
topic
.
setFormatViewCount
(
BizUtils
.
formatCountNumber
(
topic
.
getViewCount
()));
topic
.
setFormatDisscussCount
(
BizUtils
.
formatCountNumber
(
topic
.
getDisscussCount
()));
continue
;
}
// 浏览量
Integer
topicPV
=
countMapByTargetIds
.
getOrDefault
(
topic
.
getTopicId
(),
0
);
Integer
topicPV
=
topicViewMap
.
getOrDefault
(
topic
.
getTopicId
(),
0
);
Integer
themePV
=
visitLogService
.
queryThemeVisit
(
themeIds
);
topic
.
setViewCount
(
topicPV
+
themePV
+
topic
.
getViewCntAdjust
());
//讨论数=发布主题贴数+回复总数
...
...
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