fix promotion seckill for no join goods is not autostart

This commit is contained in:
paulGao 2021-09-22 09:43:11 +08:00
parent ac60f27814
commit d4c9b0f147

View File

@ -398,11 +398,9 @@ public class PromotionServiceImpl implements PromotionService {
seckill.setPromotionStatus(promotionMessage.getPromotionStatus());
result = this.seckillService.update(updateWrapper(promotionMessage));
log.info("更新限时抢购活动状态:{}", seckill);
//判断参与活动的商品是否为空如果为空则返回
if (seckill.getSeckillApplyList() == null) {
return result;
}
//判断参与活动的商品是否为空
if (seckill.getSeckillApplyList() != null && !seckill.getSeckillApplyList().isEmpty()) {
//循环秒杀商品数据将数据按照时间段进行存储
for (SeckillApply seckillApply : seckill.getSeckillApplyList()) {
if (seckillApply.getPromotionApplyStatus().equals(PromotionApplyStatusEnum.PASS.name())) {
@ -434,6 +432,8 @@ public class PromotionServiceImpl implements PromotionService {
this.goodsIndexService.updateEsGoodsIndex(seckillApply.getSkuId(), seckill1, promotionTypeEnum.name() + "-" + seckillApply.getTimeLine(), seckillApply.getPrice());
}
}
}
this.mongoTemplate.save(seckill);
return result;
}