商品修改 发送通知

This commit is contained in:
2026-04-14 13:44:27 +08:00
parent 85bc610c10
commit c1c7cbba7b
4 changed files with 72 additions and 0 deletions

View File

@@ -700,6 +700,18 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
Product old = getById(prodId);
Long categoryId = old.getCategoryId();
clearProductCache(categoryId);
ThreadUtil.execAsync(() -> rabbitPublisher.sendConsInfoChangeMsg(Convert.toStr(shopId)));
}
@Override
public void markProductIsAutoSoldOut(Long shopId, ProductIsAutoSaleParam param) {
Product entity = super.getOne(query().eq(Product::getId, param.getId()).eq(Product::getShopId, shopId));
if (entity == null) {
throw new CzgException("商品不存在");
}
Product update = new Product();
update.setIsAutoSoldStock(param.getIsAutoSoldStock());
update(update, query().eq(Product::getId, param.getId()).eq(Product::getShopId, shopId));
}
@Override