diff --git a/_doc/Task.md b/_doc/Task.md index b0c09be35..9a562ce7a 100644 --- a/_doc/Task.md +++ b/_doc/Task.md @@ -1,5 +1,5 @@ +## 单商户 2.0.5: 分账初版 -- [ ] 资金流水优化 - [x] 支付通道配置是否支持分账 - [x] 分账接收方管理 - [x] 管理 @@ -7,25 +7,28 @@ - [x] 分账组管理 - [x] 管理 - [x] 绑定 + - [ ] 默认分账组 - [ ] 分账订单管理 - [x] 订单创建 - [ ] 发起分账 - [ ] 分账完结 - [ ] 分账处理 - - [ ] 发起分账 - - [ ] 分账回调处理 + - [x] 发起分账 - [ ] 分账情况查询, 分账结果/剩余可分账金额 - [x] 修复创建支付订单报错时, 订单保存数据不完整 -2.0.6: 分账完善 +2.0.6: 分账完善和功能优化 +- [ ] 三方支付外部订单号规则优化: 支付P、退款R、分账A,根据环境加前缀:DEV_、DEMO_、PRE_ +- [ ] 资金流水优化 - [ ] 支持分账组分账和自己传接收方进行分账 - [ ] DEMO增加获取微信OpenID和支付宝OpenId功能 - [ ] 分账接收方管理提供接口调用 +- [ ] 分账回调处理 - [ ] 分账组管理提供接口调用 - [ ] 对账回退及退款 +- [ ] 分账通知 2.0.x 版本内容 -- [ ] 三方支付外部订单号规则优化: 支付P、退款R、分账A,根据环境加前缀:DEV_、DEMO_、PRE_ - [ ] 统计报表功能 - [ ] 微信新增V3版本接口 - [ ] 付款码支付自动路由到V2接口 @@ -54,3 +57,14 @@ - [ ] 增加验签调试等功能的页面 - [ ] 请求IP参数增加正则校验 - [ ] 增加账户金额表, 记录每天每个通道的账户金额, 并且提供查询接口 + +## 多商户多应用版本 +2.1.0: +- [ ] 商户管理 +- [ ] 应用管理 +- [ ] 支付配置适配 +- [ ] 支付能力适配 +- + +**任务池** + diff --git a/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/allocation/AllocationOrderController.java b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/allocation/AllocationOrderController.java new file mode 100644 index 000000000..83d374a73 --- /dev/null +++ b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/allocation/AllocationOrderController.java @@ -0,0 +1,79 @@ +package cn.bootx.platform.daxpay.admin.controller.allocation; + +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.dto.LabelValue; +import cn.bootx.platform.common.core.rest.param.PageParam; +import cn.bootx.platform.daxpay.param.pay.allocation.AllocationStartParam; +import cn.bootx.platform.daxpay.service.core.order.allocation.service.AllocationOrderService; +import cn.bootx.platform.daxpay.service.core.payment.allocation.service.AllocationService; +import cn.bootx.platform.daxpay.service.dto.order.allocation.AllocationOrderDetailDto; +import cn.bootx.platform.daxpay.service.dto.order.allocation.AllocationOrderDto; +import cn.bootx.platform.daxpay.service.param.order.AllocationOrderQuery; +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.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 对账订单控制器 + * @author xxm + * @since 2024/4/7 + */ +@Tag(name = "对账订单控制器") +@RestController +@RequestMapping("/allocation/order") +@RequiredArgsConstructor +public class AllocationOrderController { + + private final AllocationOrderService allocationOrderService; + + private final AllocationService allocationService; + + @Operation(summary = "分页") + @GetMapping("/page") + public ResResult> page(PageParam pageParam, AllocationOrderQuery param){ + return Res.ok(allocationOrderService.page(pageParam,param)); + } + + @Operation(summary = "分账明细列表") + @GetMapping("/detail/findAll") + public ResResult> findDetailsByOrderId(Long orderId){ + return Res.ok(allocationOrderService.findDetailsByOrderId(orderId)); + } + + @Operation(summary = "查询详情") + @GetMapping("/findById") + public ResResult findById(Long id){ + return Res.ok(allocationOrderService.findById(id)); + } + + + @Operation(summary = "查询明细详情") + @GetMapping("/detail/findById") + public ResResult findDetailById(Long id){ + return Res.ok(allocationOrderService.findDetailById(id)); + } + + @Operation(summary = "获取可以分账的通道") + @GetMapping("/findChannels") + public ResResult> findChannels(){ + return Res.ok(allocationOrderService.findChannels()); + } + + @Operation(summary = "发起分账") + @PostMapping("/start") + public ResResult start(Long paymentId){ + AllocationStartParam param = new AllocationStartParam(); + param.setPaymentId(paymentId); + allocationService.allocation(param); + return Res.ok(); + } + +} diff --git a/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/allocation/AllocationReceiverController.java b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/allocation/AllocationReceiverController.java index 787124b87..282ed6a52 100644 --- a/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/allocation/AllocationReceiverController.java +++ b/daxpay-single/daxpay-single-admin/src/main/java/cn/bootx/platform/daxpay/admin/controller/allocation/AllocationReceiverController.java @@ -46,6 +46,7 @@ public class AllocationReceiverController { public ResResult> findChannels(){ return Res.ok(receiverService.findChannels()); } + @Operation(summary = "根据通道获取分账接收方类型") @GetMapping("/findReceiverTypeByChannel") public ResResult> findReceiverTypeByChannel(String channel){ diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/wechat/service/WeChatPayAllocationService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/wechat/service/WeChatPayAllocationService.java index 1e70b7620..89d555094 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/wechat/service/WeChatPayAllocationService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/channel/wechat/service/WeChatPayAllocationService.java @@ -39,14 +39,18 @@ public class WeChatPayAllocationService { */ @SneakyThrows public void allocation(AllocationOrder allocationOrder, List orderDetails, WeChatPayConfig config){ - + String description = allocationOrder.getDescription(); + if (StrUtil.isBlank(description)){ + description = "分账"; + } + String finalDescription = description; List list = orderDetails.stream().map(o->{ AllocationReceiverTypeEnum receiverTypeEnum = AllocationReceiverTypeEnum.findByCode(o.getReceiverType()); return ReceiverModel.builder() .type(receiverTypeEnum.getOutCode()) .account(o.getReceiverAccount()) .amount(o.getAmount()) - .description(allocationOrder.getDescription()) + .description(finalDescription) .build(); }).collect(Collectors.toList()); diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/allocation/dao/AllocationOrderDetailManager.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/allocation/dao/AllocationOrderDetailManager.java index 63526d05a..27d435a01 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/allocation/dao/AllocationOrderDetailManager.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/allocation/dao/AllocationOrderDetailManager.java @@ -6,6 +6,8 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Repository; +import java.util.List; + /** * * @author xxm @@ -15,4 +17,11 @@ import org.springframework.stereotype.Repository; @Repository @RequiredArgsConstructor public class AllocationOrderDetailManager extends BaseManager { + + /** + * 根据订单ID查询 + */ + public List findAllByOrderId(Long orderId) { + return findAllByField(AllocationOrderDetail::getOrderId, orderId); + } } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/allocation/dao/AllocationOrderManager.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/allocation/dao/AllocationOrderManager.java index 30a064af9..a60ad9977 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/allocation/dao/AllocationOrderManager.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/allocation/dao/AllocationOrderManager.java @@ -1,7 +1,13 @@ package cn.bootx.platform.daxpay.service.core.order.allocation.dao; +import cn.bootx.platform.common.core.rest.param.PageParam; import cn.bootx.platform.common.mybatisplus.impl.BaseManager; +import cn.bootx.platform.common.mybatisplus.util.MpUtil; +import cn.bootx.platform.common.query.generator.QueryGenerator; import cn.bootx.platform.daxpay.service.core.order.allocation.entity.AllocationOrder; +import cn.bootx.platform.daxpay.service.param.order.AllocationOrderQuery; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Repository; @@ -24,4 +30,13 @@ public class AllocationOrderManager extends BaseManager findByAllocationNo(String allocationNo){ return findByField(AllocationOrder::getAllocationNo, allocationNo); } + + /** + * 分页 + */ + public Page page(PageParam pageParam, AllocationOrderQuery param){ + Page mpPage = MpUtil.getMpPage(pageParam, AllocationOrder.class); + QueryWrapper generator = QueryGenerator.generator(param); + return this.page(mpPage, generator); + } } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/allocation/entity/AllocationOrder.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/allocation/entity/AllocationOrder.java index ddce80628..3d0845dbd 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/allocation/entity/AllocationOrder.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/allocation/entity/AllocationOrder.java @@ -2,13 +2,18 @@ package cn.bootx.platform.daxpay.service.core.order.allocation.entity; 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.service.code.AllocationStatusEnum; import cn.bootx.platform.daxpay.service.core.order.allocation.convert.AllocationConvert; import cn.bootx.platform.daxpay.service.dto.order.allocation.AllocationOrderDto; import cn.bootx.table.modify.annotation.DbColumn; +import cn.bootx.table.modify.annotation.DbTable; import cn.bootx.table.modify.mysql.annotation.DbMySqlIndex; import cn.bootx.table.modify.mysql.constants.MySqlIndexType; 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; @@ -23,6 +28,8 @@ import java.time.LocalDateTime; @EqualsAndHashCode(callSuper = true) @Data @Accessors(chain = true) +@DbTable(comment = "分账订单") +@TableName("pay_allocation_order") public class AllocationOrder extends MpBaseEntity implements EntityBaseFunction { /** @@ -31,6 +38,12 @@ public class AllocationOrder extends MpBaseEntity implements EntityBaseFunction< @DbColumn(comment = "支付订单ID") private Long paymentId; + /** + * 支付订单标题 + */ + @Schema(description = "支付订单标题") + private String title; + /** * 网关支付订单号 */ @@ -59,6 +72,7 @@ public class AllocationOrder extends MpBaseEntity implements EntityBaseFunction< /** * 所属通道 + * @see PayChannelEnum */ @DbColumn(comment = "所属通道") private String channel; @@ -77,6 +91,7 @@ public class AllocationOrder extends MpBaseEntity implements EntityBaseFunction< /** * 状态 + * @see AllocationStatusEnum */ @DbColumn(comment = "状态") private String status; diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/allocation/entity/AllocationOrderDetail.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/allocation/entity/AllocationOrderDetail.java index 6be22cc89..01f3b1fc7 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/allocation/entity/AllocationOrderDetail.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/allocation/entity/AllocationOrderDetail.java @@ -1,12 +1,14 @@ package cn.bootx.platform.daxpay.service.core.order.allocation.entity; +import cn.bootx.platform.common.core.annotation.EncryptionField; import cn.bootx.platform.common.core.function.EntityBaseFunction; import cn.bootx.platform.common.mybatisplus.base.MpBaseEntity; import cn.bootx.platform.daxpay.code.AllocationReceiverTypeEnum; import cn.bootx.platform.daxpay.service.core.order.allocation.convert.AllocationConvert; import cn.bootx.platform.daxpay.service.dto.order.allocation.AllocationOrderDetailDto; -import cn.bootx.platform.starter.data.perm.sensitive.SensitiveInfo; import cn.bootx.table.modify.annotation.DbColumn; +import cn.bootx.table.modify.annotation.DbTable; +import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -19,6 +21,8 @@ import lombok.experimental.Accessors; @EqualsAndHashCode(callSuper = true) @Data @Accessors(chain = true) +@DbTable(comment = "分账订单明细") +@TableName("pay_allocation_order_detail") public class AllocationOrderDetail extends MpBaseEntity implements EntityBaseFunction { /** 分账订单ID */ @@ -46,7 +50,7 @@ public class AllocationOrderDetail extends MpBaseEntity implements EntityBaseFun /** 接收方账号 */ @DbColumn(comment = "接收方账号") - @SensitiveInfo + @EncryptionField private String receiverAccount; /** 接收方姓名 */ diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/allocation/service/AllocationOrderService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/allocation/service/AllocationOrderService.java index b7f6fc3f0..77fc973a4 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/allocation/service/AllocationOrderService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/order/allocation/service/AllocationOrderService.java @@ -1,6 +1,12 @@ package cn.bootx.platform.daxpay.service.core.order.allocation.service; +import cn.bootx.platform.common.core.exception.DataNotExistException; +import cn.bootx.platform.common.core.rest.PageResult; +import cn.bootx.platform.common.core.rest.dto.LabelValue; import cn.bootx.platform.common.core.rest.param.PageParam; +import cn.bootx.platform.common.core.util.ResultConvertUtil; +import cn.bootx.platform.common.mybatisplus.util.MpUtil; +import cn.bootx.platform.daxpay.code.PayChannelEnum; import cn.bootx.platform.daxpay.param.pay.allocation.AllocationStartParam; import cn.bootx.platform.daxpay.service.code.AllocationStatusEnum; import cn.bootx.platform.daxpay.service.core.order.allocation.dao.AllocationOrderDetailManager; @@ -10,6 +16,8 @@ import cn.bootx.platform.daxpay.service.core.order.allocation.entity.AllocationO import cn.bootx.platform.daxpay.service.core.order.allocation.entity.OrderAndDetail; import cn.bootx.platform.daxpay.service.core.order.pay.entity.PayOrder; import cn.bootx.platform.daxpay.service.dto.allocation.AllocationGroupReceiverResult; +import cn.bootx.platform.daxpay.service.dto.order.allocation.AllocationOrderDetailDto; +import cn.bootx.platform.daxpay.service.dto.order.allocation.AllocationOrderDto; import cn.bootx.platform.daxpay.service.param.order.AllocationOrderQuery; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; @@ -18,6 +26,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; @@ -33,13 +42,47 @@ public class AllocationOrderService { private final AllocationOrderManager allocationOrderManager; private final AllocationOrderDetailManager allocationOrderDetailManager; - /** - * 分页查询分账订单 - */ - public void page(PageParam pageParam, AllocationOrderQuery param){ + /** + * 获取可以分账的通道 + */ + public List findChannels(){ + return Arrays.asList( + new LabelValue(PayChannelEnum.ALI.getName(),PayChannelEnum.ALI.getCode()), + new LabelValue(PayChannelEnum.WECHAT.getName(),PayChannelEnum.WECHAT.getCode()) + ); } + /** + * 分页查询 + */ + public PageResult page(PageParam pageParam, AllocationOrderQuery param){ + return MpUtil.convert2DtoPageResult(allocationOrderManager.page(pageParam, param)); + } + + + /** + * 查询详情 + */ + public AllocationOrderDto findById(Long id) { + return allocationOrderManager.findById(id).map(AllocationOrder::toDto).orElseThrow(() -> new DataNotExistException("分账订单不存在")); + } + + /** + * 查询订单明细列表 + */ + public List findDetailsByOrderId(Long orderId){ + return ResultConvertUtil.dtoListConvert(allocationOrderDetailManager.findAllByOrderId(orderId)); + } + + /** + * 查询订单明细详情 + */ + public AllocationOrderDetailDto findDetailById(Long id){ + return allocationOrderDetailManager.findById(id).map(AllocationOrderDetail::toDto).orElseThrow(() -> new DataNotExistException("分账订单明细不存在")); + } + + /** * 生成分账订单 */ @@ -78,6 +121,7 @@ public class AllocationOrderService { // 分账订单 AllocationOrder allocationOrder = new AllocationOrder() .setPaymentId(payOrder.getId()) + .setTitle(payOrder.getTitle()) .setAllocationNo(allocationNo) .setChannel(payOrder.getAsyncChannel()) .setGatewayPayOrderNo(payOrder.getGatewayOrderNo()) diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/allocation/service/AllocationService.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/allocation/service/AllocationService.java index adb66b9e4..bcff01a2b 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/allocation/service/AllocationService.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/core/payment/allocation/service/AllocationService.java @@ -20,6 +20,7 @@ import cn.bootx.platform.daxpay.service.core.payment.allocation.entity.Allocatio import cn.bootx.platform.daxpay.service.core.payment.allocation.factory.AllocationFactory; import cn.bootx.platform.daxpay.service.dto.allocation.AllocationGroupReceiverResult; import cn.bootx.platform.daxpay.service.func.AbsAllocationStrategy; +import cn.hutool.core.util.StrUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -49,25 +50,12 @@ public class AllocationService { private final AllocationOrderService allocationOrderService; - /** * 开启分账, 使用分账组进行分账 */ public AllocationResult allocation(AllocationStartParam param) { - // 查询支付单 - PayOrder payOrder = null; - if (Objects.nonNull(param.getPaymentId())){ - payOrder = payOrderManager.findById(param.getPaymentId()) - .orElseThrow(() -> new DataNotExistException("未查询到支付订单")); - } - if (Objects.isNull(payOrder)){ - payOrder = payOrderManager.findByBusinessNo(param.getBusinessNo()) - .orElseThrow(() -> new DataNotExistException("未查询到支付订单")); - } - // 判断订单是否可以分账 - if (!payOrder.isAllocation()){ - throw new PayFailureException("该订单不允许分账"); - } + + PayOrder payOrder = this.getAndCheckPayOrder(param); // 查询待分账的通道支付订单 PayChannelOrder channelOrder = payChannelOrderManager.findByAsyncChannel(payOrder.getId()) @@ -144,4 +132,27 @@ public class AllocationService { allocationOrderManager.updateById(allocationOrder); } + + /** + * 获取并检查支付订单 + */ + private PayOrder getAndCheckPayOrder(AllocationStartParam param) { + // 查询支付单 + PayOrder payOrder = null; + if (Objects.nonNull(param.getPaymentId())){ + payOrder = payOrderManager.findById(param.getPaymentId()) + .orElseThrow(() -> new DataNotExistException("未查询到支付订单")); + } + if (StrUtil.isNotBlank(param.getBusinessNo())){ + payOrder = payOrderManager.findByBusinessNo(param.getBusinessNo()) + .orElseThrow(() -> new DataNotExistException("未查询到支付订单")); + } + // 判断订单是否可以分账 + if (!payOrder.isAllocation()){ + throw new PayFailureException("该订单不允许分账"); + } + return payOrder; + } + + } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/allocation/AllocationOrderDetailDto.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/allocation/AllocationOrderDetailDto.java index 1574ab731..a64849372 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/allocation/AllocationOrderDetailDto.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/allocation/AllocationOrderDetailDto.java @@ -1,6 +1,8 @@ package cn.bootx.platform.daxpay.service.dto.order.allocation; import cn.bootx.platform.common.core.rest.dto.BaseDto; +import cn.bootx.platform.daxpay.code.AllocationReceiverTypeEnum; +import cn.bootx.platform.starter.data.perm.sensitive.SensitiveInfo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; @@ -14,6 +16,43 @@ import lombok.experimental.Accessors; @EqualsAndHashCode(callSuper = true) @Data @Accessors(chain = true) -@Schema(title = "") +@Schema(title = "分账订单详情") public class AllocationOrderDetailDto extends BaseDto { + + + /** 分账订单ID */ + @Schema(description = "分账订单ID") + private Long orderId; + + /** 接收者ID */ + @Schema(description = "接收者ID") + private Long receiverId; + + /** 分账比例 */ + @Schema(description = "分账比例(万分之多少)") + private Integer rate; + + /** 分账金额 */ + @Schema(description = "分账金额") + private Integer amount; + + /** + * 分账接收方类型 + * @see AllocationReceiverTypeEnum + */ + @Schema(description = "分账接收方类型") + private String receiverType; + + /** 接收方账号 */ + @Schema(description = "接收方账号") + @SensitiveInfo + private String receiverAccount; + + /** 接收方姓名 */ + @Schema(description = "接收方姓名") + private String receiverName; + + /** 状态 */ + @Schema(description = "状态") + private String status; } diff --git a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/allocation/AllocationOrderDto.java b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/allocation/AllocationOrderDto.java index fdde56813..d0d08caf0 100644 --- a/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/allocation/AllocationOrderDto.java +++ b/daxpay-single/daxpay-single-service/src/main/java/cn/bootx/platform/daxpay/service/dto/order/allocation/AllocationOrderDto.java @@ -1,11 +1,15 @@ package cn.bootx.platform.daxpay.service.dto.order.allocation; import cn.bootx.platform.common.core.rest.dto.BaseDto; +import com.baomidou.mybatisplus.annotation.FieldStrategy; +import com.baomidou.mybatisplus.annotation.TableField; 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,6 +20,79 @@ import lombok.experimental.Accessors; @Accessors(chain = true) @Schema(title = "分账订单") public class AllocationOrderDto extends BaseDto { + /** + * 支付订单ID + */ + @Schema(description = "支付订单ID") + private Long paymentId; + /** + * 支付订单标题 + */ + @Schema(description = "支付订单标题") + private String title; + + /** + * 网关支付订单号 + */ + @Schema(description = "网关支付订单号") + private String gatewayPayOrderNo; + + /** + * 网关分账单号 + */ + @Schema(description = "网关分账单号") + private String gatewayAllocationNo; + + /** + * 分账单号 + */ + @Schema(description = "分账单号") + private String allocationNo; + + + /** + * 外部请求号 + */ + @Schema(description = "外部请求号") + private String outReqNo; + + /** + * 所属通道 + */ + @Schema(description = "所属通道") + private String channel; + + /** + * 总分账金额 + */ + @Schema(description = "总分账金额") + private Integer amount; + + /** + * 分账描述 + */ + @Schema(description = "分账描述") + private String description; + + /** + * 状态 + * @see cn.bootx.platform.daxpay.service.code.AllocationStatusEnum + */ + @Schema(description = "状态") + private String status; + + /** + * 错误原因 + */ + @Schema(description = "错误原因") + @TableField(updateStrategy = FieldStrategy.ALWAYS) + private String errorMsg; + + /** + * 完成时间 + */ + @Schema(description = "完成时间") + private LocalDateTime finishTime; }