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"
|
|
||||||
beego "github.com/astaxie/beego/server/web"
|
beego "github.com/astaxie/beego/server/web"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@@ -318,11 +317,11 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
|||||||
|
|
||||||
if childrenProductId != model.NO {
|
if childrenProductId != model.NO {
|
||||||
// 同步价格,库存,上架
|
// 同步价格,库存,上架
|
||||||
failedList2 := upDateChildrenPriceStockLaunch(api, storeSku, childrenProductId, vendorStoreID, syncType)
|
skuId, failedList2 := upDateChildrenPriceStockLaunch(api, storeSku, childrenProductId, vendorStoreID, syncType)
|
||||||
failedList = append(failedList, failedList2...)
|
failedList = append(failedList, failedList2...)
|
||||||
storeSku.VendorSonSkuID = utils.Int64ToStr(childrenProductId) // (属性id skuID方案一)(自商品的商品id方案二)
|
storeSku.VendorSonSkuID = utils.Int64ToStr(skuId) // (属性id skuID方案一)(自商品的商品id方案二)
|
||||||
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 {
|
if err != nil {
|
||||||
@@ -446,9 +445,9 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
|||||||
//storeSku.VendorSkuID = utils.Int2Str(storeSku.SkuID)
|
//storeSku.VendorSkuID = utils.Int2Str(storeSku.SkuID)
|
||||||
} else {
|
} else {
|
||||||
// todo 暂时关闭之后解开
|
// todo 暂时关闭之后解开
|
||||||
upDateChildrenPriceStockLaunch(api, storeSku, utils.Str2Int64(storeSku.VendorSkuID), vendorStoreID, syncType)
|
skuId, _ := upDateChildrenPriceStockLaunch(api, storeSku, utils.Str2Int64(storeSku.VendorSkuID), vendorStoreID, syncType)
|
||||||
|
storeSku.VendorSonSkuID = utils.Int64ToStr(skuId) // 品库修改 售卖状态待同步 价格待同步
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("-----------errr := %v", err)
|
|
||||||
//storeSku.SkuSyncStatus = model.SyncFlagStoreSkuModifiedMask // 品库修改 售卖状态待同步 价格待同步
|
//storeSku.SkuSyncStatus = model.SyncFlagStoreSkuModifiedMask // 品库修改 售卖状态待同步 价格待同步
|
||||||
storeSku.SkuSyncStatus = 0 // 品库修改 售卖状态待同步 价格待同步
|
storeSku.SkuSyncStatus = 0 // 品库修改 售卖状态待同步 价格待同步
|
||||||
}
|
}
|
||||||
@@ -673,10 +672,10 @@ func checkNameLenght(name string) string {
|
|||||||
}
|
}
|
||||||
return name
|
return name
|
||||||
}
|
}
|
||||||
func upDateChildrenPriceStockLaunch(api *tiktokShop.API, storeSku *dao.StoreSkuSyncInfo, childrenProductId int64, vendorStoreID, syncType string) (failedList []*partner.StoreSkuInfoWithErr) {
|
func upDateChildrenPriceStockLaunch(api *tiktokShop.API, storeSku *dao.StoreSkuSyncInfo, childrenProductId int64, vendorStoreID, syncType string) (skuID int64, failedList []*partner.StoreSkuInfoWithErr) {
|
||||||
skuId, failed := getProductSkuID(api, storeSku, syncType, childrenProductId)
|
skuId, failed := getProductSkuID(api, storeSku, syncType, childrenProductId)
|
||||||
if skuId == 0 || len(failed) > 0 {
|
if skuId == 0 || len(failed) > 0 {
|
||||||
return failed
|
return 0, failed
|
||||||
}
|
}
|
||||||
// 同步价格
|
// 同步价格
|
||||||
if err := api.EditPrice(&sku_editPrice_request.SkuEditPriceParam{
|
if err := api.EditPrice(&sku_editPrice_request.SkuEditPriceParam{
|
||||||
@@ -710,7 +709,7 @@ func upDateChildrenPriceStockLaunch(api *tiktokShop.API, storeSku *dao.StoreSkuS
|
|||||||
} else {
|
} else {
|
||||||
storeSku.SkuSyncStatus = 0
|
storeSku.SkuSyncStatus = 0
|
||||||
}
|
}
|
||||||
return failedList
|
return skuId, failedList
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询商品详情,获取商品的抖音skuId
|
// 查询商品详情,获取商品的抖音skuId
|
||||||
|
|||||||
Reference in New Issue
Block a user