From 97e605418d7b9cbff08f4c2b7d53179e8bf64076 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 28 Jul 2021 21:19:28 +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 --- .../controller/pay/TuanYouController.java | 24 ++++++++++--------- .../pay/impl/GoodsOrderServiceImpl.java | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java index c6defe97..77cf28c4 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java @@ -77,19 +77,21 @@ public class TuanYouController { HighOrder order = highOrderService.getOrderByOrderNo(object.getString("thirdOrderNo")); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 6.退款中 7.拒绝退款 - if (order != null && order.getOrderStatus() == 6) { - // 退单结果 true:成功 false:失败 - if (object.getBoolean("refundResult") == true && order != null) { - OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(), order.getPayRealPrice(), order.getPayRealPrice()); - if(orderRefundModel.getResult_code().equals("SUCCESS")) { - order.setOrderStatus(4); - order.setRefundTime(new Date()); + if (order != null) { + if (order.getOrderStatus() == 2 || order.getOrderStatus() == 6) { + // 退单结果 true:成功 false:失败 + if (object.getBoolean("refundResult") == true && order != null) { + OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(), order.getPayRealPrice(), order.getPayRealPrice()); + if(orderRefundModel.getResult_code().equals("SUCCESS")) { + order.setOrderStatus(4); + order.setRefundTime(new Date()); + highOrderService.updateOrderDetail(order); + } + } else if (!object.getBoolean("refundResult") == true && order != null) { + order.setOrderStatus(7); + order.setRefusalRefundContent(object.getString("refundFailReason")); highOrderService.updateOrderDetail(order); } - } else if (!object.getBoolean("refundResult") == true && order != null) { - order.setOrderStatus(7); - order.setRefusalRefundContent(object.getString("refundFailReason")); - highOrderService.updateOrderDetail(order); } } response.setCharacterEncoding("UTF-8"); diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java index a5427cf7..c0199d78 100644 --- a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java @@ -150,7 +150,7 @@ public class GoodsOrderServiceImpl implements PayService { paramMap.put("priceVip", priceVip); // 优惠价 paramMap.put("driverPhone", order.getMemPhone()); paramMap.put("thirdSerialNo", order.getOrderNo()); - paramMap.put("refuelingAmount", highChildOrder.getGoodsActualPrice()); + paramMap.put("refuelingAmount", highChildOrder.getTotalPrice()); // 油品类型 1:汽油:2:柴油;3:天然气 if (highChildOrder.getGasOilType() == 1) {