From 6b5ca5b337ff927e3b092ee878acaeff70791914 Mon Sep 17 00:00:00 2001 From: chc <1501738723@qq.com> Date: Thu, 25 Jan 2024 14:02:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E7=B1=BB=E7=BC=93=E5=AD=98=E8=8E=B7?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/goods/serviceimpl/CategoryServiceImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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);