接入微信支付
This commit is contained in:
@ -0,0 +1,21 @@
|
||||
package com.greenorange.promotion.utils;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Random;
|
||||
|
||||
public class RefundUtils {
|
||||
|
||||
// 生成唯一的全额退款单号,格式为 yyyyMMddHHmmssSSS + 随机数
|
||||
public static String generateRefundNo() {
|
||||
// 获取当前时间的时间戳
|
||||
String timestamp = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date());
|
||||
|
||||
// 生成一个 4 位随机数,保证每次退款单号不同
|
||||
int randomNum = new Random().nextInt(9000) + 1000; // 生成1000到9999之间的随机数
|
||||
|
||||
// 拼接退款单号
|
||||
return timestamp + randomNum;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user