This commit is contained in:
邹宗楠
2024-04-08 08:56:13 +08:00
parent a0bf9fa6ec
commit 042f48a0a0
2 changed files with 5 additions and 3 deletions

View File

@@ -935,12 +935,12 @@ func UpdateBoxPrice(ctx *jxcontext.Context, db *dao.DaoDB, list []int) error {
}) })
} }
count := utils.Float64TwoInt(math.Ceil(float64(len(foodDataList)) / float64(100))) count := utils.Float64TwoInt(math.Ceil(float64(len(foodDataList)) / float64(200)))
api := getAPI(storeDetail.VendorOrgCode, v, storeDetail.VendorStoreID) api := getAPI(storeDetail.VendorOrgCode, v, storeDetail.VendorStoreID)
for i := 1; i <= count; i++ { for i := 1; i <= count; i++ {
api.SetToken(storeDetail.MtwmToken) api.SetToken(storeDetail.MtwmToken)
if i == count { if i == count {
result, err := api.RetailBatchInitData2(ctx.GetTrackInfo(), storeDetail.VendorStoreID, foodDataList[(i-1)*100:]) result, err := api.RetailBatchInitData2(ctx.GetTrackInfo(), storeDetail.VendorStoreID, foodDataList[(i-1)*200:])
if err != nil { if err != nil {
globals.SugarLogger.Debugf("RetailBatchInitData1 err := %v", err) globals.SugarLogger.Debugf("RetailBatchInitData1 err := %v", err)
} }
@@ -948,7 +948,7 @@ func UpdateBoxPrice(ctx *jxcontext.Context, db *dao.DaoDB, list []int) error {
globals.SugarLogger.Debugf("RetailBatchInitData1 result := %s", utils.Format4Output(result, false)) globals.SugarLogger.Debugf("RetailBatchInitData1 result := %s", utils.Format4Output(result, false))
} }
} else { } else {
result, err := api.RetailBatchInitData2(ctx.GetTrackInfo(), storeDetail.VendorStoreID, foodDataList[(i-1)*100:i*100]) result, err := api.RetailBatchInitData2(ctx.GetTrackInfo(), storeDetail.VendorStoreID, foodDataList[(i-1)*200:i*200])
if err != nil { if err != nil {
globals.SugarLogger.Debugf("RetailBatchInitData2 err := %v", err) globals.SugarLogger.Debugf("RetailBatchInitData2 err := %v", err)
} }

View File

@@ -5,6 +5,7 @@ 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"
"strings" "strings"
"time" "time"
"unicode" "unicode"
@@ -238,6 +239,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
failedList = putils.GetErrMsg2FailedSingleList(storeSku, errors.New("商品同步中或同步错误"), storeID, model.VendorChineseNames[model.VendorIDDD], syncType) failedList = putils.GetErrMsg2FailedSingleList(storeSku, errors.New("商品同步中或同步错误"), storeID, model.VendorChineseNames[model.VendorIDDD], syncType)
continue continue
} else if localThing[0].SyncStatus == model.ThingTypeSyncSuccess { } else if localThing[0].SyncStatus == model.ThingTypeSyncSuccess {
globals.SugarLogger.Debugf("=========localThing := %s", utils.Format4Output(localThing, false))
// 主商品存在,直接同步子商品 // 主商品存在,直接同步子商品
childrenProductId, err := api.CreateSubProduct(utils.Str2Int64(localThing[0].VendorThingID), utils.Str2Int64(vendorStoreID)) childrenProductId, err := api.CreateSubProduct(utils.Str2Int64(localThing[0].VendorThingID), utils.Str2Int64(vendorStoreID))
if err != nil && strings.Contains(err.Error(), "2010004") { // 2010004:主商品非在线审核通过状态,不允许绑定子商品 if err != nil && strings.Contains(err.Error(), "2010004") { // 2010004:主商品非在线审核通过状态,不允许绑定子商品