TASK:mannequin;
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user