1
This commit is contained in:
@@ -151,6 +151,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
|||||||
PickupMethod: "0",
|
PickupMethod: "0",
|
||||||
OuterProductId: utils.Int2Str(storeSku.SkuID), // 本地skuId为外部商品id
|
OuterProductId: utils.Int2Str(storeSku.SkuID), // 本地skuId为外部商品id
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("=======================1")
|
||||||
if len(param.Name) < 23 { // 中文字符一个汉字三个长度符号/数字/字母两个长度,商品名称不能大于
|
if len(param.Name) < 23 { // 中文字符一个汉字三个长度符号/数字/字母两个长度,商品名称不能大于
|
||||||
param.Name += utils.Float64ToStr(float64(storeSku.SpecQuality)) + "/" + storeSku.SpecUnit
|
param.Name += utils.Float64ToStr(float64(storeSku.SpecQuality)) + "/" + storeSku.SpecUnit
|
||||||
if len(param.Name) < 23 {
|
if len(param.Name) < 23 {
|
||||||
@@ -168,6 +169,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
|||||||
}
|
}
|
||||||
param.Pic = img
|
param.Pic = img
|
||||||
param.Description = detailImg
|
param.Description = detailImg
|
||||||
|
globals.SugarLogger.Debugf("=======================2")
|
||||||
|
|
||||||
// 部分商品没有所属的分类,直接跳过!
|
// 部分商品没有所属的分类,直接跳过!
|
||||||
if storeSku.SkuVendorMapCatID != "" {
|
if storeSku.SkuVendorMapCatID != "" {
|
||||||
@@ -175,6 +177,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
|||||||
} else if len(param.Pic) != 0 { // 自动推导分类id
|
} else if len(param.Pic) != 0 { // 自动推导分类id
|
||||||
param.CategoryLeafId = api.GetRecommendCategory(strings.Split(img, "|"))
|
param.CategoryLeafId = api.GetRecommendCategory(strings.Split(img, "|"))
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("=======================3")
|
||||||
// 这个情况是原有商品不存在和推荐查询不到类目id是,使用京西类目和抖音类目的绑定关系
|
// 这个情况是原有商品不存在和推荐查询不到类目id是,使用京西类目和抖音类目的绑定关系
|
||||||
// 但是不太实用,导致商品类目错误被暂停营业等
|
// 但是不太实用,导致商品类目错误被暂停营业等
|
||||||
//if storeSku.VendorVendorCatID != 0 && param.CategoryLeafId == 0 {
|
//if storeSku.VendorVendorCatID != 0 && param.CategoryLeafId == 0 {
|
||||||
@@ -190,6 +193,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
|||||||
} else {
|
} else {
|
||||||
param.Supply7dayReturn = 0
|
param.Supply7dayReturn = 0
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("=======================4")
|
||||||
|
|
||||||
// weight_unit 目前抖音只支持g和kg两种
|
// weight_unit 目前抖音只支持g和kg两种
|
||||||
param.WeightUnit = tiktokShop.WeightUint_G
|
param.WeightUnit = tiktokShop.WeightUint_G
|
||||||
@@ -210,9 +214,9 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
|||||||
}
|
}
|
||||||
|
|
||||||
param.StandardBrandId = 789194134 // 默认品牌京西菜市 596120136
|
param.StandardBrandId = 789194134 // 默认品牌京西菜市 596120136
|
||||||
|
globals.SugarLogger.Debugf("=======================5")
|
||||||
|
|
||||||
temp, err := dao.QueryStoreBindInfo(storeDetail.Store.ID)
|
temp, err := dao.QueryStoreBindInfo(storeDetail.Store.ID)
|
||||||
globals.SugarLogger.Debugf("=========temp %s", utils.Format4Output(temp, false))
|
|
||||||
if err != nil || temp == nil || temp.ID == 0 {
|
if err != nil || temp == nil || temp.ID == 0 {
|
||||||
// 运费模板
|
// 运费模板
|
||||||
param.FreightId, err = GetDeliveryTemp(api, vendorStoreID, storeDetail)
|
param.FreightId, err = GetDeliveryTemp(api, vendorStoreID, storeDetail)
|
||||||
@@ -260,6 +264,7 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
|||||||
dao.FreightTemplateMap[temp.StoreID] = temp
|
dao.FreightTemplateMap[temp.StoreID] = temp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debugf("=======================6")
|
||||||
|
|
||||||
// 根据本地商品id获取线上商品是否存在,存在则只创建子商品
|
// 根据本地商品id获取线上商品是否存在,存在则只创建子商品
|
||||||
var tiktokResultProductId int64 = 0
|
var tiktokResultProductId int64 = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user