增加检测促销商品库存
This commit is contained in:
		
							parent
							
								
									1688a7ba15
								
							
						
					
					
						commit
						0d5f871da7
					
				| @ -190,7 +190,13 @@ public class SkuPromotionRender implements CartRenderStep { | |||||||
|             List<PromotionSkuVO> joinPromotion = cartSkuVO.getPriceDetailDTO().getJoinPromotion(); |             List<PromotionSkuVO> joinPromotion = cartSkuVO.getPriceDetailDTO().getJoinPromotion(); | ||||||
|             if (!joinPromotion.isEmpty()) { |             if (!joinPromotion.isEmpty()) { | ||||||
|                 for (PromotionSkuVO promotionSkuVO : joinPromotion) { |                 for (PromotionSkuVO promotionSkuVO : joinPromotion) { | ||||||
|  |                     this.checkPromotionGoodsQuantity(cartSkuVO, promotionSkuVO); | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|  |     private void checkPromotionGoodsQuantity(CartSkuVO cartSkuVO, PromotionSkuVO promotionSkuVO) { | ||||||
|         String promotionGoodsStockCacheKey = PromotionGoodsService.getPromotionGoodsStockCacheKey(PromotionTypeEnum.valueOf(promotionSkuVO.getPromotionType()), promotionSkuVO.getActivityId(), cartSkuVO.getGoodsSku().getId()); |         String promotionGoodsStockCacheKey = PromotionGoodsService.getPromotionGoodsStockCacheKey(PromotionTypeEnum.valueOf(promotionSkuVO.getPromotionType()), promotionSkuVO.getActivityId(), cartSkuVO.getGoodsSku().getId()); | ||||||
|         Object quantity = cache.get(promotionGoodsStockCacheKey); |         Object quantity = cache.get(promotionGoodsStockCacheKey); | ||||||
| 
 | 
 | ||||||
| @ -220,9 +226,6 @@ public class SkuPromotionRender implements CartRenderStep { | |||||||
|             cartSkuVO.setErrorMessage("促销商品库存不足,现有库存数量[" + quantity + "]"); |             cartSkuVO.setErrorMessage("促销商品库存不足,现有库存数量[" + quantity + "]"); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|             } |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * 购物车促销类型 |      * 购物车促销类型 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 paulGao
						paulGao