TASK:mannequin;

This commit is contained in:
shahaibo
2025-05-23 15:13:46 +08:00
parent 91ee58db1b
commit 8fc79f6699
6 changed files with 78 additions and 2 deletions

View File

@@ -27,7 +27,9 @@ public enum CollectionLevel1TypeEnum {
/**
* 市场
*/
MARKETING_SKETCH("MarketingSketch");
MARKETING_SKETCH("MarketingSketch"),
MANNEQUIN("Mannequin");
private String realName;

View File

@@ -101,7 +101,7 @@ public class Workspace implements Serializable {
private Long projectId;
private Integer userBrandDna;
private Long userBrandDna;
private Integer brandPercentage;

View File

@@ -1,5 +1,6 @@
package com.ai.da.model.dto;
import com.ai.da.mapper.primary.entity.Library;
import com.ai.da.model.vo.CollectionColorVO;
import com.ai.da.model.vo.CollectionElementVO;
import com.ai.da.model.vo.MoodBoardModuleChooseVO;
@@ -29,6 +30,8 @@ public class ModuleSaveDTO {
private PatternMaking3DDTO patternMaking3D;
private List<MannequinDTO> mannequin;
// private MoodBoardModuleChooseVO moodBoard;
// private List<CollectionElementVO> printBoard;
// private List<CollectionColorVO> colorBoard;

View File

@@ -40,6 +40,9 @@ public class WorkspaceVO extends Workspace {
private String style;
private String userBrandDnaImg;
private String userBrandDnaName;
private Map<String, List<String>> allKeywordsByStyle;
}

View File

@@ -1902,6 +1902,67 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
}
}
}
if (CollectionUtil.isNotEmpty(moduleSaveDTO.getMannequin())) {
QueryWrapper<CollectionElement> qw = new QueryWrapper<>();
qw.lambda().eq(CollectionElement::getProjectId, projectId);
qw.lambda().eq(CollectionElement::getLevel1Type, CollectionLevel1TypeEnum.MANNEQUIN.getRealName());
List<CollectionElement> collectionElements = collectionElementMapper.selectList(qw);
Set<Long> old = collectionElements.stream().map(CollectionElement::getId).collect(Collectors.toSet());
// Set<String> oldUrl = collectionElements.stream().map(CollectionElement::getUrl).collect(Collectors.toSet());
List<MannequinDTO> mannequin = moduleSaveDTO.getMannequin();
for (MannequinDTO dto : mannequin) {
if (dto.getType().equals("System")) {
SysFile sysFile = sysFileMapper.selectById(dto.getId());
CollectionElement collectionElement = new CollectionElement();
collectionElement.setAccountId(accountId);
collectionElement.setProjectId(projectId);
collectionElement.setLevel1Type(CollectionLevel1TypeEnum.MANNEQUIN.getRealName());
// collectionElement.setLevel2Type(board.getLevel2Type());
collectionElement.setName(sysFile.getName());
collectionElement.setUrl(sysFile.getUrl());
// collectionElement.setHasPin(board.getIsPin());
collectionElement.setMd5(sysFile.getMd5());
collectionElement.setCreateDate(new Date());
collectionElementMapper.insert(collectionElement);
}else if (dto.getType().equals("Library")) {
Library library = libraryMapper.selectById(dto.getId());
CollectionElement collectionElement = new CollectionElement();
collectionElement.setAccountId(accountId);
collectionElement.setProjectId(projectId);
collectionElement.setLevel1Type(CollectionLevel1TypeEnum.MANNEQUIN.getRealName());
// collectionElement.setLevel2Type(board.getLevel2Type());
collectionElement.setName(library.getName());
collectionElement.setUrl(library.getUrl());
// collectionElement.setHasPin(board.getIsPin());
collectionElement.setMd5(library.getMd5());
collectionElement.setCreateDate(new Date());
collectionElementMapper.insert(collectionElement);
}else {
if (old.contains(dto.getId())) {
CollectionElement collectionElement = collectionElementMapper.selectById(dto.getId());
// collectionElement.setLevel2Type(board.getLevel2Type());
// collectionElement.setHasPin(board.getIsPin());
collectionElement.setUpdateDate(new Date());
collectionElementMapper.updateById(collectionElement);
old.remove(dto.getId());
}else {
CollectionElement collectionElement = collectionElementMapper.selectById(dto.getId());
collectionElement.setProjectId(projectId);
// collectionElement.setLevel2Type(board.getLevel2Type());
// collectionElement.setHasPin(board.getIsPin());
collectionElement.setUpdateDate(new Date());
collectionElementMapper.updateById(collectionElement);
}
}
}
if (!CollectionUtils.isEmpty(old)) {
collectionElementMapper.deleteBatchIds(old);
}
}
if (boundingBox) {
QueryWrapper<CollectionElement> qw = new QueryWrapper<>();
qw.lambda().eq(CollectionElement::getLevel1Type, CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName());

View File

@@ -61,6 +61,8 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
@Resource
private LibraryMapper libraryMapper;
@Resource
private BrandDNAMapper brandDNAMapper;
@Resource
private SysFileMapper sysFileMapper;
@@ -396,6 +398,11 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
vo.setStyleName(styleEnum.getChinese());
}
}
if (null != vo.getUserBrandDna()) {
BrandDNA brandDNA = brandDNAMapper.selectById(vo.getUserBrandDna());
vo.setUserBrandDnaName(brandDNA.getBrandName());
vo.setUserBrandDnaImg(minioUtil.getPreSignedUrl(brandDNA.getBrandLogo(), 24 * 60));
}
return vo;
}