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