支付状态 取消时
This commit is contained in:
parent
046ab99359
commit
434ffe3763
|
|
@ -111,6 +111,14 @@ public class CzgControllerAdvice {
|
|||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单超时 取消
|
||||
*/
|
||||
@ExceptionHandler(OrderCancelException.class)
|
||||
public CzgResult<Object> handleOrderCancelException() {
|
||||
return CzgResult.failure(701,"订单已过期,请重新下单");
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理Hutool的断言抛出异常
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public interface RedisCst {
|
|||
*/
|
||||
class classKeyExpired {
|
||||
//订单key过期
|
||||
public static final String EXPIRED_ORDER = "expired.order:";
|
||||
public static final String EXPIRED_ORDER = "expired:order:";
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
package com.czg.exception;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
public class OrderCancelException extends RuntimeException{
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public OrderCancelException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
|
|
@ -18,6 +18,7 @@ import com.czg.entity.notify.CzgPayNotifyDTO;
|
|||
import com.czg.entity.notify.CzgRefundNotifyDTO;
|
||||
import com.czg.enums.ShopUserFlowBizEnum;
|
||||
import com.czg.exception.ApiNotPrintException;
|
||||
import com.czg.exception.OrderCancelException;
|
||||
import com.czg.order.dto.*;
|
||||
import com.czg.order.entity.CashierCart;
|
||||
import com.czg.order.entity.OrderDetail;
|
||||
|
|
@ -257,7 +258,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||
rabbitPublisher.sendOrderCancelMsg(orderInfo.getId().toString());
|
||||
});
|
||||
}
|
||||
throw new ValidateException("订单已过期,请重新下单");
|
||||
throw new OrderCancelException("订单已过期,请重新下单");
|
||||
}
|
||||
}
|
||||
ShopInfo shopInfo = shopInfoService.getById(orderInfo.getShopId());
|
||||
|
|
|
|||
Loading…
Reference in New Issue