|
|
@@ -54,7 +54,7 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
|
|
|
if (barPerformance.getPerformanceName().length() > 20) {
|
|
|
throw new IllegalArgumentException("演出名称长度不能超过20个字符");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 2. 演出海报验证:必填且限1张
|
|
|
if (StringUtils.isEmpty(barPerformance.getPerformancePoster())) {
|
|
|
throw new IllegalArgumentException("演出海报不能为空");
|
|
|
@@ -64,7 +64,7 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
|
|
|
if (posterImages.length > 1) {
|
|
|
throw new IllegalArgumentException("演出海报最多只能上传1张");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 3. 演出类型和频次的关联验证:特邀演出(0)只能选单次(0)
|
|
|
if (barPerformance.getPerformanceType() != null && barPerformance.getPerformanceType() == 0) {
|
|
|
// 特邀演出
|
|
|
@@ -72,13 +72,13 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
|
|
|
throw new IllegalArgumentException("特邀演出只能选择单次演出");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 4. 演出频次相关验证
|
|
|
String performanceFrequency = barPerformance.getPerformanceFrequency();
|
|
|
if (StringUtils.isEmpty(performanceFrequency)) {
|
|
|
throw new IllegalArgumentException("演出频次不能为空");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 获取今天的开始时间(用于时间验证)
|
|
|
java.util.Calendar cal = java.util.Calendar.getInstance();
|
|
|
cal.set(java.util.Calendar.HOUR_OF_DAY, 0);
|
|
|
@@ -86,7 +86,7 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
|
|
|
cal.set(java.util.Calendar.SECOND, 0);
|
|
|
cal.set(java.util.Calendar.MILLISECOND, 0);
|
|
|
Date todayStart = cal.getTime();
|
|
|
-
|
|
|
+
|
|
|
switch (performanceFrequency) {
|
|
|
case "0": // 单次演出
|
|
|
if (barPerformance.getSingleStartDatetime() == null) {
|
|
|
@@ -188,7 +188,7 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
|
|
|
if (StringUtils.isNotEmpty(barPerformance.getPerformanceNotice()) && barPerformance.getPerformanceNotice().length() > 300) {
|
|
|
throw new IllegalArgumentException("演出须知不能超过300个字符");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 7. 图文详情文字验证:限300字(如果有performanceContent字段)
|
|
|
if (StringUtils.isNotEmpty(barPerformance.getPerformanceContent()) && barPerformance.getPerformanceContent().length() > 300) {
|
|
|
throw new IllegalArgumentException("图文详情文字不能超过300个字符");
|
|
|
@@ -221,9 +221,9 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
|
|
|
throw new IllegalArgumentException("内容审核未通过:" + failureReason);
|
|
|
}
|
|
|
log.info("酒吧演出内容审核通过");
|
|
|
-
|
|
|
+
|
|
|
Integer id = barPerformance.getId();
|
|
|
-
|
|
|
+
|
|
|
if (id == null || id == 0) {
|
|
|
// 新增操作
|
|
|
Date nowDate = new Date(System.currentTimeMillis());
|
|
|
@@ -296,11 +296,11 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
|
|
|
if (id == null || id <= 0) {
|
|
|
return null;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
QueryWrapper<BarPerformance> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("id", id);
|
|
|
queryWrapper.eq("delete_flag", 0);
|
|
|
-
|
|
|
+
|
|
|
return barPerformanceMapper.selectOne(queryWrapper);
|
|
|
}
|
|
|
|
|
|
@@ -318,11 +318,11 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
|
|
|
if (id == null || onlineStatus == null) {
|
|
|
return 0;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
LambdaUpdateWrapper<BarPerformance> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
|
|
lambdaUpdateWrapper.eq(BarPerformance::getId, id);
|
|
|
lambdaUpdateWrapper.set(BarPerformance::getOnlineStatus, onlineStatus);
|
|
|
-
|
|
|
+
|
|
|
return barPerformanceMapper.update(null, lambdaUpdateWrapper);
|
|
|
}
|
|
|
|
|
|
@@ -346,16 +346,16 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
|
|
|
if (page == null || size == null || storeId == null || storeId <= 0) {
|
|
|
return new Page<>();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
IPage<BarPerformance> performancePage = new Page<>(page, size);
|
|
|
QueryWrapper<BarPerformance> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("store_id", storeId);
|
|
|
-
|
|
|
+
|
|
|
// 按演出名称搜索(支持模糊搜索)
|
|
|
if (StringUtils.isNotEmpty(performanceName)) {
|
|
|
queryWrapper.like("performance_name", performanceName);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 按审核状态筛选(数据库字段 review_status)
|
|
|
if (reviewStatus != null) {
|
|
|
queryWrapper.eq("review_status", reviewStatus);
|
|
|
@@ -363,7 +363,7 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
|
|
|
// 不查询草稿(review_status为null的记录)
|
|
|
queryWrapper.isNotNull("review_status");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 按演出分类筛选
|
|
|
if (StringUtils.isNotEmpty(category) && !"all".equals(category)) {
|
|
|
Date now = new Date();
|
|
|
@@ -375,7 +375,7 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
|
|
|
cal.set(java.util.Calendar.SECOND, 0);
|
|
|
cal.set(java.util.Calendar.MILLISECOND, 0);
|
|
|
Date todayStart = cal.getTime();
|
|
|
-
|
|
|
+
|
|
|
switch (category) {
|
|
|
case "not_started": // 未开始
|
|
|
queryWrapper.and(wrapper -> {
|
|
|
@@ -414,18 +414,18 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
queryWrapper.eq("delete_flag", 0);
|
|
|
// 按提交时间(创建时间)倒序排序
|
|
|
queryWrapper.orderByDesc("created_time");
|
|
|
-
|
|
|
+
|
|
|
return barPerformanceMapper.selectPage(performancePage, queryWrapper);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 比较两个时间(只比较时间部分,忽略日期部分)
|
|
|
* 用于每天定时和每周定时演出的时间验证
|
|
|
- *
|
|
|
+ *
|
|
|
* @param time1 开始时间
|
|
|
* @param time2 结束时间
|
|
|
* @return true表示time1早于time2,false表示time1晚于或等于time2
|
|
|
@@ -439,27 +439,27 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
|
|
|
int hour1 = cal1.get(java.util.Calendar.HOUR_OF_DAY);
|
|
|
int minute1 = cal1.get(java.util.Calendar.MINUTE);
|
|
|
int second1 = cal1.get(java.util.Calendar.SECOND);
|
|
|
-
|
|
|
+
|
|
|
java.util.Calendar cal2 = java.util.Calendar.getInstance();
|
|
|
cal2.setTime(time2);
|
|
|
int hour2 = cal2.get(java.util.Calendar.HOUR_OF_DAY);
|
|
|
int minute2 = cal2.get(java.util.Calendar.MINUTE);
|
|
|
int second2 = cal2.get(java.util.Calendar.SECOND);
|
|
|
-
|
|
|
+
|
|
|
// 比较小时
|
|
|
if (hour1 < hour2) {
|
|
|
return true;
|
|
|
} else if (hour1 > hour2) {
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 小时相同,比较分钟
|
|
|
if (minute1 < minute2) {
|
|
|
return true;
|
|
|
} else if (minute1 > minute2) {
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 分钟相同,比较秒
|
|
|
return second1 < second2;
|
|
|
}
|