修改更新库存方法
This commit is contained in:
parent
8657996705
commit
72740a37c8
@ -1512,9 +1512,11 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
|||||||
if (lestFrozenQuantity.compareTo(0) < 0) {
|
if (lestFrozenQuantity.compareTo(0) < 0) {
|
||||||
lestFrozenQuantity = 0;
|
lestFrozenQuantity = 0;
|
||||||
}
|
}
|
||||||
productItem.setItem_quantity(productItem.getItem_quantity() + returnNum);
|
ShopProductItem upadteShopProductItem=new ShopProductItem();
|
||||||
productItem.setItem_quantity_frozen(lestFrozenQuantity);
|
upadteShopProductItem.setItem_id(shopOrderItem.getItem_id());
|
||||||
if (!shopProductItemService.edit(productItem)) {
|
upadteShopProductItem.setItem_quantity(productItem.getItem_quantity() + returnNum);
|
||||||
|
upadteShopProductItem.setItem_quantity_frozen(lestFrozenQuantity);
|
||||||
|
if (!shopProductItemService.edit(upadteShopProductItem)) {
|
||||||
logger.error("增加库存失败!商品项ID: {}", itemId);
|
logger.error("增加库存失败!商品项ID: {}", itemId);
|
||||||
throw new ApiException(I18nUtil._("增加库存失败!"));
|
throw new ApiException(I18nUtil._("增加库存失败!"));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user