From 86fdcaf8a0927e882459c92c20d4531f15dd916c Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Thu, 9 Apr 2026 17:18:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E8=81=94=E5=85=B3=E7=B3=BB=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/product/service/impl/ProductServiceImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cash-service/product-service/src/main/java/com/czg/service/product/service/impl/ProductServiceImpl.java b/cash-service/product-service/src/main/java/com/czg/service/product/service/impl/ProductServiceImpl.java index 00ae2ad10..e0ce9d339 100644 --- a/cash-service/product-service/src/main/java/com/czg/service/product/service/impl/ProductServiceImpl.java +++ b/cash-service/product-service/src/main/java/com/czg/service/product/service/impl/ProductServiceImpl.java @@ -183,7 +183,6 @@ public class ProductServiceImpl extends ServiceImpl impl record.setSkuList(skuList); record.setProdConsRelations(prodConsRelationMapper.selectListByQuery(query() .eq(ProdConsRelation::getProductId, record.getId()) - .eq(ConsInfo::getStatus, SystemConstants.OneZero.ONE) .eq(ProdConsRelation::getShopId, record.getShopId()))); }); return records; @@ -391,6 +390,7 @@ public class ProductServiceImpl extends ServiceImpl impl for (Long categoryId : categoryIds) { redisService.del(prefix + categoryId); } + redisService.del(ADMIN_CLIENT_PRODUCT_LIST + "::" + shopId); } /** @@ -544,6 +544,12 @@ public class ProductServiceImpl extends ServiceImpl impl List list = skuList.stream().map(ProdSkuDTO::getId).filter(Objects::nonNull).distinct().toList(); skuIdList.removeAll(list); } + // 清除商品分类列表缓存 + if (!old.getCategoryId().equals(dto.getCategoryId())) { + clearProductCache(old.getCategoryId(), entity.getCategoryId()); + } else { + clearProductCache(old.getCategoryId()); + } if (CollUtil.isNotEmpty(skuIdList)) { // 逻辑删除无用的SKU数据 UpdateChain.of(ProdSku.class)