1
This commit is contained in:
@@ -470,7 +470,6 @@ func makeMainProductSku(db *dao.DaoDB, api *tiktokShop.API, storeSku *dao.StoreS
|
||||
PickupMethod: "0",
|
||||
OuterProductId: utils.Int2Str(storeSku.SkuID), // 本地skuId为外部商品id
|
||||
}
|
||||
globals.SugarLogger.Debugf("--------------2")
|
||||
param.Name = checkNameLenght(param.Name)
|
||||
|
||||
// 获取上传图,商品轮播图
|
||||
@@ -479,27 +478,31 @@ func makeMainProductSku(db *dao.DaoDB, api *tiktokShop.API, storeSku *dao.StoreS
|
||||
failedList = putils.GetErrMsg2FailedSingleList(storeSku, err, storeID, model.VendorChineseNames[model.VendorIDDD], syncType)
|
||||
return
|
||||
}
|
||||
globals.SugarLogger.Debugf("--------------4")
|
||||
param.Pic = img
|
||||
param.Description = detailImg
|
||||
param.WhiteBackGroundPicUrl = whiteImg
|
||||
|
||||
globals.SugarLogger.Debugf("--------------3")
|
||||
// 部分商品没有所属的分类,直接跳过!
|
||||
if storeSku.SkuVendorMapCatID != "" {
|
||||
globals.SugarLogger.Debugf("--------------4")
|
||||
param.CategoryLeafId = utils.Str2Int64(storeSku.SkuVendorMapCatID)
|
||||
} else if len(param.Pic) != 0 { // 自动推导分类id
|
||||
globals.SugarLogger.Debugf("--------------5")
|
||||
var vendorCategoryId int64 = 0
|
||||
vendorCategoryId, _ = api.GetRecommendCategory(strings.Split(img, "|")) // 根据图片推导分类
|
||||
if vendorCategoryId == 0 {
|
||||
vendorCategoryId, _ = api.GetRecommendCategoryByName(storeSku.SkuName) // 根据名字推导分类
|
||||
}
|
||||
globals.SugarLogger.Debugf("--------------6")
|
||||
if vendorCategoryId == 0 || err != nil {
|
||||
failedList = putils.GetErrMsg2FailedSingleList(storeSku, errors.New("当前商品本地未设置抖音分类/抖音推荐分类查询错误:"+err.Error()), storeID, model.VendorChineseNames[model.VendorIDDD], syncType)
|
||||
return
|
||||
}
|
||||
globals.SugarLogger.Debugf("--------------7")
|
||||
param.CategoryLeafId = vendorCategoryId
|
||||
}
|
||||
globals.SugarLogger.Debugf("--------------5")
|
||||
globals.SugarLogger.Debugf("--------------8")
|
||||
// 这个情况是原有商品不存在和推荐查询不到类目id是,使用京西类目和抖音类目的绑定关系
|
||||
// 但是不太实用,导致商品类目错误被暂停营业等
|
||||
//if storeSku.VendorVendorCatID != 0 && param.CategoryLeafId == 0 {
|
||||
@@ -512,7 +515,6 @@ func makeMainProductSku(db *dao.DaoDB, api *tiktokShop.API, storeSku *dao.StoreS
|
||||
} else {
|
||||
param.Supply7dayReturn = 0
|
||||
}
|
||||
globals.SugarLogger.Debugf("--------------6")
|
||||
|
||||
// weight_unit 目前抖音只支持g和kg两种
|
||||
param.WeightUnit = tiktokShop.WeightUint_G
|
||||
@@ -530,7 +532,6 @@ func makeMainProductSku(db *dao.DaoDB, api *tiktokShop.API, storeSku *dao.StoreS
|
||||
return
|
||||
}
|
||||
}
|
||||
globals.SugarLogger.Debugf("--------------7")
|
||||
|
||||
if param.StandardBrandId == 0 {
|
||||
param.StandardBrandId, _ = getTiktokBrandId(api, db, storeSku.Upc, storeSku.UpcBrandName, storeSku.UpcTiktokBrandId, param.CategoryLeafId)
|
||||
@@ -538,13 +539,11 @@ func makeMainProductSku(db *dao.DaoDB, api *tiktokShop.API, storeSku *dao.StoreS
|
||||
if param.StandardBrandId == 0 {
|
||||
param.StandardBrandId = 596120136
|
||||
}
|
||||
globals.SugarLogger.Debugf("--------------8")
|
||||
param.FreightId, param.SaleLimitId, err = getFreightIdAndSaleLimitId(api, db, storeDetail, vendorStoreID)
|
||||
if err != nil {
|
||||
failedList = putils.GetErrMsg2FailedSingleList(storeSku, err, storeID, model.VendorChineseNames[model.VendorIDDD], syncType)
|
||||
return
|
||||
}
|
||||
globals.SugarLogger.Debugf("--------------9")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user