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
7324e0ab
Commit
7324e0ab
authored
Apr 22, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
展示默认的标签
parent
69bef832
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
+17
-4
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/CollectionBookRequestDto.java
...db/dto/request/distribution/CollectionBookRequestDto.java
+5
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/CollectionBookServiceImpl.java
...dz/ch/wx/impl/distribution/CollectionBookServiceImpl.java
+10
-2
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
...wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
+2
-2
No files found.
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/CollectionBookRequestDto.java
View file @
7324e0ab
...
@@ -70,4 +70,9 @@ public class CollectionBookRequestDto extends BaseRequestDto implements Entity
...
@@ -70,4 +70,9 @@ public class CollectionBookRequestDto extends BaseRequestDto implements Entity
private
String
sortInfo
;
private
String
sortInfo
;
private
Boolean
isMine
;
private
Boolean
isMine
;
/**
* 1:展示默认的标签,为空不展示
*/
private
Integer
viewLabelType
;
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/CollectionBookServiceImpl.java
View file @
7324e0ab
...
@@ -19,6 +19,9 @@ import org.slf4j.Logger;
...
@@ -19,6 +19,9 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -154,8 +157,10 @@ public class CollectionBookServiceImpl implements CollectionBookService {
...
@@ -154,8 +157,10 @@ public class CollectionBookServiceImpl implements CollectionBookService {
continue
;
continue
;
}
}
}
else
if
(
CollectionBookConstants
.
DefaultBookEnum
.
getNameByCode
(
sortNum
)
!=
null
)
{
}
else
if
(
CollectionBookConstants
.
DefaultBookEnum
.
getNameByCode
(
sortNum
)
!=
null
)
{
if
(
dto
.
getViewLabelType
()
==
null
||
(
dto
.
getViewLabelType
().
intValue
()
!=
1
))
{
continue
;
}
map
.
put
(
"title"
,
CollectionBookConstants
.
DefaultBookEnum
.
getNameByCode
(
sortNum
));
map
.
put
(
"title"
,
CollectionBookConstants
.
DefaultBookEnum
.
getNameByCode
(
sortNum
));
}
else
{
}
else
{
map
.
put
(
"title"
,
bookMap
.
get
(
sortNum
));
map
.
put
(
"title"
,
bookMap
.
get
(
sortNum
));
}
}
...
@@ -171,6 +176,7 @@ public class CollectionBookServiceImpl implements CollectionBookService {
...
@@ -171,6 +176,7 @@ public class CollectionBookServiceImpl implements CollectionBookService {
@Override
@Override
@Transactional
public
Result
delete
(
CollectionBookRequestDto
dto
)
{
public
Result
delete
(
CollectionBookRequestDto
dto
)
{
try
{
try
{
collectionBookDao
.
delete
(
dto
.
getId
());
collectionBookDao
.
delete
(
dto
.
getId
());
...
@@ -183,7 +189,8 @@ public class CollectionBookServiceImpl implements CollectionBookService {
...
@@ -183,7 +189,8 @@ public class CollectionBookServiceImpl implements CollectionBookService {
CollectionBookSort
collectionBookSort
=
collectionBookSortDao
.
find
(
dto
.
getUserId
());
CollectionBookSort
collectionBookSort
=
collectionBookSortDao
.
find
(
dto
.
getUserId
());
if
(
collectionBookSort
!=
null
)
{
if
(
collectionBookSort
!=
null
)
{
String
sortInfo
=
collectionBookSort
.
getSortInfo
();
String
sortInfo
=
collectionBookSort
.
getSortInfo
();
List
<
String
>
list
=
Arrays
.
asList
(
sortInfo
.
split
(
","
));
List
<
String
>
arrayList
=
Arrays
.
asList
(
sortInfo
.
split
(
","
));
List
<
String
>
list
=
new
ArrayList
<>(
arrayList
);
list
.
remove
(
""
+
dto
.
getId
());
list
.
remove
(
""
+
dto
.
getId
());
sortInfo
=
String
.
join
(
","
,
list
);
sortInfo
=
String
.
join
(
","
,
list
);
collectionBookSortDao
.
update
(
dto
.
getUserId
(),
sortInfo
);
collectionBookSortDao
.
update
(
dto
.
getUserId
(),
sortInfo
);
...
@@ -191,6 +198,7 @@ public class CollectionBookServiceImpl implements CollectionBookService {
...
@@ -191,6 +198,7 @@ public class CollectionBookServiceImpl implements CollectionBookService {
return
Result
.
success
();
return
Result
.
success
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"删除收藏册 error: {}"
,
e
);
logger
.
error
(
"删除收藏册 error: {}"
,
e
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
}
}
return
Result
.
failed
();
return
Result
.
failed
();
}
}
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
View file @
7324e0ab
...
@@ -680,7 +680,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
...
@@ -680,7 +680,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
if
(
supplierItem
.
getCreatorId
().
longValue
()
!=
targetUserId
)
{
if
(
supplierItem
.
getCreatorId
().
longValue
()
!=
targetUserId
)
{
supplierItemVo
.
setIsMine
(
false
);
supplierItemVo
.
setIsMine
(
false
);
targetUserId
=
supplierItem
.
getCreatorId
();
targetUserId
=
supplierItem
.
getCreatorId
();
boolean
isCollected
=
itemCollectedRecordDao
.
isExisted
(
itemId
,
targetUserId
);
boolean
isCollected
=
itemCollectedRecordDao
.
isExisted
(
itemId
,
dto
.
getUserId
()
);
if
(
isCollected
)
{
if
(
isCollected
)
{
supplierItemVo
.
setIsCollected
(
true
);
supplierItemVo
.
setIsCollected
(
true
);
}
else
{
}
else
{
...
@@ -689,7 +689,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
...
@@ -689,7 +689,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
if
(
supplierItem
.
getIsDeleted
())
{
if
(
supplierItem
.
getIsDeleted
())
{
//判断是否有相关收藏记录,有则删除
//判断是否有相关收藏记录,有则删除
if
(
isCollected
)
{
if
(
isCollected
)
{
itemCollectedRecordDao
.
cancel
(
itemId
,
targetUserId
);
itemCollectedRecordDao
.
cancel
(
itemId
,
dto
.
getUserId
()
);
}
}
return
Result
.
failed
(
"该藏品已删除"
);
return
Result
.
failed
(
"该藏品已删除"
);
}
}
...
...
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