|
|
@@ -86,14 +86,14 @@ public class StoreBookingBusinessHoursServiceImpl extends ServiceImpl<StoreBooki
|
|
|
log.warn("保存营业时间失败:设置ID不能为空");
|
|
|
throw new RuntimeException("设置ID不能为空");
|
|
|
}
|
|
|
- if (businessHours.getBusinessType() == null) {
|
|
|
- log.warn("保存营业时间失败:营业类型不能为空");
|
|
|
- throw new RuntimeException("营业类型不能为空");
|
|
|
- }
|
|
|
- if (businessHours.getBookingTimeType() == null) {
|
|
|
- log.warn("保存营业时间失败:预订时间类型不能为空");
|
|
|
- throw new RuntimeException("预订时间类型不能为空");
|
|
|
- }
|
|
|
+// if (businessHours.getBusinessType() == null) {
|
|
|
+// log.warn("保存营业时间失败:营业类型不能为空");
|
|
|
+// throw new RuntimeException("营业类型不能为空");
|
|
|
+// }
|
|
|
+// if (businessHours.getBookingTimeType() == null) {
|
|
|
+// log.warn("保存营业时间失败:预订时间类型不能为空");
|
|
|
+// throw new RuntimeException("预订时间类型不能为空");
|
|
|
+// }
|
|
|
|
|
|
// 如果是特殊营业(节假日),验证节假日类型
|
|
|
// if (businessHours.getBusinessType() != null && businessHours.getBusinessType() == 2) {
|
|
|
@@ -104,31 +104,31 @@ public class StoreBookingBusinessHoursServiceImpl extends ServiceImpl<StoreBooki
|
|
|
// }
|
|
|
|
|
|
// 如果选择非全天,必须填写开始时间和结束时间
|
|
|
- if (businessHours.getBookingTimeType() != null && businessHours.getBookingTimeType() == 0) {
|
|
|
- if (!StringUtils.hasText(businessHours.getStartTime())) {
|
|
|
- log.warn("保存营业时间失败:非全天时必须填写开始时间");
|
|
|
- throw new RuntimeException("非全天时必须填写开始时间");
|
|
|
- }
|
|
|
- if (!StringUtils.hasText(businessHours.getEndTime())) {
|
|
|
- log.warn("保存营业时间失败:非全天时必须填写结束时间");
|
|
|
- throw new RuntimeException("非全天时必须填写结束时间");
|
|
|
- }
|
|
|
- // 验证时间格式
|
|
|
- if (!TIME_PATTERN.matcher(businessHours.getStartTime()).matches()) {
|
|
|
- log.warn("保存营业时间失败:开始时间格式不正确,应为HH:mm格式");
|
|
|
- throw new RuntimeException("开始时间格式不正确,应为HH:mm格式");
|
|
|
- }
|
|
|
- if (!TIME_PATTERN.matcher(businessHours.getEndTime()).matches()) {
|
|
|
- log.warn("保存营业时间失败:结束时间格式不正确,应为HH:mm格式");
|
|
|
- throw new RuntimeException("结束时间格式不正确,应为HH:mm格式");
|
|
|
- }
|
|
|
+// if (businessHours.getBookingTimeType() != null && businessHours.getBookingTimeType() == 0) {
|
|
|
+// if (!StringUtils.hasText(businessHours.getStartTime())) {
|
|
|
+// log.warn("保存营业时间失败:非全天时必须填写开始时间");
|
|
|
+// throw new RuntimeException("非全天时必须填写开始时间");
|
|
|
+// }
|
|
|
+// if (!StringUtils.hasText(businessHours.getEndTime())) {
|
|
|
+// log.warn("保存营业时间失败:非全天时必须填写结束时间");
|
|
|
+// throw new RuntimeException("非全天时必须填写结束时间");
|
|
|
+// }
|
|
|
+// // 验证时间格式
|
|
|
+// if (!TIME_PATTERN.matcher(businessHours.getStartTime()).matches()) {
|
|
|
+// log.warn("保存营业时间失败:开始时间格式不正确,应为HH:mm格式");
|
|
|
+// throw new RuntimeException("开始时间格式不正确,应为HH:mm格式");
|
|
|
+// }
|
|
|
+// if (!TIME_PATTERN.matcher(businessHours.getEndTime()).matches()) {
|
|
|
+// log.warn("保存营业时间失败:结束时间格式不正确,应为HH:mm格式");
|
|
|
+// throw new RuntimeException("结束时间格式不正确,应为HH:mm格式");
|
|
|
+// }
|
|
|
// 验证开始时间必须小于结束时间(支持跨天,如22:00到次日02:00)
|
|
|
// 这里只做基本格式验证,跨天逻辑由业务层处理
|
|
|
- } else {
|
|
|
- // 如果是全天,清空开始时间和结束时间
|
|
|
- businessHours.setStartTime(null);
|
|
|
- businessHours.setEndTime(null);
|
|
|
- }
|
|
|
+// } else {
|
|
|
+// // 如果是全天,清空开始时间和结束时间
|
|
|
+// businessHours.setStartTime(null);
|
|
|
+// businessHours.setEndTime(null);
|
|
|
+// }
|
|
|
|
|
|
// 设置排序,如果为空则默认为0
|
|
|
if (businessHours.getSort() == null) {
|