TASK:collection sort;

This commit is contained in:
shahaibo
2025-06-03 14:31:51 +08:00
parent 442e87267a
commit a9172dcd36
2 changed files with 12 additions and 12 deletions

View File

@@ -1313,9 +1313,6 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
//修改designItem为dislike状态
designItemService.updateLikeStatus(userLike.getDesignItemId(), (byte) 0);
//删除关联的collection,先不做
//删除对应的history
userLikeService.removeById(disDesignLikeDTO.getGroupDetailId());
List<UserLikeVO> userLikeVOS = userLikeService.getGroupDetail(userLike.getUserLikeGroupId());
if (CollectionUtils.isEmpty(userLikeVOS)) {
//group 下面没有元素时候 直接删除
@@ -1323,6 +1320,8 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
}
deleteCollectionSort(userLike.getId(), CollectionType.DESIGN.getValue(), disDesignLikeDTO.getProjectId());
//删除对应的history
userLikeService.removeById(disDesignLikeDTO.getGroupDetailId());
return Boolean.TRUE;
}

View File

@@ -782,15 +782,16 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
@Override
public Boolean productImageUnLike(ProductImageLikeDTO productImageLikeDTO) {
List<Long> toProductImageResultId = productImageLikeDTO.getToProductImageResultId();
QueryWrapper<ToProductImageResult> qw = new QueryWrapper<>();
qw.lambda().in(ToProductImageResult::getId, toProductImageResultId);
ToProductImageResult toProductImageResult = new ToProductImageResult();
toProductImageResult.setIsLike(0);
toProductImageResultMapper.update(toProductImageResult, qw);
if (toProductImageResult.getResultType().equals("Relight")) {
designService.deleteCollectionSort(toProductImageResult.getId(), CollectionType.RELIGHT.getValue(), productImageLikeDTO.getProjectId());
}else {
designService.deleteCollectionSort(toProductImageResult.getId(), CollectionType.TO_PRODUCT_IMAGE.getValue(), productImageLikeDTO.getProjectId());
if (!CollectionUtils.isEmpty(toProductImageResultId)) {
Long toProductImageId = toProductImageResultId.get(0);
ToProductImageResult toProductImageResult = toProductImageResultMapper.selectById(toProductImageId);
toProductImageResult.setIsLike(0);
toProductImageResultMapper.updateById(toProductImageResult);
if (toProductImageResult.getResultType().equals("Relight")) {
designService.deleteCollectionSort(toProductImageResult.getId(), CollectionType.RELIGHT.getValue(), productImageLikeDTO.getProjectId());
}else {
designService.deleteCollectionSort(toProductImageResult.getId(), CollectionType.TO_PRODUCT_IMAGE.getValue(), productImageLikeDTO.getProjectId());
}
}
return Boolean.TRUE;
}