From fe06555a0b405793ac554dadf329566a42888065 Mon Sep 17 00:00:00 2001 From: lifenlong Date: Mon, 28 Jun 2021 16:09:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=9630=E5=A4=A9=E7=9A=84?= =?UTF-8?q?=E7=A7=92=E6=9D=80=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../promotion/serviceimpl/SeckillApplyServiceImpl.java | 2 +- .../modules/promotion/serviceimpl/SeckillServiceImpl.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java index 7cec4571..64aa1db9 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java @@ -185,7 +185,7 @@ public class SeckillApplyServiceImpl extends ServiceImpl impl //检查秒杀活动参数 checkSeckillParam(seckillVO, seckill.getStoreId()); //保存到MYSQL中 - boolean result = this.save(seckill); + boolean result = this.save(seckillVO); //保存到MONGO中 this.mongoTemplate.save(seckillVO); //添加秒杀延时任务 @@ -245,7 +245,7 @@ public class SeckillServiceImpl extends ServiceImpl impl public Integer getApplyNum() { LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(); //秒杀申请时间未超过当前时间 - queryWrapper.le(Seckill::getApplyEndTime, cn.hutool.core.date.DateUtil.date()); + queryWrapper.ge(Seckill::getApplyEndTime, cn.hutool.core.date.DateUtil.date()); queryWrapper.eq(Seckill::getPromotionStatus, PromotionStatusEnum.NEW.name()); return this.count(queryWrapper); } @@ -296,7 +296,7 @@ public class SeckillServiceImpl extends ServiceImpl impl int sameNum = this.count(queryWrapper); //当前时间段是否存在同类活动 if (sameNum > 0) { - throw new ServiceException("当前时间内已存在同类活动"); + throw new ServiceException("当前时间内已存在同类活动:"+seckill.getStartTime()); } } } \ No newline at end of file