edit 产品图失败会导致sort不对试验5

This commit is contained in:
litianxiang
2025-12-17 15:43:26 +08:00
parent bb1d3bd359
commit 258eea5277

View File

@@ -1534,11 +1534,12 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
if (!collectionSorts.isEmpty()) {
collectionSortMapper.deleteById(collectionSorts.get(0));
List<CollectionSort> collectionSorts1 = collectionSortMapper.selectList(new LambdaQueryWrapper<CollectionSort>().eq(CollectionSort::getParentId, collectionSorts.get(0).getParentId()).orderByDesc(CollectionSort::getSort).last("LIMIT 1"));
List<CollectionSort> collectionSorts1 = collectionSortMapper.selectList(new LambdaQueryWrapper<CollectionSort>().eq(CollectionSort::getParentId, collectionSorts.get(0).getParentId()).gt(CollectionSort::getSort, collectionSorts.get(0).getSort()));
if (!collectionSorts1.isEmpty()) {
collectionSorts1.get(0).setSort(collectionSorts1.get(0).getSort() - 1);
collectionSortMapper.updateById(collectionSorts1.get(0));
for (CollectionSort collectionSort : collectionSorts1) {
collectionSort.setSort(collectionSort.getSort() - 1);
collectionSortMapper.updateById(collectionSort);
}
}
}
}