TASK:AiDA模块化

This commit is contained in:
shahaibo
2025-03-18 13:43:59 +08:00
parent f17d171231
commit 971b2034ee
7 changed files with 269 additions and 67 deletions

View File

@@ -1,10 +1,7 @@
package com.ai.da.service;
import com.ai.da.common.response.PageBaseResponse;
import com.ai.da.mapper.primary.entity.CanvasElementUpload;
import com.ai.da.mapper.primary.entity.ToProductImageResult;
import com.ai.da.mapper.primary.entity.TrialOrder;
import com.ai.da.mapper.primary.entity.UserLikeGroup;
import com.ai.da.mapper.primary.entity.*;
import com.ai.da.model.dto.*;
import com.ai.da.model.vo.*;
import com.alibaba.fastjson.JSONObject;
@@ -80,4 +77,6 @@ public interface UserLikeGroupService extends IService<UserLikeGroup> {
ModuleChooseVO getModuleContent(ProjectDTO projectDTO);
ModuleChooseVO saveModuleContent(ModuleSaveDTO moduleSaveDTO);
LibraryModelPoint getMannequinDetail(MannequinDTO mannequinDTO);
}

View File

@@ -296,14 +296,14 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
private String designOrRedesignOperateNew(DesignCollectionDTO designDTO, AuthPrincipalVo userInfo,
Long collectionIdParam, ValidateElementVO elementVO) {
if (CollectionUtil.isNotEmpty(designDTO.getSketchBoards())) {
//编辑sketchBoard
collectionElementService.editSketchBoardsElement(elementVO, designDTO.getSketchBoards());
}
if (CollectionUtil.isNotEmpty(designDTO.getPrintBoards())) {
//编辑printBoard
collectionElementService.editPrintBoardsElement(elementVO, designDTO.getPrintBoards());
}
// if (CollectionUtil.isNotEmpty(designDTO.getSketchBoards())) {
// //编辑sketchBoard
// collectionElementService.editSketchBoardsElement(elementVO, designDTO.getSketchBoards());
// }
// if (CollectionUtil.isNotEmpty(designDTO.getPrintBoards())) {
// //编辑printBoard
// collectionElementService.editPrintBoardsElement(elementVO, designDTO.getPrintBoards());
// }
//保存collection
Long collectionId;
if (null == collectionIdParam) {
@@ -317,11 +317,11 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
//批量关联element 到 collection
collectionElementService.relationCollection(elementIds, collectionId);
//library转化为collection(生成)
saveCollectionElemntsByLibrarys(elementVO, collectionId);
// saveCollectionElemntsByLibrarys(elementVO, collectionId);
//generate转化为collection(生成)
saveCollectionElemntsByGenerates(elementVO, collectionId);
// saveCollectionElemntsByGenerates(elementVO, collectionId);
//保存颜色版
collectionElementService.saveColorBoard(designDTO.getColorBoards(), collectionId, designDTO.getTimeZone());
// collectionElementService.saveColorBoard(designDTO.getColorBoards(), collectionId, designDTO.getTimeZone());
//保存design
Long designId = saveOne(designDTO, collectionId, userInfo.getId());
//计算library
@@ -1052,15 +1052,15 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
DesignCollectionDTO designCollectionDTO = CopyUtil.copyObject(reDesignDTO, DesignCollectionDTO.class);
ValidateElementVO elementVO = collectionElementService.validateElement(designCollectionDTO);
//计算并删除对应的未关联的element
List<Long> longs = calculateNoRelationElement(reDesignDTO.getCollectionId(), elementVO.getUsedElementIds());
if (!CollectionUtils.isEmpty(longs)) {
collectionElementService.batchDelete(longs);
}
Design oldDesign = selectByCollectionId(reDesignDTO.getCollectionId());
//删除老的关联的design
deleteByCollectionId(reDesignDTO.getCollectionId());
// designItemService.deleteByCollectionId(reDesignDTO.getCollectionId());
designItemDetailService.deleteByDesignId(oldDesign.getId());
// List<Long> longs = calculateNoRelationElement(reDesignDTO.getCollectionId(), elementVO.getUsedElementIds());
// if (!CollectionUtils.isEmpty(longs)) {
// collectionElementService.batchDelete(longs);
// }
// Design oldDesign = selectByCollectionId(reDesignDTO.getCollectionId());
// //删除老的关联的design
// deleteByCollectionId(reDesignDTO.getCollectionId());
//// designItemService.deleteByCollectionId(reDesignDTO.getCollectionId());
// designItemDetailService.deleteByDesignId(oldDesign.getId());
//redesign
return designOrRedesignOperateNew(CopyUtil.copyObject(
reDesignDTO, DesignCollectionDTO.class), userInfo, reDesignDTO.getCollectionId(), elementVO);

View File

@@ -107,6 +107,8 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
private ProjectMapper projectMapper;
@Resource
private PortfolioService portfolioService;
@Resource
private LibraryModelPointMapper libraryModelPointMapper;
@Override
public void deleteUserGroup(Long userGroupId) {
@@ -1175,7 +1177,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
queryWrapper.in("id", projectIdList);
}
}
queryWrapper.orderByDesc("update_date");
queryWrapper.orderByDesc("update_time");
IPage<Project> page = projectMapper.selectPage(
new Page<>(query.getPage(), query.getSize()), queryWrapper);
if (CollectionUtils.isEmpty(page.getRecords())) {
@@ -1551,7 +1553,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
collectionElementMapper.deleteBatchIds(old);
}
}
if (CollectionUtils.isEmpty(moduleSaveDTO.getPrintBoard())){
if (!CollectionUtils.isEmpty(moduleSaveDTO.getPrintBoard())){
List<DesignCollectionPrintElementDTO> printBoards = moduleSaveDTO.getPrintBoard();
QueryWrapper<CollectionElement> qw = new QueryWrapper<>();
qw.lambda().eq(CollectionElement::getProjectId, projectId);
@@ -1605,7 +1607,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
}
collectionElementMapper.deleteBatchIds(old);
}
if (CollectionUtils.isEmpty(moduleSaveDTO.getColorBoard())){
if (!CollectionUtils.isEmpty(moduleSaveDTO.getColorBoard())){
List<CollectionColorDTO> colorBoards = moduleSaveDTO.getColorBoard();
QueryWrapper<CollectionElement> qw = new QueryWrapper<>();
qw.lambda().eq(CollectionElement::getProjectId, projectId);
@@ -1632,7 +1634,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
}
collectionElementMapper.deleteBatchIds(old);
}
if (CollectionUtils.isEmpty(moduleSaveDTO.getSketchBoard())){
if (!CollectionUtils.isEmpty(moduleSaveDTO.getSketchBoard())){
QueryWrapper<CollectionElement> qw = new QueryWrapper<>();
qw.lambda().eq(CollectionElement::getProjectId, projectId);
qw.lambda().eq(CollectionElement::getLevel1Type, CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName());
@@ -1688,4 +1690,16 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
}
return null;
}
@Override
public LibraryModelPoint getMannequinDetail(MannequinDTO mannequinDTO) {
QueryWrapper<LibraryModelPoint> qw = new QueryWrapper<>();
qw.lambda().eq(LibraryModelPoint::getRelationId, mannequinDTO.getId());
qw.lambda().eq(LibraryModelPoint::getModelType, mannequinDTO.getType());
List<LibraryModelPoint> libraryModelPoints = libraryModelPointMapper.selectList(qw);
if (CollectionUtil.isEmpty(libraryModelPoints)) {
throw new BusinessException("No model doting information available.");
}
return libraryModelPoints.get(0);
}
}