fix: 修复促销商品库存扣减问题

This commit is contained in:
misworga831
2024-01-24 10:10:43 +08:00
parent a2496b267a
commit 1d2cb5737d
3 changed files with 80 additions and 58 deletions

View File

@@ -23,7 +23,7 @@ public enum PromotionTypeEnum {
/**
* 有促销库存的活动类型
*/
static final PromotionTypeEnum[] haveStockPromotion = new PromotionTypeEnum[]{PINTUAN, SECKILL, KANJIA, POINTS_GOODS};
public static final PromotionTypeEnum[] haveStockPromotion = new PromotionTypeEnum[]{PINTUAN, SECKILL, KANJIA, POINTS_GOODS};
private final String description;

View File

@@ -399,6 +399,8 @@ public class SeckillApplyServiceImpl extends ServiceImpl<SeckillApplyMapper, Sec
Object quantity = cache.get(promotionGoodsStockCacheKey);
if (quantity != null) {
goodsVO.setQuantity((Integer) quantity);
} else {
cache.put(promotionGoodsStockCacheKey, seckillApply.getQuantity());
}
seckillGoodsVoS.add(goodsVO);
}