Authored by caoyan

尺码集合

@@ -1976,19 +1976,18 @@ public class ProductServiceImpl implements ProductService { @@ -1976,19 +1976,18 @@ public class ProductServiceImpl implements ProductService {
1976 @Override 1976 @Override
1977 public SizeImageResp getSizeImage(Integer productId, Integer brandId) { 1977 public SizeImageResp getSizeImage(Integer productId, Integer brandId) {
1978 SizeImageResp resp = new SizeImageResp(); 1978 SizeImageResp resp = new SizeImageResp();
1979 - List<SizePoolDetail> list = sizePoolDetailMapper.queryByBrandId(brandId); 1979 + List<SizePoolDetail> list = sizePoolDetailMapper.queryByProductId(productId, 1, null);//包括
1980 if(CollectionUtils.isEmpty(list)) { 1980 if(CollectionUtils.isEmpty(list)) {
1981 - list = sizePoolDetailMapper.queryByProductId(productId, 1, null);//包括  
1982 - }else { 1981 + list = sizePoolDetailMapper.queryByBrandId(brandId);
  1982 + if(!CollectionUtils.isEmpty(list)) {
1983 List<SizePoolDetail> notIncludeList = sizePoolDetailMapper.queryByProductId(productId, 0, list.get(0).getSizePoolId());//不包括 1983 List<SizePoolDetail> notIncludeList = sizePoolDetailMapper.queryByProductId(productId, 0, list.get(0).getSizePoolId());//不包括
1984 if(!CollectionUtils.isEmpty(notIncludeList)) { 1984 if(!CollectionUtils.isEmpty(notIncludeList)) {
1985 return resp; 1985 return resp;
1986 } 1986 }
1987 - }  
1988 -  
1989 - if(CollectionUtils.isEmpty(list)) { 1987 + }else {
1990 return resp; 1988 return resp;
1991 } 1989 }
  1990 + }
1992 1991
1993 List<Integer> poolIdList = list.stream().map(SizePoolDetail::getSizePoolId).collect(Collectors.toList()); 1992 List<Integer> poolIdList = list.stream().map(SizePoolDetail::getSizePoolId).collect(Collectors.toList());
1994 SizePool pool = sizePoolMapper.querySizePoolByIds(poolIdList); 1993 SizePool pool = sizePoolMapper.querySizePoolByIds(poolIdList);