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)