This commit is contained in:
邹宗楠
2025-02-12 17:18:50 +08:00
parent 98e77a68cc
commit 1ed8af5d8d
2 changed files with 0 additions and 12 deletions

View File

@@ -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) { 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) shopInfo, err := api.FnAPI.GetStore(vendorStoreID)
globals.SugarLogger.Debugf("-----shopInfo := %s", utils.Format4Output(shopInfo, false))
globals.SugarLogger.Debugf("-----err := %v", err)
if err == nil { if err == nil {
storeDetail = &dao.StoreDetail2{ storeDetail = &dao.StoreDetail2{
Store: model.Store{ Store: model.Store{

View File

@@ -5,7 +5,6 @@ import (
"errors" "errors"
"fmt" "fmt"
product_addV2_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_addV2/response" 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" beego "github.com/astaxie/beego/server/web"
"strings" "strings"
"time" "time"
@@ -152,9 +151,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
} }
if len(localThing) == 0 { if len(localThing) == 0 {
globals.SugarLogger.Debugf("--------------1")
param, failedList2 := makeMainProductSku(db, api, storeSku, storeDetail, storeID, vendorStoreID, syncType) param, failedList2 := makeMainProductSku(db, api, storeSku, storeDetail, storeID, vendorStoreID, syncType)
globals.SugarLogger.Debugf("--------------2")
if len(failedList2) != 0 { if len(failedList2) != 0 {
storeSku.SkuSyncStatus = model.SyncFlagNewMask // 只创建主品,子品都没做 storeSku.SkuSyncStatus = model.SyncFlagNewMask // 只创建主品,子品都没做
failedList = append(failedList, failedList2...) failedList = append(failedList, failedList2...)
@@ -482,27 +479,21 @@ func makeMainProductSku(db *dao.DaoDB, api *tiktokShop.API, storeSku *dao.StoreS
param.Description = detailImg param.Description = detailImg
param.WhiteBackGroundPicUrl = whiteImg param.WhiteBackGroundPicUrl = whiteImg
globals.SugarLogger.Debugf("--------------3")
// 部分商品没有所属的分类,直接跳过! // 部分商品没有所属的分类,直接跳过!
if storeSku.SkuVendorMapCatID != "" { if storeSku.SkuVendorMapCatID != "" {
globals.SugarLogger.Debugf("--------------4")
param.CategoryLeafId = utils.Str2Int64(storeSku.SkuVendorMapCatID) param.CategoryLeafId = utils.Str2Int64(storeSku.SkuVendorMapCatID)
} else if len(param.Pic) != 0 { // 自动推导分类id } else if len(param.Pic) != 0 { // 自动推导分类id
globals.SugarLogger.Debugf("--------------5")
var vendorCategoryId int64 = 0 var vendorCategoryId int64 = 0
vendorCategoryId, _ = api.GetRecommendCategory(strings.Split(img, "|")) // 根据图片推导分类 vendorCategoryId, _ = api.GetRecommendCategory(strings.Split(img, "|")) // 根据图片推导分类
if vendorCategoryId == 0 { if vendorCategoryId == 0 {
vendorCategoryId, _ = api.GetRecommendCategoryByName(storeSku.SkuName) // 根据名字推导分类 vendorCategoryId, _ = api.GetRecommendCategoryByName(storeSku.SkuName) // 根据名字推导分类
} }
globals.SugarLogger.Debugf("--------------6")
if vendorCategoryId == 0 || err != nil { if vendorCategoryId == 0 || err != nil {
failedList = putils.GetErrMsg2FailedSingleList(storeSku, errors.New("当前商品本地未设置抖音分类/抖音推荐分类查询错误"), storeID, model.VendorChineseNames[model.VendorIDDD], syncType) failedList = putils.GetErrMsg2FailedSingleList(storeSku, errors.New("当前商品本地未设置抖音分类/抖音推荐分类查询错误"), storeID, model.VendorChineseNames[model.VendorIDDD], syncType)
return return
} }
globals.SugarLogger.Debugf("--------------7")
param.CategoryLeafId = vendorCategoryId param.CategoryLeafId = vendorCategoryId
} }
globals.SugarLogger.Debugf("--------------8")
// 这个情况是原有商品不存在和推荐查询不到类目id是,使用京西类目和抖音类目的绑定关系 // 这个情况是原有商品不存在和推荐查询不到类目id是,使用京西类目和抖音类目的绑定关系
// 但是不太实用,导致商品类目错误被暂停营业等 // 但是不太实用,导致商品类目错误被暂停营业等
//if storeSku.VendorVendorCatID != 0 && param.CategoryLeafId == 0 { //if storeSku.VendorVendorCatID != 0 && param.CategoryLeafId == 0 {