Commit 85ee5672 by 吕明尚

更改套餐可用时段

parent 84aaf4a2
......@@ -297,7 +297,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
throw new BaseException("您的登录已过期,请先登录");
}
SStore sStore = storeService.getById(request.getStoreId());
//验劵
//生成订单
SOrder sOrder = generatSOrder(request, user);
//校验订单金额
checkOrderPrice(sOrder, user);
......@@ -376,13 +376,13 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
String packaStartPeriod = pack.getPackaStartPeriod() + "00";
String packaEndPeriod = pack.getPackaEndPeriod() + "00";
//1 可用开始时段<结束时段,则应该预约开始时间>可用开始时间,预约结束时间<可用结束时间
if (packaEndPeriod.compareTo(packaStartPeriod) < 0) {
if (packaStartPeriod.compareTo(preStartHour) < 0 || packaEndPeriod.compareTo(preEndHour) < 0) {
if (preEndHour.compareTo(packaStartPeriod) > 0) {
if (preStartHour.compareTo(packaStartPeriod) > 0 || preEndHour.compareTo(packaEndPeriod) > 0) {
throw new BaseException("预约时段非套餐可用时段!");
}
//1 可用开始时段>结束时段,代表可用时段跨日,则应该预约开始时间<可用开始时间,预约结束时间>可用结束时间
}else{
if (packaStartPeriod.compareTo(preStartHour) < 0 || packaEndPeriod.compareTo(preEndHour) > 0) {
if (packaStartPeriod.compareTo(preStartHour) < 0 || preEndHour.compareTo(packaEndPeriod) > 0) {
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