Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
e82c7bd3
Commit
e82c7bd3
authored
Sep 22, 2023
by
muhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 浏览量
parent
ff26d761
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
21 deletions
+33
-21
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
...pi/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
+33
-21
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
View file @
e82c7bd3
...
...
@@ -572,29 +572,31 @@ public class ItemServiceImpl implements ItemService {
}
}
// 添加或更新用户足迹
Footprint
footprint
=
footPrintDao
.
selectByUserIdItem
(
dto
.
getUserId
(),
item
.
getId
());
Date
now
=
new
Date
();
if
(
Objects
.
isNull
(
footprint
))
{
Footprint
newVo
=
new
Footprint
();
newVo
.
setUserId
(
dto
.
getUserId
());
newVo
.
setItemId
(
item
.
getId
());
newVo
.
setDeleted
(
false
);
newVo
.
setAddTime
(
now
);
newVo
.
setUpdateTime
(
now
);
footPrintDao
.
insert
(
newVo
);
// 更新藏品发布者的浏览量
if
(
Objects
.
nonNull
(
userItemsRelation
))
{
UserCollectBrowseNum
userCollectBrowseNum
=
userCollectBrowseNumDao
.
findByUserId
(
userItemsRelation
.
getUserId
());
if
(
Objects
.
nonNull
(
userCollectBrowseNum
))
{
userCollectBrowseNum
.
setBrowseNum
(
userCollectBrowseNum
.
getBrowseNum
()
+
1
);
userCollectBrowseNumDao
.
update
(
userCollectBrowseNum
);
if
(
Objects
.
nonNull
(
userItemsRelation
)
&&
!
userItemsRelation
.
getUserId
().
equals
(
dto
.
getUserId
()))
{
// 添加或更新用户足迹
Footprint
footprint
=
footPrintDao
.
selectByUserIdItem
(
dto
.
getUserId
(),
item
.
getId
());
Date
now
=
new
Date
();
if
(
Objects
.
isNull
(
footprint
))
{
Footprint
newVo
=
new
Footprint
();
newVo
.
setUserId
(
dto
.
getUserId
());
newVo
.
setItemId
(
item
.
getId
());
newVo
.
setDeleted
(
false
);
newVo
.
setAddTime
(
now
);
newVo
.
setUpdateTime
(
now
);
footPrintDao
.
insert
(
newVo
);
// 更新藏品发布者的浏览量
if
(
Objects
.
nonNull
(
userItemsRelation
))
{
UserCollectBrowseNum
userCollectBrowseNum
=
userCollectBrowseNumDao
.
findByUserId
(
userItemsRelation
.
getUserId
());
if
(
Objects
.
nonNull
(
userCollectBrowseNum
))
{
userCollectBrowseNum
.
setBrowseNum
(
userCollectBrowseNum
.
getBrowseNum
()
+
1
);
userCollectBrowseNumDao
.
update
(
userCollectBrowseNum
);
}
}
}
else
{
footprint
.
setUpdateTime
(
now
);
footPrintDao
.
upateTime
(
footprint
);
}
}
else
{
footprint
.
setUpdateTime
(
now
);
footPrintDao
.
upateTime
(
footprint
);
}
}
...
...
@@ -714,6 +716,16 @@ public class ItemServiceImpl implements ItemService {
long
count
=
favoritesItemsRelationDao
.
countByItemId
(
item
.
getId
());
String
collectCount
=
StringUtil
.
formatCount
(
count
);
// 更新藏品发布者的收藏数
UserItemsRelation
userItemsRelation
=
userItemsRelationDao
.
find
(
item
.
getId
());
if
(
Objects
.
nonNull
(
userItemsRelation
))
{
UserCollectBrowseNum
userCollectBrowseNum
=
userCollectBrowseNumDao
.
findByUserId
(
userItemsRelation
.
getUserId
());
if
(
Objects
.
nonNull
(
userCollectBrowseNum
))
{
userCollectBrowseNum
.
setCollectNum
(
userCollectBrowseNum
.
getCollectNum
()
-
1
);
userCollectBrowseNumDao
.
update
(
userCollectBrowseNum
);
}
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"collectCount"
,
collectCount
);
return
Result
.
success
(
map
);
...
...
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