fix: 下单接口fix
This commit is contained in:
parent
c5d4c7b989
commit
bdf42ccf99
|
|
@ -15,6 +15,7 @@ type Config struct {
|
|||
Key string
|
||||
}
|
||||
YouleHost string
|
||||
SupplierSkuId map[string]string
|
||||
}
|
||||
|
||||
type Rpc struct {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import (
|
|||
"rs/cmd/api/internal/logic/vo"
|
||||
"rs/rpc/transfer"
|
||||
"rs/untils/httpclient"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
|
|
@ -41,6 +42,13 @@ func (l *YlAsyncLogic) YlAsync(req *types.AsyncReq) (resp *types.AsyncResp, err
|
|||
return nil, fmt.Errorf("extendParam 格式错误")
|
||||
}
|
||||
|
||||
var VoucherId = ""
|
||||
if v, ok := l.svcCtx.Config.SupplierSkuId[strconv.Itoa(int(req.SupplierSkuId))]; ok {
|
||||
VoucherId = v
|
||||
} else {
|
||||
return nil, fmt.Errorf("供货商sku 未配置")
|
||||
}
|
||||
|
||||
reqData = transfer.MarketKeySendReq{
|
||||
AppId: extendParam.AppId,
|
||||
ReqCode: "voucher.create",
|
||||
|
|
@ -48,7 +56,7 @@ func (l *YlAsyncLogic) YlAsync(req *types.AsyncReq) (resp *types.AsyncResp, err
|
|||
ReqSerialNo: req.DeliverOrderNo,
|
||||
Timestamp: time.Unix(req.CreateTime, 0).Format("20060102150405"),
|
||||
PosId: extendParam.PosId,
|
||||
VoucherId: extendParam.VoucherId,
|
||||
VoucherId: VoucherId,
|
||||
VoucherNum: extendParam.Num,
|
||||
MobileNo: extendParam.MobileNo,
|
||||
SendMsg: extendParam.SendMsg,
|
||||
|
|
@ -56,6 +64,7 @@ func (l *YlAsyncLogic) YlAsync(req *types.AsyncReq) (resp *types.AsyncResp, err
|
|||
if reqData.SendMsg == "" {
|
||||
reqData.SendMsg = "2"
|
||||
}
|
||||
|
||||
reqData.Sign = l.svcCtx.Config.Sys.PrimaryKey
|
||||
result, err := l.svcCtx.TransferRpc.MarketKeySend(l.ctx, &reqData)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -35,5 +35,4 @@ type KeySendExtendParam struct {
|
|||
Num int64 `json:"num"`
|
||||
MobileNo string `json:"mobileNo"`
|
||||
SendMsg string `json:"sendMsg"`
|
||||
VoucherId string `json:"voucherId"`
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue