TASK: collection sort;

This commit is contained in:
shahaibo
2025-06-17 09:41:19 +08:00
parent 9d022ae13e
commit 88d8b75298
2 changed files with 93 additions and 79 deletions

View File

@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel("用户分组详情-响应")
public class UserLikeVO implements AllCollectionVO{
@@ -29,4 +31,6 @@ public class UserLikeVO implements AllCollectionVO{
private String relationType;
private String collectionType;
private String resultType;
private List<AllCollectionVO> childList;
}

View File

@@ -1630,6 +1630,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
DesignModuleChooseVO vo = new DesignModuleChooseVO();
QueryWrapper<CollectionSort> userLikeSortQueryWrapper = new QueryWrapper<>();
userLikeSortQueryWrapper.lambda().eq(CollectionSort::getProjectId, projectDTO.getId());
userLikeSortQueryWrapper.lambda().isNull(CollectionSort::getParentId);
userLikeSortQueryWrapper.lambda().orderByAsc(CollectionSort::getSort);
List<CollectionSort> userLikeSortList = collectionSortMapper.selectList(userLikeSortQueryWrapper);
@@ -1637,9 +1638,9 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
moduleChooseVO.setDesign(vo);
}else {
List<AllCollectionVO> list = new ArrayList<>();
for (CollectionSort userLikeSort : userLikeSortList) {
if (userLikeSort.getRelationType().equals(CollectionType.DESIGN.getValue())) {
UserLike userLike = userLikeMapper.selectById(userLikeSort.getRelationId());
for (CollectionSort collectionSort : userLikeSortList) {
UserLike userLike = userLikeMapper.selectById(collectionSort.getRelationId());
UserLikeVO o = CopyUtil.copyObject(userLike, UserLikeVO.class);
TDesignPythonOutfit tDesignPythonOutfit1 = designPythonOutfitMapper.selectById(o.getDesignOutfitId());
o.setUrl(tDesignPythonOutfit1.getDesignUrl());
@@ -1656,13 +1657,18 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
o.setDesignOutfitId(tDesignPythonOutfit.getId());
}
o.setSort(userLikeSort.getSort());
o.setUserLikeSortId(userLikeSort.getId());
o.setRelationType(userLikeSort.getRelationType());
o.setSort(collectionSort.getSort());
o.setUserLikeSortId(collectionSort.getId());
o.setRelationType(collectionSort.getRelationType());
o.setCollectionType(CollectionType.DESIGN.getValue());
o.setResultType(CollectionType.DESIGN.getValue());
list.add(o);
} else if (userLikeSort.getRelationType().equals(CollectionType.TO_PRODUCT_IMAGE.getValue())) {
QueryWrapper<CollectionSort> childCollectionQw = new QueryWrapper<>();
childCollectionQw.lambda().eq(CollectionSort::getParentId, collectionSort.getId());
childCollectionQw.lambda().orderByAsc(CollectionSort::getSort);
List<CollectionSort> childSortList = collectionSortMapper.selectList(userLikeSortQueryWrapper);
List<AllCollectionVO> childList = new ArrayList<>();
for (CollectionSort userLikeSort : childSortList) {
if (userLikeSort.getRelationType().equals(CollectionType.TO_PRODUCT_IMAGE.getValue())) {
ToProductImageResult toProductImageResult = toProductImageResultMapper.selectById(userLikeSort.getRelationId());
toProductImageResult.setUrl(minioUtil.getPreSignedUrl(toProductImageResult.getUrl(), 24 * 60));
ToProductImageResultVO toProductImageResultVO = CopyUtil.copyObject(toProductImageResult, ToProductImageResultVO.class);
@@ -1681,7 +1687,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
toProductImageResultVO.setSort(userLikeSort.getSort());
toProductImageResultVO.setUserLikeSortId(userLikeSort.getId());
toProductImageResultVO.setRelationType(userLikeSort.getRelationType());
list.add(toProductImageResultVO);
childList.add(toProductImageResultVO);
} else if (userLikeSort.getRelationType().equals(CollectionType.RELIGHT.getValue())) {
ToProductImageResult toProductImageResult = toProductImageResultMapper.selectById(userLikeSort.getRelationId());
toProductImageResult.setUrl(minioUtil.getPreSignedUrl(toProductImageResult.getUrl(), 24 * 60));
@@ -1701,7 +1707,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
toProductImageResultVO.setSort(userLikeSort.getSort());
toProductImageResultVO.setUserLikeSortId(userLikeSort.getId());
toProductImageResultVO.setRelationType(userLikeSort.getRelationType());
list.add(toProductImageResultVO);
childList.add(toProductImageResultVO);
} else if (userLikeSort.getRelationType().equals(CollectionType.POSE_TRANSFORM.getValue())) {
PoseTransformation item = poseTransformationMapper.selectById(userLikeSort.getRelationId());
PoseTransformationVO poseTransformationVO = new PoseTransformationVO();
@@ -1716,9 +1722,13 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
poseTransformationVO.setUserLikeSortId(userLikeSort.getId());
poseTransformationVO.setRelationType(userLikeSort.getRelationType());
poseTransformationVO.setResultType(CollectionType.POSE_TRANSFORM.getValue());
list.add(poseTransformationVO);
childList.add(poseTransformationVO);
}
}
o.setChildList(childList);
list.add(o);
}
vo.setUserLikeDetails(list);
}