feat:额外收费
This commit is contained in:
1 parent
54a431891a
commit
33ff7edc2e
46 files changed
+955
-26
No files matched your search
+27
@@ -0,0 +1,27 @@
|
||||
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 ThirdPayOrderBizTypeEnum {
|
||||
|
||||
MINI_APP_WALLET_RECHARGE("10", "小程序用户钱包充值"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static ThirdPayOrderBizTypeEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
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 ThirdPayOrderStatusEnum {
|
||||
PAY_UNPAID("10", "未支付"),
|
||||
PAY_SUCCESS("20", "支付成功"),
|
||||
PAY_FAILED("30", "已经支付"),
|
||||
|
||||
REFUNDING("100", "退款中"),
|
||||
REFUND_SUCCESS("200", "退款成功"),
|
||||
REFUND_FAILED("300", "退款失败"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static ThirdPayOrderStatusEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+14
-1
@@ -1,6 +1,7 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.oathmini;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.constant.miniplatform.MiniPlatformTypeEnum;
|
||||
import com.bsd.pjcloud.thirdparty.constant.pay.ThirdPayOrderBizTypeEnum;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
@@ -8,6 +9,19 @@ import lombok.Data;
|
||||
@Data
|
||||
public class ThirdMiniAppPayDto {
|
||||
|
||||
/**
|
||||
* 充值业务类型
|
||||
*/
|
||||
@NotNull(message = "充值业务类型不能为空")
|
||||
private ThirdPayOrderBizTypeEnum bizType;
|
||||
|
||||
/**
|
||||
* 充值业务id
|
||||
*/
|
||||
@NotEmpty(message = "充值业务id不能为空")
|
||||
private String bizId;
|
||||
|
||||
|
||||
/**
|
||||
* 小程序平台
|
||||
*/
|
||||
@@ -17,7 +31,6 @@ public class ThirdMiniAppPayDto {
|
||||
/**
|
||||
* 金额(分)
|
||||
*/
|
||||
@NotNull(message = "金额(分)不能为空")
|
||||
private Integer amount;
|
||||
|
||||
/**
|
||||
|
||||
+16
@@ -1,5 +1,6 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.oathmini.pay.wechat;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.constant.pay.ThirdPayOrderBizTypeEnum;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -8,11 +9,26 @@ import lombok.Data;
|
||||
@Data
|
||||
public class ThirdMiniJsapiPayDto {
|
||||
|
||||
/**
|
||||
* 充值业务类型
|
||||
*/
|
||||
private ThirdPayOrderBizTypeEnum bizType;
|
||||
|
||||
/**
|
||||
* 充值业务id
|
||||
*/
|
||||
private String bizId;
|
||||
|
||||
/**
|
||||
* 商户订单号
|
||||
*/
|
||||
private String outTradeNo;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户标识
|
||||
*/
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.pay;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.entity.pay.ThirdPayOrderEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ThirdPayOrderDto extends ThirdPayOrderEntity {
|
||||
|
||||
}
|
||||
Vendored
Executable
+155
@@ -0,0 +1,155 @@
|
||||
package com.bsd.pjcloud.thirdparty.entity.pay;
|
||||
|
||||
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_order")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "第三方支付订单")
|
||||
public class ThirdPayOrderEntity extends Model<ThirdPayOrderEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 支付平台类型
|
||||
*/
|
||||
@Schema(description = "支付平台类型")
|
||||
private String payPlatformType;
|
||||
|
||||
/**
|
||||
* 支付类型
|
||||
*/
|
||||
@Schema(description = "支付类型")
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* 支付相关id
|
||||
*/
|
||||
@Schema(description = "支付相关id")
|
||||
private String bizId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户code
|
||||
*/
|
||||
@Schema(description = "用户code")
|
||||
private String userCode;
|
||||
|
||||
/**
|
||||
* 支付金额(分)
|
||||
*/
|
||||
@Schema(description = "支付金额(分)")
|
||||
private Integer price;
|
||||
|
||||
/**
|
||||
* 支付状态
|
||||
*/
|
||||
@Schema(description = "支付状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 支付订单号
|
||||
*/
|
||||
@Schema(description = "支付订单号")
|
||||
private String payNo;
|
||||
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
@Schema(description = "支付时间")
|
||||
private LocalDateTime payTime;
|
||||
|
||||
/**
|
||||
* 支付返回
|
||||
*/
|
||||
@Schema(description = "支付返回")
|
||||
private String payRes;
|
||||
|
||||
/**
|
||||
* 退款订单号
|
||||
*/
|
||||
@Schema(description = "退款订单号")
|
||||
private String refundNo;
|
||||
|
||||
/**
|
||||
* 退款时间
|
||||
*/
|
||||
@Schema(description = "退款时间")
|
||||
private LocalDateTime refundTime;
|
||||
|
||||
/**
|
||||
* 退款返回
|
||||
*/
|
||||
@Schema(description = "退款返回")
|
||||
private String refundRes;
|
||||
|
||||
/**
|
||||
* 订单过期时间
|
||||
*/
|
||||
@Schema(description = "订单过期时间")
|
||||
private LocalDateTime expireTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.oathmini.pay;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@Data
|
||||
public class ThirdMiniAppPayVo {
|
||||
|
||||
private HashMap<String, Object> miniAppPayParams;
|
||||
|
||||
}
|
||||
+4
@@ -3,6 +3,8 @@ package com.bsd.pjcloud.thirdparty.vo.oathmini.pay.wechat;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* JSAPI/小程序下单
|
||||
*/
|
||||
@@ -37,6 +39,8 @@ public class ThirdMiniJsapiPayVo {
|
||||
|
||||
private String code_url;
|
||||
|
||||
private HashMap<String, Object> miniAppPayParams;
|
||||
|
||||
public boolean isHttpSucess() {
|
||||
return ObjectUtil.equals(ThirdMiniWechatQueryVo.SUCCESS, return_code);
|
||||
}
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.pay;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.entity.pay.ThirdPayOrderEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ThirdPayOrderVo extends ThirdPayOrderEntity {
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user