BUGFIX:1、删除模特后保存失败
2、获取个人库中的模特不准确
This commit is contained in:
@@ -20,6 +20,7 @@ import io.swagger.annotations.ApiParam;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
@@ -168,7 +169,7 @@ public class LibraryController {
|
|||||||
|
|
||||||
@ApiOperation(value = "更新sketchboard level2type")
|
@ApiOperation(value = "更新sketchboard level2type")
|
||||||
@PostMapping("/updateLibraryLevel2Type")
|
@PostMapping("/updateLibraryLevel2Type")
|
||||||
public Response<Boolean> updateLibraryLevel2Type(@RequestBody LibraryLevel2TypeUpdateDTO libraryLevel2TypeUpdateDTO) {
|
public Response<Boolean> updateLibraryLevel2Type(@Validated @RequestBody LibraryLevel2TypeUpdateDTO libraryLevel2TypeUpdateDTO) {
|
||||||
return Response.success(libraryService.updateLibraryLevel2Type(libraryLevel2TypeUpdateDTO));
|
return Response.success(libraryService.updateLibraryLevel2Type(libraryLevel2TypeUpdateDTO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -171,7 +171,12 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
|||||||
|
|
||||||
if (!StringUtils.isEmpty(query.getAgeGroup())) {
|
if (!StringUtils.isEmpty(query.getAgeGroup())) {
|
||||||
// queryWrapper.eq("level3_type", query.getAgeGroup());
|
// queryWrapper.eq("level3_type", query.getAgeGroup());
|
||||||
queryWrapper.eq("age_group", query.getAgeGroup());
|
// queryWrapper.eq("age_group", query.getAgeGroup());
|
||||||
|
queryWrapper.lambda().and(wrapper -> wrapper
|
||||||
|
.eq(Library::getLevel3Type, query.getAgeGroup())
|
||||||
|
.or()
|
||||||
|
.eq(Library::getAgeGroup, query.getAgeGroup())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query.getBrandId() != null) {
|
if (query.getBrandId() != null) {
|
||||||
@@ -892,7 +897,7 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
|||||||
Library library = CopyUtil.copyObject(sysFile, Library.class);
|
Library library = CopyUtil.copyObject(sysFile, Library.class);
|
||||||
library.setId(null);
|
library.setId(null);
|
||||||
library.setAccountId(accountId);
|
library.setAccountId(accountId);
|
||||||
library.setLevel3Type(sysFileExtra.getAgeGroup());
|
library.setAgeGroup(sysFileExtra.getAgeGroup());
|
||||||
library.setName(DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD));
|
library.setName(DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD));
|
||||||
List<Integer> imagesWidthAndHeight = minioUtil.getImagesWidthAndHeight(sysFile.getUrl());
|
List<Integer> imagesWidthAndHeight = minioUtil.getImagesWidthAndHeight(sysFile.getUrl());
|
||||||
library.setWidth(imagesWidthAndHeight.get(0));
|
library.setWidth(imagesWidthAndHeight.get(0));
|
||||||
|
|||||||
@@ -2557,12 +2557,12 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
|||||||
if (CollectionUtil.isNotEmpty(moduleSaveDTO.getMannequin())) {
|
if (CollectionUtil.isNotEmpty(moduleSaveDTO.getMannequin())) {
|
||||||
List<CollectionElementRelModel> collectionElementRelModels = collectionElementMapper.selectByProject(projectId);
|
List<CollectionElementRelModel> collectionElementRelModels = collectionElementMapper.selectByProject(projectId);
|
||||||
List<MannequinDTO> mannequin = moduleSaveDTO.getMannequin();
|
List<MannequinDTO> mannequin = moduleSaveDTO.getMannequin();
|
||||||
List<Long> inputMannequinId = mannequin.stream().map(MannequinDTO::getId).collect(Collectors.toList());
|
List<Long> inputMannequinId = mannequin.stream().map(MannequinDTO::getCollectionElementId).collect(Collectors.toList());
|
||||||
|
|
||||||
// 创建relationId到Model的映射
|
// 创建relationId到Model的映射
|
||||||
Map<Long, CollectionElementRelModel> relationIdToModelMap = collectionElementRelModels.stream()
|
Map<Long, CollectionElementRelModel> relationIdToModelMap = collectionElementRelModels.stream()
|
||||||
.collect(Collectors.toMap(
|
.collect(Collectors.toMap(
|
||||||
CollectionElementRelModel::getRelationId,
|
CollectionElementRelModel::getCollectionElementId,
|
||||||
java.util.function.Function.identity(),
|
java.util.function.Function.identity(),
|
||||||
(existing, replacement) -> existing
|
(existing, replacement) -> existing
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -416,11 +416,16 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
|||||||
AuthPrincipalVo userInfo = UserContext.getUserHolder();
|
AuthPrincipalVo userInfo = UserContext.getUserHolder();
|
||||||
List<ModelsVO> result = new ArrayList<>();
|
List<ModelsVO> result = new ArrayList<>();
|
||||||
QueryWrapper<Library> libraryQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<Library> libraryQueryWrapper = new QueryWrapper<>();
|
||||||
libraryQueryWrapper.lambda().eq(Library::getAccountId, userInfo.getId());
|
libraryQueryWrapper.lambda()
|
||||||
libraryQueryWrapper.lambda().eq(Library::getLevel1Type, LibraryLevel1TypeEnum.MODELS.getRealName());
|
.eq(Library::getAccountId, userInfo.getId())
|
||||||
libraryQueryWrapper.lambda().eq(Library::getLevel2Type, sex);
|
.eq(Library::getLevel1Type, LibraryLevel1TypeEnum.MODELS.getRealName())
|
||||||
libraryQueryWrapper.lambda().eq(Library::getLevel3Type, ageGroup);
|
.eq(Library::getLevel2Type, sex)
|
||||||
libraryQueryWrapper.lambda().orderByDesc(Library::getCreateDate);
|
.and(wrapper -> wrapper
|
||||||
|
.eq(Library::getLevel3Type, ageGroup)
|
||||||
|
.or()
|
||||||
|
.eq(Library::getAgeGroup, ageGroup)
|
||||||
|
)
|
||||||
|
.orderByDesc(Library::getCreateDate);
|
||||||
List<Library> libraries = libraryMapper.selectList(libraryQueryWrapper);
|
List<Library> libraries = libraryMapper.selectList(libraryQueryWrapper);
|
||||||
if (!CollectionUtils.isEmpty(libraries)) {
|
if (!CollectionUtils.isEmpty(libraries)) {
|
||||||
List<ModelVO> modelVOList = new ArrayList<>();
|
List<ModelVO> modelVOList = new ArrayList<>();
|
||||||
|
|||||||
Reference in New Issue
Block a user