1
This commit is contained in:
@@ -83,10 +83,7 @@ func shopStatus2JX(status int) (jxStatus int) {
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) GetStore(ctx *jxcontext.Context, storeID int, vendorStoreID string) (storeDetail *dao.StoreDetail2, err error) {
|
||||
globals.SugarLogger.Debugf("-----vendorstoreId := %s", vendorStoreID)
|
||||
shopInfo, err := api.FnAPI.GetStore(vendorStoreID)
|
||||
globals.SugarLogger.Debugf("-----shopInfo := %s", utils.Format4Output(shopInfo, false))
|
||||
globals.SugarLogger.Debugf("-----err := %v", err)
|
||||
if err == nil {
|
||||
storeDetail = &dao.StoreDetail2{
|
||||
Store: model.Store{
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
product_addV2_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_addV2/response"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
beego "github.com/astaxie/beego/server/web"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -152,9 +151,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
}
|
||||
|
||||
if len(localThing) == 0 {
|
||||
globals.SugarLogger.Debugf("--------------1")
|
||||
param, failedList2 := makeMainProductSku(db, api, storeSku, storeDetail, storeID, vendorStoreID, syncType)
|
||||
globals.SugarLogger.Debugf("--------------2")
|
||||
if len(failedList2) != 0 {
|
||||
storeSku.SkuSyncStatus = model.SyncFlagNewMask // 只创建主品,子品都没做
|
||||
failedList = append(failedList, failedList2...)
|
||||
@@ -482,27 +479,21 @@ func makeMainProductSku(db *dao.DaoDB, api *tiktokShop.API, storeSku *dao.StoreS
|
||||
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("当前商品本地未设置抖音分类/抖音推荐分类查询错误"), storeID, model.VendorChineseNames[model.VendorIDDD], syncType)
|
||||
return
|
||||
}
|
||||
globals.SugarLogger.Debugf("--------------7")
|
||||
param.CategoryLeafId = vendorCategoryId
|
||||
}
|
||||
globals.SugarLogger.Debugf("--------------8")
|
||||
// 这个情况是原有商品不存在和推荐查询不到类目id是,使用京西类目和抖音类目的绑定关系
|
||||
// 但是不太实用,导致商品类目错误被暂停营业等
|
||||
//if storeSku.VendorVendorCatID != 0 && param.CategoryLeafId == 0 {
|
||||
|
||||
Reference in New Issue
Block a user