Commit f671ad84 authored by shiyu's avatar shiyu

首页查询数据

parent d93da892
......@@ -229,6 +229,8 @@ public class SupplierItemServiceImpl implements SupplierItemService {
List<Long> searchItemIds = (List<Long>) redisUtils.get(viewKey);
dto.setFilterIds(searchItemIds);
}
//只需要从剩下的符合条件的数据中查询出20条随机数据,无需按照前端页码获取数据
dto.setPage(1);
List<SupplierItem> supplierItemList = supplierItemDao.findListForRandomSort(dto);
PageInfo pageInfo = new PageInfo(supplierItemList);
List<Long> filterItemIds = supplierItemList.stream().map(SupplierItem::getId).collect(Collectors.toList());
......@@ -1198,6 +1200,8 @@ public class SupplierItemServiceImpl implements SupplierItemService {
List<Long> searchItemIds = (List<Long>) redisUtils.get(viewKey);
searchDto.setFilterIds(searchItemIds);
}
//只需要从剩下的符合条件的数据中查询出20条随机数据,无需按照前端页码获取数据
searchDto.setPage(1);
List<SupplierItem> supplierItemList = supplierItemDao.findForHomePage(searchDto);
PageInfo<SupplierItem> pageInfo = new PageInfo(supplierItemList);
List<Long> filterItemIds = supplierItemList.stream().map(SupplierItem::getId).collect(Collectors.toList());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment