From 6416eaf54861a94c41251afa03a28d63189863cd Mon Sep 17 00:00:00 2001 From: SongZhang <2064194730@qq.com> Date: Sat, 12 Oct 2024 09:20:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=93=E5=AD=98=E4=BF=AE=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E5=95=86=E5=93=81=E7=BA=A7=E5=BA=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/cashierservice/service/ProductService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java index fc725b5..2997138 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java @@ -157,7 +157,7 @@ public class ProductService { public void incrStock(String productId, String skuId, int addNum) { TbProductWithBLOBs product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(productId)); - if (product.getIsDistribute() == 1) { + if (true ||product.getIsDistribute() == 1) { tbProductMapper.incrStock(productId, addNum); }else { tbProductSkuMapper.incrStock(skuId, addNum); @@ -166,7 +166,7 @@ public class ProductService { public void decrStock(String productId, String skuId, int decrNum) { TbProductWithBLOBs product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(productId)); - if (product.getIsDistribute() == 1) { + if (true || product.getIsDistribute() == 1) { if (product.getIsStock() == 1) { if (tbProductMapper.decrStock(productId, decrNum) < 1) { throw new MsgException("库存不足,下单失败");