Browse Source

领取状态修改,根据开始和结束领取时间判断。

zhangchen 16 hours ago
parent
commit
e4359760b5

+ 3 - 3
alien-store/src/main/java/shop/alien/store/service/impl/LifeDiscountCouponServiceImpl.java

@@ -74,14 +74,14 @@ public class LifeDiscountCouponServiceImpl extends ServiceImpl<LifeDiscountCoupo
             //发布优惠券表信息
             LifeDiscountCoupon lifeDiscountCoupon = new LifeDiscountCoupon();
             BeanUtils.copyProperties(lifeDiscountCouponDto, lifeDiscountCoupon);
-            // 根据开始时间判断可领取状态
+            // 根据开始领取时间判断可领取状态
             // 判断是否在领取时间内
             Date now = new Date();
             Instant instant = now.toInstant();
             ZoneId zoneId = ZoneId.systemDefault();
             LocalDate localNow = instant.atZone(zoneId).toLocalDate();
-            int startResult = localNow.compareTo(lifeDiscountCoupon.getStartDate());
-            int endResult = localNow.compareTo(lifeDiscountCoupon.getEndDate());
+            int startResult = localNow.compareTo(lifeDiscountCoupon.getBeginGetDate());
+            int endResult = localNow.compareTo(lifeDiscountCoupon.getEndGetDate());
             if (startResult < 0 || endResult > 0) {
                 lifeDiscountCoupon.setGetStatus(0);
             }