|
|
|
@ -64,9 +64,10 @@ public class YxStoreHotListServiceImpl extends BaseServiceImpl<YxStoreHotListMap
|
|
|
|
|
public PageResult<YxStoreHotListVo> queryAll(YxStoreHotListQueryCriteria criteria, Pageable pageable) { |
|
|
|
|
getPage(pageable); |
|
|
|
|
PageInfo<YxStoreHotList> page = new PageInfo<>(queryAll(criteria)); |
|
|
|
|
page.getList().forEach(hotList->{ |
|
|
|
|
List<Integer> productArr = JSONUtil.toList(hotList.getProductList(), Integer.class); |
|
|
|
|
List<YxStoreProduct> list1 =new ArrayList<>(); |
|
|
|
|
PageResult<YxStoreHotListVo> result=generator.convertPageInfo(page, YxStoreHotListVo.class); |
|
|
|
|
result.getContent().forEach(hotListVo->{ |
|
|
|
|
List<Integer> productArr = JSONUtil.toList(hotListVo.getProductList(), Integer.class); |
|
|
|
|
ArrayList<YxStoreProduct> list1 =new ArrayList<>(); |
|
|
|
|
productArr.forEach(productId->{ |
|
|
|
|
LambdaQueryWrapper<YxStoreProduct> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
wrapper.eq(YxStoreProduct::getIsShow, ShopCommonEnum.SHOW_1.getValue()) |
|
|
|
@ -78,10 +79,9 @@ public class YxStoreHotListServiceImpl extends BaseServiceImpl<YxStoreHotListMap
|
|
|
|
|
list1.add(storeProduct); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
hotList.setProductList(JSONUtil.toJsonStr(list1)); |
|
|
|
|
// hotList.setProductInfo(list1);
|
|
|
|
|
hotListVo.setProductInfoList(list1); |
|
|
|
|
}); |
|
|
|
|
return generator.convertPageInfo(page, YxStoreHotListVo.class); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -110,11 +110,25 @@ public class YxStoreHotListServiceImpl extends BaseServiceImpl<YxStoreHotListMap
|
|
|
|
|
FileUtil.downloadExcel(list, response); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<HotListDTO> getList(String mouth) { |
|
|
|
|
LambdaQueryWrapper<YxStoreHotList> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
wrapper.eq(YxStoreHotList::getIsShow, ShopCommonEnum.SHOW_1.getValue()) |
|
|
|
|
.orderByAsc(YxStoreHotList::getSort) |
|
|
|
|
.eq(YxStoreHotList::getMouth,mouth); |
|
|
|
|
return getHotListDTOS(wrapper); |
|
|
|
|
} |
|
|
|
|
; |
|
|
|
|
@Override |
|
|
|
|
public List<HotListDTO> getList() { |
|
|
|
|
LambdaQueryWrapper<YxStoreHotList> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
wrapper.eq(YxStoreHotList::getIsShow, ShopCommonEnum.SHOW_1.getValue()) |
|
|
|
|
.orderByAsc(YxStoreHotList::getSort); |
|
|
|
|
return getHotListDTOS(wrapper); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<HotListDTO> getHotListDTOS(LambdaQueryWrapper<YxStoreHotList> wrapper) { |
|
|
|
|
List<HotListDTO> list = generator.convert(baseMapper.selectList(wrapper),HotListDTO.class); |
|
|
|
|
list.forEach(hotListDto->{ |
|
|
|
|
List<Integer> productArr = JSONUtil.toList(hotListDto.getProductList(), Integer.class); |
|
|
|
@ -134,5 +148,4 @@ public class YxStoreHotListServiceImpl extends BaseServiceImpl<YxStoreHotListMap
|
|
|
|
|
return list; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|