From cfee6f1704a811853b2c46c03ddbb30241742618 Mon Sep 17 00:00:00 2001 From: pengren Date: Thu, 11 Apr 2024 14:12:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E5=8F=B7=EF=BC=9AZSSAC-163=20?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=EF=BC=9A=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/exception/BusinessException.java | 77 ------------------- .../service/impl/OrderInfoServiceImpl.java | 8 +- 2 files changed, 4 insertions(+), 81 deletions(-) delete mode 100644 sf-common/src/main/java/com/sf/common/exception/BusinessException.java diff --git a/sf-common/src/main/java/com/sf/common/exception/BusinessException.java b/sf-common/src/main/java/com/sf/common/exception/BusinessException.java deleted file mode 100644 index 26ba14a..0000000 --- a/sf-common/src/main/java/com/sf/common/exception/BusinessException.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.sf.common.exception; - - -import com.sf.common.enums.ErrorCodeTypeEnum; - -/** - * @author : yswjme@163.com - * @Title : BusinessException.java - * @Package : com.zsmarter.ai.word.exception - * @Descript : 业务运行时异常 - * @date : 2020-06-29 04:59:44 - * @vsersion : V1.0 - */ -public class BusinessException extends RuntimeException { - - private static final long serialVersionUID = 4693786499059513760L; - - private ErrorCodeTypeEnum errorCodeTypeEnum; - - private final String errorDescription; - - private String errorCode; - - public BusinessException(String errorDescription) { - super(errorDescription); - this.errorDescription = errorDescription; - } - - public BusinessException(String errorDescription, Throwable t) { - super(errorDescription, t); - this.errorDescription = errorDescription; - } - - public BusinessException(String code, String errorDescription) { - super(errorDescription); - this.errorDescription = errorDescription; - this.errorCode = code; - } - - public BusinessException(String code, String errorDescription, Throwable t) { - super(errorDescription, t); - this.errorDescription = errorDescription; - this.errorCode = code; - } - - public BusinessException(ErrorCodeTypeEnum errorCodeTypeEnum, String code, String errorDescription) { - super(errorDescription); - this.errorDescription = errorDescription; - this.errorCode = code; - this.errorCodeTypeEnum = errorCodeTypeEnum; - } - - public BusinessException(ErrorCodeTypeEnum errorCodeTypeEnum, String code, String errorDescription, Throwable t) { - super(errorDescription, t); - this.errorDescription = errorDescription; - this.errorCode = code; - this.errorCodeTypeEnum = errorCodeTypeEnum; - } - - public String getErrorDescription() { - return this.errorDescription; - } - - public String getErrorCode() { - return errorCode; - } - - public String getErrorTitle() { - return "业务校验失败!"; - } - - public ErrorCodeTypeEnum getErrorCodeTypeEnum() { - return errorCodeTypeEnum; - } - - -} diff --git a/sf-order/src/main/java/com/sf/order/service/impl/OrderInfoServiceImpl.java b/sf-order/src/main/java/com/sf/order/service/impl/OrderInfoServiceImpl.java index 315b818..38c43c8 100644 --- a/sf-order/src/main/java/com/sf/order/service/impl/OrderInfoServiceImpl.java +++ b/sf-order/src/main/java/com/sf/order/service/impl/OrderInfoServiceImpl.java @@ -2,7 +2,7 @@ package com.sf.order.service.impl; import java.util.List; -import com.sf.common.exception.BusinessException; +import com.sf.common.exception.ServiceException; import com.sf.common.utils.DateUtils; import com.sf.common.utils.SnowflakeIdWorker; import com.sf.order.domain.OrderInfo; @@ -97,16 +97,16 @@ public class OrderInfoServiceImpl implements IOrderInfoService public void orderPay(Long orderId) { OrderInfo updateOrder = this.selectOrderInfoById(orderId); if (updateOrder == null) { - throw new BusinessException("订单缺失!"); + throw new ServiceException("订单缺失!"); } // if (!OrderInfoConstant.ORDER_WAITING_FOR_PAYMENT.equals(orderInfo.getOrderStatus())) { -// throw new BusinessException("订单状态异常!"); +// throw new ServiceException("订单状态异常!"); // } updateOrder.setOrderStatus(1L); updateOrder.setPayTime(DateUtils.getNowDate()); // 修改订单状态 if (1>this.updateOrderInfo(updateOrder)) { - throw new BusinessException("支付异常,请联系管理员!"); + throw new ServiceException("支付异常,请联系管理员!"); } }