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
827ae18a
Commit
827ae18a
authored
Sep 21, 2023
by
muhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 收藏册藏品列表
parent
dbd33291
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FavoritesServiceImpl.java
...c/main/java/com/wwdz/ch/wx/impl/FavoritesServiceImpl.java
+8
-1
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FavoritesServiceImpl.java
View file @
827ae18a
...
@@ -13,6 +13,7 @@ import com.wwdz.ch.wx.entity.request.ItemRequestDto;
...
@@ -13,6 +13,7 @@ import com.wwdz.ch.wx.entity.request.ItemRequestDto;
import
com.wwdz.ch.wx.entity.vo.AgentTranceResponseVo
;
import
com.wwdz.ch.wx.entity.vo.AgentTranceResponseVo
;
import
com.wwdz.ch.wx.entity.vo.FavoritesResponseVo
;
import
com.wwdz.ch.wx.entity.vo.FavoritesResponseVo
;
import
com.wwdz.ch.wx.entity.vo.ItemResponseVo
;
import
com.wwdz.ch.wx.entity.vo.ItemResponseVo
;
import
com.wwdz.ch.wx.manager.UserTokenManager
;
import
com.wwdz.ch.wx.service.FavoritesService
;
import
com.wwdz.ch.wx.service.FavoritesService
;
import
com.wwdz.ch.wx.service.ItemCommonService
;
import
com.wwdz.ch.wx.service.ItemCommonService
;
import
com.wwdz.ch.wx.util.StringUtil
;
import
com.wwdz.ch.wx.util.StringUtil
;
...
@@ -44,6 +45,8 @@ public class FavoritesServiceImpl implements FavoritesService {
...
@@ -44,6 +45,8 @@ public class FavoritesServiceImpl implements FavoritesService {
private
FootPrintDao
footPrintDao
;
private
FootPrintDao
footPrintDao
;
@Autowired
@Autowired
private
ItemCommonService
itemCommonService
;
private
ItemCommonService
itemCommonService
;
@Autowired
private
UserTokenManager
userTokenManager
;
@Override
@Override
public
Result
page
(
FavoritesRequestDto
dto
,
HttpServletRequest
request
)
{
public
Result
page
(
FavoritesRequestDto
dto
,
HttpServletRequest
request
)
{
...
@@ -223,6 +226,8 @@ public class FavoritesServiceImpl implements FavoritesService {
...
@@ -223,6 +226,8 @@ public class FavoritesServiceImpl implements FavoritesService {
page
.
setList
(
new
ArrayList
<>());
page
.
setList
(
new
ArrayList
<>());
// 获取仅自己可见的藏品列表
// 获取仅自己可见的藏品列表
Long
userId
=
userTokenManager
.
getUserId
(
request
.
getHeader
(
"Authorization"
));
boolean
isGuest
=
dto
.
getUserId
().
equals
(
userId
);
List
<
Long
>
onlyOneselfItemIds
=
itemCommonService
.
getOnlyOneselfItemIds
(
request
.
getHeader
(
"Authorization"
));
List
<
Long
>
onlyOneselfItemIds
=
itemCommonService
.
getOnlyOneselfItemIds
(
request
.
getHeader
(
"Authorization"
));
// 分页查询
// 分页查询
PageInfo
<
FavoritesItemsRelation
>
relationPage
=
favoritesItemsRelationDao
.
pageByFavoritesId
(
dto
.
getId
(),
onlyOneselfItemIds
,
dto
.
getPage
(),
dto
.
getSize
());
PageInfo
<
FavoritesItemsRelation
>
relationPage
=
favoritesItemsRelationDao
.
pageByFavoritesId
(
dto
.
getId
(),
onlyOneselfItemIds
,
dto
.
getPage
(),
dto
.
getSize
());
...
@@ -252,7 +257,9 @@ public class FavoritesServiceImpl implements FavoritesService {
...
@@ -252,7 +257,9 @@ public class FavoritesServiceImpl implements FavoritesService {
vo
.
setIsMine
(
0
);
vo
.
setIsMine
(
0
);
if
(
Objects
.
nonNull
(
dto
.
getUserId
())
&&
dto
.
getUserId
()
!=
0L
)
{
if
(
Objects
.
nonNull
(
dto
.
getUserId
())
&&
dto
.
getUserId
()
!=
0L
)
{
vo
.
setIsCollected
(
favoritesItemsRelationDao
.
isCollected
(
dto
.
getUserId
(),
relation
.
getItemId
(),
null
)
?
1
:
0
);
vo
.
setIsCollected
(
favoritesItemsRelationDao
.
isCollected
(
dto
.
getUserId
(),
relation
.
getItemId
(),
null
)
?
1
:
0
);
vo
.
setIsMine
(
userItemsRelationDao
.
isExisted
(
dto
.
getUserId
(),
item
.
getId
())
?
1
:
0
);
if
(!
isGuest
)
{
vo
.
setIsMine
(
userItemsRelationDao
.
isExisted
(
dto
.
getUserId
(),
item
.
getId
())
?
1
:
0
);
}
}
}
// 设置收藏数
// 设置收藏数
long
count
=
favoritesItemsRelationDao
.
countByItemId
(
item
.
getId
());
long
count
=
favoritesItemsRelationDao
.
countByItemId
(
item
.
getId
());
...
...
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