京西京东商城测试

This commit is contained in:
苏尹岚
2020-09-04 10:25:03 +08:00
parent baa7d3acfa
commit 6ced693fc8

View File

@@ -6,6 +6,8 @@ import (
"math" "math"
"time" "time"
"git.rosy.net.cn/jx-callback/business/model/dao"
"git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
"git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model"
@@ -54,6 +56,7 @@ func (c *PurchaseHandler) PartRefundOrder(ctx *jxcontext.Context, order *model.G
var ( var (
skuMap = make(map[int]*model.OrderSku) skuMap = make(map[int]*model.OrderSku)
salePrice int64 salePrice int64
db = dao.GetDB()
) )
for _, sku := range order.Skus { for _, sku := range order.Skus {
skuMap[sku.SkuID] = sku skuMap[sku.SkuID] = sku
@@ -82,6 +85,10 @@ func (c *PurchaseHandler) PartRefundOrder(ctx *jxcontext.Context, order *model.G
VendorSkuID: utils.Int2Str(sku.SkuID), VendorSkuID: utils.Int2Str(sku.SkuID),
SkuID: sku.SkuID, SkuID: sku.SkuID,
} }
storeSkus, _ := dao.GetStoresSkusInfo(db, []int{model.JdShopMainStoreID}, []int{sku.SkuID})
if len(storeSkus) > 0 {
orderSku.VendorSkuID = utils.Int64ToStr(storeSkus[0].JdsID)
}
if skuMap[sku.SkuID] != nil { if skuMap[sku.SkuID] != nil {
orderSku.Name = skuMap[sku.SkuID].SkuName orderSku.Name = skuMap[sku.SkuID].SkuName
orderSku.UserMoney = skuMap[sku.SkuID].SalePrice * int64(sku.Count) orderSku.UserMoney = skuMap[sku.SkuID].SalePrice * int64(sku.Count)