银豹删除商品
This commit is contained in:
@@ -17,13 +17,15 @@ import (
|
||||
)
|
||||
|
||||
func (p *PurchaseHandler) CreateStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
||||
storeSku := storeSkuList[0]
|
||||
buildYbConfigs(storeID)
|
||||
result, err := api.YinBaoAPI.AddProductInfo(buildProductInfoParam(storeSku))
|
||||
if err != nil {
|
||||
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDYB], "创建商品")
|
||||
} else {
|
||||
storeSku.VendorSkuID = utils.Int64ToStr(result.UID)
|
||||
if globals.EnableYbStoreWrite {
|
||||
storeSku := storeSkuList[0]
|
||||
buildYbConfigs(storeID)
|
||||
result, err := api.YinBaoAPI.AddProductInfo(buildProductInfoParam(storeSku))
|
||||
if err != nil {
|
||||
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDYB], "创建商品")
|
||||
} else {
|
||||
storeSku.VendorSkuID = utils.Int64ToStr(result.UID)
|
||||
}
|
||||
}
|
||||
return failedList, err
|
||||
}
|
||||
@@ -32,6 +34,23 @@ func (p *PurchaseHandler) UpdateStoreSkus(ctx *jxcontext.Context, storeID int, v
|
||||
return failedList, err
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) DeleteStoreSkus(ctx *jxcontext.Context, 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),
|
||||
Enable: utils.Int2Pointer(yinbaoapi.SkuStatusDeleted),
|
||||
}
|
||||
err = api.YinBaoAPI.UpdateProductInfo(productInfo)
|
||||
if err != nil {
|
||||
failedList = putils.GetErrMsg2FailedSingleList(storeSkuList, err, storeID, model.VendorChineseNames[model.VendorIDYB], "删除商品")
|
||||
}
|
||||
}
|
||||
}
|
||||
return failedList, err
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) GetStoreSkusFullInfo(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, vendorStoreID string, storeSkuList []*partner.StoreSkuInfo) (skuNameList []*partner.SkuNameInfo, err error) {
|
||||
buildYbConfigs(storeID)
|
||||
if storeSkuList != nil {
|
||||
|
||||
Reference in New Issue
Block a user