From 66921cc1a778e3977baec0517538dd9c49f8ee29 Mon Sep 17 00:00:00 2001 From: DaxPay Date: Mon, 29 Apr 2024 18:06:22 +0800 Subject: [PATCH] =?UTF-8?q?ref=20=E7=9B=B8=E5=85=B3=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _doc/Task.md | 10 ++- .../service/code/PayApiCallBackTypeEnum.java | 2 - .../channel/alipay/service/AliPayService.java | 8 +-- .../service/UnionPayCallbackService.java | 2 - .../union/service/UnionPayService.java | 4 +- .../service/WeChatPayCallbackService.java | 3 - .../wechat/service/WeChatPayService.java | 10 +-- .../payment/pay/service/PayAssistService.java | 14 ++-- .../refund/service/RefundAssistService.java | 6 +- .../record/close/entity/PayCloseRecord.java | 4 +- .../record/repair/entity/PayRepairRecord.java | 4 +- .../dto/record/close/PayCloseRecordDto.java | 2 +- .../dto/record/repair/PayRepairRecordDto.java | 17 +++-- .../service/func/AbsCallbackStrategy.java | 27 ------- .../param/record/PayCloseRecordQuery.java | 38 +++++++--- .../param/record/PayRepairRecordQuery.java | 37 ++++++---- .../param/record/PaySyncRecordQuery.java | 72 ++++++++++++------- 17 files changed, 136 insertions(+), 124 deletions(-) delete mode 100644 daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsCallbackStrategy.java diff --git a/_doc/Task.md b/_doc/Task.md index 3da2aea32..8c32accc2 100644 --- a/_doc/Task.md +++ b/_doc/Task.md @@ -13,14 +13,12 @@ - [x] 支付和退款回调 - [x] 去除现金支付和储值卡支付方式 - [x] 三方支付外部订单号规则优化: 支付P、退款R、分账A,根据环境加前缀:DEV_、DEMO_、PRE_ -- [ ] 资金流水优化 - [ ] 金额显示统一使用元 -- -- [ ] 数据加密方式改为类型处理器模式 -- [ ] 优化 -- [ ] 增加支付错误Rest处理器, 统一支付错误返回数据格式 +- [ ] 使用切面统一处理API调用异常, 做统一包装返回 -2.0.7: 分账完善 +2.0.7: 分账完善和基础架构优化 +- [ ] 资金流水优化 +- [ ] 数据加密方式改为类型处理器模式 - [ ] 支持分账组分账和自己传接收方进行分账 - [ ] DEMO增加获取微信OpenID和支付宝OpenId功能 - [ ] 分账接收方管理提供接口调用 diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/code/PayApiCallBackTypeEnum.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/code/PayApiCallBackTypeEnum.java index 56a77943c..5ca45b6a1 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/code/PayApiCallBackTypeEnum.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/code/PayApiCallBackTypeEnum.java @@ -14,8 +14,6 @@ public enum PayApiCallBackTypeEnum { /** 支持所有回调类型 */ ALL("all"), - /** 支持异步回调通知 */ - ASYNC_NOTICE("async_notice"), /** 不支持退掉通知 */ NONE("none"); diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/alipay/service/AliPayService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/alipay/service/AliPayService.java index 5e09c80b0..bc0ce63f4 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/alipay/service/AliPayService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/alipay/service/AliPayService.java @@ -74,7 +74,7 @@ public class AliPayService { Integer amount = payOrder.getAmount(); String payBody = null; // 异步线程存储 - PayLocal asyncPayInfo = PaymentContextLocal.get().getPayInfo(); + PayLocal payInfo = PaymentContextLocal.get().getPayInfo(); // wap支付 if (Objects.equals(payOrder.getMethod(), PayMethodEnum.WAP.getCode())) { payBody = this.wapPay(amount, payOrder, alipayConfig); @@ -96,7 +96,7 @@ public class AliPayService { this.barCode(amount, payOrder, aliPayParam, alipayConfig); } // 通常是发起支付的参数 - asyncPayInfo.setPayBody(payBody); + payInfo.setPayBody(payBody); } /** @@ -238,7 +238,7 @@ public class AliPayService { * 付款码支付 */ public void barCode(int amount, PayOrder payOrder, AliPayParam aliPayParam, AliPayConfig alipayConfig) { - PayLocal asyncPayInfo = PaymentContextLocal.get().getPayInfo(); + PayLocal payInfo = PaymentContextLocal.get().getPayInfo(); AlipayTradePayModel model = new AlipayTradePayModel(); model.setSubject(payOrder.getTitle()); @@ -259,7 +259,7 @@ public class AliPayService { // 支付成功处理 金额2000以下免密支付, 记录支付完成相关信息 if (Objects.equals(response.getCode(), AliPayCode.SUCCESS)) { - asyncPayInfo.setOutOrderNo(response.getTradeNo()) + payInfo.setOutOrderNo(response.getTradeNo()) .setComplete(true); } // 非支付中响应码, 进行错误处理 diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/union/service/UnionPayCallbackService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/union/service/UnionPayCallbackService.java index cf0e1c245..d927dc490 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/union/service/UnionPayCallbackService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/union/service/UnionPayCallbackService.java @@ -14,7 +14,6 @@ import cn.bootx.platform.daxpay.service.core.channel.union.entity.UnionPayConfig import cn.bootx.platform.daxpay.service.core.payment.callback.service.PayCallbackService; import cn.bootx.platform.daxpay.service.core.payment.callback.service.RefundCallbackService; import cn.bootx.platform.daxpay.service.core.record.callback.service.PayCallbackRecordService; -import cn.bootx.platform.daxpay.service.func.AbsCallbackStrategy; import cn.bootx.platform.daxpay.service.sdk.union.api.UnionPayKit; import cn.hutool.core.date.DatePattern; import cn.hutool.core.thread.ThreadUtil; @@ -25,7 +24,6 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; -import javax.annotation.Resource; import java.time.LocalDateTime; import java.util.Collections; import java.util.Map; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/union/service/UnionPayService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/union/service/UnionPayService.java index 494d3a3c3..08cb767c5 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/union/service/UnionPayService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/union/service/UnionPayService.java @@ -68,7 +68,7 @@ public class UnionPayService { public void pay(PayOrder payOrder, UnionPayParam unionPayParam, UnionPayKit unionPayKit){ Integer amount = payOrder.getAmount(); BigDecimal totalFee = BigDecimal.valueOf(amount * 0.01); - PayLocal asyncPayInfo = PaymentContextLocal.get().getPayInfo();; + PayLocal payInfo = PaymentContextLocal.get().getPayInfo();; String payBody = null; PayMethodEnum payMethodEnum = PayMethodEnum.findByCode(payOrder.getMethod()); @@ -97,7 +97,7 @@ public class UnionPayService { payBody = this.b2bPay(totalFee, payOrder, unionPayKit); } - asyncPayInfo.setPayBody(payBody); + payInfo.setPayBody(payBody); } /** diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/wechat/service/WeChatPayCallbackService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/wechat/service/WeChatPayCallbackService.java index 48ab8e863..2a67e418f 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/wechat/service/WeChatPayCallbackService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/wechat/service/WeChatPayCallbackService.java @@ -9,12 +9,10 @@ import cn.bootx.platform.daxpay.service.code.PayRepairSourceEnum; import cn.bootx.platform.daxpay.service.code.PaymentTypeEnum; import cn.bootx.platform.daxpay.service.common.context.CallbackLocal; import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal; -import cn.bootx.platform.daxpay.service.core.channel.alipay.service.AliPayConfigService; import cn.bootx.platform.daxpay.service.core.channel.wechat.entity.WeChatPayConfig; import cn.bootx.platform.daxpay.service.core.payment.callback.service.PayCallbackService; import cn.bootx.platform.daxpay.service.core.payment.callback.service.RefundCallbackService; import cn.bootx.platform.daxpay.service.core.record.callback.service.PayCallbackRecordService; -import cn.bootx.platform.daxpay.service.func.AbsCallbackStrategy; import cn.hutool.core.date.DatePattern; import cn.hutool.core.util.StrUtil; import cn.hutool.json.JSONUtil; @@ -24,7 +22,6 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; -import javax.annotation.Resource; import java.time.LocalDateTime; import java.util.HashMap; import java.util.Map; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/wechat/service/WeChatPayService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/wechat/service/WeChatPayService.java index b99846f31..bac514c15 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/wechat/service/WeChatPayService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/wechat/service/WeChatPayService.java @@ -87,7 +87,7 @@ public class WeChatPayService { Integer amount = payOrder.getAmount(); String totalFee = String.valueOf(amount); - PayLocal asyncPayInfo = PaymentContextLocal.get().getPayInfo();; + PayLocal payInfo = PaymentContextLocal.get().getPayInfo();; String payBody = null; PayMethodEnum payMethodEnum = PayMethodEnum.findByCode(payOrder.getMethod()); @@ -111,7 +111,7 @@ public class WeChatPayService { else if (payMethodEnum == PayMethodEnum.BARCODE) { this.barCodePay(totalFee, payOrder, weChatPayParam.getAuthCode(), weChatPayConfig); } - asyncPayInfo.setPayBody(payBody); + payInfo.setPayBody(payBody); } /** @@ -181,7 +181,7 @@ public class WeChatPayService { * 付款码支付 */ private void barCodePay(String amount, PayOrder payOrder, String authCode, WeChatPayConfig weChatPayConfig) { - PayLocal asyncPayInfo = PaymentContextLocal.get().getPayInfo(); + PayLocal payInfo = PaymentContextLocal.get().getPayInfo(); Map params = BarPayModel.builder() .appid(weChatPayConfig.getWxAppId()) @@ -210,14 +210,14 @@ public class WeChatPayService { String errCode = result.get(WeChatPayCode.ERR_CODE); // 支付成功处理, if (Objects.equals(resultCode, WeChatPayCode.PAY_SUCCESS)) { - asyncPayInfo.setOutOrderNo(result.get(WeChatPayCode.TRANSACTION_ID)).setComplete(true); + payInfo.setOutOrderNo(result.get(WeChatPayCode.TRANSACTION_ID)).setComplete(true); return; } // 支付中, 发起轮训同步 if (Objects.equals(resultCode, WeChatPayCode.PAY_FAIL) && Objects.equals(errCode, WeChatPayCode.PAY_USERPAYING)) { SpringUtil.getBean(this.getClass()).rotationSync(payOrder); - asyncPayInfo.setOutOrderNo(result.get(WeChatPayCode.TRANSACTION_ID)); + payInfo.setOutOrderNo(result.get(WeChatPayCode.TRANSACTION_ID)); return; } // 支付撤销 diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/pay/service/PayAssistService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/pay/service/PayAssistService.java index 939156532..7e8512b74 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/pay/service/PayAssistService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/pay/service/PayAssistService.java @@ -73,23 +73,23 @@ public class PayAssistService { .equals(payParam.getChannel())) { return; } - PayLocal asyncPayInfo = PaymentContextLocal.get() + PayLocal payInfo = PaymentContextLocal.get() .getPayInfo(); PlatformLocal platform = PaymentContextLocal.get() .getPlatformInfo(); // 支付订单是非为空 if (Objects.nonNull(order)) { - asyncPayInfo.setExpiredTime(order.getExpiredTime()); + payInfo.setExpiredTime(order.getExpiredTime()); return; } // 支付参数传入 if (Objects.nonNull(payParam.getExpiredTime())) { - asyncPayInfo.setExpiredTime(payParam.getExpiredTime()); + payInfo.setExpiredTime(payParam.getExpiredTime()); return; } // 读取本地时间 LocalDateTime paymentExpiredTime = PayUtil.getPaymentExpiredTime(platform.getOrderTimeout()); - asyncPayInfo.setExpiredTime(paymentExpiredTime); + payInfo.setExpiredTime(paymentExpiredTime); } /** @@ -243,10 +243,10 @@ public class PayAssistService { payResult.setStatus(payOrder.getStatus()); // 设置支付参数 - PayLocal asyncPayInfo = PaymentContextLocal.get() + PayLocal payInfo = PaymentContextLocal.get() .getPayInfo(); - if (StrUtil.isNotBlank(asyncPayInfo.getPayBody())) { - payResult.setPayBody(asyncPayInfo.getPayBody()); + if (StrUtil.isNotBlank(payInfo.getPayBody())) { + payResult.setPayBody(payInfo.getPayBody()); } // 签名 return payResult; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/service/RefundAssistService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/service/RefundAssistService.java index df42453d1..f5373cc8d 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/service/RefundAssistService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/service/RefundAssistService.java @@ -136,9 +136,9 @@ public class RefundAssistService { */ @Transactional(rollbackFor = Exception.class) public void updateOrder(RefundOrder refundOrder){ - RefundLocal asyncRefundInfo = PaymentContextLocal.get().getRefundInfo(); - refundOrder.setStatus(asyncRefundInfo.getStatus().getCode()) - .setOutRefundNo(asyncRefundInfo.getOutRefundNo()); + RefundLocal refundInfo = PaymentContextLocal.get().getRefundInfo(); + refundOrder.setStatus(refundInfo.getStatus().getCode()) + .setOutRefundNo(refundInfo.getOutRefundNo()); // 退款成功更新退款时间 if (Objects.equals(refundOrder.getStatus(), SUCCESS.getCode())){ // TODO 读取网关返回的退款时间和完成时间 diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/close/entity/PayCloseRecord.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/close/entity/PayCloseRecord.java index 8ec6dc39f..ed03c7e47 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/close/entity/PayCloseRecord.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/close/entity/PayCloseRecord.java @@ -36,7 +36,7 @@ public class PayCloseRecord extends MpCreateEntity implements EntityBaseFunction * 关闭的支付通道 * @see PayChannelEnum */ - @DbColumn(comment = "关闭的异步支付通道") + @DbColumn(comment = "关闭的支付通道") private String channel; /** @@ -47,7 +47,7 @@ public class PayCloseRecord extends MpCreateEntity implements EntityBaseFunction /** 错误码 */ @DbColumn(comment = "错误码") - private String code; + private String errorCode; /** 错误消息 */ @DbColumn(comment = "错误消息") diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/repair/entity/PayRepairRecord.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/repair/entity/PayRepairRecord.java index 429c1257d..9b6e5aef7 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/repair/entity/PayRepairRecord.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/repair/entity/PayRepairRecord.java @@ -67,8 +67,8 @@ public class PayRepairRecord extends MpCreateEntity implements EntityBaseFunctio @DbColumn(comment = "修复方式") private String repairWay; - /** 修复的异步通道 */ - @DbColumn(comment = "修复的异步通道") + /** 修复的通道 */ + @DbColumn(comment = "修复的通道") private String channel; /** diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/close/PayCloseRecordDto.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/close/PayCloseRecordDto.java index d10360c81..8841e3127 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/close/PayCloseRecordDto.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/close/PayCloseRecordDto.java @@ -42,7 +42,7 @@ public class PayCloseRecordDto extends BaseDto { /** 错误码 */ @DbColumn(comment = "错误码") - private String code; + private String errorCode; /** 错误消息 */ @DbColumn(comment = "错误消息") diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/repair/PayRepairRecordDto.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/repair/PayRepairRecordDto.java index ef815a4a0..b2560ad56 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/repair/PayRepairRecordDto.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/repair/PayRepairRecordDto.java @@ -6,7 +6,6 @@ import cn.bootx.platform.daxpay.service.code.PayRepairSourceEnum; import cn.bootx.platform.daxpay.service.code.PayRepairWayEnum; import cn.bootx.platform.daxpay.service.code.PaymentTypeEnum; import cn.bootx.platform.daxpay.service.code.RefundRepairWayEnum; -import cn.bootx.table.modify.annotation.DbColumn; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; @@ -40,6 +39,14 @@ public class PayRepairRecordDto extends BaseDto { @Schema(description = "本地业务号") private String tradeNo; + /** + * 修复方式 + * @see PayRepairWayEnum + * @see RefundRepairWayEnum + */ + @Schema(description = "修复方式") + private String repairWay; + /** * 修复类型 支付修复/退款修复 * @see PaymentTypeEnum @@ -54,14 +61,6 @@ public class PayRepairRecordDto extends BaseDto { @Schema(description = "修复来源") private String repairSource; - /** - * 修复方式 - * @see PayRepairWayEnum - * @see RefundRepairWayEnum - */ - @Schema(description = "修复方式") - private String repairWay; - /** 修复的异步通道 */ @Schema(description = "修复的异步通道") private String channel; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsCallbackStrategy.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsCallbackStrategy.java deleted file mode 100644 index d8157bdda..000000000 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsCallbackStrategy.java +++ /dev/null @@ -1,27 +0,0 @@ -package cn.bootx.platform.daxpay.service.func; - -import cn.bootx.platform.daxpay.service.code.PayCallbackStatusEnum; -import cn.bootx.platform.daxpay.service.code.PayRepairSourceEnum; -import cn.bootx.platform.daxpay.service.code.PaymentTypeEnum; -import cn.bootx.platform.daxpay.service.common.context.CallbackLocal; -import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal; -import cn.bootx.platform.daxpay.service.core.payment.callback.service.PayCallbackService; -import cn.bootx.platform.daxpay.service.core.payment.callback.service.RefundCallbackService; -import cn.bootx.platform.daxpay.service.core.record.callback.entity.PayCallbackRecord; -import cn.bootx.platform.daxpay.service.core.record.callback.service.PayCallbackRecordService; -import cn.hutool.json.JSONUtil; -import lombok.extern.slf4j.Slf4j; - -import javax.annotation.Resource; -import java.util.Map; - -/** - * 回调处理抽象类, 处理支付回调和退款回调 - * - * @author xxm - * @since 2021/6/21 - */ -@Slf4j -@Deprecated -public abstract class AbsCallbackStrategy implements PayStrategy { -} diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PayCloseRecordQuery.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PayCloseRecordQuery.java index 07042791f..d336fb6d9 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PayCloseRecordQuery.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PayCloseRecordQuery.java @@ -2,6 +2,7 @@ package cn.bootx.platform.daxpay.service.param.record; import cn.bootx.platform.common.core.rest.param.QueryOrder; import cn.bootx.platform.daxpay.code.PayChannelEnum; +import cn.bootx.table.modify.annotation.DbColumn; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; @@ -18,19 +19,36 @@ import lombok.experimental.Accessors; @Schema(title = "支付关闭记录") public class PayCloseRecordQuery extends QueryOrder { - @Schema(description = "支付记录id") - private Long paymentId; + /** 订单号 */ + @DbColumn(comment = "订单号") + private String orderNo; - @Schema(description = "业务号") - private String businessNo; + /** 商户订单号 */ + @DbColumn(comment = "商户订单号") + private String bizOrderNo; /** - * 关闭的异步支付通道, 可以为空 - * @see PayChannelEnum#getCode() + * 关闭的支付通道 + * @see PayChannelEnum */ - @Schema(description = "关闭的异步支付通道") - private String asyncChannel; + @DbColumn(comment = "关闭的异步支付通道") + private String channel; - @Schema(description = "请求链路ID") - private String reqId; + /** + * 是否关闭成功 + */ + @DbColumn(comment = "是否关闭成功") + private boolean closed; + + /** 错误码 */ + @DbColumn(comment = "错误码") + private String errorCode; + + /** 错误消息 */ + @DbColumn(comment = "错误消息") + private String errorMsg; + + /** 客户端IP */ + @DbColumn(comment = "客户端IP") + private String clientIp; } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PayRepairRecordQuery.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PayRepairRecordQuery.java index 00c4475c5..e2a143389 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PayRepairRecordQuery.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PayRepairRecordQuery.java @@ -5,6 +5,7 @@ import cn.bootx.platform.daxpay.code.PayStatusEnum; import cn.bootx.platform.daxpay.service.code.PayRepairSourceEnum; import cn.bootx.platform.daxpay.service.code.PayRepairWayEnum; import cn.bootx.platform.daxpay.service.code.PaymentTypeEnum; +import cn.bootx.platform.daxpay.service.code.RefundRepairWayEnum; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; @@ -20,23 +21,31 @@ import lombok.experimental.Accessors; @Schema(title = "支付修复记录查询参数") public class PayRepairRecordQuery { - /** 本地订单ID */ - @Schema(description = "本地订单ID") - private Long orderId; - - /** 本地订单号 */ - @Schema(description = "本地订单号") - private String orderNo; - - @Schema(description = "修复单号") - private String repairNo; /** - * 修复类型 + * 修复号 + * 如果一次修复产生的修复记录有多个记录, 使用这个作为关联 + */ + @Schema(description = "修复号") + private String repairNo; + + /** 支付ID/退款ID */ + @Schema(description = "本地订单ID") + private Long tradeId; + + /** + * 本地交易号, 支付号/退款号 + */ + @Schema(description = "本地业务号") + private String tradeNo; + + /** + * 修复类型 支付修复/退款修复 * @see PaymentTypeEnum */ @Schema(description = "修复类型") private String repairType; + /** * 修复来源 * @see PayRepairSourceEnum @@ -47,13 +56,14 @@ public class PayRepairRecordQuery { /** * 修复方式 * @see PayRepairWayEnum + * @see RefundRepairWayEnum */ @Schema(description = "修复方式") private String repairWay; /** 修复的异步通道 */ @Schema(description = "修复的异步通道") - private String asyncChannel; + private String channel; /** * 修复前状态 @@ -68,7 +78,4 @@ public class PayRepairRecordQuery { */ @Schema(description = "修复后状态") private String afterStatus; - - @Schema(description = "请求链路ID") - private String reqId; } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PaySyncRecordQuery.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PaySyncRecordQuery.java index 4515bc148..0c92990f2 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PaySyncRecordQuery.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PaySyncRecordQuery.java @@ -3,7 +3,10 @@ package cn.bootx.platform.daxpay.service.param.record; import cn.bootx.platform.common.core.annotation.QueryParam; import cn.bootx.platform.daxpay.code.PayChannelEnum; import cn.bootx.platform.daxpay.code.PaySyncStatusEnum; -import cn.bootx.table.modify.annotation.DbColumn; +import cn.bootx.platform.daxpay.code.RefundSyncStatusEnum; +import cn.bootx.platform.daxpay.service.code.PaymentTypeEnum; +import cn.bootx.table.modify.mysql.annotation.DbMySqlFieldType; +import cn.bootx.table.modify.mysql.constants.MySqlFieldTypeEnum; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.experimental.Accessors; @@ -19,43 +22,64 @@ import lombok.experimental.Accessors; @Schema(title = "支付同步记录查询参数") public class PaySyncRecordQuery { - /** 本地订单id */ - @Schema(description = "本地订单id") - private Long orderId; + /** 本地交易号 */ + @Schema(description = "本地订单ID") + private String tradeNo; - @Schema(description = "本地订单号") - private String orderNo; + /** 商户交易号 */ + @Schema(description = "商户交易号") + private String bizTradeNo; - /** 网关订单号 */ - @Schema(description = "网关订单号") - private String gatewayOrderNo; + /** 三方交易号 */ + @Schema(description = "三方交易号") + private String outTradeNo; - /** 同步类型 */ + + /** + * 三方支付返回状态 + * @see PaySyncStatusEnum + * @see RefundSyncStatusEnum + */ + @Schema(description = "网关返回状态") + private String outTradeStatus; + + + /** + * 同步类型 支付/退款 + * @see PaymentTypeEnum + */ @Schema(description = "同步类型") private String syncType; /** - * 支付通道 + * 同步的异步通道 * @see PayChannelEnum#getCode() */ - @Schema(description = "支付通道") - private String asyncChannel; + @Schema(description = "同步的异步通道") + private String channel; - @Schema(description = "请求链路ID") - private String reqId; + /** 网关返回的同步消息 */ + @DbMySqlFieldType(MySqlFieldTypeEnum.LONGTEXT) + @Schema(description = "同步消息") + private String syncInfo; /** - * 同步状态 - * @see PaySyncStatusEnum + * 支付单如果状态不一致, 是否进行修复 */ - @Schema(description = "同步状态") - private String gatewayStatus; + @Schema(description = "是否进行修复") + private boolean repair; - /** - * 支付单如果状态不一致, 是否修复成功 - */ - @DbColumn(comment = "是否进行修复") - private Boolean repairOrder; + /** 修复单号 */ + @Schema(description = "修复单号") + private String repairNo; + + /** 错误码 */ + @Schema(description = "错误码") + private String errorCode; + + /** 错误消息 */ + @Schema(description = "错误消息") + private String errorMsg; /** 客户端IP */ @Schema(description = "客户端IP")