From 95a0b51627b3b1bad8ff27f3736a8a1bf2f7714b Mon Sep 17 00:00:00 2001 From: zhangli <123879394@qq.com> Date: Sat, 23 Aug 2025 01:17:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E9=97=AD=E8=AE=A2=E5=8D=95=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/sczx/order/service/impl/OrderServiceImpl.java | 1 + .../com/sczx/order/thirdpart/integration/PayInteg.java | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/sczx/order/service/impl/OrderServiceImpl.java b/src/main/java/com/sczx/order/service/impl/OrderServiceImpl.java index 02656a5..d3a867a 100644 --- a/src/main/java/com/sczx/order/service/impl/OrderServiceImpl.java +++ b/src/main/java/com/sczx/order/service/impl/OrderServiceImpl.java @@ -191,6 +191,7 @@ public class OrderServiceImpl implements OrderService { for(OrderSubPO orderSubPO : orderSubPOList){ orderSubPO.setPaymentId(paymentId); + orderSubPO.setPaymentMethod(PayStatusEnum.USERPAYING.getCode()); } orderMainRepo.save(orderMainPO); diff --git a/src/main/java/com/sczx/order/thirdpart/integration/PayInteg.java b/src/main/java/com/sczx/order/thirdpart/integration/PayInteg.java index ce49e63..7df45f0 100644 --- a/src/main/java/com/sczx/order/thirdpart/integration/PayInteg.java +++ b/src/main/java/com/sczx/order/thirdpart/integration/PayInteg.java @@ -118,12 +118,12 @@ public class PayInteg { try { Map result = payFacade.closeOrder(companyId, outTradeNo); if(Objects.isNull(result)){ - return true; + throw new InnerException("关闭订单失败"); } else { String returnCode = result.get("return_code"); - if(StringUtils.equalsIgnoreCase(returnCode, "FAIL")){ - throw new InnerException("关闭订单失败"); - }else if(Objects.nonNull(result.get("code"))){ + if(StringUtils.isNotBlank(returnCode)&&StringUtils.equalsIgnoreCase(returnCode, "SUCCESS")){ + return true; + } else { throw new InnerException("关闭订单失败"); } } @@ -132,6 +132,5 @@ public class PayInteg { log.error("关闭订单失败",e); throw new InnerException("关闭订单失败"); } - return false; } }