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
b2d7fdb3
Commit
b2d7fdb3
authored
Aug 04, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
metrics fix
parent
b1fe8056
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
VisitLogService.java
...ain/java/com/tanpu/community/service/VisitLogService.java
+5
-4
No files found.
community-service/src/main/java/com/tanpu/community/service/VisitLogService.java
View file @
b2d7fdb3
...
...
@@ -48,6 +48,7 @@ public class VisitLogService {
.
stream
().
map
(
VisitLogEntity:
:
getRefId
).
distinct
().
collect
(
Collectors
.
toList
());
return
ListUtils
.
subtract
(
refIds
,
visited
);
}
public
List
<
String
>
queryUserVisited
(
String
userId
)
{
List
<
String
>
visited
=
visitLogMapper
.
selectList
(
new
LambdaQueryWrapper
<
VisitLogEntity
>()
.
eq
(
VisitLogEntity:
:
getVisitorId
,
userId
))
...
...
@@ -58,7 +59,7 @@ public class VisitLogService {
@Transactional
public
void
insertOrUpdateDur
(
VisitLogEntity
vs
)
{
if
(
visitLogMapper
.
selectByIdentAndRefId
(
vs
.
getIdent
(),
vs
.
getRef
Type
(),
vs
.
getRefId
())
==
null
)
{
if
(
visitLogMapper
.
selectByIdentAndRefId
(
vs
.
getIdent
(),
vs
.
getRef
Id
(),
vs
.
getRefType
())
==
null
)
{
visitLogMapper
.
insert
(
vs
);
}
else
{
visitLogMapper
.
updateDurByIdent
(
vs
.
getDuration
(),
vs
.
getIdent
());
...
...
@@ -92,7 +93,7 @@ public class VisitLogService {
// 查询主题 浏览量
public
Integer
queryThemeVisit
(
List
<
String
>
themes
)
{
if
(
CollectionUtils
.
isEmpty
(
themes
)){
if
(
CollectionUtils
.
isEmpty
(
themes
))
{
return
0
;
}
return
visitLogMapper
.
selectCount
(
new
LambdaQueryWrapper
<
VisitLogEntity
>()
...
...
@@ -114,11 +115,11 @@ public class VisitLogService {
//统计行为集合的浏览量
public
Map
<
String
,
Integer
>
getCountMapByTargetIds
(
List
<
String
>
refIds
,
String
refType
)
{
if
(
CollectionUtils
.
isEmpty
(
refIds
)){
if
(
CollectionUtils
.
isEmpty
(
refIds
))
{
return
new
HashMap
<>();
}
LambdaQueryWrapper
<
VisitLogEntity
>
wrapper
=
(
new
LambdaQueryWrapper
<
VisitLogEntity
>()
.
in
(
VisitLogEntity:
:
getRefId
,
refIds
))
.
in
(
VisitLogEntity:
:
getRefId
,
refIds
))
.
eq
(
VisitLogEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
)
.
eq
(
VisitLogEntity:
:
getRefType
,
refType
)
.
groupBy
(
VisitLogEntity:
:
getRefId
);
...
...
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