订单15分钟取消
This commit is contained in:
@@ -230,7 +230,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||||||
//发送打票信息
|
//发送打票信息
|
||||||
rabbitPublisher.sendOrderPrintMsg(orderInfo.getId().toString());
|
rabbitPublisher.sendOrderPrintMsg(orderInfo.getId().toString());
|
||||||
} else {
|
} else {
|
||||||
// redisService.set(RedisCst.classKeyExpired.EXPIRED_ORDER + orderInfo.getId(), "", 60 * 15);
|
redisService.set(RedisCst.classKeyExpired.EXPIRED_ORDER + orderInfo.getId(), "", 60 * 15);
|
||||||
}
|
}
|
||||||
rabbitPublisher.sendOrderStockMsg(orderInfo.getId().toString());
|
rabbitPublisher.sendOrderStockMsg(orderInfo.getId().toString());
|
||||||
return orderInfo;
|
return orderInfo;
|
||||||
@@ -239,22 +239,29 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||||||
@Override
|
@Override
|
||||||
public OrderInfo checkOrderPay(CheckOrderPay param) {
|
public OrderInfo checkOrderPay(CheckOrderPay param) {
|
||||||
OrderInfo orderInfo = getById(param.getOrderId());
|
OrderInfo orderInfo = getById(param.getOrderId());
|
||||||
// if (!"after-pay".equals(orderInfo.getPayMode())) {
|
if (!orderInfo.getStatus().equals(OrderStatusEnums.UNPAID.getCode())) {
|
||||||
// if (redisService.hasKey(RedisCst.classKeyExpired.EXPIRED_ORDER + param.getOrderId())) {
|
throw new ValidateException("生成支付订单失败,订单不可支付");
|
||||||
// redisService.set(RedisCst.classKeyExpired.EXPIRED_ORDER + param.getOrderId(), "", 60 * 15);
|
}
|
||||||
// } else {
|
if (!"after-pay".equals(orderInfo.getPayMode())) {
|
||||||
// throw new ValidateException("订单已过期,请重新下单");
|
if (redisService.hasKey(RedisCst.classKeyExpired.EXPIRED_ORDER + param.getOrderId())) {
|
||||||
// }
|
redisService.set(RedisCst.classKeyExpired.EXPIRED_ORDER + param.getOrderId(), "", 60 * 15);
|
||||||
// }
|
} else {
|
||||||
|
if (!orderInfo.getStatus().equals(OrderStatusEnums.CANCELLED.getCode())) {
|
||||||
|
updateChain()
|
||||||
|
.set(OrderInfo::getStatus, OrderStatusEnums.CANCELLED.getCode())
|
||||||
|
.eq(OrderInfo::getId, param.getOrderId())
|
||||||
|
.update();
|
||||||
|
rabbitPublisher.sendOrderCancelMsg(orderInfo.getId().toString());
|
||||||
|
}
|
||||||
|
throw new ValidateException("订单已过期,请重新下单");
|
||||||
|
}
|
||||||
|
}
|
||||||
ShopInfo shopInfo = shopInfoService.getById(orderInfo.getShopId());
|
ShopInfo shopInfo = shopInfoService.getById(orderInfo.getShopId());
|
||||||
AssertUtil.isNull(shopInfo, "生成订单失败,店铺信息不存在");
|
AssertUtil.isNull(shopInfo, "生成订单失败,店铺信息不存在");
|
||||||
if (param.isVipPrice() && !shopInfo.getIsMemberPrice().equals(1)) {
|
if (param.isVipPrice() && !shopInfo.getIsMemberPrice().equals(1)) {
|
||||||
throw new ValidateException("生成订单失败,该店铺不支持使用会员价");
|
throw new ValidateException("生成订单失败,该店铺不支持使用会员价");
|
||||||
}
|
}
|
||||||
log.info("订单信息:{},优惠信息:{}", JSONObject.toJSONString(orderInfo), JSONObject.toJSONString(param));
|
log.info("订单信息:{},优惠信息:{}", JSONObject.toJSONString(orderInfo), JSONObject.toJSONString(param));
|
||||||
if (!orderInfo.getStatus().equals(OrderStatusEnums.UNPAID.getCode())) {
|
|
||||||
throw new ValidateException("生成支付订单失败,订单不可支付");
|
|
||||||
}
|
|
||||||
Long shopId = orderInfo.getShopId();
|
Long shopId = orderInfo.getShopId();
|
||||||
AssertUtil.isNull(shopId, "生成支付订单失败,订单信息异常");
|
AssertUtil.isNull(shopId, "生成支付订单失败,订单信息异常");
|
||||||
orderInfo.setSeatNum(param.getSeatNum());
|
orderInfo.setSeatNum(param.getSeatNum());
|
||||||
|
|||||||
Reference in New Issue
Block a user