From 0f454239977dc42c1b17a88bef61d9f613235292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 24 Mar 2020 11:17:21 +0800 Subject: [PATCH] =?UTF-8?q?=E9=93=B6=E8=B1=B9=E6=9B=B4=E6=96=B0=E5=95=86?= =?UTF-8?q?=E5=93=81=E7=8A=B6=E6=80=81=E5=92=8C=E5=BA=93=E5=AD=98=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/yb/store_sku.go | 25 +++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/business/partner/purchase/yb/store_sku.go b/business/partner/purchase/yb/store_sku.go index 09ba9b9bd..b8bfb6aa8 100644 --- a/business/partner/purchase/yb/store_sku.go +++ b/business/partner/purchase/yb/store_sku.go @@ -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 }