接入微信支付

This commit is contained in:
2025-06-30 20:46:59 +08:00
parent 6c248d1da3
commit f094f58159
6 changed files with 480 additions and 4 deletions

View File

@ -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;
}
}