feat: 订单查询和通知,填写卡密
This commit is contained in:
parent
667651240a
commit
c8b7989838
|
|
@ -9,6 +9,7 @@ import (
|
||||||
"rs/cmd/api/internal/svc"
|
"rs/cmd/api/internal/svc"
|
||||||
"rs/cmd/api/internal/types"
|
"rs/cmd/api/internal/types"
|
||||||
"rs/rpc/transfer"
|
"rs/rpc/transfer"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -76,7 +77,7 @@ func (l *GetOrderLogic) GetOrder(req *types.GetOrderReq) (resp *types.GetOrderRs
|
||||||
Msg: "",
|
Msg: "",
|
||||||
SupplierId: asyncReq.SupplierId,
|
SupplierId: asyncReq.SupplierId,
|
||||||
CardNo: "",
|
CardNo: "",
|
||||||
CardKey: "",
|
CardKey: l.getCode(data.Data.VoucherCode),
|
||||||
CardExpireTime: endTime.Add(23*time.Hour + 59*time.Minute + 59*time.Second).Format(time.DateTime),
|
CardExpireTime: endTime.Add(23*time.Hour + 59*time.Minute + 59*time.Second).Format(time.DateTime),
|
||||||
CardExchangeUrl: data.Data.ShortUrl,
|
CardExchangeUrl: data.Data.ShortUrl,
|
||||||
}
|
}
|
||||||
|
|
@ -124,3 +125,11 @@ func (l *GetOrderLogic) GetOrder2(req *types.GetOrderReq) (resp *types.GetOrderR
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (l *GetOrderLogic) getCode(voucherCode string) string {
|
||||||
|
if strings.Contains(voucherCode, "http") {
|
||||||
|
temp := strings.Split(strings.TrimSpace(voucherCode), "/")
|
||||||
|
return temp[len(temp)-1]
|
||||||
|
}
|
||||||
|
return voucherCode
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@ func (l *YlAsyncLogic) asyncSendMarket(supplierOrderNo string, asyncReq *types.A
|
||||||
Price: asyncReq.Price,
|
Price: asyncReq.Price,
|
||||||
SupplierId: asyncReq.SupplierId,
|
SupplierId: asyncReq.SupplierId,
|
||||||
CardNo: "",
|
CardNo: "",
|
||||||
CardKey: "",
|
CardKey: l.getCode(data.VoucherCode),
|
||||||
CardExpireTime: endTime.Add(23*time.Hour + 59*time.Minute + 59*time.Second).Format(time.DateTime),
|
CardExpireTime: endTime.Add(23*time.Hour + 59*time.Minute + 59*time.Second).Format(time.DateTime),
|
||||||
CardExchangeUrl: data.ShortUrl,
|
CardExchangeUrl: data.ShortUrl,
|
||||||
Sign: "",
|
Sign: "",
|
||||||
|
|
@ -268,3 +268,11 @@ func (l *YlAsyncLogic) updateOrder(req *types.AsyncReq, rsp *transfer.MarketKeyS
|
||||||
l.Logger.Errorf("order = %s 插入订单失败:%v", order, err.Error())
|
l.Logger.Errorf("order = %s 插入订单失败:%v", order, err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (l *YlAsyncLogic) getCode(voucherCode string) string {
|
||||||
|
if strings.Contains(voucherCode, "http") {
|
||||||
|
temp := strings.Split(strings.TrimSpace(voucherCode), "/")
|
||||||
|
return temp[len(temp)-1]
|
||||||
|
}
|
||||||
|
return voucherCode
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue