Merge remote-tracking branch 'origin/master'

This commit is contained in:
sin 2019-03-12 02:04:23 +08:00
commit 8c71163907
9 changed files with 422 additions and 0 deletions

View File

@ -43,6 +43,7 @@
r.create_time, r.pid, r.handler r.create_time, r.pid, r.handler
FROM resource r, role_resource rr FROM resource r, role_resource rr
WHERE r.deleted = 0 WHERE r.deleted = 0
AND rr.deleted = 0
<if test="type != null"> <if test="type != null">
AND r.type = #{type} AND r.type = #{type}
</if> </if>

View File

@ -0,0 +1,43 @@
package cn.iocoder.mall.pay.api.constant;
/**
* 支付通道
*/
public enum PayChannel {
WEIXIN_APP(100, "wx", "微信 App 支付"),
WEIXIN_PUB(100, "wx", "微信 JS API 支付"),
ALIPAY(200, "alipay", "微信支付");
/**
* 渠道编号
*/
private Integer id;
/**
* 编码
*/
private String code;
/**
* 渠道名
*/
private String name;
PayChannel(Integer id, String code, String name) {
this.id = id;
this.code = code;
this.name = name;
}
public Integer getId() {
return id;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}

View File

@ -0,0 +1,15 @@
package cn.iocoder.mall.pay.dataobject;
import cn.iocoder.common.framework.dataobject.BaseDO;
/**
* TODO 支付应用业务线DO
*/
public class PayAppDO extends BaseDO {
/**
* 应用编号
*/
private String id;
}

View File

@ -0,0 +1,24 @@
package cn.iocoder.mall.pay.dataobject;
/**
* 交易日志 DO
*
* 通过该日志我们可以追溯整个执行过程
*
* TODO 芋艿后面在捉摸
*/
public class PayLogDO {
/**
* 编号自增
*/
private Integer id;
/**
* 应用编号
*/
private String appId;
/**
* 业务线订单编号
*/
private Integer orderId;
}

View File

@ -0,0 +1,7 @@
package cn.iocoder.mall.pay.dataobject;
/**
*
*/
public class PayNotifyAppLogDO {
}

View File

@ -0,0 +1,4 @@
package cn.iocoder.mall.pay.dataobject;
public class PayRefundDO {
}

View File

@ -0,0 +1,7 @@
package cn.iocoder.mall.pay.dataobject;
/**
* TODO 重复支付的交易
*/
public class PayRepeatTransactionDO {
}

View File

@ -0,0 +1,215 @@
package cn.iocoder.mall.pay.dataobject;
import cn.iocoder.common.framework.dataobject.BaseDO;
import java.util.Date;
/**
* 支付交易 DO
*/
public class PayTransactionDO extends BaseDO {
/**
* 编号自增
*/
private Integer id;
/**
* 应用编号
*
* 不同业务线分配不同的 appId
* 举个例子
* 1. 电商系统的订单appId = 1024
* 2. 活动系统的订单appId = 2048
*/
private String appId;
/**
* 发起交易的 IP
*/
private String createIp;
/**
* 业务线的订单编号
*
* 1. 使用 String 的原因是业务线可能使用 String 做为编号
* 2. 每个 appId orderId 唯一
*/
private String orderId;
/**
* 订单状态
*
* 0 等待支付
* 1 待付款完成
* 2 该笔交易已关闭 TODO 交易关闭是不是订单系统触发
* -1 支付失败 TODO 怎么触发
*/
private Integer orderStatus;
/**
* 订单商品名
*/
private String orderSubject;
/**
* 订单商品描述
*/
private String orderDescription;
/**
* 订单备注
*/
private String orderMemo;
/**
* 支付金额单位
*
* TODO 暂时不考虑货币类型
*/
private Integer price;
/**
* 交易过期时间
*/
private Integer expireTime;
// TODO return url
// TODO notify url
/**
* 支付成功的支付渠道
*/
private Integer payChannel;
/**
* 第三方支付成功的时间
*/
private Date paymentTime;
/**
* 收到第三方系统通知的时间
*
* 一般情况下即第三方系统的异步通知
*/
private Date notifyTime;
/**
* 第三方的流水号
*/
private String tradeNo;
public Integer getId() {
return id;
}
public PayTransactionDO setId(Integer id) {
this.id = id;
return this;
}
public String getAppId() {
return appId;
}
public PayTransactionDO setAppId(String appId) {
this.appId = appId;
return this;
}
public String getCreateIp() {
return createIp;
}
public PayTransactionDO setCreateIp(String createIp) {
this.createIp = createIp;
return this;
}
public String getOrderId() {
return orderId;
}
public PayTransactionDO setOrderId(String orderId) {
this.orderId = orderId;
return this;
}
public Integer getOrderStatus() {
return orderStatus;
}
public PayTransactionDO setOrderStatus(Integer orderStatus) {
this.orderStatus = orderStatus;
return this;
}
public Integer getPrice() {
return price;
}
public PayTransactionDO setPrice(Integer price) {
this.price = price;
return this;
}
public Integer getPayChannel() {
return payChannel;
}
public PayTransactionDO setPayChannel(Integer payChannel) {
this.payChannel = payChannel;
return this;
}
public Integer getExpireTime() {
return expireTime;
}
public PayTransactionDO setExpireTime(Integer expireTime) {
this.expireTime = expireTime;
return this;
}
public Date getPaymentTime() {
return paymentTime;
}
public PayTransactionDO setPaymentTime(Date paymentTime) {
this.paymentTime = paymentTime;
return this;
}
public Date getNotifyTime() {
return notifyTime;
}
public PayTransactionDO setNotifyTime(Date notifyTime) {
this.notifyTime = notifyTime;
return this;
}
public String getTradeNo() {
return tradeNo;
}
public PayTransactionDO setTradeNo(String tradeNo) {
this.tradeNo = tradeNo;
return this;
}
public String getOrderSubject() {
return orderSubject;
}
public PayTransactionDO setOrderSubject(String orderSubject) {
this.orderSubject = orderSubject;
return this;
}
public String getOrderDescription() {
return orderDescription;
}
public PayTransactionDO setOrderDescription(String orderDescription) {
this.orderDescription = orderDescription;
return this;
}
public String getOrderMemo() {
return orderMemo;
}
public PayTransactionDO setOrderMemo(String orderMemo) {
this.orderMemo = orderMemo;
return this;
}
}

View File

@ -0,0 +1,106 @@
package cn.iocoder.mall.pay.dataobject;
import cn.iocoder.common.framework.dataobject.BaseDO;
/**
* 交易扩展表
*/
public class PayTransactionExtensionDO extends BaseDO {
/**
* 编号自增
*/
private Integer id;
/**
* 交易编号 {@link PayTransactionDO#getId()}
*/
private Integer transactionId;
/**
* 选择的支付渠道
*/
private Integer payChannel;
/**
* 生成传输给第三方的订单号
*/
private String transactionCode;
/**
* 发起调用的次数
*
* TODO 芋艿需要去请教下
*/
private Integer callNum;
/**
* 扩展内容
*
* 异步通知的时候填充回调的数据
*/
private String extensionData;
/**
* 发起交易的 IP
*/
private String createIp;
public Integer getId() {
return id;
}
public PayTransactionExtensionDO setId(Integer id) {
this.id = id;
return this;
}
public Integer getTransactionId() {
return transactionId;
}
public PayTransactionExtensionDO setTransactionId(Integer transactionId) {
this.transactionId = transactionId;
return this;
}
public Integer getPayChannel() {
return payChannel;
}
public PayTransactionExtensionDO setPayChannel(Integer payChannel) {
this.payChannel = payChannel;
return this;
}
public String getTransactionCode() {
return transactionCode;
}
public PayTransactionExtensionDO setTransactionCode(String transactionCode) {
this.transactionCode = transactionCode;
return this;
}
public Integer getCallNum() {
return callNum;
}
public PayTransactionExtensionDO setCallNum(Integer callNum) {
this.callNum = callNum;
return this;
}
public String getExtensionData() {
return extensionData;
}
public PayTransactionExtensionDO setExtensionData(String extensionData) {
this.extensionData = extensionData;
return this;
}
public String getCreateIp() {
return createIp;
}
public PayTransactionExtensionDO setCreateIp(String createIp) {
this.createIp = createIp;
return this;
}
}