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("支付异常,请联系管理员!"); } }