1.代客下单 库存不足提示商品名

This commit is contained in:
SongZhang 2024-08-26 10:21:21 +08:00
parent 078a986e6b
commit 48aab9eeac
1 changed files with 2 additions and 2 deletions

View File

@ -550,7 +550,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
if (product.getIsDistribute() == 1) { if (product.getIsDistribute() == 1) {
if (product.getIsStock() == 1) { if (product.getIsStock() == 1) {
if (productMapper.decrStock(productId, decrNum) < 1) { if (productMapper.decrStock(productId, decrNum) < 1) {
throw new BadRequestException("库存不足,下单失败"); throw new BadRequestException(product.getName() + "库存不足,下单失败");
} }
} else { } else {
productMapper.decrStockUnCheck(productId, decrNum); productMapper.decrStockUnCheck(productId, decrNum);
@ -558,7 +558,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
} else { } else {
if (product.getIsStock() == 1) { if (product.getIsStock() == 1) {
if (producSkutMapper.decrStock(String.valueOf(skuId), decrNum) < 1) { if (producSkutMapper.decrStock(String.valueOf(skuId), decrNum) < 1) {
throw new BadRequestException("库存不足,下单失败"); throw new BadRequestException(product.getName() + "库存不足,下单失败");
} }
} else { } else {
producSkutMapper.decrStockUnCheck(String.valueOf(skuId), decrNum); producSkutMapper.decrStockUnCheck(String.valueOf(skuId), decrNum);