mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-09-02 10:36:57 +00:00
feat 增加分账接收者列表接口和一些优化
This commit is contained in:
@@ -1,6 +1,22 @@
|
||||
# CHANGELOG
|
||||
## [v3.0.0.beta1] 2024-10-24
|
||||
|
||||
- 重构: JDK版本升级为21+, Spring Boot 版本升级为3.3.x, 前端组件升级为Antd Vue 4.x + Vite5
|
||||
- 重构: 数据库更新为PostgreSQL + MySQL8.x 双版本支持
|
||||
- 重构: 脚手架全新重构, 精简和优化各种功能模块, 支持基于有赞文章实现的Redis延时队列
|
||||
- 重构: 支持多应用模式, 每个应用都可以配置单独一套支付通道、通知订阅、收款码牌等配置, 可以实现同时对接多个业务系统
|
||||
- 重构: 项目结构进行重构, 修改为支付核心+通道扩展+功能插件的方式, 实现功能模块的耦合拆分, 便于进行功能扩展和二次开发
|
||||
- 重构: 对账功能进行重构, 更加简单直观和易用
|
||||
- 重构: 删除订单调整相关逻辑, 分别放到订单同步和回调处理中, 只保留
|
||||
- 新增: 微信支付同时支持V2和V3版本的接口, 同时V3版本支持付款码和撤销接口
|
||||
- 新增: 交易调试接口功能, 用于开发时对交易流程进行测试
|
||||
- 新增: 获取通道认证信息的测试页, 便于获取微信、支付宝等用户的认证信息
|
||||
- 新增: 增加简易移动端收款码牌功能, 支持自动跳转到微信或支付宝对应的H5收银台, 支持自主配置所使用的通道和支付方式
|
||||
- 新增: 增加商户通知功能, 通过订阅指定类型的通知类型, 将会在符合条件时推送到预留的客户系统地址上
|
||||
- 优化: 各类错误处理进行统一化处理
|
||||
- 优化: 优化商户回调功能, 简化配置项, 使用延时器优化重复推送的逻辑
|
||||
- 优化: 减少在各种流程中上下文对象的线程变量使用, 非必需的上下文对象使用方法调用明确传输
|
||||
- 优化: 对各类状态码进行优化合并, 如转账接收方类型、分账接收方类型等
|
||||
- 优化: 所有金额统一为元, 保留两位小数
|
||||
## [v2.0.8] 2024-06-27
|
||||
- 新增: 撤销接口
|
||||
- 新增: 转账功能
|
||||
|
@@ -15,12 +15,8 @@ public enum ChannelEnum {
|
||||
|
||||
/** 支付宝 - 直连商户 */
|
||||
ALI("ali_pay"),
|
||||
/** 支付宝 - 服务商商户 */
|
||||
ALI_SERVICE("ali_service"),
|
||||
/** 微信支付 */
|
||||
WECHAT("wechat_pay"),
|
||||
/** 微信支付服务商 */
|
||||
WECHAT_SERVICE("wechat_service"),
|
||||
/** 云闪付 */
|
||||
UNION_PAY("union_pay"),
|
||||
;
|
||||
|
@@ -33,6 +33,15 @@ public class AllocReceiverTest {
|
||||
DaxPayKit.initConfig(config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@Test
|
||||
public void query() {
|
||||
AllocReceiverAddParam param = new AllocReceiverAddParam();
|
||||
param.setChannel(ChannelEnum.ALI.getCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package org.dromara.daxpay.core.param.allocation;
|
||||
package org.dromara.daxpay.core.param.allocation.receiver;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
@@ -0,0 +1,31 @@
|
||||
package org.dromara.daxpay.core.param.allocation.receiver;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.dromara.daxpay.core.enums.ChannelEnum;
|
||||
import org.dromara.daxpay.core.param.PaymentCommonParam;
|
||||
|
||||
/**
|
||||
* 分账接收方查询参数
|
||||
* @author xxm
|
||||
* @since 2024/10/22
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(title = "分账接收方")
|
||||
public class AllocReceiverQueryParam extends PaymentCommonParam {
|
||||
/**
|
||||
* 所属通道
|
||||
* @see ChannelEnum
|
||||
*/
|
||||
@Schema(description = "所属通道")
|
||||
@NotBlank(message = "所属通道必填")
|
||||
@Size(max = 20, message = "所属通道不可超过20位")
|
||||
private String channel;
|
||||
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
package org.dromara.daxpay.core.param.allocation;
|
||||
package org.dromara.daxpay.core.param.allocation.receiver;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
@@ -1,6 +1,5 @@
|
||||
package org.dromara.daxpay.service.result.allocation;
|
||||
package org.dromara.daxpay.core.result.allocation.receiver;
|
||||
|
||||
import cn.bootx.platform.common.jackson.sensitive.SensitiveInfo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -37,12 +36,10 @@ public class AllocReceiverResult extends MchAppResult {
|
||||
|
||||
|
||||
@Schema(description = "接收方账号")
|
||||
@SensitiveInfo
|
||||
private String receiverAccount;
|
||||
|
||||
/** 接收方姓名 */
|
||||
@Schema(description = "接收方姓名")
|
||||
@SensitiveInfo(SensitiveInfo.SensitiveType.CHINESE_NAME)
|
||||
private String receiverName;
|
||||
|
||||
/**
|
@@ -22,22 +22,18 @@ import java.time.LocalDateTime;
|
||||
@Schema(title = "退款订单数据")
|
||||
public class RefundOrderResult extends MchAppResult {
|
||||
|
||||
/** 支付订单ID */
|
||||
@Schema(description = "支付订单ID")
|
||||
private Long orderId;
|
||||
|
||||
/** 支付订单号 */
|
||||
@Schema(description = "支付订单号")
|
||||
private String orderNo;
|
||||
|
||||
/** 通道支付订单号 */
|
||||
@Schema(description = "通道支付订单号")
|
||||
private String outOrderNo;
|
||||
|
||||
/** 商户支付订单号 */
|
||||
@Schema(description = "商户支付订单号")
|
||||
private String bizOrderNo;
|
||||
|
||||
/** 通道支付订单号 */
|
||||
@Schema(description = "通道支付订单号")
|
||||
private String outOrderNo;
|
||||
|
||||
/** 支付标题 */
|
||||
@Schema(description = "支付标题")
|
||||
private String title;
|
||||
@@ -58,12 +54,12 @@ public class RefundOrderResult extends MchAppResult {
|
||||
* 退款通道
|
||||
* @see ChannelEnum
|
||||
*/
|
||||
@Schema(description = "支付通道")
|
||||
@Schema(description = "退款通道")
|
||||
private String channel;
|
||||
|
||||
/** 订单金额 */
|
||||
@Schema(description = "订单金额")
|
||||
private Integer orderAmount;
|
||||
private BigDecimal orderAmount;
|
||||
|
||||
/** 退款金额 */
|
||||
@Schema(description = "退款金额")
|
||||
@@ -88,10 +84,6 @@ public class RefundOrderResult extends MchAppResult {
|
||||
@Schema(description = "商户扩展参数,回调时会原样返回, 以最后一次为准")
|
||||
private String attach;
|
||||
|
||||
/** 终端ip */
|
||||
@Schema(description = "终端ip")
|
||||
private String clientIp;
|
||||
|
||||
/** 错误信息 */
|
||||
@Schema(description = "错误信息")
|
||||
private String errorMsg;
|
||||
|
@@ -85,10 +85,6 @@ public class TransferOrderResult extends MchAppResult {
|
||||
@Schema(description = "商户扩展参数")
|
||||
private String attach;
|
||||
|
||||
/** 终端ip */
|
||||
@Schema(description = "终端ip")
|
||||
private String clientIp;
|
||||
|
||||
/**
|
||||
* 错误原因
|
||||
*/
|
||||
|
@@ -1,4 +1,4 @@
|
||||
package org.dromara.daxpay.service.result.allocation;
|
||||
package org.dromara.daxpay.service.bo.allocation;
|
||||
|
||||
import cn.bootx.platform.common.jackson.sensitive.SensitiveInfo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -19,7 +19,7 @@ import java.math.BigDecimal;
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(title = "分账组接收方信息")
|
||||
public class AllocGroupReceiverResult extends MchAppResult {
|
||||
public class AllocGroupReceiverResultBo extends MchAppResult {
|
||||
|
||||
@Schema(description = "接收方ID")
|
||||
private Long receiverId;
|
@@ -1,4 +1,4 @@
|
||||
package org.dromara.daxpay.service.result.allocation;
|
||||
package org.dromara.daxpay.service.bo.allocation;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -17,7 +17,7 @@ import java.math.BigDecimal;
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(title = "分账组")
|
||||
public class AllocGroupResult extends MchAppResult {
|
||||
public class AllocGroupResultBo extends MchAppResult {
|
||||
|
||||
@Schema(description = "分账组编号")
|
||||
private String groupNo;
|
@@ -0,0 +1,57 @@
|
||||
package org.dromara.daxpay.service.bo.allocation;
|
||||
|
||||
import cn.bootx.platform.common.jackson.sensitive.SensitiveInfo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.dromara.daxpay.core.enums.ChannelEnum;
|
||||
import org.dromara.daxpay.core.result.MchAppResult;
|
||||
|
||||
/**
|
||||
* 分账接收方
|
||||
* @author xxm
|
||||
* @since 2024/3/28
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@Schema(title = "分账接收方")
|
||||
public class AllocReceiverResultBo extends MchAppResult {
|
||||
|
||||
@Schema(description = "接收方编号")
|
||||
private String receiverNo;
|
||||
|
||||
/**
|
||||
* @see ChannelEnum
|
||||
*/
|
||||
@Schema(description = "所属通道")
|
||||
private String channel;
|
||||
|
||||
/**
|
||||
* 分账接收方类型 个人/商户
|
||||
* @see org.dromara.daxpay.core.enums.AllocReceiverTypeEnum
|
||||
*/
|
||||
@Schema(description = "分账接收方类型")
|
||||
private String receiverType;
|
||||
|
||||
|
||||
@Schema(description = "接收方账号")
|
||||
@SensitiveInfo
|
||||
private String receiverAccount;
|
||||
|
||||
/** 接收方姓名 */
|
||||
@Schema(description = "接收方姓名")
|
||||
@SensitiveInfo(SensitiveInfo.SensitiveType.CHINESE_NAME)
|
||||
private String receiverName;
|
||||
|
||||
/**
|
||||
* 分账关系类型
|
||||
* @see org.dromara.daxpay.core.enums.AllocRelationTypeEnum
|
||||
*/
|
||||
@Schema(description = "分账关系类型")
|
||||
private String relationType;
|
||||
|
||||
@Schema(description = "关系名称")
|
||||
private String relationName;
|
||||
}
|
@@ -10,12 +10,12 @@ import cn.bootx.platform.core.util.ValidationUtil;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.daxpay.service.bo.allocation.AllocGroupResultBo;
|
||||
import org.dromara.daxpay.service.param.allocation.group.AllocGroupBindParam;
|
||||
import org.dromara.daxpay.service.param.allocation.group.AllocGroupParam;
|
||||
import org.dromara.daxpay.service.param.allocation.group.AllocGroupQuery;
|
||||
import org.dromara.daxpay.service.param.allocation.group.AllocGroupUnbindParam;
|
||||
import org.dromara.daxpay.service.result.allocation.AllocGroupReceiverResult;
|
||||
import org.dromara.daxpay.service.result.allocation.AllocGroupResult;
|
||||
import org.dromara.daxpay.service.bo.allocation.AllocGroupReceiverResultBo;
|
||||
import org.dromara.daxpay.service.service.allocation.AllocGroupService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -40,14 +40,14 @@ public class AllocGroupController {
|
||||
@RequestPath("分页")
|
||||
@Operation(summary = "分页")
|
||||
@GetMapping("/page")
|
||||
public Result<PageResult<AllocGroupResult>> page(PageParam pageParam, AllocGroupQuery query){
|
||||
public Result<PageResult<AllocGroupResultBo>> page(PageParam pageParam, AllocGroupQuery query){
|
||||
return Res.ok(allocGroupService.page(pageParam,query));
|
||||
}
|
||||
|
||||
@RequestPath("查询详情")
|
||||
@Operation(summary = "查询详情")
|
||||
@GetMapping("/findById")
|
||||
public Result<AllocGroupResult> findById(Long id){
|
||||
public Result<AllocGroupResultBo> findById(Long id){
|
||||
return Res.ok(allocGroupService.findById(id));
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class AllocGroupController {
|
||||
@RequestPath("查询分账接收方信息")
|
||||
@Operation(summary = "查询分账接收方信息")
|
||||
@GetMapping("/findReceiversByGroups")
|
||||
public Result<List<AllocGroupReceiverResult>> findReceiversByGroups(Long groupId){
|
||||
public Result<List<AllocGroupReceiverResultBo>> findReceiversByGroups(Long groupId){
|
||||
return Res.ok(allocGroupService.findReceiversByGroups(groupId));
|
||||
}
|
||||
|
||||
|
@@ -11,10 +11,10 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.daxpay.core.param.allocation.AllocReceiverAddParam;
|
||||
import org.dromara.daxpay.core.param.allocation.receiver.AllocReceiverAddParam;
|
||||
import org.dromara.daxpay.core.param.allocation.receiver.AllocReceiverRemoveParam;
|
||||
import org.dromara.daxpay.service.bo.allocation.AllocReceiverResultBo;
|
||||
import org.dromara.daxpay.service.param.allocation.receiver.AllocReceiverQuery;
|
||||
import org.dromara.daxpay.core.param.allocation.AllocReceiverRemoveParam;
|
||||
import org.dromara.daxpay.service.result.allocation.AllocReceiverResult;
|
||||
import org.dromara.daxpay.service.service.allocation.AllocReceiverService;
|
||||
import org.dromara.daxpay.service.service.assist.PaymentAssistService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -41,14 +41,14 @@ public class AllocReceiverController {
|
||||
@RequestPath("分页")
|
||||
@Operation(summary = "分页")
|
||||
@GetMapping("/page")
|
||||
public Result<PageResult<AllocReceiverResult>> page(PageParam pageParam, AllocReceiverQuery query){
|
||||
public Result<PageResult<AllocReceiverResultBo>> page(PageParam pageParam, AllocReceiverQuery query){
|
||||
return Res.ok(receiverService.page(pageParam, query));
|
||||
}
|
||||
|
||||
@RequestPath("查询详情")
|
||||
@Operation(summary = "查询详情")
|
||||
@GetMapping("/findById")
|
||||
public Result<AllocReceiverResult> findById(Long id){
|
||||
public Result<AllocReceiverResultBo> findById(Long id){
|
||||
return Res.ok(receiverService.findById(id));
|
||||
}
|
||||
|
||||
|
@@ -1,21 +1,24 @@
|
||||
package org.dromara.daxpay.service.controller.unipay;
|
||||
|
||||
import cn.bootx.platform.core.annotation.IgnoreAuth;
|
||||
import org.dromara.daxpay.core.param.PaymentCommonParam;
|
||||
import org.dromara.daxpay.core.result.DaxResult;
|
||||
import org.dromara.daxpay.core.util.DaxRes;
|
||||
import org.dromara.daxpay.service.common.anno.PaymentVerify;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.daxpay.core.param.allocation.AllocReceiverAddParam;
|
||||
import org.dromara.daxpay.core.param.allocation.AllocReceiverRemoveParam;
|
||||
import org.dromara.daxpay.core.param.allocation.receiver.AllocReceiverAddParam;
|
||||
import org.dromara.daxpay.core.param.allocation.receiver.AllocReceiverQueryParam;
|
||||
import org.dromara.daxpay.core.param.allocation.receiver.AllocReceiverRemoveParam;
|
||||
import org.dromara.daxpay.core.result.DaxResult;
|
||||
import org.dromara.daxpay.core.result.allocation.receiver.AllocReceiverResult;
|
||||
import org.dromara.daxpay.core.util.DaxRes;
|
||||
import org.dromara.daxpay.service.common.anno.PaymentVerify;
|
||||
import org.dromara.daxpay.service.service.allocation.AllocReceiverService;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分账控制器
|
||||
* @author xxm
|
||||
@@ -44,8 +47,8 @@ public class UniAllocationController {
|
||||
|
||||
@Operation(summary = "分账接收方查询接口")
|
||||
@PostMapping("/receiver/list")
|
||||
public DaxResult<Void> receiverList(@RequestBody PaymentCommonParam param){
|
||||
return DaxRes.ok();
|
||||
public DaxResult<List<AllocReceiverResult>> receiverList(@RequestBody AllocReceiverQueryParam param){
|
||||
return DaxRes.ok(allocReceiverService.list(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "分账接收方添加接口")
|
||||
@@ -61,5 +64,4 @@ public class UniAllocationController {
|
||||
allocReceiverService.removeAndSync(param);
|
||||
return DaxRes.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@ package org.dromara.daxpay.service.convert.allocation;
|
||||
|
||||
import org.dromara.daxpay.service.entity.allocation.receiver.AllocGroup;
|
||||
import org.dromara.daxpay.service.param.allocation.group.AllocGroupParam;
|
||||
import org.dromara.daxpay.service.result.allocation.AllocGroupResult;
|
||||
import org.dromara.daxpay.service.bo.allocation.AllocGroupResultBo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.mapstruct.factory.Mappers;
|
||||
public interface AllocGroupConvert {
|
||||
AllocGroupConvert CONVERT = Mappers.getMapper(AllocGroupConvert.class);
|
||||
|
||||
AllocGroupResult convert(AllocGroup in);
|
||||
AllocGroupResultBo convert(AllocGroup in);
|
||||
|
||||
AllocGroup convert(AllocGroupParam in);
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
package org.dromara.daxpay.service.convert.allocation;
|
||||
|
||||
import org.dromara.daxpay.service.bo.allocation.AllocGroupReceiverResultBo;
|
||||
import org.dromara.daxpay.service.entity.allocation.receiver.AllocGroupReceiver;
|
||||
import org.dromara.daxpay.service.param.allocation.group.AllocGroupReceiverParam;
|
||||
import org.dromara.daxpay.service.result.allocation.AllocGroupReceiverResult;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.mapstruct.factory.Mappers;
|
||||
public interface AllocGroupReceiverConvert {
|
||||
AllocGroupReceiverConvert CONVERT = Mappers.getMapper(AllocGroupReceiverConvert.class);
|
||||
|
||||
AllocGroupReceiverResult convert(AllocGroupReceiver in);
|
||||
AllocGroupReceiverResultBo convert(AllocGroupReceiver in);
|
||||
|
||||
AllocGroupReceiver convert(AllocGroupReceiverParam in);
|
||||
}
|
||||
|
@@ -1,11 +1,14 @@
|
||||
package org.dromara.daxpay.service.convert.allocation;
|
||||
|
||||
import org.dromara.daxpay.core.param.allocation.receiver.AllocReceiverAddParam;
|
||||
import org.dromara.daxpay.core.result.allocation.receiver.AllocReceiverResult;
|
||||
import org.dromara.daxpay.service.bo.allocation.AllocReceiverResultBo;
|
||||
import org.dromara.daxpay.service.entity.allocation.receiver.AllocReceiver;
|
||||
import org.dromara.daxpay.core.param.allocation.AllocReceiverAddParam;
|
||||
import org.dromara.daxpay.service.result.allocation.AllocReceiverResult;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author xxm
|
||||
@@ -17,5 +20,9 @@ public interface AllocReceiverConvert {
|
||||
|
||||
AllocReceiver convert(AllocReceiverAddParam in);
|
||||
|
||||
AllocReceiverResultBo toBo(AllocReceiver in);
|
||||
|
||||
AllocReceiverResult toResult(AllocReceiver in);
|
||||
|
||||
List<AllocReceiverResult> toList(List<AllocReceiver> in);
|
||||
}
|
||||
|
@@ -7,9 +7,9 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.dromara.daxpay.service.bo.allocation.AllocGroupResultBo;
|
||||
import org.dromara.daxpay.service.common.entity.MchAppBaseEntity;
|
||||
import org.dromara.daxpay.service.convert.allocation.AllocGroupConvert;
|
||||
import org.dromara.daxpay.service.result.allocation.AllocGroupResult;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.math.BigDecimal;
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName("pay_alloc_group")
|
||||
public class AllocGroup extends MchAppBaseEntity implements ToResult<AllocGroupResult> {
|
||||
public class AllocGroup extends MchAppBaseEntity implements ToResult<AllocGroupResultBo> {
|
||||
|
||||
/** 分账组编码 */
|
||||
private String groupNo;
|
||||
@@ -44,7 +44,7 @@ public class AllocGroup extends MchAppBaseEntity implements ToResult<AllocGroupR
|
||||
private String remark;
|
||||
|
||||
@Override
|
||||
public AllocGroupResult toResult() {
|
||||
public AllocGroupResultBo toResult() {
|
||||
return AllocGroupConvert.CONVERT.convert(this);
|
||||
}
|
||||
}
|
||||
|
@@ -5,9 +5,9 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.dromara.daxpay.service.bo.allocation.AllocGroupReceiverResultBo;
|
||||
import org.dromara.daxpay.service.common.entity.MchAppBaseEntity;
|
||||
import org.dromara.daxpay.service.convert.allocation.AllocGroupReceiverConvert;
|
||||
import org.dromara.daxpay.service.result.allocation.AllocGroupReceiverResult;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.math.BigDecimal;
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName("pay_alloc_group_receiver")
|
||||
public class AllocGroupReceiver extends MchAppBaseEntity implements ToResult<AllocGroupReceiverResult> {
|
||||
public class AllocGroupReceiver extends MchAppBaseEntity implements ToResult<AllocGroupReceiverResultBo> {
|
||||
|
||||
/** 分账组ID */
|
||||
private Long groupId;
|
||||
@@ -32,7 +32,7 @@ public class AllocGroupReceiver extends MchAppBaseEntity implements ToResult<All
|
||||
private BigDecimal rate;
|
||||
|
||||
@Override
|
||||
public AllocGroupReceiverResult toResult() {
|
||||
public AllocGroupReceiverResultBo toResult() {
|
||||
return AllocGroupReceiverConvert.CONVERT.convert(this);
|
||||
}
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.dromara.daxpay.service.convert.allocation.AllocReceiverConvert;
|
||||
import org.dromara.daxpay.service.result.allocation.AllocReceiverResult;
|
||||
import org.dromara.daxpay.service.bo.allocation.AllocReceiverResultBo;
|
||||
|
||||
/**
|
||||
* 分账接收方
|
||||
@@ -23,7 +23,7 @@ import org.dromara.daxpay.service.result.allocation.AllocReceiverResult;
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TableName("pay_alloc_receiver")
|
||||
public class AllocReceiver extends MchAppBaseEntity implements ToResult<AllocReceiverResult> {
|
||||
public class AllocReceiver extends MchAppBaseEntity implements ToResult<AllocReceiverResultBo> {
|
||||
|
||||
/** 分账接收方编号, 需要保证唯一 */
|
||||
private String receiverNo;
|
||||
@@ -58,7 +58,7 @@ public class AllocReceiver extends MchAppBaseEntity implements ToResult<AllocRec
|
||||
private String relationName;
|
||||
|
||||
@Override
|
||||
public AllocReceiverResult toResult() {
|
||||
return AllocReceiverConvert.CONVERT.toResult(this);
|
||||
public AllocReceiverResultBo toResult() {
|
||||
return AllocReceiverConvert.CONVERT.toBo(this);
|
||||
}
|
||||
}
|
||||
|
@@ -10,6 +10,7 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.daxpay.service.bo.allocation.AllocGroupReceiverResultBo;
|
||||
import org.dromara.daxpay.service.convert.allocation.AllocGroupConvert;
|
||||
import org.dromara.daxpay.service.dao.allocation.receiver.AllocGroupManager;
|
||||
import org.dromara.daxpay.service.dao.allocation.receiver.AllocGroupReceiverManager;
|
||||
@@ -18,8 +19,7 @@ import org.dromara.daxpay.service.entity.allocation.receiver.AllocGroup;
|
||||
import org.dromara.daxpay.service.entity.allocation.receiver.AllocGroupReceiver;
|
||||
import org.dromara.daxpay.service.entity.allocation.receiver.AllocReceiver;
|
||||
import org.dromara.daxpay.service.param.allocation.group.*;
|
||||
import org.dromara.daxpay.service.result.allocation.AllocGroupReceiverResult;
|
||||
import org.dromara.daxpay.service.result.allocation.AllocGroupResult;
|
||||
import org.dromara.daxpay.service.bo.allocation.AllocGroupResultBo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -46,21 +46,21 @@ public class AllocGroupService {
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
public PageResult<AllocGroupResult> page(PageParam pageParam, AllocGroupQuery query){
|
||||
public PageResult<AllocGroupResultBo> page(PageParam pageParam, AllocGroupQuery query){
|
||||
return MpUtil.toPageResult(groupManager.page(pageParam, query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
public AllocGroupResult findById(Long id){
|
||||
public AllocGroupResultBo findById(Long id){
|
||||
return groupManager.findById(id).map(AllocGroup::toResult).orElseThrow(()->new DataNotExistException("分账组不存在"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分账接收方
|
||||
*/
|
||||
public List<AllocGroupReceiverResult> findReceiversByGroups(Long groupId){
|
||||
public List<AllocGroupReceiverResultBo> findReceiversByGroups(Long groupId){
|
||||
List<AllocGroupReceiver> groupReceivers = groupReceiverManager.findByGroupId(groupId);
|
||||
List<Long> receiverIds = groupReceivers.stream()
|
||||
.map(AllocGroupReceiver::getReceiverId)
|
||||
@@ -73,7 +73,7 @@ public class AllocGroupService {
|
||||
return groupReceivers.stream()
|
||||
.map(o -> {
|
||||
AllocReceiver receiver = receiverMap.get(o.getReceiverId());
|
||||
AllocGroupReceiverResult result = new AllocGroupReceiverResult()
|
||||
AllocGroupReceiverResultBo result = new AllocGroupReceiverResultBo()
|
||||
.setReceiverId(receiver.getId())
|
||||
.setReceiverNo(receiver.getReceiverNo())
|
||||
.setReceiverAccount(receiver.getReceiverAccount())
|
||||
|
@@ -16,14 +16,16 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.daxpay.core.exception.DataErrorException;
|
||||
import org.dromara.daxpay.core.exception.OperationFailException;
|
||||
import org.dromara.daxpay.core.exception.OperationProcessingException;
|
||||
import org.dromara.daxpay.core.param.allocation.receiver.AllocReceiverAddParam;
|
||||
import org.dromara.daxpay.core.param.allocation.receiver.AllocReceiverQueryParam;
|
||||
import org.dromara.daxpay.core.param.allocation.receiver.AllocReceiverRemoveParam;
|
||||
import org.dromara.daxpay.core.result.allocation.receiver.AllocReceiverResult;
|
||||
import org.dromara.daxpay.service.bo.allocation.AllocReceiverResultBo;
|
||||
import org.dromara.daxpay.service.convert.allocation.AllocReceiverConvert;
|
||||
import org.dromara.daxpay.service.dao.allocation.receiver.AllocGroupReceiverManager;
|
||||
import org.dromara.daxpay.service.dao.allocation.receiver.AllocReceiverManager;
|
||||
import org.dromara.daxpay.service.entity.allocation.receiver.AllocReceiver;
|
||||
import org.dromara.daxpay.core.param.allocation.AllocReceiverAddParam;
|
||||
import org.dromara.daxpay.service.param.allocation.receiver.AllocReceiverQuery;
|
||||
import org.dromara.daxpay.core.param.allocation.AllocReceiverRemoveParam;
|
||||
import org.dromara.daxpay.service.result.allocation.AllocReceiverResult;
|
||||
import org.dromara.daxpay.service.strategy.AbsAllocReceiverStrategy;
|
||||
import org.dromara.daxpay.service.strategy.PaymentStrategy;
|
||||
import org.dromara.daxpay.service.util.PaymentStrategyFactory;
|
||||
@@ -54,14 +56,14 @@ public class AllocReceiverService {
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
public PageResult<AllocReceiverResult> page(PageParam pageParam, AllocReceiverQuery query) {
|
||||
public PageResult<AllocReceiverResultBo> page(PageParam pageParam, AllocReceiverQuery query) {
|
||||
return MpUtil.toPageResult(allocReceiverManager.page(pageParam, query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
public AllocReceiverResult findById(Long id) {
|
||||
public AllocReceiverResultBo findById(Long id) {
|
||||
return allocReceiverManager.findById(id)
|
||||
.map(AllocReceiver::toResult)
|
||||
.orElseThrow(() -> new DataNotExistException("分账接收方不存在"));
|
||||
@@ -74,6 +76,16 @@ public class AllocReceiverService {
|
||||
return allocReceiverManager.existedByReceiverNo(receiverNo, appId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分账接收方列表
|
||||
*/
|
||||
public List<AllocReceiverResult> list(AllocReceiverQueryParam param){
|
||||
List<AllocReceiver> allocReceivers = allocReceiverManager.findAllByChannel(param.getChannel(), param.getAppId());
|
||||
return AllocReceiverConvert.CONVERT.toList(allocReceivers);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加分账接收方并同步到三方支付系统中
|
||||
*/
|
||||
|
Reference in New Issue
Block a user