|
@@ -273,16 +273,15 @@ public class LifeDiscountCouponServiceImpl extends ServiceImpl<LifeDiscountCoupo
|
|
|
@Override
|
|
@Override
|
|
|
public boolean cutDiscountCouponStatus(String counponId) {
|
|
public boolean cutDiscountCouponStatus(String counponId) {
|
|
|
LifeDiscountCoupon lifeDiscountCoupon = lifeDiscountCouponMapper.selectById(counponId);
|
|
LifeDiscountCoupon lifeDiscountCoupon = lifeDiscountCouponMapper.selectById(counponId);
|
|
|
|
|
+ if(lifeDiscountCoupon.getGetStatus() == Integer.parseInt(DiscountCouponEnum.NO_GET.getValue())){
|
|
|
|
|
+ Date now = new Date();
|
|
|
|
|
+ Instant instant = now.toInstant();
|
|
|
|
|
+ ZoneId zoneId = ZoneId.systemDefault();
|
|
|
|
|
+ LocalDate localNow = instant.atZone(zoneId).toLocalDate();
|
|
|
|
|
+ lifeDiscountCoupon.setBeginGetDate(localNow);
|
|
|
|
|
+ }
|
|
|
lifeDiscountCoupon.setGetStatus(lifeDiscountCoupon.getGetStatus() == Integer.parseInt(DiscountCouponEnum.NO_GET.getValue())
|
|
lifeDiscountCoupon.setGetStatus(lifeDiscountCoupon.getGetStatus() == Integer.parseInt(DiscountCouponEnum.NO_GET.getValue())
|
|
|
? Integer.parseInt(DiscountCouponEnum.CAN_GET.getValue()) : Integer.parseInt(DiscountCouponEnum.NO_GET.getValue()));
|
|
? Integer.parseInt(DiscountCouponEnum.CAN_GET.getValue()) : Integer.parseInt(DiscountCouponEnum.NO_GET.getValue()));
|
|
|
-// Date now = new Date();
|
|
|
|
|
-// Instant instant = now.toInstant();
|
|
|
|
|
-// ZoneId zoneId = ZoneId.systemDefault();
|
|
|
|
|
-// LocalDate localNow = instant.atZone(zoneId).toLocalDate();
|
|
|
|
|
-// if (localNow.compareTo(lifeDiscountCoupon.getStartDate()) < 0) {
|
|
|
|
|
-// lifeDiscountCoupon.setStartDate(localNow);
|
|
|
|
|
-// lifeDiscountCoupon.setGetStatus(Integer.parseInt(DiscountCouponEnum.CAN_GET.getValue()));
|
|
|
|
|
-// }
|
|
|
|
|
lifeDiscountCouponMapper.updateById(lifeDiscountCoupon);
|
|
lifeDiscountCouponMapper.updateById(lifeDiscountCoupon);
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|