fix:初次从收藏和生成的线稿,再刷新前不会被用于design
This commit is contained in:
@@ -644,7 +644,7 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
if (result) {
|
if (result) {
|
||||||
throw new BusinessException("sketchBoards.designType.cannot.be.empty");
|
throw new BusinessException("sketchBoards.designType.cannot.be.empty");
|
||||||
}
|
}
|
||||||
|
List<CollectionElement> sketchBoardElements = new ArrayList<>();
|
||||||
// 提取类型为COLLECTION的sketchBoard ID列表
|
// 提取类型为COLLECTION的sketchBoard ID列表
|
||||||
List<Long> sketchBoardIds = designDTO.getSketchBoards().stream()
|
List<Long> sketchBoardIds = designDTO.getSketchBoards().stream()
|
||||||
.filter(f -> f.getDesignType().equals(DesignTypeEnum.COLLECTION.getRealName()))
|
.filter(f -> f.getDesignType().equals(DesignTypeEnum.COLLECTION.getRealName()))
|
||||||
@@ -652,12 +652,12 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if (!CollectionUtils.isEmpty(sketchBoardIds)) {
|
if (!CollectionUtils.isEmpty(sketchBoardIds)) {
|
||||||
// 从数据库查询验证sketchBoard元素是否存在
|
// 从数据库查询验证sketchBoard元素是否存在
|
||||||
List<CollectionElement> sketchBoardElements = collectionElementMapper.selectBatchIds(sketchBoardIds);
|
sketchBoardElements = collectionElementMapper.selectBatchIds(sketchBoardIds);
|
||||||
|
|
||||||
if (CollectionUtil.isEmpty(sketchBoardElements) || sketchBoardElements.size() != sketchBoardIds.size()) {
|
if (CollectionUtil.isEmpty(sketchBoardElements) || sketchBoardElements.size() != sketchBoardIds.size()) {
|
||||||
throw new BusinessException("get.sketchBoards.data.is.mismatch");
|
throw new BusinessException("get.sketchBoards.data.is.mismatch");
|
||||||
}
|
}
|
||||||
// 设置验证通过的sketchBoard元素到结果对象
|
|
||||||
elementVO.setSketchBoardElements(sketchBoardElements);
|
|
||||||
// 记录已使用的元素ID
|
// 记录已使用的元素ID
|
||||||
usedElementIds.addAll(sketchBoardIds);
|
usedElementIds.addAll(sketchBoardIds);
|
||||||
}
|
}
|
||||||
@@ -675,7 +675,9 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
Map<Long, CollectionSketchDTO> idToMap = designDTO.getSketchBoards()
|
Map<Long, CollectionSketchDTO> idToMap = designDTO.getSketchBoards()
|
||||||
.stream()
|
.stream()
|
||||||
.collect(Collectors.toMap(CollectionSketchDTO::getSketchBoardId, v -> v));
|
.collect(Collectors.toMap(CollectionSketchDTO::getSketchBoardId, v -> v));
|
||||||
libraryCollectionElements.addAll(covertLibrarysToCollections(librarys, idToMap));
|
List<CollectionElement> librarysToCollections = covertLibrarysToCollections(librarys, idToMap);
|
||||||
|
libraryCollectionElements.addAll(librarysToCollections);
|
||||||
|
sketchBoardElements.addAll(librarysToCollections);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -691,9 +693,13 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
Map<Long, CollectionSketchDTO> idToMap = designDTO.getSketchBoards()
|
Map<Long, CollectionSketchDTO> idToMap = designDTO.getSketchBoards()
|
||||||
.stream()
|
.stream()
|
||||||
.collect(Collectors.toMap(CollectionSketchDTO::getSketchBoardId, v -> v));
|
.collect(Collectors.toMap(CollectionSketchDTO::getSketchBoardId, v -> v));
|
||||||
generateCollectionElements.addAll(covertGeneratesToCollections(generateDetailList, idToMap));
|
List<CollectionElement> generatesToCollections = covertGeneratesToCollections(generateDetailList, idToMap);
|
||||||
|
generateCollectionElements.addAll(generatesToCollections);
|
||||||
|
sketchBoardElements.addAll(generatesToCollections);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 设置验证通过的sketchBoard元素到结果对象
|
||||||
|
elementVO.setSketchBoardElements(sketchBoardElements);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//校验marketingSketch
|
//校验marketingSketch
|
||||||
|
|||||||
Reference in New Issue
Block a user