Commit e44d9fe136efff873a9fd997ef4453fab56d03e4
1 parent
2cad35f3
fix:【mall 商城】优惠劵在“领取之后”场景下,计算不正确的问题
Showing
1 changed file
with
6 additions
and
6 deletions
yudao-module-mall/yudao-module-promotion/src/main/java/cn/iocoder/yudao/module/promotion/convert/coupon/CouponConvert.java
| @@ -30,7 +30,7 @@ public interface CouponConvert { | @@ -30,7 +30,7 @@ public interface CouponConvert { | ||
| 30 | CouponRespDTO convert(CouponDO bean); | 30 | CouponRespDTO convert(CouponDO bean); |
| 31 | 31 | ||
| 32 | default CouponDO convert(CouponTemplateDO template, Long userId) { | 32 | default CouponDO convert(CouponTemplateDO template, Long userId) { |
| 33 | - CouponDO couponDO = new CouponDO() | 33 | + CouponDO coupon = new CouponDO() |
| 34 | .setTemplateId(template.getId()) | 34 | .setTemplateId(template.getId()) |
| 35 | .setName(template.getName()) | 35 | .setName(template.getName()) |
| 36 | .setTakeType(template.getTakeType()) | 36 | .setTakeType(template.getTakeType()) |
| @@ -44,13 +44,13 @@ public interface CouponConvert { | @@ -44,13 +44,13 @@ public interface CouponConvert { | ||
| 44 | .setStatus(CouponStatusEnum.UNUSED.getStatus()) | 44 | .setStatus(CouponStatusEnum.UNUSED.getStatus()) |
| 45 | .setUserId(userId); | 45 | .setUserId(userId); |
| 46 | if (CouponTemplateValidityTypeEnum.DATE.getType().equals(template.getValidityType())) { | 46 | if (CouponTemplateValidityTypeEnum.DATE.getType().equals(template.getValidityType())) { |
| 47 | - couponDO.setValidStartTime(template.getValidStartTime()); | ||
| 48 | - couponDO.setValidEndTime(template.getValidEndTime()); | 47 | + coupon.setValidStartTime(template.getValidStartTime()); |
| 48 | + coupon.setValidEndTime(template.getValidEndTime()); | ||
| 49 | } else if (CouponTemplateValidityTypeEnum.TERM.getType().equals(template.getValidityType())) { | 49 | } else if (CouponTemplateValidityTypeEnum.TERM.getType().equals(template.getValidityType())) { |
| 50 | - couponDO.setValidStartTime(LocalDateTime.now().plusDays(template.getFixedStartTerm())); | ||
| 51 | - couponDO.setValidEndTime(LocalDateTime.now().plusDays(template.getFixedEndTerm())); | 50 | + coupon.setValidStartTime(LocalDateTime.now().plusDays(template.getFixedStartTerm())); |
| 51 | + coupon.setValidEndTime(coupon.getValidStartTime().plusDays(template.getFixedEndTerm())); | ||
| 52 | } | 52 | } |
| 53 | - return couponDO; | 53 | + return coupon; |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | CouponPageReqVO convert(AppCouponPageReqVO pageReqVO, Collection<Long> userIds); | 56 | CouponPageReqVO convert(AppCouponPageReqVO pageReqVO, Collection<Long> userIds); |