Commit a706f7f3 by wuwenlong

order pack check bugfix;

parent 30d29a09
......@@ -372,10 +372,19 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
&&(!StringUtils.equals(pack.getPackaStartPeriod(),"0")||!StringUtils.equals(pack.getPackaEndPeriod(),"23"))) {
String preStartHour = DateUtils.parseDateToStr("H", request.getPreStartDate());
String preEndHour = DateUtils.parseDateToStr("H", request.getPreEndDate());
if (Integer.parseInt(pack.getPackaStartPeriod()) < Integer.parseInt(preStartHour)
//1 可用开始时段<结束时段,则应该预约开始时间>可用开始时间,预约结束时间<可用结束时间
if(Integer.parseInt(pack.getPackaStartPeriod()) < Integer.parseInt(pack.getPackaEndPeriod())) {
if (Integer.parseInt(pack.getPackaStartPeriod()) > Integer.parseInt(preStartHour)
|| Integer.parseInt(pack.getPackaEndPeriod()) < Integer.parseInt(preEndHour)) {
throw new BaseException("预约时段非套餐可用时段!");
}
//1 可用开始时段>结束时段,代表可用时段跨日,则应该预约开始时间<可用开始时间,预约结束时间>可用结束时间
}else{
if (Integer.parseInt(pack.getPackaStartPeriod()) < Integer.parseInt(preStartHour)
|| Integer.parseInt(pack.getPackaEndPeriod()) > Integer.parseInt(preEndHour)) {
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