From 32597db1bada2341d18d207b683a90e821046f22 Mon Sep 17 00:00:00 2001 From: "autumn.g@foxmail.com" Date: Fri, 1 Sep 2023 17:33:32 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E8=AE=A2=E5=8D=95=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E6=94=B9=E9=80=A0=E5=B7=A5=E5=8E=82=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../orderlogic/DelayMerchantOrderLogic.java | 16 ++++------------ .../orderlogic/NotDelayMerchantOrderLogic.java | 6 +++--- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/orderlogic/DelayMerchantOrderLogic.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/orderlogic/DelayMerchantOrderLogic.java index c8c712b2d..27b2e9e9d 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/orderlogic/DelayMerchantOrderLogic.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/orderlogic/DelayMerchantOrderLogic.java @@ -521,22 +521,14 @@ public class DelayMerchantOrderLogic extends AbstractOrderLogic { BigDecimal deductionAmount = vo.getDeductionAmount(); // 调汇付的交易撤销接口 - // PaymentReverseResponse paymentReverseRequest = adapayService.createPaymentReverseRequest(paymentId, deductionAmount, dto.getWechatAppId(), - // dto.getMemberId(), ScenarioEnum.BALANCE.getValue(), null); + PaymentReverseResponse request = adapayService.createPaymentReverseRequest(paymentId, deductionAmount, + dto.getWechatAppId(), dto.getMemberId(), ScenarioEnum.BALANCE.getValue(), null); - PaymentReverseOperation operation = new PaymentReverseOperation(); - operation.setPaymentId(paymentId); - operation.setReverseAmt(deductionAmount); - operation.setMerchantKey(dto.getWechatAppId()); - operation.setMemberId(dto.getMemberId()); - operation.setScenarioType(ScenarioEnum.BALANCE.getValue()); - PaymentReverseResponse paymentReverseRequest = adapayService.createPaymentReverseRequest(operation); - - if (paymentReverseRequest != null && paymentReverseRequest.isNotFailed()) { + if (request != null && request.isNotFailed()) { memberAdapayRecordService.updateRefundAmount(paymentId, deductionAmount); // 放缓存 - redisCache.setCacheObject(redisKey, paymentReverseRequest, CacheConstants.cache_expire_time_30m); + redisCache.setCacheObject(redisKey, request, CacheConstants.cache_expire_time_30m); } } } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/orderlogic/NotDelayMerchantOrderLogic.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/orderlogic/NotDelayMerchantOrderLogic.java index 9006aa077..a8d222a90 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/orderlogic/NotDelayMerchantOrderLogic.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/orderlogic/NotDelayMerchantOrderLogic.java @@ -493,14 +493,14 @@ public class NotDelayMerchantOrderLogic extends AbstractOrderLogic{ BigDecimal deductionAmount = vo.getDeductionAmount(); // 调汇付的交易退款接口 - RefundResponse refundRequest = adapayService.createRefundRequest(paymentId, refundAmount, + RefundResponse response = adapayService.createRefundRequest(paymentId, refundAmount, dto.getWechatAppId(), dto.getMemberId(), ScenarioEnum.ORDER.getValue(), dto.getOrderCode()); - if (refundRequest != null && refundRequest.isNotFailed()) { + if (response != null && response.isNotFailed()) { memberAdapayRecordService.updateRefundAmount(paymentId, deductionAmount); // 放缓存 - redisCache.setCacheObject(redisKey, refundRequest, CacheConstants.cache_expire_time_30m); + redisCache.setCacheObject(redisKey, response, CacheConstants.cache_expire_time_30m); } } }