1
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
sku_syncStock_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/sku_syncStock/request"
|
||||
tiktokShop "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/tiktok_api"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
@@ -436,7 +435,7 @@ func (p *PurchaseHandler) UpdateStoreSkusSpecTag(ctx *jxcontext.Context, vendorO
|
||||
return err
|
||||
}
|
||||
|
||||
func GetProductAuditList(vendorOrgCode string) (string, error) {
|
||||
func GetProductAuditList(vendorOrgCode string) map[string]string {
|
||||
var page int64 = 1
|
||||
var pageSize int64 = 100
|
||||
|
||||
@@ -451,23 +450,12 @@ func GetProductAuditList(vendorOrgCode string) (string, error) {
|
||||
if strings.Contains(v.AuditReason["综合原因"][0], "该商品类目选择错误,推荐放置在") {
|
||||
list := strings.Split(v.AuditReason["综合原因"][0], `“`)
|
||||
categoryNameList := strings.Split(list[1], "/")
|
||||
vendorCatgory, err := cms.GetVendorCategoriesByName(14, categoryNameList[len(categoryNameList)])
|
||||
if err != nil {
|
||||
return utils.Format4Output(updateCategory, false), err
|
||||
}
|
||||
if vendorCatgory != nil {
|
||||
updateCategory[utils.Int64ToStr(v.ProductId)] = vendorCatgory.VendorCategoryID
|
||||
} else {
|
||||
updateCategory[utils.Int64ToStr(v.ProductId)] = "-1"
|
||||
}
|
||||
updateCategory[utils.Int64ToStr(v.ProductId)] = categoryNameList[len(categoryNameList)]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if len(data) >= 100 {
|
||||
page++
|
||||
}
|
||||
break
|
||||
}
|
||||
globals.SugarLogger.Debugf("=================111:= %s", utils.Format4Output(updateCategory, false))
|
||||
return utils.Format4Output(updateCategory, false), nil
|
||||
return updateCategory
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/tiktok_store"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
)
|
||||
|
||||
@@ -837,7 +838,16 @@ func (c *SkuController) BatchSetRestockingPrice() {
|
||||
// @router /UpdateTiktokCategory [post]
|
||||
func (c *SkuController) UpdateTiktokCategory() {
|
||||
c.callUpdateCategory(func(params *tSkuUpdateCategoryParams) (interface{}, string, error) {
|
||||
data, err := tiktok_store.GetProductAuditList("57939570")
|
||||
return data, "", err
|
||||
data := tiktok_store.GetProductAuditList("57939570")
|
||||
globals.SugarLogger.Debugf("==========111 %s", utils.Format4Output(data, false))
|
||||
for k, v := range data {
|
||||
vendorCatgory, err := cms.GetVendorCategoriesByName(14, v)
|
||||
if err != nil {
|
||||
globals.SugarLogger.Debugf("err := %s", err)
|
||||
}
|
||||
data[k] = vendorCatgory.VendorCategoryID
|
||||
}
|
||||
globals.SugarLogger.Debugf("==========222 %s", utils.Format4Output(data, false))
|
||||
return data, "", nil
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user