关联关系状态

This commit is contained in:
2026-04-09 17:18:16 +08:00
parent a1fe1bac16
commit 86fdcaf8a0

View File

@@ -183,7 +183,6 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> 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<ProductMapper, Product> 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<ProductMapper, Product> impl
List<Long> 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)