BUGFIX:design colorboard元素混入sketchboard;
This commit is contained in:
@@ -78,6 +78,9 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
||||
@Value("${minio.bucketName.gradient}")
|
||||
private String gradientBucketName;
|
||||
|
||||
// @Resource
|
||||
// private RedisUtil redisUtil;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public CollectionElementVO upload(CollectionElementUploadDTO uploadDTO) {
|
||||
@@ -101,6 +104,9 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
||||
//保存element元素
|
||||
CollectionElement collectionElement = resolveData(uploadDTO, userInfo, path, level2Type);
|
||||
saveOne(collectionElement);
|
||||
// if (!StringUtils.isEmpty(uploadDTO.getMoodboardPosition())) {
|
||||
// redisUtil.saveMoodboardPosition(collectionElement.getId(), uploadDTO.getMoodboardPosition());
|
||||
// }
|
||||
CollectionElementVO collectionElementVO = CopyUtil.copyObject(collectionElement, CollectionElementVO.class);
|
||||
collectionElementVO.setMinIOPath(collectionElementVO.getUrl());
|
||||
collectionElementVO.setUrl(minioUtil.getPreSignedUrl(collectionElementVO.getUrl(), 24 * 60));
|
||||
@@ -689,30 +695,40 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
||||
@Override
|
||||
public void editSketchBoardsElement(ValidateElementVO elementVO, List<CollectionSketchDTO> sketchBoards) {
|
||||
if (CollectionUtil.isNotEmpty(sketchBoards)) {
|
||||
sketchBoards.forEach(sketchBoard -> {
|
||||
List<CollectionSketchDTO> collect = sketchBoards.stream().filter(o -> o.getDesignType().equals(DesignTypeEnum.COLLECTION.getRealName())).collect(Collectors.toList());
|
||||
collect.forEach(sketchBoard -> {
|
||||
CollectionElement collectionElement = CopyUtil.copyObject(sketchBoard, CollectionElement.class);
|
||||
collectionElement.setHasPin(sketchBoard.getIsPin());
|
||||
collectionElement.setId(sketchBoard.getSketchBoardId());
|
||||
collectionElementMapper.updateById(collectionElement);
|
||||
});
|
||||
List<Long> sketchBoardIds = sketchBoards.stream().map(CollectionSketchDTO::getSketchBoardId).collect(Collectors.toList());
|
||||
List<CollectionElement> sketchBoardElements = collectionElementMapper.selectBatchIds(sketchBoardIds);
|
||||
elementVO.setSketchBoardElements(sketchBoardElements);
|
||||
List<Long> sketchBoardIds = collect.stream().map(CollectionSketchDTO::getSketchBoardId).collect(Collectors.toList());
|
||||
if (!CollectionUtils.isEmpty(sketchBoardIds)) {
|
||||
List<CollectionElement> sketchBoardElements = collectionElementMapper.selectBatchIds(sketchBoardIds);
|
||||
elementVO.setSketchBoardElements(sketchBoardElements);
|
||||
}else {
|
||||
elementVO.setSketchBoardElements(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editPrintBoardsElement(ValidateElementVO elementVO, List<DesignCollectionPrintElementDTO> printBoards) {
|
||||
if (CollectionUtil.isNotEmpty(printBoards)) {
|
||||
printBoards.forEach(printBoard -> {
|
||||
List<DesignCollectionPrintElementDTO> collect = printBoards.stream().filter(o -> o.getDesignType().equals(DesignTypeEnum.COLLECTION.getRealName())).collect(Collectors.toList());
|
||||
collect.forEach(printBoard -> {
|
||||
CollectionElement collectionElement = CopyUtil.copyObject(printBoard, CollectionElement.class);
|
||||
collectionElement.setHasPin(Objects.isNull(printBoard.getIsPin()) ? 0 : printBoard.getIsPin());
|
||||
collectionElement.setId(printBoard.getId());
|
||||
collectionElementMapper.updateById(collectionElement);
|
||||
});
|
||||
List<Long> printBoardIds = printBoards.stream().map(DesignCollectionPrintElementDTO::getId).collect(Collectors.toList());
|
||||
List<CollectionElement> printBoardElements = collectionElementMapper.selectBatchIds(printBoardIds);
|
||||
elementVO.setPrintBoardElements(printBoardElements);
|
||||
List<Long> printBoardIds = collect.stream().map(DesignCollectionPrintElementDTO::getId).collect(Collectors.toList());
|
||||
if (!CollectionUtils.isEmpty(printBoardIds)) {
|
||||
List<CollectionElement> printBoardElements = collectionElementMapper.selectBatchIds(printBoardIds);
|
||||
elementVO.setPrintBoardElements(printBoardElements);
|
||||
}else {
|
||||
elementVO.setPrintBoardElements(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user