库存修改为商品级库存
This commit is contained in:
@@ -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("库存不足,下单失败");
|
||||
|
||||
Reference in New Issue
Block a user