diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategoryServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategoryServiceImpl.java index 18c4b574..541f886f 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategoryServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/CategoryServiceImpl.java @@ -107,10 +107,10 @@ public class CategoryServiceImpl extends ServiceImpl i @Override public List categoryTree() { -// List categoryVOList = (List) cache.get(CachePrefix.CATEGORY.getPrefix()); -// if (categoryVOList != null) { -// return categoryVOList; -// } + List categoryVOList = (List) cache.get(CachePrefix.CATEGORY.getPrefix()); + if (categoryVOList != null) { + return categoryVOList; + } //获取全部分类 LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); @@ -118,7 +118,7 @@ public class CategoryServiceImpl extends ServiceImpl i List list = this.list(queryWrapper); //构造分类树 - List categoryVOList = new ArrayList<>(); + categoryVOList = new ArrayList<>(); for (Category category : list) { if ("0".equals(category.getParentId())) { CategoryVO categoryVO = new CategoryVO(category);