TASK:collection sort;
This commit is contained in:
@@ -1332,14 +1332,16 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
qw.lambda().orderByDesc(CollectionSort::getSort);
|
||||
List<CollectionSort> userLikeSorts = collectionSortMapper.selectList(qw);
|
||||
CollectionSort userLikeSort = getUserLikeSortByUserLikeId(relationId, relationType, projectId);
|
||||
Long userLikeSortId = userLikeSort.getId();
|
||||
for (CollectionSort likeSort : userLikeSorts) {
|
||||
if (Objects.equals(likeSort.getId(), userLikeSortId)) {
|
||||
collectionSortMapper.deleteById(likeSort);
|
||||
break;
|
||||
}else {
|
||||
likeSort.setSort(likeSort.getSort() - 1);
|
||||
collectionSortMapper.updateById(likeSort);
|
||||
if (Objects.nonNull(userLikeSort)) {
|
||||
Long userLikeSortId = userLikeSort.getId();
|
||||
for (CollectionSort likeSort : userLikeSorts) {
|
||||
if (Objects.equals(likeSort.getId(), userLikeSortId)) {
|
||||
collectionSortMapper.deleteById(likeSort);
|
||||
break;
|
||||
}else {
|
||||
likeSort.setSort(likeSort.getSort() - 1);
|
||||
collectionSortMapper.updateById(likeSort);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user