mirror of
https://github.com/YunaiV/ruoyi-vue-pro.git
synced 2025-10-29 01:17:27 +08:00
fix:【mall 商城】优惠劵在“领取之后”场景下,计算不正确的问题
This commit is contained in:
@ -30,7 +30,7 @@ public interface CouponConvert {
|
||||
CouponRespDTO convert(CouponDO bean);
|
||||
|
||||
default CouponDO convert(CouponTemplateDO template, Long userId) {
|
||||
CouponDO couponDO = new CouponDO()
|
||||
CouponDO coupon = new CouponDO()
|
||||
.setTemplateId(template.getId())
|
||||
.setName(template.getName())
|
||||
.setTakeType(template.getTakeType())
|
||||
@ -44,13 +44,13 @@ public interface CouponConvert {
|
||||
.setStatus(CouponStatusEnum.UNUSED.getStatus())
|
||||
.setUserId(userId);
|
||||
if (CouponTemplateValidityTypeEnum.DATE.getType().equals(template.getValidityType())) {
|
||||
couponDO.setValidStartTime(template.getValidStartTime());
|
||||
couponDO.setValidEndTime(template.getValidEndTime());
|
||||
coupon.setValidStartTime(template.getValidStartTime());
|
||||
coupon.setValidEndTime(template.getValidEndTime());
|
||||
} else if (CouponTemplateValidityTypeEnum.TERM.getType().equals(template.getValidityType())) {
|
||||
couponDO.setValidStartTime(LocalDateTime.now().plusDays(template.getFixedStartTerm()));
|
||||
couponDO.setValidEndTime(LocalDateTime.now().plusDays(template.getFixedEndTerm()));
|
||||
coupon.setValidStartTime(LocalDateTime.now().plusDays(template.getFixedStartTerm()));
|
||||
coupon.setValidEndTime(coupon.getValidStartTime().plusDays(template.getFixedEndTerm()));
|
||||
}
|
||||
return couponDO;
|
||||
return coupon;
|
||||
}
|
||||
|
||||
CouponPageReqVO convert(AppCouponPageReqVO pageReqVO, Collection<Long> userIds);
|
||||
|
||||
Reference in New Issue
Block a user