This commit is contained in:
苏尹岚
2020-03-23 11:55:52 +08:00
parent fe50ecc7b9
commit 58041e7173

View File

@@ -1,6 +1,8 @@
package yb
import (
"fmt"
"git.rosy.net.cn/baseapi/platformapi/yinbaoapi"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
@@ -17,6 +19,7 @@ var (
func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
storeSku := storeSkuList[0]
fmt.Println(utils.Format4Output(storeSku, false))
api.YinBaoAPI = yinbaoapi.New(storeSku.YbAppKey, storeSku.YbAppID)
result, err := api.YinBaoAPI.AddProductInfo(buildProductInfoParam(storeSku))
if err != nil {
@@ -32,8 +35,8 @@ func (p *PurchaseHandler) UpdateStoreSkus(ctx *jxcontext.Context, storeID int, v
func buildProductInfoParam(storeSku *dao.StoreSkuSyncInfo) (productInfoParam *yinbaoapi.ProductInfoParam) {
var (
buyPrice float64 = utils.Str2Float64(utils.Int64ToStr(storeSku.Price))
sellPrice float64 = utils.Str2Float64(utils.Int64ToStr(storeSku.VendorPrice))
buyPrice float64 = utils.Str2Float64(utils.Int64ToStr(storeSku.Price)) / 100
sellPrice float64 = utils.Str2Float64(utils.Int64ToStr(storeSku.VendorPrice)) / 100
)
productInfoParam = &yinbaoapi.ProductInfoParam{}
productInfo := &yinbaoapi.ProductInfo{