From 85943a52604bcbe82a7e02d1220eedc2837f4e26 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Wed, 24 Nov 2021 09:10:14 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E6=AC=BE=E8=AF=B7=E6=B1=82=E8=B6=85?= =?UTF-8?q?=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bweb/controller/OutRechargeOrderController.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java b/hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java index be546e0a..c065c33b 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/OutRechargeOrderController.java @@ -40,10 +40,7 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; @Controller @RequestMapping(value = "/outRechargeOrder") @@ -265,9 +262,15 @@ public class OutRechargeOrderController { if (order.getPayType() == 2) { JSONObject jsonObject = HuiLianTongUnionCardConfig.refund( "HFR"+new Date().getTime() , order.getOrderNo()); + + if (jsonObject == null) { + log.error("orderToPay error!", "请求超时"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请求超时,请重新点击"); + } + JSONObject dataObject = HuiLianTongUnionCardConfig.resolveResponse(jsonObject.getString("data")); - if (dataObject.getBoolean("success")) { + if (dataObject.getBoolean("success") || Objects.equals(dataObject.getString("message"), "原交易已撤销,不可再次操作")) { order.setStatus(5); order.setRefundTime(new Date()); order.setOutRefundNo("HFR"+new Date().getTime() );