|
@@ -7,13 +7,14 @@ import (
|
|
|
"eta/eta_mini_crm_ht/models/response"
|
|
|
"eta/eta_mini_crm_ht/utils"
|
|
|
"fmt"
|
|
|
- uuid2 "github.com/google/uuid"
|
|
|
+ "github.com/google/uuid"
|
|
|
"github.com/rdlucklib/rdluck_tools/paging"
|
|
|
"github.com/xuri/excelize/v2"
|
|
|
"math/rand"
|
|
|
"net/http"
|
|
|
"net/url"
|
|
|
"strconv"
|
|
|
+ "strings"
|
|
|
"sync"
|
|
|
"time"
|
|
|
)
|
|
@@ -779,12 +780,12 @@ func (this *OrderController) Refund() {
|
|
|
br.ErrMsg = "退款失败,原订单未完成支付"
|
|
|
return
|
|
|
}
|
|
|
- uuid := uuid2.NewString()
|
|
|
+ uuidStr := strings.ReplaceAll(uuid.New().String(), "-", "")
|
|
|
key := fmt.Sprintf("refund_lock_%s", productOrder.OrderId)
|
|
|
defer func() {
|
|
|
- utils.ReleaseLock(key, uuid)
|
|
|
+ utils.ReleaseLock(key, uuidStr)
|
|
|
}()
|
|
|
- if utils.AcquireLock(key, 10, uuid) {
|
|
|
+ if utils.AcquireLock(key, 10, uuidStr) {
|
|
|
aa := GenerateProductOrderNo()
|
|
|
refundOrder := &models.TradeOrder{
|
|
|
TransactionId: aa,
|
|
@@ -814,7 +815,7 @@ func (this *OrderController) Refund() {
|
|
|
refundflow := models.RefundDealFlow{
|
|
|
ProductOrderNo: productOrder.OrderId,
|
|
|
RefundOrderNo: refundOrder.TransactionId,
|
|
|
- OperatorUserID: this.SysUser.SysUserId,
|
|
|
+ OperatorUserId: this.SysUser.SysUserId,
|
|
|
CreatedTime: time.Now(),
|
|
|
}
|
|
|
//增加一条退款流水
|