库存不足提示

This commit is contained in:
wangw 2025-04-16 18:26:14 +08:00
parent 2688efc638
commit 306eb0fbb2
1 changed files with 1 additions and 1 deletions

View File

@ -463,7 +463,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
.eq(Product::getShopId, detail.getShopId())
.eq(Product::getIsDel, 0)
.eq(Product::getIsStock, 1));
if (product != null && detail.getNum().compareTo(new BigDecimal(product.getStockNumber())) < 0) {
if (product != null && detail.getNum().compareTo(new BigDecimal(product.getStockNumber())) > 0) {
throw new CzgException("下单失败" + product.getName() + "库存不足");
}
}