Authored by caoyan

尺码集合

@@ -170,13 +170,16 @@ public class SizePoolService implements ISizePoolService{ @@ -170,13 +170,16 @@ public class SizePoolService implements ISizePoolService{
170 resp.setRangeTypeStr(getRangeTypeStr(pool.getRangeType())); 170 resp.setRangeTypeStr(getRangeTypeStr(pool.getRangeType()));
171 resp.setImageUrl(pool.getImageUrl()); 171 resp.setImageUrl(pool.getImageUrl());
172 List<SizePoolDetail> itemList = poolIdMap.get(pool.getId()); 172 List<SizePoolDetail> itemList = poolIdMap.get(pool.getId());
173 - if(pool.getRangeType().equals(RANGE_TYPE_BRAND)) {  
174 - Map<Integer, List<SizePoolDetail>> isIncludeMap = itemList.stream().collect(Collectors.groupingBy(SizePoolDetail::getIsInclude));  
175 - resp.setIncludeItems(brandMapper.selectOneById(isIncludeMap.get(1).get(0).getItemId()).getBrandName());  
176 - resp.setNotIncludeItems(getIsIncludeItemStr(isIncludeMap.get(0)));  
177 - }else if(pool.getRangeType().equals(ITEM_TYPE_PRODUCT)) {  
178 - resp.setIncludeItems(getIsIncludeItemStr(itemList)); 173 + if(CollectionUtils.isNotEmpty(itemList)) {
  174 + if(pool.getRangeType().equals(RANGE_TYPE_BRAND)) {
  175 + Map<Integer, List<SizePoolDetail>> isIncludeMap = itemList.stream().collect(Collectors.groupingBy(SizePoolDetail::getIsInclude));
  176 + resp.setIncludeItems(brandMapper.selectOneById(isIncludeMap.get(1).get(0).getItemId()).getBrandName());
  177 + resp.setNotIncludeItems(getIsIncludeItemStr(isIncludeMap.get(0)));
  178 + }else if(pool.getRangeType().equals(ITEM_TYPE_PRODUCT)) {
  179 + resp.setIncludeItems(getIsIncludeItemStr(itemList));
  180 + }
179 } 181 }
  182 +
180 respList.add(resp); 183 respList.add(resp);
181 } 184 }
182 185