...
|
...
|
@@ -2013,6 +2013,42 @@ public class ProductServiceImpl implements ProductService { |
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<SizeImageResp> getSizeImages(Integer productId, Integer brandId) {
|
|
|
List<SizePoolDetail> list = sizePoolDetailMapper.queryByProductId(productId, 1, null);//包括
|
|
|
if(CollectionUtils.isEmpty(list)) {
|
|
|
if (null == brandId) {
|
|
|
Product product = productHelpService.selectByIdCache(productId);
|
|
|
brandId = null == product ? null : product.getBrandId();
|
|
|
}
|
|
|
list = sizePoolDetailMapper.queryByBrandId(brandId);
|
|
|
if(!CollectionUtils.isEmpty(list)) {
|
|
|
List<SizePoolDetail> notIncludeList = sizePoolDetailMapper.queryByProductId(productId, 0, list.get(0).getSizePoolId());//不包括
|
|
|
if(!CollectionUtils.isEmpty(notIncludeList)) {
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
}else {
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
List<Integer> poolIdList = list.stream().map(SizePoolDetail::getSizePoolId).collect(Collectors.toList());
|
|
|
List<Integer> poolIdListSingle = new ArrayList<>();
|
|
|
if (!poolIdList.isEmpty()) {
|
|
|
poolIdListSingle.add(poolIdList.get(0));
|
|
|
}
|
|
|
List<SizePool> poolList = sizePoolMapper.querySizePoolImagesByIds(poolIdListSingle);
|
|
|
List<SizeImageResp> respList = new ArrayList<>();
|
|
|
for (SizePool sp : poolList) {
|
|
|
SizeImageResp re = new SizeImageResp();
|
|
|
re.setImageUrl(sp.getImageUrl());
|
|
|
re.setImageWidth(sp.getImageWidth());
|
|
|
re.setImageHeight(sp.getImageHeight());
|
|
|
respList.add(re);
|
|
|
}
|
|
|
return respList;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public VedioImageResp getVedioImage(Integer productId) {
|
|
|
VedioImageResp resp = new VedioImageResp();
|
|
|
ProductExt ext = productExtMapper.selectByProductId(productId);
|
...
|
...
|
|