1
This commit is contained in:
@@ -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"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode"
|
||||
@@ -158,21 +157,16 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
continue
|
||||
}
|
||||
tiktokResult, errCreate := api.CreateStoreCommodity(param) // 创建主商品,同步主商品
|
||||
globals.SugarLogger.Debugf("========tiktokResult ;= %s", utils.Format4Output(tiktokResult, false))
|
||||
if tiktokResult == nil {
|
||||
tiktokResult = &product_addV2_response.ProductAddV2Data{}
|
||||
}
|
||||
if errCreate != nil {
|
||||
if strings.Contains(errCreate.Error(), "outProductId或者outerProductId已经存在") { // 主品以创建但是未返回出来
|
||||
mainProductDetail, _ := api.GetSkuDetail("", utils.Int2Str(storeSku.SkuID))
|
||||
globals.SugarLogger.Debugf("========v ;= %s", utils.Format4Output(mainProductDetail != nil, false))
|
||||
globals.SugarLogger.Debugf("========v ;= %s", utils.Format4Output(mainProductDetail.ProductId, false))
|
||||
if mainProductDetail != nil || mainProductDetail.ProductId != 0 {
|
||||
tiktokResult.ProductId = mainProductDetail.ProductId
|
||||
specPrices := make([]product_addV2_response.SkuItem, 0, 0)
|
||||
globals.SugarLogger.Debugf("========mainProductDetail.SpecPrices ;= %s", utils.Format4Output(mainProductDetail.SpecPrices, false))
|
||||
for _, v := range mainProductDetail.SpecPrices {
|
||||
globals.SugarLogger.Debugf("========v ;= %s", utils.Format4Output(v, false))
|
||||
specPrices = append(specPrices, product_addV2_response.SkuItem{
|
||||
SkuId: v.SkuId,
|
||||
OutSkuId: v.OutSkuId,
|
||||
@@ -203,7 +197,6 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
continue
|
||||
}
|
||||
}
|
||||
globals.SugarLogger.Debugf("========tiktokResult ;= %s", utils.Format4Output(tiktokResult, false))
|
||||
|
||||
if tiktokResult.ProductId > model.NO {
|
||||
dao.CreateThingMap(int64(storeSku.SkuID), utils.Int64ToStr(tiktokResult.ProductId), storeDetail.VendorOrgCode, "创建成功", model.ThingTypeSku, model.ThingTypeSyncSuccess)
|
||||
|
||||
Reference in New Issue
Block a user