up
This commit is contained in:
@@ -167,13 +167,13 @@ func skuInfo2Param(ctx *jxcontext.Context, sku *dao.StoreSkuSyncInfo) (param *jd
|
|||||||
Upc: sku.Upc,
|
Upc: sku.Upc,
|
||||||
Images: jxutils.BatchString2Slice(sku.Img, sku.Img2),
|
Images: jxutils.BatchString2Slice(sku.Img, sku.Img2),
|
||||||
}
|
}
|
||||||
// 京东强制要求upc的商品,如果没有设置upc,自动生成一个假的
|
|
||||||
if param.Upc == "" && isSkuMustHaveUpc(sku) {
|
|
||||||
param.Upc = jxutils.GenFakeUPC(sku.SkuID)
|
|
||||||
}
|
|
||||||
if param.CategoryID == 0 {
|
if param.CategoryID == 0 {
|
||||||
param.CategoryID = int64(getDefJdCategoryID())
|
param.CategoryID = int64(getDefJdCategoryID())
|
||||||
}
|
}
|
||||||
|
// 京东强制要求upc的商品,如果没有设置upc,自动生成一个假的
|
||||||
|
if param.Upc == "" && isSkuMustHaveUpc(sku.Unit, param.CategoryID) {
|
||||||
|
param.Upc = jxutils.GenFakeUPC(sku.SkuID)
|
||||||
|
}
|
||||||
if sku.IsGlobal == 0 && len(sku.SellCities) > 0 {
|
if sku.IsGlobal == 0 && len(sku.SellCities) > 0 {
|
||||||
param.SellCities = utils.StringSlice2Int64(sku.SellCities)
|
param.SellCities = utils.StringSlice2Int64(sku.SellCities)
|
||||||
}
|
}
|
||||||
@@ -363,8 +363,8 @@ func jxStatus2jdStatus(jxStatus int) (jdStatus int) {
|
|||||||
return jdStatus
|
return jdStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
func isSkuMustHaveUpc(sku *dao.StoreSkuSyncInfo) bool {
|
func isSkuMustHaveUpc(unit string, vendorVendorCatID int64) bool {
|
||||||
return sku.Unit != model.SpecialUnit || !upcLessMap[sku.VendorVendorCatID]
|
return unit != model.SpecialUnit || !upcLessMap[vendorVendorCatID]
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
Reference in New Issue
Block a user