Merge branch 'dev/dev' into dev/dev_xp
# Conflicts: # src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java
This commit is contained in:
@@ -13,6 +13,8 @@ import com.ai.da.mapper.primary.ClassificationRelLibraryMapper;
|
||||
import com.ai.da.mapper.primary.entity.Classification;
|
||||
import com.ai.da.mapper.primary.entity.ClassificationRelLibrary;
|
||||
import com.ai.da.model.dto.ClassificationDTO;
|
||||
import com.ai.da.model.enums.DesignElementsEnum;
|
||||
import com.ai.da.model.enums.Language;
|
||||
import com.ai.da.model.vo.AuthPrincipalVo;
|
||||
import com.ai.da.model.vo.ClassificationVO;
|
||||
import com.ai.da.service.ClassificationService;
|
||||
@@ -106,7 +108,19 @@ public class ClassificationServiceImpl implements ClassificationService {
|
||||
List<Classification> classificationList = classificationMapper.selectList(qw);
|
||||
if (CollectionUtil.isNotEmpty(classificationList)) {
|
||||
// 获取结果集
|
||||
return getClassificationVOList(classificationList);
|
||||
List<ClassificationVO> classificationVOList = getClassificationVOList(classificationList);
|
||||
if (classificationDTO.getType().equals("DesignElements")) {
|
||||
for (ClassificationVO classificationVO : classificationVOList) {
|
||||
String classificationName = classificationVO.getClassificationName();
|
||||
DesignElementsEnum designElementsEnum = DesignElementsEnum.fromName(classificationName);
|
||||
if (userHolder.getLanguage().equals(Language.ENGLISH.name())) {
|
||||
classificationVO.setClassificationName(designElementsEnum.getEnglish());
|
||||
}else {
|
||||
classificationVO.setClassificationName(designElementsEnum.getChinese());
|
||||
}
|
||||
}
|
||||
}
|
||||
return classificationVOList;
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@@ -130,10 +130,10 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
||||
queryWrapper.eq("level2_type", query.getModelSex());
|
||||
}
|
||||
if (!StringUtils.isEmpty(query.getLevel2Type())) {
|
||||
CollectionLevel2TypeEnum level2TypeEnum = CollectionLevel2TypeEnum.of(query.getLevel2Type());
|
||||
if (Objects.isNull(level2TypeEnum)) {
|
||||
throw new BusinessException("unknown.parameter.level2Type");
|
||||
}
|
||||
// CollectionLevel2TypeEnum level2TypeEnum = CollectionLevel2TypeEnum.of(query.getLevel2Type());
|
||||
// if (Objects.isNull(level2TypeEnum)) {
|
||||
// throw new BusinessException("unknown.parameter.level2Type");
|
||||
// }
|
||||
queryWrapper.eq("level2_type", query.getLevel2Type());
|
||||
}
|
||||
if (!StringUtils.isEmpty(query.getType())) {
|
||||
@@ -228,13 +228,13 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
||||
if (Objects.isNull(level1TypeEnum)) {
|
||||
throw new BusinessException("unknown.parameter.level1Type");
|
||||
}
|
||||
if (!StringUtils.isEmpty(libraryUploadDTO.getLevel2Type())) {
|
||||
CollectionLevel2TypeEnum level2TypeEnum = CollectionLevel2TypeEnum.of(libraryUploadDTO.getLevel2Type());
|
||||
if (Objects.isNull(level2TypeEnum)) {
|
||||
throw new BusinessException("unknown.parameter.level2Type");
|
||||
}
|
||||
}
|
||||
if (level1TypeEnum.equals(LibraryLevel1TypeEnum.SKETCH_BOARD) && StringUtils.isEmpty(libraryUploadDTO.getLevel2Type())) {
|
||||
// if (!StringUtils.isEmpty(libraryUploadDTO.getLevel2Type())) {
|
||||
// CollectionLevel2TypeEnum level2TypeEnum = CollectionLevel2TypeEnum.of(libraryUploadDTO.getLevel2Type());
|
||||
// if (Objects.isNull(level2TypeEnum)) {
|
||||
// throw new BusinessException("unknown.parameter.level2Type");
|
||||
// }
|
||||
// }
|
||||
if ((level1TypeEnum.equals(LibraryLevel1TypeEnum.SKETCH_BOARD) || level1TypeEnum.equals(LibraryLevel1TypeEnum.PRINT_BOARD) || level1TypeEnum.equals(LibraryLevel1TypeEnum.DESIGN_ELEMENTS)) && StringUtils.isEmpty(libraryUploadDTO.getLevel2Type())) {
|
||||
throw new BusinessException("level2Type.cannot.be.empty");
|
||||
}
|
||||
String path = calculateFileUrl(level1TypeEnum, libraryUploadDTO.getLevel2Type(), libraryUploadDTO.getModelSex(), userInfo.getId());
|
||||
@@ -244,6 +244,7 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
||||
case MOOD_BOARD:
|
||||
case PRINT_BOARD:
|
||||
case SKETCH_BOARD:
|
||||
case DESIGN_ELEMENTS:
|
||||
bucketName = users;
|
||||
break;
|
||||
case MARKETING_SKETCH:
|
||||
|
||||
@@ -276,7 +276,6 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
||||
|
||||
@Override
|
||||
public WorkspaceVO getByIdNew(Long id) {
|
||||
AuthPrincipalVo authPrincipalVo = UserContext.getUserHolder();
|
||||
Long accountId = UserContext.getUserHolder().getId();
|
||||
QueryWrapper<Workspace> qwOld = new QueryWrapper<>();
|
||||
qwOld.lambda().eq(Workspace::getAccountId, accountId);
|
||||
@@ -287,21 +286,26 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
||||
Workspace newIsLastIndex = workspaceMapper.selectById(id);
|
||||
newIsLastIndex.setIsLastIndex(1);
|
||||
workspaceMapper.updateById(newIsLastIndex);
|
||||
WorkspaceVO workspaceVO = CopyUtil.copyObject(newIsLastIndex, WorkspaceVO.class);
|
||||
QueryWrapper<WorkspaceRelStyle> qw = new QueryWrapper<>();
|
||||
qw.lambda().eq(WorkspaceRelStyle::getWorkspaceId, workspaceVO.getId());
|
||||
List<WorkspaceRelStyle> workspaceRelStyles = workspaceRelStyleMapper.selectList(qw);
|
||||
if (!CollectionUtils.isEmpty(workspaceRelStyles)) {
|
||||
Long styleId = workspaceRelStyles.get(0).getStyleId();
|
||||
Style style = styleMapper.selectById(styleId);
|
||||
StyleEnum styleEnum = StyleEnum.fromName(style.getName());
|
||||
if (authPrincipalVo.getLanguage().equals(Language.ENGLISH.name())) {
|
||||
workspaceVO.setStyleName(styleEnum.getEnglish());
|
||||
}else {
|
||||
workspaceVO.setStyleName(styleEnum.getChinese());
|
||||
WorkspaceVO vo = CopyUtil.copyObject(newIsLastIndex, WorkspaceVO.class);
|
||||
if (vo.getMannequinFemaleId() != null) {
|
||||
if (vo.getMannequinFemaleType().equals(ModelType.SYSTEM.getValue())) {
|
||||
vo.setFemalePresignedUrl(minioUtil.getPresignedUrl(sysFileMapper.selectById(vo.getMannequinFemaleId()).getUrl(), 24 * 60));
|
||||
} else if (vo.getMannequinFemaleType().equals(ModelType.LIBRARY.getValue())) {
|
||||
vo.setFemalePresignedUrl(minioUtil.getPresignedUrl(libraryMapper.selectById(vo.getMannequinFemaleId()).getUrl(), 24 * 60));
|
||||
}
|
||||
}
|
||||
return workspaceVO;
|
||||
if (vo.getMannequinMaleId() != null) {
|
||||
if (vo.getMannequinMaleType().equals(ModelType.SYSTEM.getValue())) {
|
||||
vo.setMalePresignedUrl(minioUtil.getPresignedUrl(sysFileMapper.selectById(vo.getMannequinMaleId()).getUrl(), 24 * 60));
|
||||
} else if (vo.getMannequinMaleType().equals(ModelType.LIBRARY.getValue())) {
|
||||
vo.setMalePresignedUrl(minioUtil.getPresignedUrl(libraryMapper.selectById(vo.getMannequinMaleId()).getUrl(), 24 * 60));
|
||||
}
|
||||
}
|
||||
Sex sex = Sex.getSex(vo.getSex());
|
||||
Position position = Position.getPosition(vo.getPosition());
|
||||
vo.setSexEnum(new BizJson(sex.getValue(), sex.name(), BusinessException.getMessageFromResource(sex.name())));
|
||||
vo.setPositionEnum(new BizJson(position.getValue(), position.name(), BusinessException.getMessageFromResource(position.name())));
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user