Commit bc3b0ee6 by wuwenlong

order pack check bugfix;

parent da387aba
...@@ -363,14 +363,19 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -363,14 +363,19 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
throw new BaseException("当前套餐仅首次下单可用!"); throw new BaseException("当前套餐仅首次下单可用!");
} }
} }
Date now = new Date(); if(Objects.nonNull(pack.getPackaStartPeriod())&&Objects.nonNull(pack.getPackaEndPeriod())
if(now.compareTo(request.getPreStartDate())>0 &&(!StringUtils.equals(pack.getPackaStartPeriod(),"0")||!StringUtils.equals(pack.getPackaEndPeriod(),"23"))) {
|| now.compareTo(request.getPreEndDate())<0){ String preStartHour = DateUtils.parseDateToStr("H", request.getPreStartDate());
throw new BaseException("预约时段非套餐可用时段!"); String preEndHour = DateUtils.parseDateToStr("H", request.getPreEndDate());
if (Integer.parseInt(pack.getPackaStartPeriod()) < Integer.parseInt(preStartHour)
|| Integer.parseInt(pack.getPackaEndPeriod()) < Integer.parseInt(preEndHour)) {
throw new BaseException("预约时段非套餐可用时段!");
}
} }
} }
} }
private void checkOrderDate(CreateOrderRequest request) { private void checkOrderDate(CreateOrderRequest request) {
LambdaQueryWrapper<SOrder> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SOrder> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.notIn(SOrder::getRefundStatus, RefundStatusEnum.getRefundedStatus()); queryWrapper.notIn(SOrder::getRefundStatus, RefundStatusEnum.getRefundedStatus());
......
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