-
Notifications
You must be signed in to change notification settings - Fork 930
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2.账单类型定义与实现 3.微信小程序领红包实现 4.代码优化
- Loading branch information
Showing
31 changed files
with
1,618 additions
and
628 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
pay-java-ali/src/main/java/com/egzosn/pay/ali/bean/AliPayBillType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
package com.egzosn.pay.ali.bean; | ||
|
||
import com.egzosn.pay.common.bean.BillType; | ||
import com.egzosn.pay.common.util.DateUtils; | ||
|
||
/** | ||
* 支付宝账单类型 | ||
* @author Egan | ||
* <pre> | ||
* email [email protected] | ||
* date 2021/2/22 | ||
* </pre> | ||
*/ | ||
public enum AliPayBillType implements BillType { | ||
/** | ||
* 商户基于支付宝交易收单的业务账单;每日账单 | ||
*/ | ||
TRADE_DAY("trade", DateUtils.YYYY_MM_DD), | ||
/** | ||
* 商户基于支付宝交易收单的业务账单;每月账单 | ||
*/ | ||
TRADE_MONTH("trade", DateUtils.YYYY_MM), | ||
/** | ||
* 基于商户支付宝余额收入及支出等资金变动的帐务账单;每日账单 | ||
*/ | ||
SIGNCUSTOMER_DAY("signcustomer", DateUtils.YYYY_MM_DD), | ||
/** | ||
* 基于商户支付宝余额收入及支出等资金变动的帐务账单;每月账单 | ||
*/ | ||
SIGNCUSTOMER_MONTH("signcustomer", DateUtils.YYYY_MM), | ||
|
||
; | ||
|
||
/** | ||
* 账单类型 | ||
*/ | ||
private String type; | ||
/** | ||
* 日期格式化表达式 | ||
*/ | ||
private String datePattern; | ||
|
||
AliPayBillType(String type, String datePattern) { | ||
this.type = type; | ||
this.datePattern = datePattern; | ||
} | ||
|
||
/** | ||
* 获取类型名称 | ||
* | ||
* @return 类型 | ||
*/ | ||
@Override | ||
public String getType() { | ||
return type; | ||
} | ||
|
||
/** | ||
* 获取类型对应的日期格式化表达式 | ||
* | ||
* @return 日期格式化表达式 | ||
*/ | ||
@Override | ||
public String getDatePattern() { | ||
return datePattern; | ||
} | ||
|
||
/** | ||
* 获取文件类型 | ||
* | ||
* @return 文件类型 | ||
*/ | ||
@Override | ||
public String getFileType() { | ||
return null; | ||
} | ||
|
||
|
||
/** | ||
* 自定义属性 | ||
* | ||
* @return 自定义属性 | ||
*/ | ||
@Override | ||
public String getCustom() { | ||
return null; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
pay-java-baidu/src/main/java/com/egzosn/pay/baidu/bean/BaiduBillType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
package com.egzosn.pay.baidu.bean; | ||
|
||
import com.egzosn.pay.common.bean.BillType; | ||
import com.egzosn.pay.common.util.DateUtils; | ||
import com.egzosn.pay.common.util.str.StringUtils; | ||
|
||
/** | ||
* 百度 | ||
* @author Egan | ||
* <pre> | ||
* email [email protected] | ||
* date 2021/2/22 | ||
* </pre> | ||
*/ | ||
public class BaiduBillType implements BillType { | ||
/** | ||
* 用户accessToken | ||
*/ | ||
private String accessToken; | ||
/** | ||
* 值为DOWNLOAD_ORDER_BILL与DOWNLOAD_BILL | ||
* com.egzosn.pay.baidu.bean.BaiduTransactionType#DOWNLOAD_ORDER_BILL | ||
* com.egzosn.pay.baidu.bean.BaiduTransactionType#DOWNLOAD_BILL | ||
*/ | ||
private String type; | ||
|
||
private String datePattern; | ||
|
||
public String getAccessToken() { | ||
return accessToken; | ||
} | ||
|
||
public void setAccessToken(String accessToken) { | ||
this.accessToken = accessToken; | ||
} | ||
|
||
public void setType(String type) { | ||
this.type = type; | ||
} | ||
|
||
/** | ||
* 获取类型名称 | ||
* | ||
* @return 类型 | ||
*/ | ||
@Override | ||
public String getType() { | ||
return type; | ||
} | ||
|
||
/** | ||
* 获取类型对应的日期格式化表达式 | ||
* | ||
* @return 日期格式化表达式 | ||
*/ | ||
@Override | ||
public String getDatePattern() { | ||
if (StringUtils.isEmpty(datePattern)){ | ||
datePattern = DateUtils.YYYY_MM_DD; | ||
} | ||
return datePattern; | ||
} | ||
|
||
/** | ||
* 获取文件类型 | ||
* | ||
* @return 文件类型 | ||
*/ | ||
@Override | ||
public String getFileType() { | ||
return null; | ||
} | ||
|
||
public void setDatePattern(String datePattern) { | ||
this.datePattern = datePattern; | ||
} | ||
|
||
|
||
|
||
/** | ||
* 自定义属性 | ||
* | ||
* @return 自定义属性 | ||
*/ | ||
@Override | ||
public String getCustom() { | ||
return accessToken; | ||
} | ||
|
||
public BaiduBillType() { | ||
} | ||
|
||
public BaiduBillType(String accessToken) { | ||
this.accessToken = accessToken; | ||
} | ||
|
||
public BaiduBillType(String accessToken, String type) { | ||
this.accessToken = accessToken; | ||
this.type = type; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.