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