TASK:mannequin;
This commit is contained in:
@@ -27,7 +27,9 @@ public enum CollectionLevel1TypeEnum {
|
|||||||
/**
|
/**
|
||||||
* 市场
|
* 市场
|
||||||
*/
|
*/
|
||||||
MARKETING_SKETCH("MarketingSketch");
|
MARKETING_SKETCH("MarketingSketch"),
|
||||||
|
|
||||||
|
MANNEQUIN("Mannequin");
|
||||||
|
|
||||||
private String realName;
|
private String realName;
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public class Workspace implements Serializable {
|
|||||||
|
|
||||||
private Long projectId;
|
private Long projectId;
|
||||||
|
|
||||||
private Integer userBrandDna;
|
private Long userBrandDna;
|
||||||
|
|
||||||
private Integer brandPercentage;
|
private Integer brandPercentage;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ai.da.model.dto;
|
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.CollectionColorVO;
|
||||||
import com.ai.da.model.vo.CollectionElementVO;
|
import com.ai.da.model.vo.CollectionElementVO;
|
||||||
import com.ai.da.model.vo.MoodBoardModuleChooseVO;
|
import com.ai.da.model.vo.MoodBoardModuleChooseVO;
|
||||||
@@ -29,6 +30,8 @@ public class ModuleSaveDTO {
|
|||||||
|
|
||||||
private PatternMaking3DDTO patternMaking3D;
|
private PatternMaking3DDTO patternMaking3D;
|
||||||
|
|
||||||
|
private List<MannequinDTO> mannequin;
|
||||||
|
|
||||||
// private MoodBoardModuleChooseVO moodBoard;
|
// private MoodBoardModuleChooseVO moodBoard;
|
||||||
// private List<CollectionElementVO> printBoard;
|
// private List<CollectionElementVO> printBoard;
|
||||||
// private List<CollectionColorVO> colorBoard;
|
// private List<CollectionColorVO> colorBoard;
|
||||||
|
|||||||
@@ -40,6 +40,9 @@ public class WorkspaceVO extends Workspace {
|
|||||||
|
|
||||||
private String style;
|
private String style;
|
||||||
|
|
||||||
|
private String userBrandDnaImg;
|
||||||
|
private String userBrandDnaName;
|
||||||
|
|
||||||
private Map<String, List<String>> allKeywordsByStyle;
|
private Map<String, List<String>> allKeywordsByStyle;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) {
|
if (boundingBox) {
|
||||||
QueryWrapper<CollectionElement> qw = new QueryWrapper<>();
|
QueryWrapper<CollectionElement> qw = new QueryWrapper<>();
|
||||||
qw.lambda().eq(CollectionElement::getLevel1Type, CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName());
|
qw.lambda().eq(CollectionElement::getLevel1Type, CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName());
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private LibraryMapper libraryMapper;
|
private LibraryMapper libraryMapper;
|
||||||
|
@Resource
|
||||||
|
private BrandDNAMapper brandDNAMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysFileMapper sysFileMapper;
|
private SysFileMapper sysFileMapper;
|
||||||
@@ -396,6 +398,11 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
|||||||
vo.setStyleName(styleEnum.getChinese());
|
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;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user