Commit 95918c6f by 吕明尚

套餐的跨天重新判断

parent 2d458c19
...@@ -398,12 +398,12 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -398,12 +398,12 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
packaEndPeriod1 = "0" + packaEndPeriod1; packaEndPeriod1 = "0" + packaEndPeriod1;
} }
String packaEndPeriod = packaEndPeriod1 + "00"; String packaEndPeriod = packaEndPeriod1 + "00";
//1 可用开始时段<结束时段,则应该预约开始时间>可用开始时间,预约结束时间<可用结束时间 //1 开始时段<结束时段,则应该预约开始时间>可用开始时间,预约结束时间<可用结束时间
if (preEndHour.compareTo(packaStartPeriod) > 0) { if (preEndHour.compareTo(preStartHour) > 0) {
if (preStartHour.compareTo(packaStartPeriod) < 0 || packaEndPeriod.compareTo(preEndHour) < 0) { if (preStartHour.compareTo(packaStartPeriod) < 0 || packaEndPeriod.compareTo(preEndHour) < 0) {
throw new BaseException("预约时段非套餐可用时段!"); throw new BaseException("预约时段非套餐可用时段!");
} }
//1 可用开始时段>结束时段,代表可用时段跨日,则应该预约开始时间<可用开始时间,预约结束时间>可用结束时间 //1 开始时段>结束时段,代表可用时段跨日,则应该预约开始时间<可用开始时间,预约结束时间>可用结束时间
}else{ }else{
if (packaStartPeriod.compareTo(preStartHour) < 0 || preEndHour.compareTo(packaEndPeriod) < 0) { if (packaStartPeriod.compareTo(preStartHour) < 0 || preEndHour.compareTo(packaEndPeriod) < 0) {
throw new BaseException("预约时段非套餐可用时段!"); throw new BaseException("预约时段非套餐可用时段!");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment