优化代码,修复编辑秒杀活动时执行顺序问题
This commit is contained in:
parent
f4d7c07f57
commit
348f362b30
@ -74,7 +74,7 @@ public class SkuPromotionRender implements CartRenderStep {
|
||||
renderBasePrice(tradeDTO);
|
||||
//渲染单品促销
|
||||
renderSkuPromotion(tradeDTO);
|
||||
|
||||
//检查促销库存
|
||||
checkPromotionQuantity(tradeDTO);
|
||||
|
||||
|
||||
|
@ -185,7 +185,6 @@ public class CartServiceImpl implements CartService {
|
||||
|
||||
//购物车中不存在此商品,则新建立一个
|
||||
CartSkuVO cartSkuVO = new CartSkuVO(dataSku, promotionMap);
|
||||
this.checkSetGoodsQuantity(cartSkuVO, skuId, num);
|
||||
cartSkuVO.setCartType(cartTypeEnum);
|
||||
//检测购物车数据
|
||||
checkCart(cartTypeEnum, cartSkuVO, skuId, num);
|
||||
|
@ -232,8 +232,6 @@ public class PromotionGoodsServiceImpl extends ServiceImpl<PromotionGoodsMapper,
|
||||
this.update(updateWrapper);
|
||||
stringRedisTemplate.opsForValue().set(promotionStockKey, promotionGoods.getQuantity().toString());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -150,7 +150,6 @@ public class PromotionServiceImpl implements PromotionService {
|
||||
searchParams.setSkuId(promotionGoods.getSkuId());
|
||||
List<SeckillApply> seckillApplyList = seckillApplyService.getSeckillApplyList(searchParams);
|
||||
if (seckillApplyList != null && !seckillApplyList.isEmpty()) {
|
||||
SeckillApply seckillApply = seckillApplyList.get(0);
|
||||
String[] split = seckill.getHours().split(",");
|
||||
int[] hoursSored = Arrays.stream(split).mapToInt(Integer::parseInt).toArray();
|
||||
Arrays.sort(hoursSored);
|
||||
@ -158,7 +157,6 @@ public class PromotionServiceImpl implements PromotionService {
|
||||
seckill.setEndTime(promotionGoods.getEndTime());
|
||||
promotionMap.put(esPromotionKey, seckill);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -146,8 +146,11 @@ public class SeckillServiceImpl extends AbstractPromotionsServiceImpl<SeckillMap
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean updatePromotions(Seckill promotions) {
|
||||
this.checkStatus(promotions);
|
||||
this.checkPromotions(promotions);
|
||||
boolean result = this.updateById(promotions);
|
||||
seckillApplyService.updateSeckillApplyTime(promotions);
|
||||
return this.saveOrUpdate(promotions);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user