Commit 976f0495 by 吕明尚

修改订单结束后的续单条件

parent 1a89d35d
......@@ -862,8 +862,11 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
save(sOrder);
if (sOrder.getOrderType().equals(OrderTypeEnum.RENEW.getCode())) {
if (!redisUtil.exists(ReceiptRdeisEnum.ROOM_EXPIRE_TIME.getValue() + request.getPreOrderNo())
&& getOne(new LambdaQueryWrapper<SOrder>().eq(SOrder::getOrderNo, request.getPreOrderNo())).getStatus().equals(OrderStatusEnum.USED.getCode()))
SOrder one = getOne(new LambdaQueryWrapper<SOrder>().eq(SOrder::getOrderNo, request.getPreOrderNo()));
//结束时间加15分钟
Date date = cn.hutool.core.date.DateUtil.offsetMinute(one.getEndDate(), 15);
if ((one.getStatus().equals(OrderStatusEnum.USED.getCode()) && date.getTime() > new Date().getTime())
| !redisUtil.exists(ReceiptRdeisEnum.ROOM_EXPIRE_TIME.getValue() + request.getPreOrderNo()))
throw new BaseException("原订单已过期,请重新预约");
sOrder.setStartDate(sOrder.getPreStartDate());
sOrder.setEndDate(sOrder.getPreEndDate());
......
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