Ver código fonte

演出校验时间修改

zhangchen 4 semanas atrás
pai
commit
8531449437

+ 2 - 8
alien-store/src/main/java/shop/alien/store/service/impl/BarPerformanceServiceImpl.java

@@ -139,18 +139,12 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
                 barPerformance.setPerformanceWeek("");
                 break;
             case "2": // 每周定时
-                if (barPerformance.getDailyStartDate() == null) {
-                    throw new IllegalArgumentException("每周定时演出必须填写开始日期");
-                }
-                if (barPerformance.getDailyEndDate() == null) {
-                    throw new IllegalArgumentException("每周定时演出必须填写结束日期");
-                }
                 // 验证开始日期必须是今天或以后
-                if (barPerformance.getDailyStartDate().before(todayStart)) {
+                if (barPerformance.getDailyStartDate() != null && barPerformance.getDailyStartDate().before(todayStart)) {
                     throw new IllegalArgumentException("开始日期必须是今天或以后");
                 }
                 // 确保开始日期早于或等于结束日期
-                if (barPerformance.getDailyStartDate().after(barPerformance.getDailyEndDate())) {
+                if (barPerformance.getDailyEndDate() != null && barPerformance.getDailyStartDate() != null && barPerformance.getDailyStartDate().after(barPerformance.getDailyEndDate())) {
                     throw new IllegalArgumentException("开始日期不能晚于结束日期");
                 }
                 // 每周定时演出需要验证演出日期(周几)