银豹更新商品状态和库存接口
This commit is contained in:
@@ -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) {
|
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 {
|
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
|
return failedList, err
|
||||||
}
|
}
|
||||||
@@ -106,6 +116,7 @@ func (p *PurchaseHandler) UpdateStoreSkusPrice(ctx *jxcontext.Context, vendorOrg
|
|||||||
var productInfo = &yinbaoapi.ProductInfo{
|
var productInfo = &yinbaoapi.ProductInfo{
|
||||||
UID: utils.Str2Int64(v.VendorSkuID),
|
UID: utils.Str2Int64(v.VendorSkuID),
|
||||||
SellPrice: utils.Float64ToPointer(jxutils.IntPrice2Standard(v.VendorPrice)),
|
SellPrice: utils.Float64ToPointer(jxutils.IntPrice2Standard(v.VendorPrice)),
|
||||||
|
BuyPrice: utils.Float64ToPointer(jxutils.IntPrice2Standard(v.VendorPrice)),
|
||||||
}
|
}
|
||||||
err = api.YinBaoAPI.UpdateProductInfo(productInfo)
|
err = api.YinBaoAPI.UpdateProductInfo(productInfo)
|
||||||
if err != nil {
|
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) {
|
func (p *PurchaseHandler) UpdateStoreSkusStock(ctx *jxcontext.Context, vendorOrgCode string, storeID int, vendorStoreID string, storeSkuList []*partner.StoreSkuInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
||||||
if globals.EnableYbStoreWrite {
|
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
|
return failedList, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user