diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderPayServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderPayServiceImpl.java index 0bd39867..bdc998db 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderPayServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderPayServiceImpl.java @@ -123,7 +123,7 @@ public class OrderPayServiceImpl implements OrderPayService { if (StringUtils.isNotBlank(carLicensePlate)) { // 加油订单 HighGasOrder gasOrder = gasOrderService.getDetailByOrderNo(order.getOrderNo()); - if (gasOrder != null) { + if (gasOrder == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到加油订单"); } gasOrder.setGasCarLicensePlate(carLicensePlate); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighFleetOilCardServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighFleetOilCardServiceImpl.java index f62ef26e..1e09bf5e 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighFleetOilCardServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighFleetOilCardServiceImpl.java @@ -275,9 +275,8 @@ public class HighFleetOilCardServiceImpl implements HighFleetOilCardService { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的的订单"); } if (!order.getOrderStatus().equals(OrderStatusEnum.type2.getType()) - || !order.getOrderStatus().equals(OrderStatusEnum.type3.getType()) - || !order.getOrderStatus().equals(OrderStatusEnum.type7.getType()) - ) { + && !order.getOrderStatus().equals(OrderStatusEnum.type3.getType()) + && !order.getOrderStatus().equals(OrderStatusEnum.type7.getType())) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单当前状态无法退款"); } if (!order.getPayType().equals(OrderPayType.PAY_TYPE8.getNumber())) { diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOilCardServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOilCardServiceImpl.java index a4ae57e8..6f7fc4d8 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOilCardServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOilCardServiceImpl.java @@ -208,6 +208,11 @@ public class HighOilCardServiceImpl implements HighOilCardService { if (StringUtils.isBlank(order.getMemCardNo())) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油卡卡号"); } + if (!order.getOrderStatus().equals(OrderStatusEnum.type2.getType()) + && !order.getOrderStatus().equals(OrderStatusEnum.type3.getType()) + && !order.getOrderStatus().equals(OrderStatusEnum.type7.getType())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单当前状态无法退款"); + } // 查询油卡卡号 HighOilCard oilCard = getOilCardByCardNo(order.getMemCardNo()); if (oilCard == null) {