TASK:AiDA模块化

This commit is contained in:
shahaibo
2025-03-19 11:35:13 +08:00
parent b027396567
commit d3b507ed45
2 changed files with 29 additions and 1 deletions

View File

@@ -28,6 +28,8 @@ public class ModuleChooseVO {
private List<ToProductImageResultVO> relight;
private CavasModuleChooseVO canvas;
private List<CollectionSketchVO> boundingBox;
// private moodBoardModuleChooseVO poseTransfer;
// private moodBoardModuleChooseVO patternMaking3D;
// private moodBoardModuleChooseVO deReconstruction;

View File

@@ -109,6 +109,8 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
private PortfolioService portfolioService;
@Resource
private LibraryModelPointMapper libraryModelPointMapper;
@Resource
private LibraryService libraryService;
@Override
public void deleteUserGroup(Long userGroupId) {
@@ -1485,8 +1487,10 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
@Override
@Transactional
public ModuleChooseVO saveModuleContent(ModuleSaveDTO moduleSaveDTO) {
ModuleChooseVO result = new ModuleChooseVO();
Long accountId = UserContext.getUserHolder().getId();
Long projectId = moduleSaveDTO.getProjectId();
boolean boundingBox = false;
if (Objects.nonNull(moduleSaveDTO.getMoodBoard())) {
MoodBoardModuleSaveDTO moodBoard = moduleSaveDTO.getMoodBoard();
if (moodBoard.getMoodTemplateId() != null) {
@@ -1653,6 +1657,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
}
}
if (!CollectionUtils.isEmpty(moduleSaveDTO.getSketchBoard())){
boundingBox = true;
QueryWrapper<CollectionElement> qw = new QueryWrapper<>();
qw.lambda().eq(CollectionElement::getProjectId, projectId);
qw.lambda().eq(CollectionElement::getLevel1Type, CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName());
@@ -1708,7 +1713,28 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
collectionElementMapper.deleteBatchIds(old);
}
}
return null;
if (boundingBox) {
QueryWrapper<CollectionElement> qw = new QueryWrapper<>();
qw.lambda().eq(CollectionElement::getLevel1Type, CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName());
qw.lambda().eq(CollectionElement::getProjectId, projectId);
List<CollectionElement> collectionElements = collectionElementMapper.selectList(qw);
List<CollectionSketchVO> voList = new ArrayList<>();
for (CollectionElement collectionElement : collectionElements) {
CollectionSketchVO vo = CopyUtil.copyObject(collectionElement, CollectionSketchVO.class);
String url = collectionElement.getUrl();
libraryService.processSketchBoards(url, collectionElement.getLevel2Type());
if (url.contains(".")) {
String[] split = url.split("\\.");
vo.setUrlWithWhiteSide(minioUtil.getPreSignedUrl(split[0] + "-show." + split[1], 24 * 60, true));
}else {
vo.setUrlWithWhiteSide(minioUtil.getPreSignedUrl(url + "-show", 24 * 60, true));
}
voList.add(vo);
}
result.setBoundingBox(voList);
}
return result;
}
@Override