From 9ff2f50b8f9cbbbbeecaac2e3a7e67fc598267c3 Mon Sep 17 00:00:00 2001 From: lifenlong Date: Wed, 21 Jul 2021 12:51:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=97=AE=E9=A2=98=EF=BC=9A?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E4=BC=98=E6=83=A0=E5=88=B8=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E5=95=86=E5=93=81=E9=A1=B5=E9=9D=A2=E8=BF=98=E6=98=AF=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E4=BC=98=E6=83=A0=E5=88=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceimpl/CouponServiceImpl.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/CouponServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/CouponServiceImpl.java index 666b7539..329efcc6 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/CouponServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/CouponServiceImpl.java @@ -156,16 +156,14 @@ public class CouponServiceImpl extends ServiceImpl impleme couponVO.setPromotionStatus(promotionStatus.name()); this.updateById(couponVO); this.mongoTemplate.save(couponVO); - if (promotionStatus.name().equals(PromotionStatusEnum.START.name())) { - PromotionMessage promotionMessage = new PromotionMessage(couponVO.getId(), PromotionTypeEnum.COUPON.name(), PromotionStatusEnum.START.name(), couponVO.getStartTime(), couponVO.getEndTime()); - //更新延时任务 - this.timeTrigger.edit(TimeExecuteConstant.PROMOTION_EXECUTOR, - promotionMessage, - couponVO.getStartTime().getTime(), couponVO.getStartTime().getTime(), - DelayQueueTools.wrapperUniqueKey(DelayTypeEnums.PROMOTION, (promotionMessage.getPromotionType() + promotionMessage.getPromotionId())), - DateUtil.getDelayTime(couponVO.getStartTime().getTime()), - rocketmqCustomProperties.getPromotionTopic()); - } + PromotionMessage promotionMessage = new PromotionMessage(couponVO.getId(), PromotionTypeEnum.COUPON.name(), promotionStatus.name(), couponVO.getStartTime(), couponVO.getEndTime()); + //更新延时任务 + this.timeTrigger.edit(TimeExecuteConstant.PROMOTION_EXECUTOR, + promotionMessage, + couponVO.getStartTime().getTime(), couponVO.getStartTime().getTime(), + DelayQueueTools.wrapperUniqueKey(DelayTypeEnums.PROMOTION, (promotionMessage.getPromotionType() + promotionMessage.getPromotionId())), + DateUtil.getDelayTime(couponVO.getStartTime().getTime()), + rocketmqCustomProperties.getPromotionTopic()); } return true; }