京东商城建商品

This commit is contained in:
苏尹岚
2020-05-13 14:52:12 +08:00
parent c6476faccb
commit 335e8a0806
2 changed files with 18 additions and 9 deletions

View File

@@ -402,7 +402,7 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
}
formalizeStoreSkuList(skus)
//京东商城的商品名规则不同
//name空格comment约xxg
// name空格comment约xxg
// if vendorID == model.VendorIDJDShop {
// formalizeStoreSkuListForJds(skus)
// }

View File

@@ -292,27 +292,29 @@ func updateOrCreateCategories(storeCat *dao.SkuStoreCatInfo, isCreate bool) (err
}
func buildCreateWareParam(storeSku *dao.StoreSkuSyncInfo) (createSkuParamWare *jdshopapi.CreateSkuParamWare, createSkuParamSkus []*jdshopapi.CreateSkuParamSkus, err error) {
var images []*jdshopapi.CreateSkuParamImages
var (
images []*jdshopapi.CreateSkuParamImages
desc string
)
createSkuParamWare = &jdshopapi.CreateSkuParamWare{
Title: storeSku.Name,
ShopCategorys: []int{utils.Str2Int(storeSku.VendorCatID)},
CategoryID: int(storeSku.VendorVendorCatID),
BrandID: jdshopapi.JxBrandId,
TransportID: jdshopapi.TransportID,
MobileDesc: "因生鲜比较脆弱,发货途中如果有磕碰损坏,请收到联系客服,闪电赔付。请核对好地址,发货后不可修改地址,因改地址导致损坏不能赔付,谢谢理解",
Introduction: "因生鲜比较脆弱,发货途中如果有磕碰损坏,请收到联系客服,闪电赔付。请核对好地址,发货后不可修改地址,因改地址导致损坏不能赔付,谢谢理解",
WareStatus: 8, //上架待审核
OuterID: utils.Int2Str(storeSku.NameID),
VenderID: 0,
Is7ToReturn: 0, //不支持7天退货
Length: 100,
Width: 100,
Height: 100,
Weight: 500,
JdPrice: int(storeSku.UnitPrice),
MarketPrice: int(storeSku.UnitPrice),
JdPrice: int(storeSku.UnitPrice) / 100,
MarketPrice: int(storeSku.UnitPrice) / 100,
}
desc = "<img src=\"" + jdshopapi.JdsImgURL + storeSku.DescImg + "\" style=\"width: auto; height: auto; max-width: 100%;\">"
createSkuParamWare.MobileDesc = desc
createSkuParamWare.Introduction = desc
//上传京东图片 start
//规则,有两张就传两张,没有就重复传一张
data, _, err := jxutils.DownloadFileByURL(storeSku.Img)
@@ -390,6 +392,13 @@ func buildCreateWareParam(storeSku *dao.StoreSkuSyncInfo) (createSkuParamWare *j
attrsProp = append(attrsProp, attrJhl)
attrsProp = append(attrsProp, attrBzq)
createSkuParamWare.MultiCateProps = attrsProp
var features []*jdshopapi.CreateSkuParamFeatures
feature := &jdshopapi.CreateSkuParamFeatures{
Key: "is7ToReturn", //不支持7天无理由退货
Value: "0",
}
features = append(features, feature)
createSkuParamWare.Features = features
//组合sku
for _, v := range storeSku.StoreSkuSyncInfoJds {
@@ -414,7 +423,7 @@ func buildCreateWareParam(storeSku *dao.StoreSkuSyncInfo) (createSkuParamWare *j
}
attrsPropSku = append(attrsPropSku, attrSku)
sku := &jdshopapi.CreateSkuParamSkus{
JdPrice: int(v.VendorPrice),
JdPrice: int(v.VendorPrice) / 100,
StockNum: 9999,
Type: "com.jd.pop.ware.ic.api.domain.sku",
Type2: "com.jd.pop.ware.ic.api.domain.Sku",