TASK: collection sort;
This commit is contained in:
@@ -1247,8 +1247,8 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public CollectionSort addCollectionSort(Long relationId, String relationType, Long projectId, Long sortParentId) {
|
||||
int sort = getNextSort(projectId, sortParentId);
|
||||
public CollectionSort addCollectionSort(Long relationId, String relationType, Long projectId, Long collectionSortParentId) {
|
||||
int sort = getNextSort(projectId, collectionSortParentId);
|
||||
CollectionSort userLikeSort = new CollectionSort();
|
||||
// userLikeSort.setUserLikeGroupId(userGroupId);
|
||||
// userLikeSort.setUserLikeId(relationId);
|
||||
@@ -1256,8 +1256,8 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
userLikeSort.setRelationId(relationId);
|
||||
userLikeSort.setRelationType(relationType);
|
||||
userLikeSort.setSort(sort);
|
||||
if (null != sortParentId) {
|
||||
userLikeSort.setParentId(sortParentId);
|
||||
if (null != collectionSortParentId) {
|
||||
userLikeSort.setParentId(collectionSortParentId);
|
||||
}
|
||||
collectionSortMapper.insert(userLikeSort);
|
||||
return userLikeSort;
|
||||
|
||||
@@ -1255,17 +1255,17 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
|
||||
return vos;
|
||||
}
|
||||
|
||||
public Object disOrLikePose(Long transformedId, String likeOrDislike, Long projectId, Long sortLikeParentId){
|
||||
public Object disOrLikePose(Long transformedId, String likeOrDislike, Long projectId, Long collectionSortParentId){
|
||||
PoseTransformation poseTransformation = poseTransformationMapper.selectById(transformedId);
|
||||
Long collectionSortId = null;
|
||||
if (Objects.nonNull(poseTransformation)){
|
||||
if (likeOrDislike.equals("like")){
|
||||
poseTransformation.setIsLiked((byte)1);
|
||||
CollectionSort collectionSort = designService.addCollectionSort(poseTransformation.getId(), CollectionType.POSE_TRANSFORM.getValue(), projectId, sortLikeParentId);
|
||||
CollectionSort collectionSort = designService.addCollectionSort(poseTransformation.getId(), CollectionType.POSE_TRANSFORM.getValue(), projectId, collectionSortParentId);
|
||||
collectionSortId = collectionSort.getId();
|
||||
}else if (likeOrDislike.equals("dislike")){
|
||||
poseTransformation.setIsLiked((byte)0);
|
||||
designService.deleteCollectionSort(poseTransformation.getId(), CollectionType.POSE_TRANSFORM.getValue(), projectId, sortLikeParentId);
|
||||
designService.deleteCollectionSort(poseTransformation.getId(), CollectionType.POSE_TRANSFORM.getValue(), projectId, collectionSortParentId);
|
||||
}
|
||||
poseTransformation.setUpdateTime(LocalDateTime.now());
|
||||
poseTransformationMapper.updateById(poseTransformation);
|
||||
|
||||
@@ -618,10 +618,10 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
||||
ToProductImageResult toProductImageResult1 = toProductImageResultMapper.selectById(toProductImageResultId.get(0));
|
||||
Long collectionSortId = null;
|
||||
if (toProductImageResult1.getResultType().equals("Relight")) {
|
||||
CollectionSort collectionSort = designService.addCollectionSort(toProductImageResult1.getId(), CollectionType.RELIGHT.getValue(), productImageLikeDTO.getProjectId(), productImageLikeDTO.getSortLikeParentId());
|
||||
CollectionSort collectionSort = designService.addCollectionSort(toProductImageResult1.getId(), CollectionType.RELIGHT.getValue(), productImageLikeDTO.getProjectId(), productImageLikeDTO.getCollectionSortParentId());
|
||||
collectionSortId = collectionSort.getId();
|
||||
}else {
|
||||
CollectionSort collectionSort = designService.addCollectionSort(toProductImageResult1.getId(), CollectionType.TO_PRODUCT_IMAGE.getValue(), productImageLikeDTO.getProjectId(), productImageLikeDTO.getSortLikeParentId());
|
||||
CollectionSort collectionSort = designService.addCollectionSort(toProductImageResult1.getId(), CollectionType.TO_PRODUCT_IMAGE.getValue(), productImageLikeDTO.getProjectId(), productImageLikeDTO.getCollectionSortParentId());
|
||||
collectionSortId = collectionSort.getId();
|
||||
}
|
||||
return collectionSortId;
|
||||
@@ -860,9 +860,9 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
||||
toProductImageResult.setIsLike(0);
|
||||
toProductImageResultMapper.updateById(toProductImageResult);
|
||||
if (toProductImageResult.getResultType().equals("Relight")) {
|
||||
designService.deleteCollectionSort(toProductImageResult.getId(), CollectionType.RELIGHT.getValue(), productImageLikeDTO.getProjectId(), productImageLikeDTO.getSortLikeParentId());
|
||||
designService.deleteCollectionSort(toProductImageResult.getId(), CollectionType.RELIGHT.getValue(), productImageLikeDTO.getProjectId(), productImageLikeDTO.getCollectionSortParentId());
|
||||
}else {
|
||||
designService.deleteCollectionSort(toProductImageResult.getId(), CollectionType.TO_PRODUCT_IMAGE.getValue(), productImageLikeDTO.getProjectId(), productImageLikeDTO.getSortLikeParentId());
|
||||
designService.deleteCollectionSort(toProductImageResult.getId(), CollectionType.TO_PRODUCT_IMAGE.getValue(), productImageLikeDTO.getProjectId(), productImageLikeDTO.getCollectionSortParentId());
|
||||
}
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
|
||||
Reference in New Issue
Block a user