|
@@ -100,13 +100,12 @@ public class ShowroomController extends BaseController {
|
|
|
List<ShowCollection> origin = showCollectionRepo.findAllByShowroomIdOrderBySort(id);
|
|
List<ShowCollection> origin = showCollectionRepo.findAllByShowroomIdOrderBySort(id);
|
|
|
List<ShowCollection> neo = new ArrayList<>();
|
|
List<ShowCollection> neo = new ArrayList<>();
|
|
|
if (origin != null) {
|
|
if (origin != null) {
|
|
|
- origin.forEach(orig -> {
|
|
|
|
|
- Collection collection = collectionRepo.findById(orig.getCollectionId())
|
|
|
|
|
- .orElseThrow(new BusinessException("暂无"));
|
|
|
|
|
- orig.setStatus(showroomService.getStatus(collection));
|
|
|
|
|
- orig.setPrice(collection.getPrice());
|
|
|
|
|
- neo.add(orig);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ origin.forEach(orig -> collectionRepo.findById(orig.getCollectionId())
|
|
|
|
|
+ .ifPresent(collection -> {
|
|
|
|
|
+ orig.setStatus(showroomService.getStatus(collection));
|
|
|
|
|
+ orig.setPrice(collection.getPrice());
|
|
|
|
|
+ neo.add(orig);
|
|
|
|
|
+ }));
|
|
|
}
|
|
}
|
|
|
showroom.setCollections(neo);
|
|
showroom.setCollections(neo);
|
|
|
User user = SecurityUtils.getAuthenticatedUser();
|
|
User user = SecurityUtils.getAuthenticatedUser();
|