Selaa lähdekoodia

无sku商品下单问题修复

macro 6 vuotta sitten
vanhempi
commit
dd2597b862

+ 1 - 1
mall-portal/src/main/java/com/macro/mall/portal/service/impl/OmsPortalOrderServiceImpl.java

@@ -613,7 +613,7 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
      */
     private boolean hasStock(List<CartPromotionItem> cartPromotionItemList) {
         for (CartPromotionItem cartPromotionItem : cartPromotionItemList) {
-            if (cartPromotionItem.getRealStock() <= 0) {
+            if (cartPromotionItem.getRealStock()==null||cartPromotionItem.getRealStock() <= 0) {
                 return false;
             }
         }

+ 3 - 1
mall-portal/src/main/java/com/macro/mall/portal/service/impl/OmsPromotionServiceImpl.java

@@ -162,7 +162,9 @@ public class OmsPromotionServiceImpl implements OmsPromotionService {
             cartPromotionItem.setPromotionMessage("无优惠");
             cartPromotionItem.setReduceAmount(new BigDecimal(0));
             PmsSkuStock skuStock = getOriginalPrice(promotionProduct,item.getProductSkuId());
-            cartPromotionItem.setRealStock(skuStock.getStock()-skuStock.getLockStock());
+            if(skuStock!=null){
+                cartPromotionItem.setRealStock(skuStock.getStock()-skuStock.getLockStock());
+            }
             cartPromotionItem.setIntegration(promotionProduct.getGiftPoint());
             cartPromotionItem.setGrowth(promotionProduct.getGiftGrowth());
             cartPromotionItemList.add(cartPromotionItem);