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
7bd23c09
Commit
7bd23c09
authored
Sep 08, 2023
by
muhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 藏品编辑
parent
76527c20
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
49 deletions
+0
-49
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
...pi/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
+0
-49
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
View file @
7bd23c09
...
@@ -560,55 +560,6 @@ public class ItemServiceImpl implements ItemService {
...
@@ -560,55 +560,6 @@ public class ItemServiceImpl implements ItemService {
item
.
setUpdateTime
(
now
);
item
.
setUpdateTime
(
now
);
itemDao
.
update
(
item
);
itemDao
.
update
(
item
);
// 更新收藏册
List
<
Long
>
favoritesIds
=
new
ArrayList
<>();
FavoritesItemsRelation
beforeRelation
=
favoritesItemsRelationDao
.
selectByUserIdItemId
(
dto
.
getUserId
(),
dto
.
getId
());
if
(
Objects
.
isNull
(
beforeRelation
))
{
if
(
Objects
.
nonNull
(
dto
.
getFavoritesId
())
&&
!
dto
.
getFavoritesId
().
equals
(
0L
))
{
// 新增藏品和收藏册关联
FavoritesItemsRelation
favoritesItemsRelation
=
new
FavoritesItemsRelation
();
favoritesItemsRelation
.
setUserId
(
dto
.
getUserId
());
favoritesItemsRelation
.
setFavoritesId
(
dto
.
getFavoritesId
());
favoritesItemsRelation
.
setItemId
(
item
.
getId
());
favoritesItemsRelation
.
setAddTime
(
now
);
favoritesItemsRelation
.
setUpdateTime
(
now
);
favoritesItemsRelationDao
.
insert
(
favoritesItemsRelation
);
// 加入更新列表
favoritesIds
.
add
(
dto
.
getFavoritesId
());
}
}
else
{
Long
beforeFavoritesId
=
beforeRelation
.
getFavoritesId
();
if
(
Objects
.
isNull
(
dto
.
getFavoritesId
())
||
dto
.
getFavoritesId
().
equals
(
0L
))
{
// 删除原来藏品和收藏册关联
favoritesItemsRelationDao
.
deleteByUserIdItemId
(
dto
.
getUserId
(),
dto
.
getId
());
// 加入更新列表
favoritesIds
.
add
(
beforeFavoritesId
);
}
else
{
if
(!
beforeRelation
.
getFavoritesId
().
equals
(
dto
.
getFavoritesId
()))
{
// 删除原来藏品和收藏册关联
favoritesItemsRelationDao
.
deleteByUserIdItemId
(
dto
.
getUserId
(),
dto
.
getId
());
// 新增藏品和收藏册关联
FavoritesItemsRelation
favoritesItemsRelation
=
new
FavoritesItemsRelation
();
favoritesItemsRelation
.
setUserId
(
dto
.
getUserId
());
favoritesItemsRelation
.
setFavoritesId
(
dto
.
getFavoritesId
());
favoritesItemsRelation
.
setItemId
(
item
.
getId
());
favoritesItemsRelation
.
setAddTime
(
now
);
favoritesItemsRelation
.
setUpdateTime
(
now
);
favoritesItemsRelationDao
.
insert
(
favoritesItemsRelation
);
// 加入更新列表
favoritesIds
.
add
(
beforeFavoritesId
);
favoritesIds
.
add
(
dto
.
getFavoritesId
());
}
}
}
if
(
CollectionUtils
.
isNotEmpty
(
favoritesIds
))
{
favoritesDao
.
updateTime
(
null
,
favoritesIds
);
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"id"
,
dto
.
getId
());
map
.
put
(
"id"
,
dto
.
getId
());
return
Result
.
success
(
map
);
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