|
|
|
@ -8,6 +8,7 @@
|
|
|
|
|
*/ |
|
|
|
|
package co.yixiang.modules.activity.service.impl; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateTime; |
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
|
import cn.hutool.core.util.NumberUtil; |
|
|
|
|
import cn.iocoder.yudao.framework.common.exception.YshopException; |
|
|
|
@ -44,6 +45,9 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
import java.sql.Array; |
|
|
|
|
import java.sql.Timestamp; |
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
@ -156,7 +160,6 @@ public class YxStoreCouponUserServiceImpl extends BaseServiceImpl<YxStoreCouponU
|
|
|
|
|
YxStoreCouponUser couponUser = new YxStoreCouponUser(); |
|
|
|
|
couponUser.setId((long)id); |
|
|
|
|
couponUser.setStatus(1); |
|
|
|
|
couponUser.setUseTime(new Date()); |
|
|
|
|
yxStoreCouponUserMapper.updateById(couponUser); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -210,11 +213,14 @@ public class YxStoreCouponUserServiceImpl extends BaseServiceImpl<YxStoreCouponU
|
|
|
|
|
if(storeCoupon == null) { |
|
|
|
|
throw new YshopException("优惠劵不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Date now = new Date(); |
|
|
|
|
|
|
|
|
|
Date endTime = DateUtil.offsetDay(now,storeCoupon.getCouponTime()); |
|
|
|
|
|
|
|
|
|
//现在的日期向后偏移,得到优惠券的使用截止期期
|
|
|
|
|
// Date now = new Date();
|
|
|
|
|
// Date endTime = DateUtil.offsetDay(now,storeCoupon.getCouponTime());
|
|
|
|
|
|
|
|
|
|
// //有效期改为时间段,不需要偏移,切割开始日期和截止日期
|
|
|
|
|
// String[] time=storeCoupon.getUseTime().toString().split(",");
|
|
|
|
|
// DateTime endTime = new DateTime(time[1]);
|
|
|
|
|
DateTime endTime =new DateTime(storeCoupon.getUseEndTime().toString()); |
|
|
|
|
YxStoreCouponUser storeCouponUser = YxStoreCouponUser.builder() |
|
|
|
|
.cid(storeCoupon.getId()) |
|
|
|
|
.uid(uid) |
|
|
|
|