feat:第三方支付日志
This commit is contained in:
1 parent
4f3a8c1883
commit
3c20ebf10a
16 files changed
+547
No files matched your search
+28
@@ -0,0 +1,28 @@
|
||||
package com.bsd.pjcloud.thirdparty.constant.pay;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 第三方统一支付类型
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum ThirdPayBizTypeEnum {
|
||||
|
||||
LB_PAY("10", "宁波银行支付"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static ThirdPayBizTypeEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.bsd.pjcloud.thirdparty.constant.pay;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 支付状态返回枚举
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum ThirdPayVoStatusEnum {
|
||||
|
||||
SUCCESS(200, "成功"),
|
||||
SIGN_ERROR(400, "签名验证失败"),
|
||||
USER_EXIST(501, "用户不存在"),
|
||||
ORDER_EXIST(502, "订单不存在"),
|
||||
BALANCE_NOT_ENOUGH(505, "用户余额不足"),
|
||||
;
|
||||
|
||||
private final int type;
|
||||
private final String description;
|
||||
|
||||
public static ThirdPayVoStatusEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.pay;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.constant.pay.ThirdPayBizTypeEnum;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PayDto {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 第三方唯一id
|
||||
*/
|
||||
private String thirdOrderId;
|
||||
|
||||
/**
|
||||
* 第三方统一支付类型
|
||||
*/
|
||||
private ThirdPayBizTypeEnum bizType;
|
||||
|
||||
/**
|
||||
* 扣款金额(分)
|
||||
*/
|
||||
private Integer money;
|
||||
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.pay;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RefundDto {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 平台唯一订单号
|
||||
*/
|
||||
private String platformOrderId;
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.pay;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.entity.api.ThirdPayLogEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Data
|
||||
public class ThirdPayLogDto extends ThirdPayLogEntity {
|
||||
|
||||
private LocalDate[] createTimeList;
|
||||
|
||||
}
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
package com.bsd.pjcloud.thirdparty.entity.api;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 第三方支付日志
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("third_pay_log")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "第三方支付日志")
|
||||
public class ThirdPayLogEntity extends Model<ThirdPayLogEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 支付发起方类型id
|
||||
*/
|
||||
@Schema(description="支付发起方类型id")
|
||||
private String paySourceType;
|
||||
|
||||
/**
|
||||
* 支付类型
|
||||
*/
|
||||
@Schema(description="支付类型")
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* 支付类型id
|
||||
*/
|
||||
@Schema(description="支付类型id")
|
||||
private String bizId;
|
||||
|
||||
/**
|
||||
* api-url
|
||||
*/
|
||||
@Schema(description="api-url")
|
||||
private String apiUrl;
|
||||
|
||||
/**
|
||||
* res
|
||||
*/
|
||||
@Schema(description="res")
|
||||
private String res;
|
||||
|
||||
/**
|
||||
* req
|
||||
*/
|
||||
@Schema(description="req")
|
||||
private String req;
|
||||
|
||||
/**
|
||||
* 调用错误
|
||||
*/
|
||||
@Schema(description="调用错误")
|
||||
private String error;
|
||||
|
||||
/**
|
||||
* 耗时(毫秒)
|
||||
*/
|
||||
@Schema(description="耗时(毫秒)")
|
||||
private String timeConsuming;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="删除时间")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* tenantId
|
||||
*/
|
||||
@Schema(description="tenantId")
|
||||
private Long tenantId;
|
||||
}
|
||||
pjcloud-thirdparty/pjcloud-thirdparty-api/src/main/java/com/bsd/pjcloud/thirdparty/vo/pay/PayVo.java
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.pay;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class PayVo {
|
||||
|
||||
/**
|
||||
* 平台唯一订单号
|
||||
*/
|
||||
private String platformOrderId;
|
||||
|
||||
/**
|
||||
* 第三方唯一订单号
|
||||
*/
|
||||
private String thirdOrderId;
|
||||
|
||||
/**
|
||||
* 平台支付时间
|
||||
*/
|
||||
private LocalDateTime payTime;
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.pay;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class RefundVo {
|
||||
|
||||
/**
|
||||
* 平台唯一订单号
|
||||
*/
|
||||
private String platformOrderId;
|
||||
|
||||
/**
|
||||
* 平台唯一退款单号
|
||||
*/
|
||||
private String platformRefundId;
|
||||
|
||||
/**
|
||||
* 第三方唯一订单号
|
||||
*/
|
||||
private String thirdOrderId;
|
||||
|
||||
/**
|
||||
* 退款时间
|
||||
*/
|
||||
private LocalDateTime refundTime;
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user