From 57bb56df7f8bf01dd4ef41aa79c00ad1d4c4e2d8 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 12 Jan 2023 11:41:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hai/order/service/impl/OrderPayServiceImpl.java | 2 +- .../com/hai/service/impl/HighFleetOilCardServiceImpl.java | 5 ++--- .../java/com/hai/service/impl/HighOilCardServiceImpl.java | 5 +++++ 3 files changed, 8 insertions(+), 4 deletions(-) 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) {