1
This commit is contained in:
@@ -118,10 +118,11 @@ func CreateWayOrder(ctx *jxcontext.Context, param *model.MakeOrderParamReq, user
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 第三方数据创建成功,则创建本地数据
|
// 第三方数据创建成功,则创建本地数据
|
||||||
|
random := RandomString(5)
|
||||||
vendorOrder := &model.UserVendorOrder{
|
vendorOrder := &model.UserVendorOrder{
|
||||||
UserId: userId,
|
UserId: userId,
|
||||||
LocalWayBill: utils.Int64ToStr(time.Now().Unix()) + userId[:4], // 当前时间秒数加用户ID前四位
|
LocalWayBill: utils.Int64ToStr(time.Now().Unix()) + userId[:4] + random, // 当前时间秒数加用户ID前四位
|
||||||
OtherWayBill: utils.Int64ToStr(time.Now().Unix()) + userId[:4],
|
OtherWayBill: utils.Int64ToStr(time.Now().Unix()) + userId[:4] + random,
|
||||||
PromiseTimeType: param.PromiseTimeType,
|
PromiseTimeType: param.PromiseTimeType,
|
||||||
DeliveryType: param.DeliveryType,
|
DeliveryType: param.DeliveryType,
|
||||||
Goods: param.Goods,
|
Goods: param.Goods,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
bida "git.rosy.net.cn/baseapi/platformapi/q_bida"
|
bida "git.rosy.net.cn/baseapi/platformapi/q_bida"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
"git.rosy.net.cn/jx-callback/globals/api"
|
"git.rosy.net.cn/jx-callback/globals/api"
|
||||||
|
"math/rand"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 检查快递费是否正确
|
// 检查快递费是否正确
|
||||||
@@ -39,3 +40,15 @@ func createOtherOrder(param *bida.MakeOrderReq) (string, error) {
|
|||||||
// 创建三方订单
|
// 创建三方订单
|
||||||
return api.QBiDaAPI.CreateOrder(param)
|
return api.QBiDaAPI.CreateOrder(param)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RandomString 生成随机字符串
|
||||||
|
func RandomString(n int) string {
|
||||||
|
var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
|
||||||
|
|
||||||
|
b := make([]rune, n)
|
||||||
|
for i := range b {
|
||||||
|
b[i] = letters[rand.Intn(len(letters))]
|
||||||
|
}
|
||||||
|
|
||||||
|
return string(b)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user