diff --git a/jsowell-admin/src/main/java/com/jsowell/service/OrderService.java b/jsowell-admin/src/main/java/com/jsowell/service/OrderService.java index 6889f23bf..875969937 100644 --- a/jsowell-admin/src/main/java/com/jsowell/service/OrderService.java +++ b/jsowell-admin/src/main/java/com/jsowell/service/OrderService.java @@ -909,6 +909,28 @@ public class OrderService { // 使用微信支付 payInfo.setPayMode(OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue()); payInfo.setPayModeDesc(OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getLabel()); + + // 判断是微信支付还是汇付支付 + MemberTransactionRecord record = memberTransactionRecordService.selectByOrderCode(orderCode); + if (record != null) { + String paymentInstitutions = record.getPaymentInstitutions(); + if (StringUtils.equals(paymentInstitutions, PaymentInstitutionsEnum.WECHAT_PAY.getValue())) { + // 查微信支付回调记录 + WxpayCallbackRecord wxpayCallbackRecord = wxpayCallbackRecordService.selectByOrderCode(orderCode); + if (wxpayCallbackRecord != null) { + payInfo.setOutTradeNo(wxpayCallbackRecord.getOutTradeNo()); + payInfo.setTransactionId(wxpayCallbackRecord.getTransactionId()); + } + } else if (StringUtils.equals(paymentInstitutions, PaymentInstitutionsEnum.ADAPAY.getValue())) { + // 查询汇付支付回调 + AdapayCallbackRecord adapayCallbackRecord = adapayCallbackRecordService.selectByOrderCode(orderCode); + if (adapayCallbackRecord != null) { + payInfo.setOutTradeNo(adapayCallbackRecord.getPaymentId()); + payInfo.setTransactionId(adapayCallbackRecord.getOutTransId()); + } + } + } + // 查微信支付回调记录 WxpayCallbackRecord wxpayCallbackRecord = wxpayCallbackRecordService.selectByOrderCode(orderCode); if (wxpayCallbackRecord != null) { diff --git a/jsowell-common/src/main/java/com/jsowell/common/constant/CacheConstants.java b/jsowell-common/src/main/java/com/jsowell/common/constant/CacheConstants.java index 6c829a447..de89ff523 100644 --- a/jsowell-common/src/main/java/com/jsowell/common/constant/CacheConstants.java +++ b/jsowell-common/src/main/java/com/jsowell/common/constant/CacheConstants.java @@ -40,7 +40,9 @@ public class CacheConstants { public static final String PILE_PROGRAM_VERSION = "pile_program_version_"; // 查询订单回调 - public static final String QUERY_ORDER_CALLBACK = "query_order_callback:"; + public static final String QUERY_ORDER_WECHAT_CALLBACK = "query_order_wechat_callback:"; + + public static final String QUERY_ORDER_ADAPAY_CALLBACK = "query_order_adapay_callback:"; // 汇付支付参数 public static final String ADAPAY_ORDER_PARAM = "adapay_order_param:"; diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/AdapayCallbackRecordServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/AdapayCallbackRecordServiceImpl.java index dcff64c2f..f1de52ee3 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/AdapayCallbackRecordServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/AdapayCallbackRecordServiceImpl.java @@ -64,7 +64,7 @@ public class AdapayCallbackRecordServiceImpl implements AdapayCallbackRecordServ if (StringUtils.isBlank(orderCode)) { return null; } - String redisKey = CacheConstants.QUERY_ORDER_CALLBACK + orderCode; + String redisKey = CacheConstants.QUERY_ORDER_ADAPAY_CALLBACK + orderCode; AdapayCallbackRecord record = redisCache.getCacheObject(redisKey); if (record != null) { return record; diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/WxpayCallbackRecordServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/WxpayCallbackRecordServiceImpl.java index d21f37cdc..cb5808e6a 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/WxpayCallbackRecordServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/WxpayCallbackRecordServiceImpl.java @@ -61,7 +61,7 @@ public class WxpayCallbackRecordServiceImpl implements WxpayCallbackRecordServic if (StringUtils.isBlank(orderCode)) { return null; } - String redisKey = CacheConstants.QUERY_ORDER_CALLBACK + orderCode; + String redisKey = CacheConstants.QUERY_ORDER_WECHAT_CALLBACK + orderCode; WxpayCallbackRecord wxpayCallbackRecord = redisCache.getCacheObject(redisKey); if (wxpayCallbackRecord != null) { return wxpayCallbackRecord;