银豹更新商品状态和库存接口

This commit is contained in:
苏尹岚
2020-03-24 11:17:21 +08:00
parent 1922939b5a
commit 0f45423997

View File

@@ -94,7 +94,17 @@ func (p *PurchaseHandler) GetStoreSkusFullInfo(ctx *jxcontext.Context, parentTas
func (p *PurchaseHandler) UpdateStoreSkusStatus(ctx *jxcontext.Context, vendorOrgCode string, storeID int, vendorStoreID string, storeSkuList []*partner.StoreSkuInfo, status int) (failedList []*partner.StoreSkuInfoWithErr, err error) {
if globals.EnableYbStoreWrite {
buildYbConfigs(storeID)
for _, v := range storeSkuList {
var productInfo = &yinbaoapi.ProductInfo{
UID: utils.Str2Int64(v.VendorSkuID),
Enable: utils.Int2Pointer(ybSkuStatus2Jx(v.Status)),
}
err = api.YinBaoAPI.UpdateProductInfo(productInfo)
if err != nil {
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDYB], "更新商品状态")
}
}
}
return failedList, err
}
@@ -106,6 +116,7 @@ func (p *PurchaseHandler) UpdateStoreSkusPrice(ctx *jxcontext.Context, vendorOrg
var productInfo = &yinbaoapi.ProductInfo{
UID: utils.Str2Int64(v.VendorSkuID),
SellPrice: utils.Float64ToPointer(jxutils.IntPrice2Standard(v.VendorPrice)),
BuyPrice: utils.Float64ToPointer(jxutils.IntPrice2Standard(v.VendorPrice)),
}
err = api.YinBaoAPI.UpdateProductInfo(productInfo)
if err != nil {
@@ -118,7 +129,17 @@ func (p *PurchaseHandler) UpdateStoreSkusPrice(ctx *jxcontext.Context, vendorOrg
func (p *PurchaseHandler) UpdateStoreSkusStock(ctx *jxcontext.Context, vendorOrgCode string, storeID int, vendorStoreID string, storeSkuList []*partner.StoreSkuInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
if globals.EnableYbStoreWrite {
buildYbConfigs(storeID)
for _, v := range storeSkuList {
var productInfo = &yinbaoapi.ProductInfo{
UID: utils.Str2Int64(v.VendorSkuID),
Stock: utils.Float64ToPointer(utils.Str2Float64(utils.Int2Str(v.Stock))),
}
err = api.YinBaoAPI.UpdateProductInfo(productInfo)
if err != nil {
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDYB], "更新商品库存")
}
}
}
return failedList, err
}