|
@@ -9,6 +9,7 @@ import (
|
|
|
"fmt"
|
|
|
"github.com/rdlucklib/rdluck_tools/paging"
|
|
|
"github.com/xuri/excelize/v2"
|
|
|
+ "math/rand"
|
|
|
"net/http"
|
|
|
"net/url"
|
|
|
"strconv"
|
|
@@ -738,8 +739,9 @@ func (this *OrderController) Refund() {
|
|
|
br.ErrMsg = "退款失败,原订单未完成支付"
|
|
|
return
|
|
|
}
|
|
|
+ aa := GenerateProductOrderNo()
|
|
|
refundOrder := &models.TradeOrder{
|
|
|
- TransactionId: productOrder.TradeNO,
|
|
|
+ TransactionId: aa,
|
|
|
OrgTransactionId: productOrder.TradeNO,
|
|
|
ProductOrderId: productOrder.OrderID,
|
|
|
PaymentAccount: tradeOrder.PaymentAccount,
|
|
@@ -767,6 +769,15 @@ func (this *OrderController) Refund() {
|
|
|
br.Success = true
|
|
|
br.Msg = "退款处理成功"
|
|
|
}
|
|
|
+func GenerateProductOrderNo() string {
|
|
|
+ timestamp := time.Now().UnixNano() / 1000000 // 毫秒级时间戳
|
|
|
+ // 生成随机数
|
|
|
+ rand.New(rand.NewSource(time.Now().UnixNano()))
|
|
|
+ randomPart := rand.Intn(999999)
|
|
|
+ // 格式化订单号
|
|
|
+ orderNumber := fmt.Sprintf("R%d%06d", timestamp, randomPart)
|
|
|
+ return orderNumber
|
|
|
+}
|
|
|
|
|
|
// RefundDetail
|
|
|
// @Title 退款详情
|