瀏覽代碼

维护好评赠券的开始时间报空问题

lutong 2 天之前
父節點
當前提交
6b4ba8eccc

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

@@ -1234,10 +1234,11 @@ public class LifeDiscountCouponStoreFriendServiceImpl extends ServiceImpl<LifeDi
                 }
                 if (!Integer.valueOf(1).equals(coupon.getLongTermValid())) {
                     LocalDate beginDate = coupon.getBeginGetDate();
-                    String specifiedDayStr = coupon.getSpecifiedDay();
                     if (beginDate == null) {
-                        throw new IllegalArgumentException("优惠券开始日期不能为空");
+                        beginDate = LocalDate.now(ZoneId.systemDefault());
+                        coupon.setBeginGetDate(beginDate);
                     }
+                    String specifiedDayStr = coupon.getSpecifiedDay();
                     if (specifiedDayStr == null || specifiedDayStr.isEmpty()) {
                         throw new IllegalArgumentException("有效天数不能为空");
                     }