1
This commit is contained in:
@@ -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"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
"unicode"
|
"unicode"
|
||||||
@@ -239,7 +238,6 @@ 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:主商品非在线审核通过状态,不允许绑定子商品
|
||||||
@@ -298,6 +296,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
|||||||
childrenProductId = storeSkuDetail.ProductId
|
childrenProductId = storeSkuDetail.ProductId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if childrenProductId != model.NO {
|
||||||
// 同步价格,库存,上架
|
// 同步价格,库存,上架
|
||||||
failedList2 := upDateChildrenPriceStockLaunch(api, storeSku, childrenProductId, vendorStoreID, syncType)
|
failedList2 := upDateChildrenPriceStockLaunch(api, storeSku, childrenProductId, vendorStoreID, syncType)
|
||||||
failedList = append(failedList, failedList2...)
|
failedList = append(failedList, failedList2...)
|
||||||
@@ -305,6 +304,13 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
|||||||
storeSku.VendorSkuID = utils.Int64ToStr(childrenProductId) // 子商品主id
|
storeSku.VendorSkuID = utils.Int64ToStr(childrenProductId) // 子商品主id
|
||||||
storeSku.VendorMainId = localThing[0].VendorThingID // 商品主id
|
storeSku.VendorMainId = localThing[0].VendorThingID // 商品主id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
failedList4 := putils.GetErrMsg2FailedSingleList(storeSku, errors.New("创建子品异常:"+err.Error()), storeID, model.VendorChineseNames[model.VendorIDDD], syncType)
|
||||||
|
failedList = append(failedList, failedList4...)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
syncType = "更新商品"
|
syncType = "更新商品"
|
||||||
|
|||||||
Reference in New Issue
Block a user