From 3ff914a2355550704c08b40dbc7aa917464eca5e Mon Sep 17 00:00:00 2001 From: nws <3239709711@qq.com> Date: Wed, 10 Jan 2024 00:33:22 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E5=A2=9E=E5=8A=A0=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=92=8C=E7=BB=A7=E7=BB=AD=E7=9B=B8=E5=85=B3=E7=9A=84=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _doc/Task.md | 1 + .../controller/order/PayOrderController.java | 65 ++++++++++++++++ .../order/PayRefundOrderController.java | 41 ++++++++++ .../record/PayCallbackRecordController.java | 41 ++++++++++ .../record/PayCloseRecordController.java | 41 ++++++++++ .../record/PayRepairRecordController.java | 41 ++++++++++ .../record/PaySyncRecordController.java | 41 ++++++++++ .../system/PayWayInfoController.java | 7 +- ...efundableInfo.java => RefundableInfo.java} | 4 +- .../RefundableInfoTypeHandler.java | 8 +- .../alipay/service/AliPayCloseService.java | 2 +- .../alipay/service/AliPayOrderService.java | 10 +-- .../alipay/service/AliPayRefundService.java | 2 +- .../channel/alipay/service/AliPayService.java | 2 +- .../alipay/service/AliPaySyncService.java | 2 +- .../channel/cash/service/CashService.java | 2 +- .../core/channel/voucher/entity/Voucher.java | 16 ++-- .../service/VoucherPayOrderService.java | 2 +- .../voucher/service/VoucherPayService.java | 2 +- .../wallet/service/WalletPayOrderService.java | 2 +- .../wallet/service/WalletPayService.java | 2 +- .../wechat/service/WeChatPayCloseService.java | 2 +- .../wechat/service/WeChatPayOrderService.java | 12 +-- .../wechat/service/WeChatPayService.java | 2 +- .../wechat/service/WechatRefundService.java | 6 +- .../core/notice/service/PayNoticeService.java | 10 +-- .../pay/builder/PaymentBuilder.java | 16 ++-- .../order/pay/convert/PayOrderConvert.java | 26 +++++++ .../pay/dao/PayOrderChannelManager.java | 4 +- .../pay/dao/PayOrderChannelMapper.java | 4 +- .../pay/dao/PayOrderExtraManager.java | 4 +- .../pay/dao/PayOrderExtraMapper.java | 4 +- .../core/order/pay/dao/PayOrderManager.java | 38 +++++++++ .../pay/dao/PayOrderMapper.java | 4 +- .../pay/entity/PayOrder.java | 20 +++-- .../pay/entity/PayOrderChannel.java | 15 +++- .../pay/entity/PayOrderExtra.java | 28 ++++--- .../pay/service/PayOrderChannelService.java | 18 ++++- .../pay/service/PayOrderExtraService.java | 28 +++++++ .../pay/service/PayOrderService.java | 31 ++++++-- .../refund/convert/RefundConvert.java | 6 +- .../refund/dao/PayRefundOrderManager.java | 17 ++-- .../refund/dao/PayRefundOrderMapper.java | 4 +- .../refund/entity/PayRefundOrder.java | 10 +-- .../service/PayRefundOrderService.java} | 19 ++--- .../callback/service/PayCallbackService.java | 4 +- .../close/service/PayCloseService.java | 8 +- .../common/service/PaymentSignService.java | 4 +- .../payment/pay/service/PayAssistService.java | 14 ++-- .../core/payment/pay/service/PayService.java | 6 +- .../payment/pay/strategy/CashPayStrategy.java | 2 +- .../service/PayRefundAssistService.java | 8 +- .../refund/service/PayRefundService.java | 4 +- .../refund/strategy/AliPayRefundStrategy.java | 2 +- .../strategy/CashPayRefundStrategy.java | 2 +- .../strategy/VoucherPayRefundStrategy.java | 2 +- .../strategy/WalletPayRefundStrategy.java | 2 +- .../strategy/WeChatPayRefundStrategy.java | 2 +- .../payment/repair/result/RepairResult.java | 2 +- .../repair/service/PayRepairService.java | 16 ++-- .../repair/strategy/AliPayRepairStrategy.java | 4 +- .../strategy/WeChatPayRepairStrategy.java | 4 +- .../payment/sync/service/PaySyncService.java | 4 +- .../dao/PayCallbackRecordManager.java | 15 ++++ .../callback/entity/PayCallbackRecord.java | 16 ++-- .../service/PayCallbackRecordService.java | 12 ++- .../close/dao/PayCloseRecordManager.java | 15 +++- .../record/close/entity/PayCloseRecord.java | 11 ++- .../close/service/PayCloseRecordService.java | 24 ++++++ .../core/record/pay/dao/PayOrderManager.java | 23 ------ .../convert/PayRepairRecordConvert.java | 4 + .../repair/dao/PayRepairRecordManager.java | 15 ++++ .../record/repair/entity/PayRepairRecord.java | 16 +++- .../service/PayRepairRecordService.java | 20 +++++ .../record/sync/dao/PaySyncRecordManager.java | 7 +- .../record/sync/entity/PaySyncRecord.java | 18 ++--- .../sync/service/PaySyncRecordService.java | 22 +++--- .../system/config/entity/PayApiConfig.java | 3 + .../service/PayExpiredTimeService.java | 2 +- .../dto/channel/alipay/AliPaymentDto.java | 2 +- .../channel/voucher/VoucherPayOrderDto.java | 2 +- .../dto/channel/wallet/WalletPayOrderDto.java | 2 +- .../dto/channel/wechat/WeChatPayOrderDto.java | 2 +- .../dto/order/pay/PayOrderChannelDto.java | 19 +++++ .../service/dto/order/pay/PayOrderDto.java | 78 +++++++++++++++++++ .../dto/order/pay/PayOrderExtraDto.java | 19 +++++ .../refund/PayRefundOrderDto.java | 6 +- .../dto/order/repair/PayRepairRecordDto.java | 51 ++++++++++++ .../record/callback/PayCallbackRecordDto.java | 43 ++++++++++ .../dto/record/close/PayCloseRecordDto.java | 35 +++++++++ .../service/dto/record/pay/PayOrderDto.java | 47 ----------- .../dto/record/sync/PaySyncRecordDto.java | 4 +- .../dto/system/config/PayApiConfigDto.java | 3 + .../service/func/AbsPayCloseStrategy.java | 2 +- .../service/func/AbsPayRefundStrategy.java | 2 +- .../service/func/AbsPayRepairStrategy.java | 2 +- .../daxpay/service/func/AbsPayStrategy.java | 2 +- .../service/func/AbsPaySyncStrategy.java | 2 +- .../service/func/PayStrategyConsumer.java | 2 +- .../service/param/order/PayOrderQuery.java | 16 ++++ .../param/order/PayRefundOrderQuery.java | 28 +++++++ .../param/record/PayCallbackRecordQuery.java | 16 ++++ .../param/record/PayCloseRecordQuery.java | 16 ++++ .../param/record/PayRepairRecordQuery.java | 17 ++++ .../param/record/PaySyncRecordQuery.java | 57 ++++++++++++++ .../system/config/PayApiConfigParam.java | 3 + .../src/main/resources/application-dev.yml | 1 - 107 files changed, 1161 insertions(+), 293 deletions(-) create mode 100644 daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/order/PayOrderController.java create mode 100644 daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/order/PayRefundOrderController.java create mode 100644 daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/record/PayCallbackRecordController.java create mode 100644 daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/record/PayCloseRecordController.java create mode 100644 daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/record/PayRepairRecordController.java create mode 100644 daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/record/PaySyncRecordController.java rename daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/common/entity/{OrderRefundableInfo.java => RefundableInfo.java} (79%) rename daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/{record => order}/pay/builder/PaymentBuilder.java (89%) create mode 100644 daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/convert/PayOrderConvert.java rename daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/{record => order}/pay/dao/PayOrderChannelManager.java (90%) rename daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/{record => order}/pay/dao/PayOrderChannelMapper.java (66%) rename daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/{record => order}/pay/dao/PayOrderExtraManager.java (73%) rename daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/{record => order}/pay/dao/PayOrderExtraMapper.java (64%) create mode 100644 daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/dao/PayOrderManager.java rename daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/{record => order}/pay/dao/PayOrderMapper.java (63%) rename daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/{record => order}/pay/entity/PayOrder.java (79%) rename daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/{record => order}/pay/entity/PayOrderChannel.java (71%) rename daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/{record => order}/pay/entity/PayOrderExtra.java (67%) rename daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/{record => order}/pay/service/PayOrderChannelService.java (71%) create mode 100644 daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/service/PayOrderExtraService.java rename daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/{record => order}/pay/service/PayOrderService.java (70%) rename daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/{record => order}/refund/convert/RefundConvert.java (54%) rename daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/{record => order}/refund/dao/PayRefundOrderManager.java (60%) rename daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/{record => order}/refund/dao/PayRefundOrderMapper.java (61%) rename daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/{record => order}/refund/entity/PayRefundOrder.java (88%) rename daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/{record/refund/service/PayRefundRecordService.java => order/refund/service/PayRefundOrderService.java} (68%) delete mode 100644 daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/dao/PayOrderManager.java create mode 100644 daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/pay/PayOrderChannelDto.java create mode 100644 daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/pay/PayOrderDto.java create mode 100644 daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/pay/PayOrderExtraDto.java rename daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/{record => order}/refund/PayRefundOrderDto.java (88%) create mode 100644 daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/repair/PayRepairRecordDto.java delete mode 100644 daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/pay/PayOrderDto.java create mode 100644 daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/order/PayOrderQuery.java create mode 100644 daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/order/PayRefundOrderQuery.java create mode 100644 daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PayCallbackRecordQuery.java create mode 100644 daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PayCloseRecordQuery.java create mode 100644 daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PayRepairRecordQuery.java create mode 100644 daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PaySyncRecordQuery.java diff --git a/_doc/Task.md b/_doc/Task.md index eb3101ab..f52d739f 100644 --- a/_doc/Task.md +++ b/_doc/Task.md @@ -41,6 +41,7 @@ - [ ] (前端) 平台配置 - [ ] (前端) 接口配置 - **任务池** + - [ ] 支付宝方式支持 - [ ] 退款状态同步逻辑 - [ ] 退款回调的处理 - [ ] 支付状态同步处理考虑退款情况 diff --git a/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/order/PayOrderController.java b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/order/PayOrderController.java new file mode 100644 index 00000000..5084accc --- /dev/null +++ b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/order/PayOrderController.java @@ -0,0 +1,65 @@ +package cn.bootx.platform.daxpay.admin.controller.order; + +import cn.bootx.platform.common.core.exception.DataNotExistException; +import cn.bootx.platform.common.core.rest.PageResult; +import cn.bootx.platform.common.core.rest.Res; +import cn.bootx.platform.common.core.rest.ResResult; +import cn.bootx.platform.common.core.rest.param.PageParam; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.service.PayOrderChannelService; +import cn.bootx.platform.daxpay.service.core.order.pay.service.PayOrderExtraService; +import cn.bootx.platform.daxpay.service.core.order.pay.service.PayOrderService; +import cn.bootx.platform.daxpay.service.dto.order.pay.PayOrderChannelDto; +import cn.bootx.platform.daxpay.service.dto.order.pay.PayOrderDto; +import cn.bootx.platform.daxpay.service.dto.order.pay.PayOrderExtraDto; +import cn.bootx.platform.daxpay.service.param.order.PayOrderQuery; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 支付订单控制器 + * @author xxm + * @since 2024/1/9 + */ +@Tag(name = "支付订单控制器") +@RestController +@RequestMapping("/order/pay") +@RequiredArgsConstructor +public class PayOrderController { + private final PayOrderService payOrderService; + private final PayOrderExtraService payOrderExtraService; + private final PayOrderChannelService payOrderChannelService; + + @Operation(summary = "分页查询") + @GetMapping("/page") + public ResResult> page(PageParam pageParam, PayOrderQuery param){ + return Res.ok(payOrderService.page(pageParam,param)); + } + + @Operation(summary = "查询订单详情") + @GetMapping("/findById") + public ResResult findById(Long id){ + PayOrderDto order = payOrderService.findById(id) + .map(PayOrder::toDto) + .orElseThrow(() -> new DataNotExistException("支付订单不存在")); + return Res.ok(order); + } + + @Operation(summary = "查询支付订单扩展信息") + @GetMapping("/getExtraById") + public ResResult getExtraById(Long id){ + return Res.ok(payOrderExtraService.findById(id)); + } + + @Operation(summary = "查询支付订单关联支付通道") + @GetMapping("/getChannels") + public ResResult> getChannels(Long paymentId){ + return Res.ok(payOrderChannelService.findAllByPaymentId(paymentId)); + } +} diff --git a/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/order/PayRefundOrderController.java b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/order/PayRefundOrderController.java new file mode 100644 index 00000000..d9916819 --- /dev/null +++ b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/order/PayRefundOrderController.java @@ -0,0 +1,41 @@ +package cn.bootx.platform.daxpay.admin.controller.order; + +import cn.bootx.platform.common.core.rest.PageResult; +import cn.bootx.platform.common.core.rest.Res; +import cn.bootx.platform.common.core.rest.ResResult; +import cn.bootx.platform.common.core.rest.param.PageParam; +import cn.bootx.platform.daxpay.service.core.order.refund.service.PayRefundOrderService; +import cn.bootx.platform.daxpay.service.dto.order.refund.PayRefundOrderDto; +import cn.bootx.platform.daxpay.service.param.order.PayRefundOrderQuery; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 支付退款控制器 + * @author xxm + * @since 2024/1/9 + */ +@Tag(name = "支付退款控制器") +@RestController +@RequestMapping("/order/refund") +@RequiredArgsConstructor +public class PayRefundOrderController { + private final PayRefundOrderService payRefundOrderService; + + + @Operation(summary = "分页查询") + @GetMapping("/page") + public ResResult> page(PageParam pageParam, PayRefundOrderQuery query){ + return Res.ok(payRefundOrderService.page(pageParam, query)); + } + + @Operation(summary = "查询单条") + @GetMapping("/findById") + public ResResult findById(Long paymentId){ + return Res.ok(payRefundOrderService.findById(paymentId)); + } +} diff --git a/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/record/PayCallbackRecordController.java b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/record/PayCallbackRecordController.java new file mode 100644 index 00000000..e96abcb1 --- /dev/null +++ b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/record/PayCallbackRecordController.java @@ -0,0 +1,41 @@ +package cn.bootx.platform.daxpay.admin.controller.record; + +import cn.bootx.platform.common.core.rest.PageResult; +import cn.bootx.platform.common.core.rest.Res; +import cn.bootx.platform.common.core.rest.ResResult; +import cn.bootx.platform.common.core.rest.param.PageParam; +import cn.bootx.platform.daxpay.service.core.record.callback.service.PayCallbackRecordService; +import cn.bootx.platform.daxpay.service.dto.record.callback.PayCallbackRecordDto; +import cn.bootx.platform.daxpay.service.param.record.PayCallbackRecordQuery; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 支付回调信息记录 + * @author xxm + * @since 2024/1/9 + */ +@Tag(name = "支付回调信息记录") +@RestController +@RequestMapping("/record/callback") +@RequiredArgsConstructor +public class PayCallbackRecordController { + private final PayCallbackRecordService service; + + @Operation(summary = "分页查询") + @GetMapping("/page") + public ResResult> page(PageParam pageParam, PayCallbackRecordQuery query){ + return Res.ok(service.page(pageParam, query)); + } + + @Operation(summary = "查询单条") + @GetMapping("/findById") + public ResResult findById(Long paymentId){ + return Res.ok(service.findById(paymentId)); + } + +} diff --git a/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/record/PayCloseRecordController.java b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/record/PayCloseRecordController.java new file mode 100644 index 00000000..ed92ea4f --- /dev/null +++ b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/record/PayCloseRecordController.java @@ -0,0 +1,41 @@ +package cn.bootx.platform.daxpay.admin.controller.record; + +import cn.bootx.platform.common.core.rest.PageResult; +import cn.bootx.platform.common.core.rest.Res; +import cn.bootx.platform.common.core.rest.ResResult; +import cn.bootx.platform.common.core.rest.param.PageParam; +import cn.bootx.platform.daxpay.service.core.record.close.service.PayCloseRecordService; +import cn.bootx.platform.daxpay.service.dto.record.close.PayCloseRecordDto; +import cn.bootx.platform.daxpay.service.param.record.PayCloseRecordQuery; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * + * @author xxm + * @since 2024/1/9 + */ +@Tag(name = "支付订单关闭记录") +@RestController +@RequestMapping("/record/close") +@RequiredArgsConstructor +public class PayCloseRecordController { + private final PayCloseRecordService service; + + @Operation(summary = "分页查询") + @GetMapping("/page") + public ResResult> page(PageParam pageParam, PayCloseRecordQuery query){ + return Res.ok(service.page(pageParam, query)); + } + + @Operation(summary = "查询单条") + @GetMapping("/findById") + public ResResult findById(Long paymentId){ + return Res.ok(service.findById(paymentId)); + } + +} diff --git a/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/record/PayRepairRecordController.java b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/record/PayRepairRecordController.java new file mode 100644 index 00000000..357b8b85 --- /dev/null +++ b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/record/PayRepairRecordController.java @@ -0,0 +1,41 @@ +package cn.bootx.platform.daxpay.admin.controller.record; + +import cn.bootx.platform.common.core.rest.PageResult; +import cn.bootx.platform.common.core.rest.Res; +import cn.bootx.platform.common.core.rest.ResResult; +import cn.bootx.platform.common.core.rest.param.PageParam; +import cn.bootx.platform.daxpay.service.core.record.repair.service.PayRepairRecordService; +import cn.bootx.platform.daxpay.service.dto.order.repair.PayRepairRecordDto; +import cn.bootx.platform.daxpay.service.param.record.PayRepairRecordQuery; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 支付修复记录控制器 + * @author xxm + * @since 2024/1/9 + */ +@Tag(name = "支付修复记录") +@RestController +@RequestMapping("/record/repair") +@RequiredArgsConstructor +public class PayRepairRecordController { + private final PayRepairRecordService service; + + @Operation(summary = "分页查询") + @GetMapping("/page") + public ResResult> page(PageParam pageParam, PayRepairRecordQuery query){ + return Res.ok(service.page(pageParam, query)); + } + + @Operation(summary = "查询单条") + @GetMapping("/findById") + public ResResult findById(Long paymentId){ + return Res.ok(service.findById(paymentId)); + } + +} diff --git a/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/record/PaySyncRecordController.java b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/record/PaySyncRecordController.java new file mode 100644 index 00000000..ed1cfdeb --- /dev/null +++ b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/record/PaySyncRecordController.java @@ -0,0 +1,41 @@ +package cn.bootx.platform.daxpay.admin.controller.record; + +import cn.bootx.platform.common.core.rest.PageResult; +import cn.bootx.platform.common.core.rest.Res; +import cn.bootx.platform.common.core.rest.ResResult; +import cn.bootx.platform.common.core.rest.param.PageParam; +import cn.bootx.platform.daxpay.service.core.record.sync.service.PaySyncRecordService; +import cn.bootx.platform.daxpay.service.dto.record.sync.PaySyncRecordDto; +import cn.bootx.platform.daxpay.service.param.record.PaySyncRecordQuery; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 支付同步记录控制器 + * @author xxm + * @since 2024/1/9 + */ +@Tag(name = "支付同步记录控制器") +@RestController +@RequestMapping("/record/sync") +@RequiredArgsConstructor +public class PaySyncRecordController { + private final PaySyncRecordService service; + + @Operation(summary = "分页查询") + @GetMapping("/page") + public ResResult> page(PageParam pageParam, PaySyncRecordQuery query){ + return Res.ok(service.page(pageParam, query)); + } + + @Operation(summary = "查询单条") + @GetMapping("/findById") + public ResResult findById(Long paymentId){ + return Res.ok(service.findById(paymentId)); + } + +} diff --git a/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/system/PayWayInfoController.java b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/system/PayWayInfoController.java index a7b81048..179211a1 100644 --- a/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/system/PayWayInfoController.java +++ b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/system/PayWayInfoController.java @@ -8,10 +8,7 @@ import cn.bootx.platform.daxpay.service.param.system.payinfo.PayWayInfoParam; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -40,7 +37,7 @@ public class PayWayInfoController { } @Operation(summary = "更新") - @GetMapping("/update") + @PostMapping("/update") public ResResult update(@RequestBody PayWayInfoParam param){ payWayInfoService.update(param); return Res.ok(); diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/common/entity/OrderRefundableInfo.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/common/entity/RefundableInfo.java similarity index 79% rename from daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/common/entity/OrderRefundableInfo.java rename to daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/common/entity/RefundableInfo.java index fc9e06a1..f5d41894 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/common/entity/OrderRefundableInfo.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/common/entity/RefundableInfo.java @@ -5,13 +5,13 @@ import lombok.Data; import lombok.experimental.Accessors; /** - * 支付订单可退款信息(不持久化,直接保存为json) + * 可退款信息(不持久化,直接保存为json) * @author xxm * @since 2023/12/18 */ @Data @Accessors(chain = true) -public class OrderRefundableInfo { +public class RefundableInfo { /** * @see PayChannelEnum#getCode() */ diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/common/typehandler/RefundableInfoTypeHandler.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/common/typehandler/RefundableInfoTypeHandler.java index 0bfdb2b4..2110d1ca 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/common/typehandler/RefundableInfoTypeHandler.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/common/typehandler/RefundableInfoTypeHandler.java @@ -1,7 +1,7 @@ package cn.bootx.platform.daxpay.service.common.typehandler; import cn.bootx.platform.common.mybatisplus.handler.JacksonTypeReferenceHandler; -import cn.bootx.platform.daxpay.service.common.entity.OrderRefundableInfo; +import cn.bootx.platform.daxpay.service.common.entity.RefundableInfo; import com.fasterxml.jackson.core.type.TypeReference; import java.util.List; @@ -11,13 +11,13 @@ import java.util.List; * @author xxm * @since 2024/1/3 */ -public class RefundableInfoTypeHandler extends JacksonTypeReferenceHandler> { +public class RefundableInfoTypeHandler extends JacksonTypeReferenceHandler> { /** * 返回要反序列化的类型对象 */ @Override - public TypeReference> getTypeReference() { - return new TypeReference>() {}; + public TypeReference> getTypeReference() { + return new TypeReference>() {}; } } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/alipay/service/AliPayCloseService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/alipay/service/AliPayCloseService.java index bc6eedd0..2debd3c2 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/alipay/service/AliPayCloseService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/alipay/service/AliPayCloseService.java @@ -4,7 +4,7 @@ import cn.bootx.platform.common.spring.exception.RetryableException; import cn.bootx.platform.daxpay.code.PaySyncStatusEnum; import cn.bootx.platform.daxpay.service.code.AliPayCode; import cn.bootx.platform.daxpay.service.core.payment.sync.result.GatewaySyncResult; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; import cn.bootx.platform.daxpay.exception.pay.PayFailureException; import com.alipay.api.AlipayApiException; import com.alipay.api.domain.AlipayTradeCloseModel; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/alipay/service/AliPayOrderService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/alipay/service/AliPayOrderService.java index c832f23c..4c23ac7e 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/alipay/service/AliPayOrderService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/alipay/service/AliPayOrderService.java @@ -2,12 +2,12 @@ package cn.bootx.platform.daxpay.service.core.channel.alipay.service; import cn.bootx.platform.daxpay.code.PayChannelEnum; import cn.bootx.platform.daxpay.code.PayStatusEnum; -import cn.bootx.platform.daxpay.service.common.entity.OrderRefundableInfo; +import cn.bootx.platform.daxpay.service.common.entity.RefundableInfo; import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal; import cn.bootx.platform.daxpay.service.core.channel.alipay.dao.AliPayOrderManager; import cn.bootx.platform.daxpay.service.core.channel.alipay.entity.AliPayOrder; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; -import cn.bootx.platform.daxpay.service.core.record.pay.service.PayOrderChannelService; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.service.PayOrderChannelService; import cn.bootx.platform.daxpay.param.pay.PayChannelParam; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -45,9 +45,9 @@ public class AliPayOrderService { payOrderChannelService.updateChannel(payChannelParam,payOrder); // 更新支付宝可退款类型信息 - List refundableInfos = payOrder.getRefundableInfos(); + List refundableInfos = payOrder.getRefundableInfos(); refundableInfos.removeIf(payTypeInfo -> PayChannelEnum.ASYNC_TYPE_CODE.contains(payTypeInfo.getChannel())); - refundableInfos.add(new OrderRefundableInfo() + refundableInfos.add(new RefundableInfo() .setChannel(PayChannelEnum.ALI.getCode()) .setAmount(payChannelParam.getAmount()) ); diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/alipay/service/AliPayRefundService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/alipay/service/AliPayRefundService.java index d2fb368d..19d0d908 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/alipay/service/AliPayRefundService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/alipay/service/AliPayRefundService.java @@ -3,7 +3,7 @@ package cn.bootx.platform.daxpay.service.core.channel.alipay.service; import cn.bootx.platform.daxpay.service.code.AliPayCode; import cn.bootx.platform.daxpay.service.common.context.AsyncRefundLocal; import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; import cn.bootx.platform.daxpay.exception.pay.PayFailureException; import cn.hutool.core.util.IdUtil; import com.alipay.api.AlipayApiException; 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 aecc67a7..13e11022 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 @@ -8,7 +8,7 @@ import cn.bootx.platform.daxpay.service.common.context.AsyncPayLocal; import cn.bootx.platform.daxpay.service.common.context.NoticeLocal; import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal; import cn.bootx.platform.daxpay.service.core.channel.alipay.entity.AliPayConfig; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; import cn.bootx.platform.daxpay.exception.pay.PayFailureException; import cn.bootx.platform.daxpay.param.channel.AliPayParam; import cn.bootx.platform.daxpay.param.pay.PayChannelParam; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/alipay/service/AliPaySyncService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/alipay/service/AliPaySyncService.java index 8c30e69e..a9a51c00 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/alipay/service/AliPaySyncService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/alipay/service/AliPaySyncService.java @@ -6,7 +6,7 @@ import cn.bootx.platform.daxpay.code.PaySyncStatusEnum; import cn.bootx.platform.daxpay.service.code.AliPayCode; import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal; import cn.bootx.platform.daxpay.service.core.payment.sync.result.GatewaySyncResult; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; import cn.hutool.json.JSONUtil; import com.alipay.api.AlipayApiException; import com.alipay.api.domain.AlipayTradeQueryModel; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/cash/service/CashService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/cash/service/CashService.java index 6884b2ef..704bb5a5 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/cash/service/CashService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/cash/service/CashService.java @@ -3,7 +3,7 @@ package cn.bootx.platform.daxpay.service.core.channel.cash.service; import cn.bootx.platform.daxpay.code.PayStatusEnum; import cn.bootx.platform.daxpay.service.core.channel.cash.dao.CashPayOrderManager; import cn.bootx.platform.daxpay.service.core.channel.cash.entity.CashPayOrder; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; import cn.bootx.platform.daxpay.param.pay.PayParam; import cn.bootx.platform.daxpay.param.pay.PayChannelParam; import lombok.RequiredArgsConstructor; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/voucher/entity/Voucher.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/voucher/entity/Voucher.java index 6937a583..e6f2f74c 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/voucher/entity/Voucher.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/voucher/entity/Voucher.java @@ -43,20 +43,20 @@ public class Voucher extends MpBaseEntity implements EntityBaseFunction refundableInfos = payOrder.getRefundableInfos(); + List refundableInfos = payOrder.getRefundableInfos(); refundableInfos.removeIf(payTypeInfo -> PayChannelEnum.ASYNC_TYPE_CODE.contains(payTypeInfo.getChannel())); - refundableInfos.add(new OrderRefundableInfo() + refundableInfos.add(new RefundableInfo() .setChannel(PayChannelEnum.WECHAT.getCode()) .setAmount(payChannelParam.getAmount()) ); 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 1152f161..5b27ebd8 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 @@ -11,7 +11,7 @@ import cn.bootx.platform.daxpay.service.code.WeChatPayWay; import cn.bootx.platform.daxpay.service.common.context.AsyncPayLocal; import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal; import cn.bootx.platform.daxpay.service.core.channel.wechat.entity.WeChatPayConfig; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; import cn.bootx.platform.daxpay.service.core.payment.sync.service.PaySyncService; import cn.bootx.platform.daxpay.exception.pay.PayFailureException; import cn.bootx.platform.daxpay.service.param.channel.wechat.WeChatPayParam; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/wechat/service/WechatRefundService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/wechat/service/WechatRefundService.java index dd3d3a10..ccad0bd3 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/wechat/service/WechatRefundService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/wechat/service/WechatRefundService.java @@ -4,10 +4,10 @@ import cn.bootx.platform.daxpay.code.PayChannelEnum; import cn.bootx.platform.daxpay.code.PayRefundStatusEnum; import cn.bootx.platform.daxpay.service.code.WeChatPayCode; import cn.bootx.platform.daxpay.service.common.context.AsyncRefundLocal; -import cn.bootx.platform.daxpay.service.common.entity.OrderRefundableInfo; +import cn.bootx.platform.daxpay.service.common.entity.RefundableInfo; import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal; import cn.bootx.platform.daxpay.service.core.channel.wechat.entity.WeChatPayConfig; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; import cn.bootx.platform.daxpay.exception.pay.PayFailureException; import cn.hutool.core.codec.Base64; import cn.hutool.core.util.IdUtil; @@ -40,7 +40,7 @@ public class WechatRefundService { */ public void refund(PayOrder payOrder, int amount, WeChatPayConfig weChatPayConfig) { - OrderRefundableInfo refundableInfo = payOrder.getRefundableInfos().stream() + RefundableInfo refundableInfo = payOrder.getRefundableInfos().stream() .filter(o -> Objects.equals(o.getChannel(), PayChannelEnum.WECHAT.getCode())) .findFirst() .orElseThrow(() -> new PayFailureException("未找到微信支付的详细信息")); diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/notice/service/PayNoticeService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/notice/service/PayNoticeService.java index 375aa2e6..cc154e09 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/notice/service/PayNoticeService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/notice/service/PayNoticeService.java @@ -7,11 +7,11 @@ import cn.bootx.platform.daxpay.service.common.context.PlatformLocal; import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal; import cn.bootx.platform.daxpay.service.core.notice.result.PayChannelResult; import cn.bootx.platform.daxpay.service.core.notice.result.PayNoticeResult; -import cn.bootx.platform.daxpay.service.core.record.pay.dao.PayOrderChannelManager; -import cn.bootx.platform.daxpay.service.core.record.pay.dao.PayOrderExtraManager; -import cn.bootx.platform.daxpay.service.core.record.pay.dao.PayOrderManager; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrderExtra; +import cn.bootx.platform.daxpay.service.core.order.pay.dao.PayOrderChannelManager; +import cn.bootx.platform.daxpay.service.core.order.pay.dao.PayOrderExtraManager; +import cn.bootx.platform.daxpay.service.core.order.pay.dao.PayOrderManager; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrderExtra; import cn.bootx.platform.daxpay.util.PaySignUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.http.ContentType; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/builder/PaymentBuilder.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/builder/PaymentBuilder.java similarity index 89% rename from daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/builder/PaymentBuilder.java rename to daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/builder/PaymentBuilder.java index 221e4221..839f576b 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/builder/PaymentBuilder.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/builder/PaymentBuilder.java @@ -1,4 +1,4 @@ -package cn.bootx.platform.daxpay.service.core.record.pay.builder; +package cn.bootx.platform.daxpay.service.core.order.pay.builder; import cn.bootx.platform.daxpay.code.PayChannelEnum; import cn.bootx.platform.daxpay.code.PayStatusEnum; @@ -6,10 +6,10 @@ import cn.bootx.platform.daxpay.service.common.context.AsyncPayLocal; import cn.bootx.platform.daxpay.service.common.context.NoticeLocal; import cn.bootx.platform.daxpay.service.common.context.PlatformLocal; import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrderChannel; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrderExtra; -import cn.bootx.platform.daxpay.service.common.entity.OrderRefundableInfo; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrderChannel; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrderExtra; +import cn.bootx.platform.daxpay.service.common.entity.RefundableInfo; import cn.bootx.platform.daxpay.param.pay.PayParam; import cn.bootx.platform.daxpay.param.pay.PayChannelParam; import cn.bootx.platform.daxpay.result.pay.PayResult; @@ -42,7 +42,7 @@ public class PaymentBuilder { .getAsyncPayInfo() .getExpiredTime(); // 可退款信息 - List refundableInfos = buildRefundableInfo(payParam.getPayChannels()); + List refundableInfos = buildRefundableInfo(payParam.getPayChannels()); // 计算总价 int sumAmount = payParam.getPayChannels().stream() .map(PayChannelParam::getAmount) @@ -109,12 +109,12 @@ public class PaymentBuilder { /** * 构建支付订单的可退款信息列表 */ - private List buildRefundableInfo(List payChannelParamList) { + private List buildRefundableInfo(List payChannelParamList) { if (CollectionUtil.isEmpty(payChannelParamList)) { return Collections.emptyList(); } return payChannelParamList.stream() - .map(o-> new OrderRefundableInfo() + .map(o-> new RefundableInfo() .setChannel(o.getChannel()) .setAmount(o.getAmount())) .collect(Collectors.toList()); diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/convert/PayOrderConvert.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/convert/PayOrderConvert.java new file mode 100644 index 00000000..0e2ca7d6 --- /dev/null +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/convert/PayOrderConvert.java @@ -0,0 +1,26 @@ +package cn.bootx.platform.daxpay.service.core.order.pay.convert; + +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrderChannel; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrderExtra; +import cn.bootx.platform.daxpay.service.dto.order.pay.PayOrderChannelDto; +import cn.bootx.platform.daxpay.service.dto.order.pay.PayOrderDto; +import cn.bootx.platform.daxpay.service.dto.order.pay.PayOrderExtraDto; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +/** + * + * @author xxm + * @since 2024/1/9 + */ +@Mapper +public interface PayOrderConvert { + PayOrderConvert CONVERT = Mappers.getMapper(PayOrderConvert.class); + + PayOrderExtraDto convert(PayOrderExtra in); + + PayOrderDto convert(PayOrder in); + + PayOrderChannelDto convert(PayOrderChannel in); +} diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/dao/PayOrderChannelManager.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/dao/PayOrderChannelManager.java similarity index 90% rename from daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/dao/PayOrderChannelManager.java rename to daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/dao/PayOrderChannelManager.java index 36edca35..b7b37519 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/dao/PayOrderChannelManager.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/dao/PayOrderChannelManager.java @@ -1,7 +1,7 @@ -package cn.bootx.platform.daxpay.service.core.record.pay.dao; +package cn.bootx.platform.daxpay.service.core.order.pay.dao; import cn.bootx.platform.common.mybatisplus.impl.BaseManager; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrderChannel; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrderChannel; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Repository; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/dao/PayOrderChannelMapper.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/dao/PayOrderChannelMapper.java similarity index 66% rename from daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/dao/PayOrderChannelMapper.java rename to daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/dao/PayOrderChannelMapper.java index f66f6b0d..65251dda 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/dao/PayOrderChannelMapper.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/dao/PayOrderChannelMapper.java @@ -1,6 +1,6 @@ -package cn.bootx.platform.daxpay.service.core.record.pay.dao; +package cn.bootx.platform.daxpay.service.core.order.pay.dao; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrderChannel; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrderChannel; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/dao/PayOrderExtraManager.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/dao/PayOrderExtraManager.java similarity index 73% rename from daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/dao/PayOrderExtraManager.java rename to daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/dao/PayOrderExtraManager.java index acde023d..c7230834 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/dao/PayOrderExtraManager.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/dao/PayOrderExtraManager.java @@ -1,7 +1,7 @@ -package cn.bootx.platform.daxpay.service.core.record.pay.dao; +package cn.bootx.platform.daxpay.service.core.order.pay.dao; import cn.bootx.platform.common.mybatisplus.impl.BaseManager; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrderExtra; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrderExtra; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Repository; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/dao/PayOrderExtraMapper.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/dao/PayOrderExtraMapper.java similarity index 64% rename from daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/dao/PayOrderExtraMapper.java rename to daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/dao/PayOrderExtraMapper.java index 13335e94..413b1466 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/dao/PayOrderExtraMapper.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/dao/PayOrderExtraMapper.java @@ -1,6 +1,6 @@ -package cn.bootx.platform.daxpay.service.core.record.pay.dao; +package cn.bootx.platform.daxpay.service.core.order.pay.dao; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrderExtra; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrderExtra; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/dao/PayOrderManager.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/dao/PayOrderManager.java new file mode 100644 index 00000000..1eb56d86 --- /dev/null +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/dao/PayOrderManager.java @@ -0,0 +1,38 @@ +package cn.bootx.platform.daxpay.service.core.order.pay.dao; + +import cn.bootx.platform.common.core.rest.param.PageParam; +import cn.bootx.platform.common.mybatisplus.base.MpIdEntity; +import cn.bootx.platform.common.mybatisplus.impl.BaseManager; +import cn.bootx.platform.common.mybatisplus.util.MpUtil; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.param.order.PayOrderQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Repository; + +import java.util.Optional; + +/** + * 支付订单 + * @author xxm + * @since 2023/12/18 + */ +@Slf4j +@Repository +@RequiredArgsConstructor +public class PayOrderManager extends BaseManager { + public Optional findByBusinessNo(String businessNo) { + return findByField(PayOrder::getBusinessNo,businessNo); + } + + /** + * 分页 + */ + public Page page(PageParam pageParam, PayOrderQuery query){ + Page mpPage = MpUtil.getMpPage(pageParam, PayOrder.class); + return lambdaQuery() + .orderByDesc(MpIdEntity::getId) + .page(mpPage); + } +} diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/dao/PayOrderMapper.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/dao/PayOrderMapper.java similarity index 63% rename from daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/dao/PayOrderMapper.java rename to daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/dao/PayOrderMapper.java index 32566c62..96f19fff 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/dao/PayOrderMapper.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/dao/PayOrderMapper.java @@ -1,6 +1,6 @@ -package cn.bootx.platform.daxpay.service.core.record.pay.dao; +package cn.bootx.platform.daxpay.service.core.order.pay.dao; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/entity/PayOrder.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/entity/PayOrder.java similarity index 79% rename from daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/entity/PayOrder.java rename to daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/entity/PayOrder.java index e8d26eae..1fe3d813 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/entity/PayOrder.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/entity/PayOrder.java @@ -1,11 +1,14 @@ -package cn.bootx.platform.daxpay.service.core.record.pay.entity; +package cn.bootx.platform.daxpay.service.core.order.pay.entity; import cn.bootx.platform.common.core.annotation.BigField; +import cn.bootx.platform.common.core.function.EntityBaseFunction; import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity; import cn.bootx.platform.daxpay.code.PayChannelEnum; import cn.bootx.platform.daxpay.code.PayStatusEnum; -import cn.bootx.platform.daxpay.service.common.entity.OrderRefundableInfo; +import cn.bootx.platform.daxpay.service.common.entity.RefundableInfo; import cn.bootx.platform.daxpay.service.common.typehandler.RefundableInfoTypeHandler; +import cn.bootx.platform.daxpay.service.core.order.pay.convert.PayOrderConvert; +import cn.bootx.platform.daxpay.service.dto.order.pay.PayOrderDto; import cn.bootx.table.modify.annotation.DbColumn; import cn.bootx.table.modify.annotation.DbTable; import cn.bootx.table.modify.mysql.annotation.DbMySqlFieldType; @@ -31,7 +34,7 @@ import java.util.List; @DbTable(comment = "支付订单") @Accessors(chain = true) @TableName(value = "pay_order",autoResultMap = true) -public class PayOrder extends MpBaseEntity { +public class PayOrder extends MpBaseEntity implements EntityBaseFunction { /** 关联的业务id */ @DbMySqlIndex(comment = "业务业务号索引",type = MySqlIndexType.UNIQUE) @@ -67,13 +70,13 @@ public class PayOrder extends MpBaseEntity { /** * 退款信息列表 - * @see OrderRefundableInfo + * @see RefundableInfo */ @TableField(typeHandler = RefundableInfoTypeHandler.class) @BigField @DbMySqlFieldType(MySqlFieldTypeEnum.LONGTEXT) @DbColumn(comment = "退款信息列表") - private List refundableInfos; + private List refundableInfos; /** * 支付状态 @@ -90,4 +93,11 @@ public class PayOrder extends MpBaseEntity { @DbColumn(comment = "过期时间") private LocalDateTime expiredTime; + /** + * 转换 + */ + @Override + public PayOrderDto toDto() { + return PayOrderConvert.CONVERT.convert(this); + } } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/entity/PayOrderChannel.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/entity/PayOrderChannel.java similarity index 71% rename from daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/entity/PayOrderChannel.java rename to daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/entity/PayOrderChannel.java index 759ca3eb..18b9e554 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/entity/PayOrderChannel.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/entity/PayOrderChannel.java @@ -1,10 +1,13 @@ -package cn.bootx.platform.daxpay.service.core.record.pay.entity; +package cn.bootx.platform.daxpay.service.core.order.pay.entity; +import cn.bootx.platform.common.core.function.EntityBaseFunction; import cn.bootx.platform.common.mybatisplus.base.MpCreateEntity; import cn.bootx.platform.daxpay.param.channel.AliPayParam; import cn.bootx.platform.daxpay.param.channel.VoucherPayParam; import cn.bootx.platform.daxpay.param.channel.WalletPayParam; import cn.bootx.platform.daxpay.param.channel.WeChatPayParam; +import cn.bootx.platform.daxpay.service.core.order.pay.convert.PayOrderConvert; +import cn.bootx.platform.daxpay.service.dto.order.pay.PayOrderChannelDto; import cn.bootx.table.modify.annotation.DbColumn; import cn.bootx.table.modify.annotation.DbTable; import com.baomidou.mybatisplus.annotation.TableName; @@ -22,7 +25,7 @@ import lombok.experimental.Accessors; @Accessors(chain = true) @DbTable(comment = "支付订单关联支付时通道信息") @TableName("pay_order_channel") -public class PayOrderChannel extends MpCreateEntity { +public class PayOrderChannel extends MpCreateEntity implements EntityBaseFunction { @DbColumn(comment = "支付id") private Long paymentId; @@ -47,4 +50,12 @@ public class PayOrderChannel extends MpCreateEntity { */ @DbColumn(comment = "附加支付参数") private String channelExtra; + + /** + * 转换 + */ + @Override + public PayOrderChannelDto toDto() { + return PayOrderConvert.CONVERT.convert(this); + } } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/entity/PayOrderExtra.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/entity/PayOrderExtra.java similarity index 67% rename from daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/entity/PayOrderExtra.java rename to daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/entity/PayOrderExtra.java index 265a038e..98567e2f 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/entity/PayOrderExtra.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/entity/PayOrderExtra.java @@ -1,13 +1,15 @@ -package cn.bootx.platform.daxpay.service.core.record.pay.entity; +package cn.bootx.platform.daxpay.service.core.order.pay.entity; +import cn.bootx.platform.common.core.function.EntityBaseFunction; import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity; +import cn.bootx.platform.daxpay.service.core.order.pay.convert.PayOrderConvert; +import cn.bootx.platform.daxpay.service.dto.order.pay.PayOrderExtraDto; import cn.bootx.table.modify.annotation.DbColumn; import cn.bootx.table.modify.annotation.DbTable; import com.baomidou.mybatisplus.annotation.FieldStrategy; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -24,7 +26,7 @@ import java.time.LocalDateTime; @Accessors(chain = true) @DbTable(comment = "支付订单扩展信息") @TableName("pay_order_extra") -public class PayOrderExtra extends MpBaseEntity { +public class PayOrderExtra extends MpBaseEntity implements EntityBaseFunction { /** 描述 */ @DbColumn(comment = "描述") @@ -34,8 +36,8 @@ public class PayOrderExtra extends MpBaseEntity { @DbColumn(comment = "支付终端ip") private String clientIp; - /** 是否不启用异步通知 */ - @DbColumn(comment = "是否不启用异步通知,以最后一次为准") + /** 是否不需要异步通知,以最后一次为准 */ + @DbColumn(comment = "是否不需要异步通知") private boolean notNotify; /** 异步通知地址 */ @@ -43,17 +45,16 @@ public class PayOrderExtra extends MpBaseEntity { @TableField(updateStrategy = FieldStrategy.ALWAYS) private String notifyUrl; - /** 同步通知 */ - /** 签名类型 */ @DbColumn(comment = "签名类型") private String signType; - /** 签名 */ - @DbColumn(comment = "签名,以最后一次为准") + /** 签名,以最后一次为准 */ + @DbColumn(comment = "签名") private String sign; - @Schema(description = "商户扩展参数,回调时会原样返回") + /** 商户扩展参数,回调时会原样返回 */ + @DbColumn(comment = "商户扩展参数") private String attach; /** API版本号 */ @@ -72,4 +73,11 @@ public class PayOrderExtra extends MpBaseEntity { @DbColumn(comment = "错误信息") private String errorMsg; + /** + * 转换 + */ + @Override + public PayOrderExtraDto toDto() { + return PayOrderConvert.CONVERT.convert(this); + } } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/service/PayOrderChannelService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/service/PayOrderChannelService.java similarity index 71% rename from daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/service/PayOrderChannelService.java rename to daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/service/PayOrderChannelService.java index 424cadce..4d0c955d 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/service/PayOrderChannelService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/service/PayOrderChannelService.java @@ -1,15 +1,18 @@ -package cn.bootx.platform.daxpay.service.core.record.pay.service; +package cn.bootx.platform.daxpay.service.core.order.pay.service; +import cn.bootx.platform.common.core.util.ResultConvertUtil; import cn.bootx.platform.daxpay.code.PayChannelEnum; -import cn.bootx.platform.daxpay.service.core.record.pay.dao.PayOrderChannelManager; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrderChannel; import cn.bootx.platform.daxpay.param.pay.PayChannelParam; +import cn.bootx.platform.daxpay.service.core.order.pay.dao.PayOrderChannelManager; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrderChannel; +import cn.bootx.platform.daxpay.service.dto.order.pay.PayOrderChannelDto; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.List; import java.util.Optional; /** @@ -23,6 +26,13 @@ import java.util.Optional; public class PayOrderChannelService { private final PayOrderChannelManager payOrderChannelManager; + /** + * 根据支付ID查询列表 + */ + public List findAllByPaymentId(Long paymentId){ + return ResultConvertUtil.dtoListConvert(payOrderChannelManager.findAllByPaymentId(paymentId)); + } + /** * 更新支付订单的通道信息 */ diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/service/PayOrderExtraService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/service/PayOrderExtraService.java new file mode 100644 index 00000000..f28d06b9 --- /dev/null +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/service/PayOrderExtraService.java @@ -0,0 +1,28 @@ +package cn.bootx.platform.daxpay.service.core.order.pay.service; + +import cn.bootx.platform.common.core.exception.DataNotExistException; +import cn.bootx.platform.daxpay.service.core.order.pay.dao.PayOrderExtraManager; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrderExtra; +import cn.bootx.platform.daxpay.service.dto.order.pay.PayOrderExtraDto; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * 支付订单扩展信息 + * @author xxm + * @since 2024/1/9 + */ +@Slf4j +@Service +@RequiredArgsConstructor +public class PayOrderExtraService { + private final PayOrderExtraManager payOrderExtraManager; + + /** + * 查询详情 + */ + public PayOrderExtraDto findById(Long id){ + return payOrderExtraManager.findById(id).map(PayOrderExtra::toDto).orElseThrow(()->new DataNotExistException("支付订单扩展信息不存在")); + } +} diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/service/PayOrderService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/service/PayOrderService.java similarity index 70% rename from daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/service/PayOrderService.java rename to daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/service/PayOrderService.java index 49910161..8a5ac3c6 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/service/PayOrderService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/pay/service/PayOrderService.java @@ -1,12 +1,18 @@ -package cn.bootx.platform.daxpay.service.core.record.pay.service; +package cn.bootx.platform.daxpay.service.core.order.pay.service; +import cn.bootx.platform.common.core.rest.PageResult; +import cn.bootx.platform.common.core.rest.param.PageParam; +import cn.bootx.platform.common.mybatisplus.util.MpUtil; import cn.bootx.platform.daxpay.code.PayChannelEnum; import cn.bootx.platform.daxpay.code.PayStatusEnum; -import cn.bootx.platform.daxpay.service.common.entity.OrderRefundableInfo; -import cn.bootx.platform.daxpay.service.core.record.pay.dao.PayOrderManager; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; -import cn.bootx.platform.daxpay.service.core.timeout.service.PayExpiredTimeService; import cn.bootx.platform.daxpay.exception.pay.PayFailureException; +import cn.bootx.platform.daxpay.service.common.entity.RefundableInfo; +import cn.bootx.platform.daxpay.service.core.order.pay.dao.PayOrderManager; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.timeout.service.PayExpiredTimeService; +import cn.bootx.platform.daxpay.service.dto.order.pay.PayOrderDto; +import cn.bootx.platform.daxpay.service.param.order.PayOrderQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -29,9 +35,17 @@ public class PayOrderService { private final PayExpiredTimeService expiredTimeService; - // + // 支付完成常量集合 private final List ORDER_FINISH = Arrays.asList(PayStatusEnum.CLOSE.getCode(), PayStatusEnum.SUCCESS.getCode()); + /** + * 根据id查询 + */ + public PageResult page(PageParam pageParam, PayOrderQuery param) { + Page page = payOrderManager.page(pageParam, param); + return MpUtil.convert2DtoPageResult(page); + } + /** * 根据id查询 */ @@ -73,8 +87,8 @@ public class PayOrderService { */ public void updateRefundSuccess(PayOrder payment, int amount, PayChannelEnum payChannelEnum) { // 删除旧有的退款记录, 替换退款完的新的 - List refundableInfos = payment.getRefundableInfos(); - OrderRefundableInfo refundableInfo = refundableInfos.stream() + List refundableInfos = payment.getRefundableInfos(); + RefundableInfo refundableInfo = refundableInfos.stream() .filter(o -> Objects.equals(o.getChannel(), payChannelEnum.getCode())) .findFirst() .orElseThrow(() -> new PayFailureException("退款数据不存在")); @@ -83,4 +97,5 @@ public class PayOrderService { refundableInfos.add(refundableInfo); payment.setRefundableInfos(refundableInfos); } + } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/refund/convert/RefundConvert.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/refund/convert/RefundConvert.java similarity index 54% rename from daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/refund/convert/RefundConvert.java rename to daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/refund/convert/RefundConvert.java index eda819be..65a87162 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/refund/convert/RefundConvert.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/refund/convert/RefundConvert.java @@ -1,7 +1,7 @@ -package cn.bootx.platform.daxpay.service.core.record.refund.convert; +package cn.bootx.platform.daxpay.service.core.order.refund.convert; -import cn.bootx.platform.daxpay.service.core.record.refund.entity.PayRefundOrder; -import cn.bootx.platform.daxpay.service.dto.record.refund.PayRefundOrderDto; +import cn.bootx.platform.daxpay.service.core.order.refund.entity.PayRefundOrder; +import cn.bootx.platform.daxpay.service.dto.order.refund.PayRefundOrderDto; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/refund/dao/PayRefundOrderManager.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/refund/dao/PayRefundOrderManager.java similarity index 60% rename from daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/refund/dao/PayRefundOrderManager.java rename to daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/refund/dao/PayRefundOrderManager.java index d50223c1..0ee99945 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/refund/dao/PayRefundOrderManager.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/refund/dao/PayRefundOrderManager.java @@ -1,11 +1,11 @@ -package cn.bootx.platform.daxpay.service.core.record.refund.dao; +package cn.bootx.platform.daxpay.service.core.order.refund.dao; import cn.bootx.platform.common.core.rest.param.PageParam; import cn.bootx.platform.common.mybatisplus.base.MpIdEntity; import cn.bootx.platform.common.mybatisplus.impl.BaseManager; import cn.bootx.platform.common.mybatisplus.util.MpUtil; -import cn.bootx.platform.daxpay.service.core.record.refund.entity.PayRefundOrder; -import cn.bootx.platform.daxpay.service.dto.record.refund.PayRefundOrderDto; +import cn.bootx.platform.daxpay.service.core.order.refund.entity.PayRefundOrder; +import cn.bootx.platform.daxpay.service.param.order.PayRefundOrderQuery; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -22,12 +22,15 @@ import java.util.Objects; @RequiredArgsConstructor public class PayRefundOrderManager extends BaseManager { - public Page page(PageParam pageParam, PayRefundOrderDto param) { + /** + * 分页 + */ + public Page page(PageParam pageParam, PayRefundOrderQuery query) { Page mpPage = MpUtil.getMpPage(pageParam, PayRefundOrder.class); return lambdaQuery().orderByDesc(MpIdEntity::getId) - .like(Objects.nonNull(param.getPaymentId()), PayRefundOrder::getPaymentId, param.getPaymentId()) - .like(Objects.nonNull(param.getBusinessNo()), PayRefundOrder::getBusinessNo, param.getBusinessNo()) - .like(Objects.nonNull(param.getTitle()), PayRefundOrder::getTitle, param.getTitle()) + .like(Objects.nonNull(query.getPaymentId()), PayRefundOrder::getPaymentId, query.getPaymentId()) + .like(Objects.nonNull(query.getBusinessNo()), PayRefundOrder::getBusinessNo, query.getBusinessNo()) + .like(Objects.nonNull(query.getTitle()), PayRefundOrder::getTitle, query.getTitle()) .page(mpPage); } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/refund/dao/PayRefundOrderMapper.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/refund/dao/PayRefundOrderMapper.java similarity index 61% rename from daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/refund/dao/PayRefundOrderMapper.java rename to daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/refund/dao/PayRefundOrderMapper.java index a3b1b84c..f99d2d59 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/refund/dao/PayRefundOrderMapper.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/refund/dao/PayRefundOrderMapper.java @@ -1,6 +1,6 @@ -package cn.bootx.platform.daxpay.service.core.record.refund.dao; +package cn.bootx.platform.daxpay.service.core.order.refund.dao; -import cn.bootx.platform.daxpay.service.core.record.refund.entity.PayRefundOrder; +import cn.bootx.platform.daxpay.service.core.order.refund.entity.PayRefundOrder; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/refund/entity/PayRefundOrder.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/refund/entity/PayRefundOrder.java similarity index 88% rename from daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/refund/entity/PayRefundOrder.java rename to daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/refund/entity/PayRefundOrder.java index aeba8a23..e6731840 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/refund/entity/PayRefundOrder.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/refund/entity/PayRefundOrder.java @@ -1,12 +1,12 @@ -package cn.bootx.platform.daxpay.service.core.record.refund.entity; +package cn.bootx.platform.daxpay.service.core.order.refund.entity; import cn.bootx.platform.common.core.function.EntityBaseFunction; import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity; import cn.bootx.platform.daxpay.code.PayRefundStatusEnum; -import cn.bootx.platform.daxpay.service.common.entity.OrderRefundableInfo; +import cn.bootx.platform.daxpay.service.common.entity.RefundableInfo; import cn.bootx.platform.daxpay.service.common.typehandler.RefundableInfoTypeHandler; -import cn.bootx.platform.daxpay.service.core.record.refund.convert.RefundConvert; -import cn.bootx.platform.daxpay.service.dto.record.refund.PayRefundOrderDto; +import cn.bootx.platform.daxpay.service.core.order.refund.convert.RefundConvert; +import cn.bootx.platform.daxpay.service.dto.order.refund.PayRefundOrderDto; import cn.bootx.table.modify.annotation.DbColumn; import cn.bootx.table.modify.annotation.DbTable; import cn.bootx.table.modify.mysql.annotation.DbMySqlFieldType; @@ -79,7 +79,7 @@ public class PayRefundOrder extends MpBaseEntity implements EntityBaseFunction

refundableInfo; + private List refundableInfo; /** * 退款状态 diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/refund/service/PayRefundRecordService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/refund/service/PayRefundOrderService.java similarity index 68% rename from daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/refund/service/PayRefundRecordService.java rename to daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/refund/service/PayRefundOrderService.java index cd7e09db..0ee6c25a 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/refund/service/PayRefundRecordService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/refund/service/PayRefundOrderService.java @@ -1,12 +1,13 @@ -package cn.bootx.platform.daxpay.service.core.record.refund.service; +package cn.bootx.platform.daxpay.service.core.order.refund.service; import cn.bootx.platform.common.core.exception.DataNotExistException; import cn.bootx.platform.common.core.rest.PageResult; import cn.bootx.platform.common.core.rest.param.PageParam; import cn.bootx.platform.common.mybatisplus.util.MpUtil; -import cn.bootx.platform.daxpay.service.core.record.refund.dao.PayRefundOrderManager; -import cn.bootx.platform.daxpay.service.core.record.refund.entity.PayRefundOrder; -import cn.bootx.platform.daxpay.service.dto.record.refund.PayRefundOrderDto; +import cn.bootx.platform.daxpay.service.core.order.refund.dao.PayRefundOrderManager; +import cn.bootx.platform.daxpay.service.core.order.refund.entity.PayRefundOrder; +import cn.bootx.platform.daxpay.service.dto.order.refund.PayRefundOrderDto; +import cn.bootx.platform.daxpay.service.param.order.PayRefundOrderQuery; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -21,19 +22,15 @@ import org.springframework.stereotype.Service; @Slf4j @Service @RequiredArgsConstructor -public class PayRefundRecordService { +public class PayRefundOrderService { private final PayRefundOrderManager refundRecordManager; - // TODO 记录退款记录 - - - /** * 分页查询 */ - public PageResult page(PageParam pageParam, PayRefundOrderDto param) { - Page page = refundRecordManager.page(pageParam, param); + public PageResult page(PageParam pageParam, PayRefundOrderQuery query) { + Page page = refundRecordManager.page(pageParam, query); return MpUtil.convert2DtoPageResult(page); } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/callback/service/PayCallbackService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/callback/service/PayCallbackService.java index 9a1dfca2..06646855 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/callback/service/PayCallbackService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/callback/service/PayCallbackService.java @@ -8,8 +8,8 @@ import cn.bootx.platform.daxpay.code.PayStatusEnum; import cn.bootx.platform.daxpay.service.core.payment.callback.result.PayCallbackResult; import cn.bootx.platform.daxpay.service.core.payment.repair.param.PayRepairParam; import cn.bootx.platform.daxpay.service.core.payment.repair.service.PayRepairService; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; -import cn.bootx.platform.daxpay.service.core.record.pay.service.PayOrderService; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.service.PayOrderService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/close/service/PayCloseService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/close/service/PayCloseService.java index 4585c9d6..e1dc2781 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/close/service/PayCloseService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/close/service/PayCloseService.java @@ -5,13 +5,13 @@ import cn.bootx.platform.daxpay.code.PayStatusEnum; import cn.bootx.platform.daxpay.exception.pay.PayFailureException; import cn.bootx.platform.daxpay.exception.pay.PayUnsupportedMethodException; import cn.bootx.platform.daxpay.param.pay.PayCloseParam; -import cn.bootx.platform.daxpay.service.common.entity.OrderRefundableInfo; +import cn.bootx.platform.daxpay.service.common.entity.RefundableInfo; import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal; import cn.bootx.platform.daxpay.service.core.payment.close.factory.PayCloseStrategyFactory; import cn.bootx.platform.daxpay.service.core.record.close.entity.PayCloseRecord; import cn.bootx.platform.daxpay.service.core.record.close.service.PayCloseRecordService; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; -import cn.bootx.platform.daxpay.service.core.record.pay.service.PayOrderService; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.service.PayOrderService; import cn.bootx.platform.daxpay.service.func.AbsPayCloseStrategy; import cn.hutool.core.collection.CollectionUtil; import com.baomidou.lock.LockInfo; @@ -76,7 +76,7 @@ public class PayCloseService { // 1.获取支付方式(退款列表中提取),通过工厂生成对应的策略组 List channels = payOrder.getRefundableInfos() .stream() - .map(OrderRefundableInfo::getChannel) + .map(RefundableInfo::getChannel) .collect(Collectors.toList()); List payCloseStrategies = PayCloseStrategyFactory.createAsyncLast(channels); if (CollectionUtil.isEmpty(payCloseStrategies)) { diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/common/service/PaymentSignService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/common/service/PaymentSignService.java index 0f575a97..d4738ba1 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/common/service/PaymentSignService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/common/service/PaymentSignService.java @@ -44,12 +44,12 @@ public class PaymentSignService { if (Objects.equals(PaySignTypeEnum.HMAC_SHA256.getCode(), signType)){ boolean verified = PaySignUtil.verifyHmacSha256Sign(param, platform.getSignSecret(), param.getSign()); if (!verified){ - throw new PayFailureException("签名验证未通过"); + throw new PayFailureException("未通过签名验证"); } } else if (Objects.equals(PaySignTypeEnum.MD5.getCode(), signType)){ boolean verified = PaySignUtil.verifyMd5Sign(param, platform.getSignSecret(), param.getSign()); if (!verified){ - throw new PayFailureException("签名验证未通过"); + throw new PayFailureException("未通过签名验证"); } } else { throw new PayFailureException("签名方式错误"); 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 cd7cf8a0..18c96f7e 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 @@ -12,13 +12,13 @@ import cn.bootx.platform.daxpay.service.common.context.NoticeLocal; import cn.bootx.platform.daxpay.service.common.context.PlatformLocal; import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal; import cn.bootx.platform.daxpay.service.core.payment.sync.service.PaySyncService; -import cn.bootx.platform.daxpay.service.core.record.pay.builder.PaymentBuilder; -import cn.bootx.platform.daxpay.service.core.record.pay.dao.PayOrderChannelManager; -import cn.bootx.platform.daxpay.service.core.record.pay.dao.PayOrderExtraManager; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrderChannel; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrderExtra; -import cn.bootx.platform.daxpay.service.core.record.pay.service.PayOrderService; +import cn.bootx.platform.daxpay.service.core.order.pay.builder.PaymentBuilder; +import cn.bootx.platform.daxpay.service.core.order.pay.dao.PayOrderChannelManager; +import cn.bootx.platform.daxpay.service.core.order.pay.dao.PayOrderExtraManager; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrderChannel; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrderExtra; +import cn.bootx.platform.daxpay.service.core.order.pay.service.PayOrderService; import cn.bootx.platform.daxpay.util.PayUtil; import cn.hutool.core.util.StrUtil; import lombok.RequiredArgsConstructor; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/pay/service/PayService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/pay/service/PayService.java index 6f8e403d..f6eb68e2 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/pay/service/PayService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/pay/service/PayService.java @@ -8,9 +8,9 @@ import cn.bootx.platform.daxpay.param.pay.PayChannelParam; import cn.bootx.platform.daxpay.param.pay.SimplePayParam; import cn.bootx.platform.daxpay.result.pay.PayResult; import cn.bootx.platform.daxpay.service.core.payment.pay.factory.PayStrategyFactory; -import cn.bootx.platform.daxpay.service.core.record.pay.builder.PaymentBuilder; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; -import cn.bootx.platform.daxpay.service.core.record.pay.service.PayOrderService; +import cn.bootx.platform.daxpay.service.core.order.pay.builder.PaymentBuilder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.service.PayOrderService; import cn.bootx.platform.daxpay.service.func.AbsPayStrategy; import cn.bootx.platform.daxpay.service.func.PayStrategyConsumer; import cn.bootx.platform.daxpay.util.PayUtil; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/pay/strategy/CashPayStrategy.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/pay/strategy/CashPayStrategy.java index bc87c4ba..f1335879 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/pay/strategy/CashPayStrategy.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/pay/strategy/CashPayStrategy.java @@ -2,7 +2,7 @@ package cn.bootx.platform.daxpay.service.core.payment.pay.strategy; import cn.bootx.platform.daxpay.code.PayChannelEnum; import cn.bootx.platform.daxpay.service.core.channel.cash.service.CashService; -import cn.bootx.platform.daxpay.service.core.record.pay.service.PayOrderService; +import cn.bootx.platform.daxpay.service.core.order.pay.service.PayOrderService; import cn.bootx.platform.daxpay.exception.pay.PayAmountAbnormalException; import cn.bootx.platform.daxpay.service.func.AbsPayStrategy; import cn.bootx.platform.daxpay.param.pay.PayChannelParam; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/service/PayRefundAssistService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/service/PayRefundAssistService.java index cae24888..7c06f9ad 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/service/PayRefundAssistService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/service/PayRefundAssistService.java @@ -8,10 +8,10 @@ import cn.bootx.platform.daxpay.service.common.context.AsyncRefundLocal; import cn.bootx.platform.daxpay.service.common.context.NoticeLocal; import cn.bootx.platform.daxpay.service.common.context.PlatformLocal; import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; -import cn.bootx.platform.daxpay.service.core.record.pay.service.PayOrderService; -import cn.bootx.platform.daxpay.service.core.record.refund.dao.PayRefundOrderManager; -import cn.bootx.platform.daxpay.service.core.record.refund.entity.PayRefundOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.service.PayOrderService; +import cn.bootx.platform.daxpay.service.core.order.refund.dao.PayRefundOrderManager; +import cn.bootx.platform.daxpay.service.core.order.refund.entity.PayRefundOrder; import cn.bootx.platform.daxpay.exception.pay.PayFailureException; import cn.bootx.platform.daxpay.param.pay.RefundChannelParam; import cn.bootx.platform.daxpay.param.pay.RefundParam; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/service/PayRefundService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/service/PayRefundService.java index 3e171760..a399f814 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/service/PayRefundService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/service/PayRefundService.java @@ -4,8 +4,8 @@ import cn.bootx.platform.common.core.exception.RepetitiveOperationException; import cn.bootx.platform.common.core.util.ValidationUtil; import cn.bootx.platform.daxpay.code.PayStatusEnum; import cn.bootx.platform.daxpay.service.core.payment.refund.factory.PayRefundStrategyFactory; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; -import cn.bootx.platform.daxpay.service.core.record.pay.service.PayOrderService; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.service.PayOrderService; import cn.bootx.platform.daxpay.exception.pay.PayUnsupportedMethodException; import cn.bootx.platform.daxpay.service.func.AbsPayRefundStrategy; import cn.bootx.platform.daxpay.param.pay.RefundChannelParam; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/strategy/AliPayRefundStrategy.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/strategy/AliPayRefundStrategy.java index 4032f9d1..84be17a4 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/strategy/AliPayRefundStrategy.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/strategy/AliPayRefundStrategy.java @@ -5,7 +5,7 @@ import cn.bootx.platform.daxpay.service.core.channel.alipay.entity.AliPayConfig; import cn.bootx.platform.daxpay.service.core.channel.alipay.service.AliPayOrderService; import cn.bootx.platform.daxpay.service.core.channel.alipay.service.AliPayRefundService; import cn.bootx.platform.daxpay.service.core.channel.alipay.service.AliPayConfigService; -import cn.bootx.platform.daxpay.service.core.record.pay.service.PayOrderService; +import cn.bootx.platform.daxpay.service.core.order.pay.service.PayOrderService; import cn.bootx.platform.daxpay.service.func.AbsPayRefundStrategy; import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Scope; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/strategy/CashPayRefundStrategy.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/strategy/CashPayRefundStrategy.java index da1165fa..84b8f1c8 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/strategy/CashPayRefundStrategy.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/strategy/CashPayRefundStrategy.java @@ -2,7 +2,7 @@ package cn.bootx.platform.daxpay.service.core.payment.refund.strategy; import cn.bootx.platform.daxpay.code.PayChannelEnum; import cn.bootx.platform.daxpay.service.core.channel.cash.service.CashService; -import cn.bootx.platform.daxpay.service.core.record.pay.service.PayOrderService; +import cn.bootx.platform.daxpay.service.core.order.pay.service.PayOrderService; import cn.bootx.platform.daxpay.service.func.AbsPayRefundStrategy; import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Scope; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/strategy/VoucherPayRefundStrategy.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/strategy/VoucherPayRefundStrategy.java index b67355b9..d8253b8d 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/strategy/VoucherPayRefundStrategy.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/strategy/VoucherPayRefundStrategy.java @@ -3,7 +3,7 @@ package cn.bootx.platform.daxpay.service.core.payment.refund.strategy; import cn.bootx.platform.daxpay.code.PayChannelEnum; import cn.bootx.platform.daxpay.service.core.channel.voucher.service.VoucherPayService; import cn.bootx.platform.daxpay.service.core.channel.voucher.service.VoucherPayOrderService; -import cn.bootx.platform.daxpay.service.core.record.pay.service.PayOrderService; +import cn.bootx.platform.daxpay.service.core.order.pay.service.PayOrderService; import cn.bootx.platform.daxpay.service.func.AbsPayRefundStrategy; import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Scope; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/strategy/WalletPayRefundStrategy.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/strategy/WalletPayRefundStrategy.java index 4b256829..102b361b 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/strategy/WalletPayRefundStrategy.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/strategy/WalletPayRefundStrategy.java @@ -3,7 +3,7 @@ package cn.bootx.platform.daxpay.service.core.payment.refund.strategy; import cn.bootx.platform.daxpay.code.PayChannelEnum; import cn.bootx.platform.daxpay.service.core.channel.wallet.service.WalletPayService; import cn.bootx.platform.daxpay.service.core.channel.wallet.service.WalletPayOrderService; -import cn.bootx.platform.daxpay.service.core.record.pay.service.PayOrderService; +import cn.bootx.platform.daxpay.service.core.order.pay.service.PayOrderService; import cn.bootx.platform.daxpay.service.func.AbsPayRefundStrategy; import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Scope; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/strategy/WeChatPayRefundStrategy.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/strategy/WeChatPayRefundStrategy.java index bf416d48..2b7ab139 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/strategy/WeChatPayRefundStrategy.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/refund/strategy/WeChatPayRefundStrategy.java @@ -5,7 +5,7 @@ import cn.bootx.platform.daxpay.service.core.channel.wechat.entity.WeChatPayConf import cn.bootx.platform.daxpay.service.core.channel.wechat.service.WeChatPayConfigService; import cn.bootx.platform.daxpay.service.core.channel.wechat.service.WeChatPayOrderService; import cn.bootx.platform.daxpay.service.core.channel.wechat.service.WechatRefundService; -import cn.bootx.platform.daxpay.service.core.record.pay.service.PayOrderService; +import cn.bootx.platform.daxpay.service.core.order.pay.service.PayOrderService; import cn.bootx.platform.daxpay.service.func.AbsPayRefundStrategy; import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Scope; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/repair/result/RepairResult.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/repair/result/RepairResult.java index ec49f076..d720009f 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/repair/result/RepairResult.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/repair/result/RepairResult.java @@ -13,7 +13,7 @@ import lombok.experimental.Accessors; @Accessors(chain = true) public class RepairResult { /** 修复前状态 */ - private PayStatusEnum oldStatus; + private PayStatusEnum beforeStatus; /** 修复后状态 */ private PayStatusEnum repairStatus; } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/repair/service/PayRepairService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/repair/service/PayRepairService.java index ba081ebf..af0eb52e 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/repair/service/PayRepairService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/repair/service/PayRepairService.java @@ -1,13 +1,13 @@ package cn.bootx.platform.daxpay.service.core.payment.repair.service; import cn.bootx.platform.daxpay.code.PayStatusEnum; -import cn.bootx.platform.daxpay.service.common.entity.OrderRefundableInfo; +import cn.bootx.platform.daxpay.service.common.entity.RefundableInfo; import cn.bootx.platform.daxpay.service.common.local.PaymentContextLocal; import cn.bootx.platform.daxpay.service.core.payment.repair.factory.PayRepairStrategyFactory; import cn.bootx.platform.daxpay.service.core.payment.repair.param.PayRepairParam; import cn.bootx.platform.daxpay.service.core.payment.repair.result.RepairResult; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; -import cn.bootx.platform.daxpay.service.core.record.pay.service.PayOrderService; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.service.PayOrderService; import cn.bootx.platform.daxpay.service.core.record.repair.entity.PayRepairRecord; import cn.bootx.platform.daxpay.service.core.record.repair.service.PayRepairRecordService; import cn.bootx.platform.daxpay.service.func.AbsPayRepairStrategy; @@ -42,14 +42,14 @@ public class PayRepairService { // 从退款记录中获取支付通道 退款记录中的支付通道跟支付时关联的支付通道一致 List channels = order.getRefundableInfos() .stream() - .map(OrderRefundableInfo::getChannel) + .map(RefundableInfo::getChannel) .collect(Collectors.toList()); // 初始化修复参数 List repairStrategies = PayRepairStrategyFactory.createAsyncLast(channels); repairStrategies.forEach(repairStrategy -> repairStrategy.initRepairParam(order, repairParam.getRepairSource())); repairStrategies.forEach(AbsPayRepairStrategy::doBeforeHandler); - RepairResult repairResult = new RepairResult().setOldStatus(PayStatusEnum.findByCode(order.getStatus())); + RepairResult repairResult = new RepairResult().setBeforeStatus(PayStatusEnum.findByCode(order.getStatus())); // 根据不同的类型执行对应的修复逻辑 switch (repairParam.getRepairType()) { @@ -149,10 +149,12 @@ public class PayRepairService { private void saveRecord(PayOrder order, PayRepairParam repairParam, RepairResult repairResult){ PayRepairRecord payRepairRecord = new PayRepairRecord() - .setBeforeStatus(repairResult.getOldStatus().getCode()) + .setPaymentId(order.getId()) + .setAsyncChannel(order.getAsyncChannel()) + .setBusinessNo(order.getBusinessNo()) + .setBeforeStatus(repairResult.getBeforeStatus().getCode()) .setAfterStatus(repairResult.getRepairStatus().getCode()) .setAmount(repairParam.getAmount()) - .setBusinessNo(order.getBusinessNo()) .setRepairSource(repairParam.getRepairSource().getCode()) .setRepairType(repairParam.getRepairType().getCode()); recordService.saveRecord(payRepairRecord); diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/repair/strategy/AliPayRepairStrategy.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/repair/strategy/AliPayRepairStrategy.java index cf9b70da..bdd57095 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/repair/strategy/AliPayRepairStrategy.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/repair/strategy/AliPayRepairStrategy.java @@ -6,8 +6,8 @@ import cn.bootx.platform.daxpay.service.core.channel.alipay.entity.AliPayConfig; import cn.bootx.platform.daxpay.service.core.channel.alipay.service.AliPayCloseService; import cn.bootx.platform.daxpay.service.core.channel.alipay.service.AliPayConfigService; import cn.bootx.platform.daxpay.service.core.channel.alipay.service.AliPayOrderService; -import cn.bootx.platform.daxpay.service.core.record.pay.dao.PayOrderChannelManager; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrderChannel; +import cn.bootx.platform.daxpay.service.core.order.pay.dao.PayOrderChannelManager; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrderChannel; import cn.bootx.platform.daxpay.service.func.AbsPayRepairStrategy; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/repair/strategy/WeChatPayRepairStrategy.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/repair/strategy/WeChatPayRepairStrategy.java index 5d3c603a..0c34be3e 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/repair/strategy/WeChatPayRepairStrategy.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/repair/strategy/WeChatPayRepairStrategy.java @@ -6,8 +6,8 @@ import cn.bootx.platform.daxpay.service.core.channel.wechat.entity.WeChatPayConf import cn.bootx.platform.daxpay.service.core.channel.wechat.service.WeChatPayCloseService; import cn.bootx.platform.daxpay.service.core.channel.wechat.service.WeChatPayConfigService; import cn.bootx.platform.daxpay.service.core.channel.wechat.service.WeChatPayOrderService; -import cn.bootx.platform.daxpay.service.core.record.pay.dao.PayOrderChannelManager; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrderChannel; +import cn.bootx.platform.daxpay.service.core.order.pay.dao.PayOrderChannelManager; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrderChannel; import cn.bootx.platform.daxpay.service.func.AbsPayRepairStrategy; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/sync/service/PaySyncService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/sync/service/PaySyncService.java index c157f25d..81dc2493 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/sync/service/PaySyncService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/sync/service/PaySyncService.java @@ -15,8 +15,8 @@ import cn.bootx.platform.daxpay.service.core.payment.repair.param.PayRepairParam import cn.bootx.platform.daxpay.service.core.payment.repair.service.PayRepairService; import cn.bootx.platform.daxpay.service.core.payment.sync.factory.PaySyncStrategyFactory; import cn.bootx.platform.daxpay.service.core.payment.sync.result.GatewaySyncResult; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; -import cn.bootx.platform.daxpay.service.core.record.pay.service.PayOrderService; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.service.PayOrderService; import cn.bootx.platform.daxpay.service.core.record.sync.entity.PaySyncRecord; import cn.bootx.platform.daxpay.service.core.record.sync.service.PaySyncRecordService; import cn.bootx.platform.daxpay.service.func.AbsPaySyncStrategy; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/callback/dao/PayCallbackRecordManager.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/callback/dao/PayCallbackRecordManager.java index fa9f6906..a8c69b1f 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/callback/dao/PayCallbackRecordManager.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/callback/dao/PayCallbackRecordManager.java @@ -1,7 +1,12 @@ package cn.bootx.platform.daxpay.service.core.record.callback.dao; +import cn.bootx.platform.common.core.rest.param.PageParam; +import cn.bootx.platform.common.mybatisplus.base.MpIdEntity; import cn.bootx.platform.common.mybatisplus.impl.BaseManager; +import cn.bootx.platform.common.mybatisplus.util.MpUtil; import cn.bootx.platform.daxpay.service.core.record.callback.entity.PayCallbackRecord; +import cn.bootx.platform.daxpay.service.param.record.PayCallbackRecordQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Repository; @@ -13,4 +18,14 @@ import org.springframework.stereotype.Repository; @Slf4j @Repository public class PayCallbackRecordManager extends BaseManager { + + /** + * 分页 + */ + public Page page(PageParam pageParam, PayCallbackRecordQuery param){ + Page mpPage = MpUtil.getMpPage(pageParam, PayCallbackRecord.class); + return lambdaQuery() + .orderByDesc(MpIdEntity::getId) + .page(mpPage); + } } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/callback/entity/PayCallbackRecord.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/callback/entity/PayCallbackRecord.java index c2635553..3b011756 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/callback/entity/PayCallbackRecord.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/callback/entity/PayCallbackRecord.java @@ -6,7 +6,7 @@ import cn.bootx.platform.daxpay.code.PayChannelEnum; import cn.bootx.platform.daxpay.code.PayStatusEnum; import cn.bootx.platform.daxpay.service.core.record.callback.convert.PayCallbackRecordConvert; import cn.bootx.platform.daxpay.service.dto.record.callback.PayCallbackRecordDto; -import cn.bootx.table.modify.annotation.DbComment; +import cn.bootx.table.modify.annotation.DbColumn; import cn.bootx.table.modify.annotation.DbTable; import cn.bootx.table.modify.mysql.annotation.DbMySqlFieldType; import cn.bootx.table.modify.mysql.constants.MySqlFieldTypeEnum; @@ -29,40 +29,40 @@ import java.time.LocalDateTime; @TableName("pay_callback_record") public class PayCallbackRecord extends MpCreateEntity implements EntityBaseFunction { /** 支付记录id */ - @DbComment("支付记录id") + @DbColumn(comment = "支付记录id") private Long paymentId; /** * 支付通道 * @see PayChannelEnum#getCode() */ - @DbComment("支付通道") + @DbColumn(comment = "支付通道") private String payChannel; /** 通知消息 */ @DbMySqlFieldType(MySqlFieldTypeEnum.LONGTEXT) - @DbComment("通知消息") + @DbColumn(comment = "通知消息") private String notifyInfo; /** * 支付状态 * @see PayStatusEnum */ - @DbComment("支付状态") + @DbColumn(comment = "支付状态") private String payStatus; /** * 回调处理状态 */ - @DbComment("回调处理状态") + @DbColumn(comment = "回调处理状态") private String status; /** 提示信息 */ - @DbComment("提示信息") + @DbColumn(comment = "提示信息") private String msg; /** 回调时间 */ - @DbComment("回调时间") + @DbColumn(comment = "回调时间") private LocalDateTime notifyTime; /** diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/callback/service/PayCallbackRecordService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/callback/service/PayCallbackRecordService.java index 4b150ca8..fc613ba0 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/callback/service/PayCallbackRecordService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/callback/service/PayCallbackRecordService.java @@ -1,9 +1,13 @@ package cn.bootx.platform.daxpay.service.core.record.callback.service; import cn.bootx.platform.common.core.exception.DataNotExistException; +import cn.bootx.platform.common.core.rest.PageResult; +import cn.bootx.platform.common.core.rest.param.PageParam; +import cn.bootx.platform.common.mybatisplus.util.MpUtil; import cn.bootx.platform.daxpay.service.core.record.callback.dao.PayCallbackRecordManager; import cn.bootx.platform.daxpay.service.core.record.callback.entity.PayCallbackRecord; import cn.bootx.platform.daxpay.service.dto.record.callback.PayCallbackRecordDto; +import cn.bootx.platform.daxpay.service.param.record.PayCallbackRecordQuery; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -17,7 +21,6 @@ import org.springframework.stereotype.Service; @Service @RequiredArgsConstructor public class PayCallbackRecordService { - private final PayCallbackRecordManager callbackRecordManager; /** @@ -26,4 +29,11 @@ public class PayCallbackRecordService { public PayCallbackRecordDto findById(Long id) { return callbackRecordManager.findById(id).map(PayCallbackRecord::toDto).orElseThrow(DataNotExistException::new); } + + /** + * 分页查询 + */ + public PageResult page(PageParam pageParam, PayCallbackRecordQuery param){ + return MpUtil.convert2DtoPageResult(callbackRecordManager.page(pageParam,param)); + } } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/close/dao/PayCloseRecordManager.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/close/dao/PayCloseRecordManager.java index 2b1f7b1b..5eb6ca51 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/close/dao/PayCloseRecordManager.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/close/dao/PayCloseRecordManager.java @@ -1,7 +1,12 @@ package cn.bootx.platform.daxpay.service.core.record.close.dao; +import cn.bootx.platform.common.core.rest.param.PageParam; +import cn.bootx.platform.common.mybatisplus.base.MpIdEntity; import cn.bootx.platform.common.mybatisplus.impl.BaseManager; +import cn.bootx.platform.common.mybatisplus.util.MpUtil; import cn.bootx.platform.daxpay.service.core.record.close.entity.PayCloseRecord; +import cn.bootx.platform.daxpay.service.param.record.PayCloseRecordQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Repository; @@ -16,5 +21,13 @@ import org.springframework.stereotype.Repository; @RequiredArgsConstructor public class PayCloseRecordManager extends BaseManager { - + /** + * 分页 + */ + public Page page(PageParam pageParam, PayCloseRecordQuery param){ + Page mpPage = MpUtil.getMpPage(pageParam, PayCloseRecord.class); + return lambdaQuery() + .orderByDesc(MpIdEntity::getId) + .page(mpPage); + } } 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 57a84ced..6543b6db 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 @@ -6,7 +6,6 @@ import cn.bootx.platform.daxpay.code.PayChannelEnum; import cn.bootx.platform.daxpay.service.core.record.close.convert.PayCloseRecordConvert; import cn.bootx.platform.daxpay.service.dto.record.close.PayCloseRecordDto; import cn.bootx.table.modify.annotation.DbColumn; -import cn.bootx.table.modify.annotation.DbComment; import cn.bootx.table.modify.annotation.DbTable; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -26,27 +25,27 @@ import lombok.experimental.Accessors; public class PayCloseRecord extends MpCreateEntity implements EntityBaseFunction { /** 支付记录id */ - @DbComment("支付记录id") + @DbColumn(comment = "支付记录id") private Long paymentId; /** 业务号 */ - @DbComment("业务号") + @DbColumn(comment = "业务号") private String businessNo; /** * 关闭的异步支付通道, 可以为空 * @see PayChannelEnum#getCode() */ - @DbComment("关闭的异步支付通道") + @DbColumn(comment = "关闭的异步支付通道") private String asyncChannel; /** * 是否关闭成功 */ - @DbComment("是否关闭成功") + @DbColumn(comment = "是否关闭成功") private boolean closed; - @DbComment("错误消息") + @DbColumn(comment = "错误消息") private String errorMsg; /** 客户端IP */ diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/close/service/PayCloseRecordService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/close/service/PayCloseRecordService.java index 949da542..7a6b96f3 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/close/service/PayCloseRecordService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/close/service/PayCloseRecordService.java @@ -1,7 +1,13 @@ package cn.bootx.platform.daxpay.service.core.record.close.service; +import cn.bootx.platform.common.core.exception.DataNotExistException; +import cn.bootx.platform.common.core.rest.PageResult; +import cn.bootx.platform.common.core.rest.param.PageParam; +import cn.bootx.platform.common.mybatisplus.util.MpUtil; import cn.bootx.platform.daxpay.service.core.record.close.dao.PayCloseRecordManager; import cn.bootx.platform.daxpay.service.core.record.close.entity.PayCloseRecord; +import cn.bootx.platform.daxpay.service.dto.record.close.PayCloseRecordDto; +import cn.bootx.platform.daxpay.service.param.record.PayCloseRecordQuery; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -19,6 +25,24 @@ import org.springframework.transaction.annotation.Transactional; public class PayCloseRecordService { private final PayCloseRecordManager manager; + + /** + * 根据id查询 + */ + public PayCloseRecordDto findById(Long id) { + return manager.findById(id).map(PayCloseRecord::toDto).orElseThrow(DataNotExistException::new); + } + + /** + * 分页查询 + */ + public PageResult page(PageParam pageParam, PayCloseRecordQuery param){ + return MpUtil.convert2DtoPageResult(manager.page(pageParam,param)); + } + + /** + * 新开事务进行记录保存 + */ @Transactional(propagation = Propagation.REQUIRES_NEW) public void saveRecord(PayCloseRecord record){ manager.save(record); diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/dao/PayOrderManager.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/dao/PayOrderManager.java deleted file mode 100644 index 44783807..00000000 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/pay/dao/PayOrderManager.java +++ /dev/null @@ -1,23 +0,0 @@ -package cn.bootx.platform.daxpay.service.core.record.pay.dao; - -import cn.bootx.platform.common.mybatisplus.impl.BaseManager; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Repository; - -import java.util.Optional; - -/** - * 支付订单 - * @author xxm - * @since 2023/12/18 - */ -@Slf4j -@Repository -@RequiredArgsConstructor -public class PayOrderManager extends BaseManager { - public Optional findByBusinessNo(String businessNo) { - return findByField(PayOrder::getBusinessNo,businessNo); - } -} diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/repair/convert/PayRepairRecordConvert.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/repair/convert/PayRepairRecordConvert.java index 2bd12f9b..7a92487d 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/repair/convert/PayRepairRecordConvert.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/repair/convert/PayRepairRecordConvert.java @@ -1,5 +1,7 @@ package cn.bootx.platform.daxpay.service.core.record.repair.convert; +import cn.bootx.platform.daxpay.service.core.record.repair.entity.PayRepairRecord; +import cn.bootx.platform.daxpay.service.dto.order.repair.PayRepairRecordDto; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; @@ -11,4 +13,6 @@ import org.mapstruct.factory.Mappers; @Mapper public interface PayRepairRecordConvert { PayRepairRecordConvert CONVERT = Mappers.getMapper(PayRepairRecordConvert.class); + + PayRepairRecordDto convert(PayRepairRecord in); } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/repair/dao/PayRepairRecordManager.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/repair/dao/PayRepairRecordManager.java index f4493b18..7e5a39f9 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/repair/dao/PayRepairRecordManager.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/repair/dao/PayRepairRecordManager.java @@ -1,7 +1,12 @@ package cn.bootx.platform.daxpay.service.core.record.repair.dao; +import cn.bootx.platform.common.core.rest.param.PageParam; +import cn.bootx.platform.common.mybatisplus.base.MpIdEntity; import cn.bootx.platform.common.mybatisplus.impl.BaseManager; +import cn.bootx.platform.common.mybatisplus.util.MpUtil; import cn.bootx.platform.daxpay.service.core.record.repair.entity.PayRepairRecord; +import cn.bootx.platform.daxpay.service.param.record.PayRepairRecordQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Repository; @@ -15,4 +20,14 @@ import org.springframework.stereotype.Repository; @Repository @RequiredArgsConstructor public class PayRepairRecordManager extends BaseManager { + + /** + * 分页 + */ + public Page page(PageParam pageParam, PayRepairRecordQuery param){ + Page mpPage = MpUtil.getMpPage(pageParam, PayRepairRecord.class); + return lambdaQuery() + .orderByDesc(MpIdEntity::getId) + .page(mpPage); + } } 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 36d14802..18a7e81e 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 @@ -1,6 +1,9 @@ package cn.bootx.platform.daxpay.service.core.record.repair.entity; +import cn.bootx.platform.common.core.function.EntityBaseFunction; import cn.bootx.platform.common.mybatisplus.base.MpCreateEntity; +import cn.bootx.platform.daxpay.service.core.record.repair.convert.PayRepairRecordConvert; +import cn.bootx.platform.daxpay.service.dto.order.repair.PayRepairRecordDto; import cn.bootx.table.modify.annotation.DbColumn; import cn.bootx.table.modify.annotation.DbTable; import com.baomidou.mybatisplus.annotation.TableName; @@ -18,7 +21,7 @@ import lombok.experimental.Accessors; @Accessors(chain = true) @TableName("pay_repair_record") @DbTable(comment = "支付修复记录") -public class PayRepairRecord extends MpCreateEntity { +public class PayRepairRecord extends MpCreateEntity implements EntityBaseFunction { /** 支付ID */ @DbColumn(comment = "支付ID") @@ -36,6 +39,10 @@ public class PayRepairRecord extends MpCreateEntity { @DbColumn(comment = "修复类型") private String repairType; + /** 修复的异步通道 */ + @DbColumn(comment = "修复的异步通道") + private String asyncChannel; + /** 修复前状态 */ @DbColumn(comment = "修复前状态") private String beforeStatus; @@ -48,4 +55,11 @@ public class PayRepairRecord extends MpCreateEntity { @DbColumn(comment = "金额变动") private Integer amount; + /** + * 转换 + */ + @Override + public PayRepairRecordDto toDto() { + return PayRepairRecordConvert.CONVERT.convert(this); + } } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/repair/service/PayRepairRecordService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/repair/service/PayRepairRecordService.java index 906c89ad..a3501e0a 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/repair/service/PayRepairRecordService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/repair/service/PayRepairRecordService.java @@ -1,7 +1,13 @@ package cn.bootx.platform.daxpay.service.core.record.repair.service; +import cn.bootx.platform.common.core.exception.DataNotExistException; +import cn.bootx.platform.common.core.rest.PageResult; +import cn.bootx.platform.common.core.rest.param.PageParam; +import cn.bootx.platform.common.mybatisplus.util.MpUtil; import cn.bootx.platform.daxpay.service.core.record.repair.dao.PayRepairRecordManager; import cn.bootx.platform.daxpay.service.core.record.repair.entity.PayRepairRecord; +import cn.bootx.platform.daxpay.service.dto.order.repair.PayRepairRecordDto; +import cn.bootx.platform.daxpay.service.param.record.PayRepairRecordQuery; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -19,6 +25,20 @@ import org.springframework.transaction.annotation.Transactional; public class PayRepairRecordService { private final PayRepairRecordManager repairRecordManager; + /** + * 根据id查询 + */ + public PayRepairRecordDto findById(Long id) { + return repairRecordManager.findById(id).map(PayRepairRecord::toDto).orElseThrow(DataNotExistException::new); + } + + /** + * 分页查询 + */ + public PageResult page(PageParam pageParam, PayRepairRecordQuery param){ + return MpUtil.convert2DtoPageResult(repairRecordManager.page(pageParam,param)); + } + /** * 保存记录 */ diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/sync/dao/PaySyncRecordManager.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/sync/dao/PaySyncRecordManager.java index 2d750716..941bf1fb 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/sync/dao/PaySyncRecordManager.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/sync/dao/PaySyncRecordManager.java @@ -5,7 +5,7 @@ import cn.bootx.platform.common.mybatisplus.base.MpIdEntity; import cn.bootx.platform.common.mybatisplus.impl.BaseManager; import cn.bootx.platform.common.mybatisplus.util.MpUtil; import cn.bootx.platform.daxpay.service.core.record.sync.entity.PaySyncRecord; -import cn.bootx.platform.daxpay.service.dto.record.sync.PaySyncRecordDto; +import cn.bootx.platform.daxpay.service.param.record.PaySyncRecordQuery; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -23,7 +23,10 @@ import java.util.Objects; @RequiredArgsConstructor public class PaySyncRecordManager extends BaseManager { - public Page page(PageParam pageParam, PaySyncRecordDto param) { + /** + * 分页 + */ + public Page page(PageParam pageParam, PaySyncRecordQuery param) { Page mpPage = MpUtil.getMpPage(pageParam, PaySyncRecord.class); return lambdaQuery().orderByDesc(MpIdEntity::getId) .like(Objects.nonNull(param.getPaymentId()), PaySyncRecord::getPaymentId, param.getPaymentId()) diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/sync/entity/PaySyncRecord.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/sync/entity/PaySyncRecord.java index 47409a9b..0258e62f 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/sync/entity/PaySyncRecord.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/sync/entity/PaySyncRecord.java @@ -29,47 +29,47 @@ import lombok.experimental.Accessors; public class PaySyncRecord extends MpCreateEntity implements EntityBaseFunction { /** 支付记录id */ - @DbComment("支付记录id") + @DbColumn(comment = "支付记录id") private Long paymentId; /** 业务号 */ - @DbComment("业务号") + @DbColumn(comment = "业务号") private String businessNo; /** * 支付通道 * @see PayChannelEnum#getCode() */ - @DbComment("支付通道") + @DbColumn(comment = "支付通道") private String channel; /** 通知消息 */ @DbMySqlFieldType(MySqlFieldTypeEnum.LONGTEXT) - @DbComment("通知消息") + @DbColumn(comment = "通知消息") private String syncInfo; /** * 网关返回状态 * @see PaySyncStatusEnum */ - @DbComment("同步状态") + @DbColumn(comment = "同步状态") private String gatewayStatus; /** * 支付单如果状态不一致, 是否进行修复 */ - @DbComment("是否进行修复") + @DbColumn(comment = "是否进行修复") private boolean repairOrder; /** 支付单修复前状态 */ - @DbComment("支付单修复前状态") + @DbColumn(comment = "支付单修复前状态") private String oldStatus; /** 支付单修复后状态 */ - @DbComment("支付单修复后状态") + @DbColumn(comment = "支付单修复后状态") private String repairStatus; - @DbComment("错误消息") + @DbColumn(comment = "错误消息") private String errorMsg; /** 客户端IP */ diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/sync/service/PaySyncRecordService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/sync/service/PaySyncRecordService.java index 17ca7f22..b451c8ad 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/sync/service/PaySyncRecordService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/record/sync/service/PaySyncRecordService.java @@ -7,6 +7,7 @@ import cn.bootx.platform.common.mybatisplus.util.MpUtil; import cn.bootx.platform.daxpay.service.core.record.sync.dao.PaySyncRecordManager; import cn.bootx.platform.daxpay.service.core.record.sync.entity.PaySyncRecord; import cn.bootx.platform.daxpay.service.dto.record.sync.PaySyncRecordDto; +import cn.bootx.platform.daxpay.service.param.record.PaySyncRecordQuery; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -25,19 +26,11 @@ import org.springframework.transaction.annotation.Transactional; public class PaySyncRecordService { private final PaySyncRecordManager orderManager; - /** - * 记录同步记录 同步支付单的不进行记录 - */ - @Transactional(propagation = Propagation.REQUIRES_NEW) - public void saveRecord(PaySyncRecord paySyncRecord){ - orderManager.save(paySyncRecord); - } - /** * 分页查询 */ - public PageResult page(PageParam pageParam, PaySyncRecordDto param) { - Page page = orderManager.page(pageParam, param); + public PageResult page(PageParam pageParam, PaySyncRecordQuery query) { + Page page = orderManager.page(pageParam, query); return MpUtil.convert2DtoPageResult(page); } @@ -47,4 +40,13 @@ public class PaySyncRecordService { public PaySyncRecordDto findById(Long id) { return orderManager.findById(id).map(PaySyncRecord::toDto).orElseThrow(DataNotExistException::new); } + + /** + * 记录同步记录 同步支付单的不进行记录 + */ + @Transactional(propagation = Propagation.REQUIRES_NEW) + public void saveRecord(PaySyncRecord paySyncRecord){ + orderManager.save(paySyncRecord); + } + } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/system/config/entity/PayApiConfig.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/system/config/entity/PayApiConfig.java index 7da5849b..6f637cf7 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/system/config/entity/PayApiConfig.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/system/config/entity/PayApiConfig.java @@ -61,6 +61,9 @@ public class PayApiConfig extends MpBaseEntity implements EntityBaseFunction refundableInfos; + + /** + * 支付状态 + * @see PayStatusEnum + */ + @Schema(description = "支付状态") + private String status; + + /** 支付时间 */ + @Schema(description = "支付时间") + private LocalDateTime payTime; + + /** 过期时间 */ + @Schema(description = "过期时间") + private LocalDateTime expiredTime; + +} diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/pay/PayOrderExtraDto.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/pay/PayOrderExtraDto.java new file mode 100644 index 00000000..6936a1ed --- /dev/null +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/pay/PayOrderExtraDto.java @@ -0,0 +1,19 @@ +package cn.bootx.platform.daxpay.service.dto.order.pay; + +import cn.bootx.platform.common.core.rest.dto.BaseDto; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * 支付订单扩展信息 + * @author xxm + * @since 2024/1/9 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@Accessors(chain = true) +@Schema(title = "支付订单扩展信息") +public class PayOrderExtraDto extends BaseDto { +} diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/refund/PayRefundOrderDto.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/refund/PayRefundOrderDto.java similarity index 88% rename from daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/refund/PayRefundOrderDto.java rename to daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/refund/PayRefundOrderDto.java index 50dda8d8..8d45ea74 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/refund/PayRefundOrderDto.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/refund/PayRefundOrderDto.java @@ -1,8 +1,8 @@ -package cn.bootx.platform.daxpay.service.dto.record.refund; +package cn.bootx.platform.daxpay.service.dto.order.refund; import cn.bootx.platform.common.core.rest.dto.BaseDto; import cn.bootx.platform.daxpay.code.PayRefundStatusEnum; -import cn.bootx.platform.daxpay.service.common.entity.OrderRefundableInfo; +import cn.bootx.platform.daxpay.service.common.entity.RefundableInfo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; @@ -49,7 +49,7 @@ public class PayRefundOrderDto extends BaseDto { private LocalDateTime refundTime; @Schema(description = "退款信息列表") - private List refundableInfo; + private List refundableInfo; /** * @see PayRefundStatusEnum diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/repair/PayRepairRecordDto.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/repair/PayRepairRecordDto.java new file mode 100644 index 00000000..b53a4837 --- /dev/null +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/repair/PayRepairRecordDto.java @@ -0,0 +1,51 @@ +package cn.bootx.platform.daxpay.service.dto.order.repair; + +import cn.bootx.platform.common.core.rest.dto.BaseDto; +import cn.bootx.table.modify.annotation.DbColumn; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * 支付修复记录 + * @author xxm + * @since 2024/1/9 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@Accessors(chain = true) +@Schema(title = "支付修复记录") +public class PayRepairRecordDto extends BaseDto { + + /** 支付ID */ + @Schema(description = "支付ID") + private Long paymentId; + + /** 业务号 */ + @Schema(description = "业务号") + private String businessNo; + + /** 修复来源 */ + @Schema(description = "修复来源") + private String repairSource; + + /** 修复类型 */ + @Schema(description = "修复类型") + private String repairType; + + @DbColumn(comment = "修复的异步通道") + private String asyncChannel; + + /** 修复前状态 */ + @Schema(description = "修复前状态") + private String beforeStatus; + + /** 修复后状态 */ + @Schema(description = "修复后状态") + private String afterStatus; + + /** 金额变动 */ + @Schema(description = "金额变动") + private Integer amount; +} diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/callback/PayCallbackRecordDto.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/callback/PayCallbackRecordDto.java index 760159a0..a751bd66 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/callback/PayCallbackRecordDto.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/callback/PayCallbackRecordDto.java @@ -1,11 +1,17 @@ package cn.bootx.platform.daxpay.service.dto.record.callback; import cn.bootx.platform.common.core.rest.dto.BaseDto; +import cn.bootx.platform.daxpay.code.PayChannelEnum; +import cn.bootx.platform.daxpay.code.PayStatusEnum; +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.EqualsAndHashCode; import lombok.experimental.Accessors; +import java.time.LocalDateTime; + /** * 支付回调记录 * @author xxm @@ -16,4 +22,41 @@ import lombok.experimental.Accessors; @Accessors(chain = true) @Schema(title = "回调记录") public class PayCallbackRecordDto extends BaseDto { + + /** 支付记录id */ + @Schema(description = "支付记录id") + private Long paymentId; + + /** + * 支付通道 + * @see PayChannelEnum#getCode() + */ + @Schema(description = "支付通道") + private String payChannel; + + /** 通知消息 */ + @DbMySqlFieldType(MySqlFieldTypeEnum.LONGTEXT) + @Schema(description = "通知消息") + private String notifyInfo; + + /** + * 支付状态 + * @see PayStatusEnum + */ + @Schema(description = "支付状态") + private String payStatus; + + /** + * 回调处理状态 + */ + @Schema(description = "回调处理状态") + private String status; + + /** 提示信息 */ + @Schema(description = "提示信息") + private String msg; + + /** 回调时间 */ + @Schema(description = "回调时间") + private LocalDateTime notifyTime; } 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 3a61b756..e6c057e2 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 @@ -1,6 +1,8 @@ package cn.bootx.platform.daxpay.service.dto.record.close; import cn.bootx.platform.common.core.rest.dto.BaseDto; +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; @@ -16,4 +18,37 @@ import lombok.experimental.Accessors; @Accessors(chain = true) @Schema(title = "支付关闭记录") public class PayCloseRecordDto extends BaseDto { + + /** 支付记录id */ + @Schema(description = "支付记录id") + private Long paymentId; + + /** 业务号 */ + @Schema(description = "业务号") + private String businessNo; + + /** + * 关闭的异步支付通道, 可以为空 + * @see PayChannelEnum#getCode() + */ + @Schema(description = "关闭的异步支付通道") + private String asyncChannel; + + /** + * 是否关闭成功 + */ + @Schema(description = "是否关闭成功") + private boolean closed; + + /** 错误消息 */ + @Schema(description = "错误消息") + private String errorMsg; + + /** 客户端IP */ + @DbColumn(comment = "客户端IP") + private String clientIp; + + /** 请求链路ID */ + @DbColumn(comment = "请求链路ID") + private String reqId; } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/pay/PayOrderDto.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/pay/PayOrderDto.java deleted file mode 100644 index cbd0d07a..00000000 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/pay/PayOrderDto.java +++ /dev/null @@ -1,47 +0,0 @@ -package cn.bootx.platform.daxpay.service.dto.record.pay; - -import cn.bootx.platform.common.core.rest.dto.BaseDto; -import cn.bootx.platform.daxpay.code.PayStatusEnum; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.math.BigDecimal; -import java.time.LocalDateTime; - -/** - * @author xxm - * @since 2021/2/25 - */ -@EqualsAndHashCode(callSuper = true) -@Data -@Accessors(chain = true) -@Schema(title = "具体支付日志基类") -public class PayOrderDto extends BaseDto { - - @Schema(description = "支付id") - private Long paymentId; - - @Schema(description = "用户id") - private Long userId; - - @Schema(description = "关联的业务id") - private String businessId; - - @Schema(description = "金额") - private BigDecimal amount; - - @Schema(description = "可退款金额") - private BigDecimal refundableBalance; - - /** - * @see PayStatusEnum#getCode() - */ - @Schema(description = "支付状态") - private int payStatus; - - @Schema(description = "支付时间") - private LocalDateTime payTime; - -} diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/sync/PaySyncRecordDto.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/sync/PaySyncRecordDto.java index 9ac3c2b2..d2ed6dd0 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/sync/PaySyncRecordDto.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/record/sync/PaySyncRecordDto.java @@ -3,7 +3,7 @@ package cn.bootx.platform.daxpay.service.dto.record.sync; import cn.bootx.platform.common.core.rest.dto.BaseDto; import cn.bootx.platform.daxpay.code.PayChannelEnum; import cn.bootx.platform.daxpay.code.PaySyncStatusEnum; -import cn.bootx.table.modify.annotation.DbComment; +import cn.bootx.table.modify.annotation.DbColumn; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; @@ -47,7 +47,7 @@ public class PaySyncRecordDto extends BaseDto { /** * 支付单如果状态不一致, 是否修复成功 */ - @DbComment("是否进行修复") + @DbColumn(comment = "是否进行修复") private boolean repairOrder; @Schema(description = "错误消息") diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/system/config/PayApiConfigDto.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/system/config/PayApiConfigDto.java index c5fe9758..adbf24e7 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/system/config/PayApiConfigDto.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/system/config/PayApiConfigDto.java @@ -47,4 +47,7 @@ public class PayApiConfigDto extends BaseDto { @Schema(description = "是否记录请求的信息") private boolean record; + @Schema(description = "备注") + private String remark; + } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsPayCloseStrategy.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsPayCloseStrategy.java index e6eebf64..324afed6 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsPayCloseStrategy.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsPayCloseStrategy.java @@ -1,7 +1,7 @@ package cn.bootx.platform.daxpay.service.func; import cn.bootx.platform.daxpay.service.common.exception.ExceptionInfo; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; import lombok.Getter; import lombok.Setter; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsPayRefundStrategy.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsPayRefundStrategy.java index d59ebdc3..d4b96731 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsPayRefundStrategy.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsPayRefundStrategy.java @@ -2,7 +2,7 @@ package cn.bootx.platform.daxpay.service.func; import cn.bootx.platform.daxpay.code.PayChannelEnum; import cn.bootx.platform.daxpay.service.common.exception.ExceptionInfo; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; import cn.bootx.platform.daxpay.param.pay.RefundChannelParam; import cn.bootx.platform.daxpay.param.pay.RefundParam; import lombok.Getter; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsPayRepairStrategy.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsPayRepairStrategy.java index b05a8936..1b9b0255 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsPayRepairStrategy.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsPayRepairStrategy.java @@ -1,7 +1,7 @@ package cn.bootx.platform.daxpay.service.func; import cn.bootx.platform.daxpay.service.code.PayRepairSourceEnum; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; import lombok.Getter; import lombok.Setter; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsPayStrategy.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsPayStrategy.java index 994ba942..7a0a6698 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsPayStrategy.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsPayStrategy.java @@ -2,7 +2,7 @@ package cn.bootx.platform.daxpay.service.func; import cn.bootx.platform.daxpay.code.PayChannelEnum; import cn.bootx.platform.daxpay.service.common.exception.ExceptionInfo; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; import cn.bootx.platform.daxpay.param.pay.PayParam; import cn.bootx.platform.daxpay.param.pay.PayChannelParam; import lombok.Getter; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsPaySyncStrategy.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsPaySyncStrategy.java index 6cf641ee..d88163f2 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsPaySyncStrategy.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/AbsPaySyncStrategy.java @@ -1,7 +1,7 @@ package cn.bootx.platform.daxpay.service.func; import cn.bootx.platform.daxpay.code.PaySyncStatusEnum; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; import cn.bootx.platform.daxpay.service.core.payment.sync.result.GatewaySyncResult; import lombok.Getter; import lombok.Setter; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/PayStrategyConsumer.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/PayStrategyConsumer.java index 3ce2b99a..c100ce48 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/PayStrategyConsumer.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/func/PayStrategyConsumer.java @@ -1,6 +1,6 @@ package cn.bootx.platform.daxpay.service.func; -import cn.bootx.platform.daxpay.service.core.record.pay.entity.PayOrder; +import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; import java.util.List; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/order/PayOrderQuery.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/order/PayOrderQuery.java new file mode 100644 index 00000000..4b6067cd --- /dev/null +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/order/PayOrderQuery.java @@ -0,0 +1,16 @@ +package cn.bootx.platform.daxpay.service.param.order; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 支付订单查询参数 + * @author xxm + * @since 2024/1/9 + */ +@Data +@Accessors(chain = true) +@Schema(title = "支付订单查询参数") +public class PayOrderQuery { +} diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/order/PayRefundOrderQuery.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/order/PayRefundOrderQuery.java new file mode 100644 index 00000000..19212531 --- /dev/null +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/order/PayRefundOrderQuery.java @@ -0,0 +1,28 @@ +package cn.bootx.platform.daxpay.service.param.order; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 支付退款查询参数 + * @author xxm + * @since 2024/1/9 + */ +@Data +@Accessors(chain = true) +@Schema(title = "支付退款查询参数") +public class PayRefundOrderQuery { + + @Schema(description = "关联的业务号") + private String businessNo; + + @Schema(description = "付款付单号") + private Long paymentId; + + @Schema(description = "异步方式关联退款请求号(部分退款情况)") + private String refundRequestNo; + + @Schema(description = "标题") + private String title; +} diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PayCallbackRecordQuery.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PayCallbackRecordQuery.java new file mode 100644 index 00000000..5fc1af96 --- /dev/null +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PayCallbackRecordQuery.java @@ -0,0 +1,16 @@ +package cn.bootx.platform.daxpay.service.param.record; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 支付回调信息记录 + * @author xxm + * @since 2024/1/9 + */ +@Data +@Accessors(chain = true) +@Schema(title = "支付回调信息记录") +public class PayCallbackRecordQuery { +} 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 new file mode 100644 index 00000000..3bd8d484 --- /dev/null +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PayCloseRecordQuery.java @@ -0,0 +1,16 @@ +package cn.bootx.platform.daxpay.service.param.record; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 支付关闭记录 + * @author xxm + * @since 2024/1/9 + */ +@Data +@Accessors(chain = true) +@Schema(title = "支付关闭记录") +public class PayCloseRecordQuery { +} 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 new file mode 100644 index 00000000..d47d247f --- /dev/null +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PayRepairRecordQuery.java @@ -0,0 +1,17 @@ +package cn.bootx.platform.daxpay.service.param.record; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 支付修复记录查询参数 + * @author xxm + * @since 2024/1/9 + */ +@Data +@Accessors(chain = true) +@Schema(title = "支付修复记录查询参数") +public class PayRepairRecordQuery { + +} 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 new file mode 100644 index 00000000..f8ee2d26 --- /dev/null +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/record/PaySyncRecordQuery.java @@ -0,0 +1,57 @@ +package cn.bootx.platform.daxpay.service.param.record; + +import cn.bootx.platform.daxpay.code.PayChannelEnum; +import cn.bootx.platform.daxpay.code.PaySyncStatusEnum; +import cn.bootx.table.modify.annotation.DbColumn; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * 支付同步记录查询参数 + * @author xxm + * @since 2024/1/9 + */ +@Data +@Accessors(chain = true) +@Schema(title = "支付同步记录查询参数") +public class PaySyncRecordQuery { + + /** 支付记录id */ + @Schema(description = "支付记录id") + private Long paymentId; + + /** + * 支付通道 + * @see PayChannelEnum#getCode() + */ + @Schema(description = "支付通道") + private String channel; + + /** 通知消息 */ + @Schema(description = "同步消息") + private String syncInfo; + + /** + * 同步状态 + * @see PaySyncStatusEnum + */ + @Schema(description = "同步状态") + private String status; + + /** + * 支付单如果状态不一致, 是否修复成功 + */ + @DbColumn(comment = "是否进行修复") + private boolean repairOrder; + + /** 同步时间 */ + @Schema(description = "同步时间") + private LocalDateTime syncTime; + + /** 客户端IP */ + @Schema(description = "客户端IP") + private String clientIp; +} diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/system/config/PayApiConfigParam.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/system/config/PayApiConfigParam.java index 42070f66..2c94a8db 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/system/config/PayApiConfigParam.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/param/system/config/PayApiConfigParam.java @@ -37,4 +37,7 @@ public class PayApiConfigParam { @Schema(description = "是否记录请求的信息") private boolean record; + + @Schema(description = "备注") + private String remark; } diff --git a/daxpay-single/daxpay-single-start/src/main/resources/application-dev.yml b/daxpay-single/daxpay-single-start/src/main/resources/application-dev.yml index 166cf51c..132281a7 100644 --- a/daxpay-single/daxpay-single-start/src/main/resources/application-dev.yml +++ b/daxpay-single/daxpay-single-start/src/main/resources/application-dev.yml @@ -125,7 +125,6 @@ bootx: - '/css/**' - '/error' - '/favicon.ico' - - '/**' # 审计日志 audit-log: # 审计日志存储