京东商城一系列
This commit is contained in:
@@ -231,11 +231,12 @@ func storeSkuSyncInfo2Bare(inSku *dao.StoreSkuSyncInfo) (outSku *partner.StoreSk
|
||||
NameID: inSku.NameID,
|
||||
VendorNameID: inSku.VendorNameID,
|
||||
|
||||
Status: inSku.MergedStatus,
|
||||
VendorPrice: inSku.VendorPrice,
|
||||
Seq: inSku.Seq,
|
||||
JxPrice: inSku.Price,
|
||||
JxUnitPrice: inSku.UnitPrice,
|
||||
Status: inSku.MergedStatus,
|
||||
VendorPrice: inSku.VendorPrice,
|
||||
Seq: inSku.Seq,
|
||||
JxPrice: inSku.Price,
|
||||
JxUnitPrice: inSku.UnitPrice,
|
||||
VendorSkuID2: utils.Int2Str(inSku.JdsWareID),
|
||||
}
|
||||
if !isStoreSkuSyncNeedDelete(inSku) {
|
||||
outSku.Stock = model.MaxStoreSkuStockQty
|
||||
@@ -260,6 +261,15 @@ func getSkuBoxFee(vendorID int) (boxFee int64) {
|
||||
return boxFee
|
||||
}
|
||||
|
||||
func formalizeStoreSkuListForJds(inSkuList []*dao.StoreSkuSyncInfo) []*dao.StoreSkuSyncInfo {
|
||||
if len(inSkuList) > 0 {
|
||||
for _, skuItem := range inSkuList {
|
||||
skuItem.SkuName = jxutils.ComposeSkuNameSync2(skuItem.Prefix, skuItem.Name, skuItem.Comment, skuItem.Unit, skuItem.SpecQuality, skuItem.SpecUnit, 0, skuItem.ExPrefix, skuItem.ExPrefixBegin, skuItem.ExPrefixEnd)
|
||||
}
|
||||
}
|
||||
return inSkuList
|
||||
}
|
||||
|
||||
func formalizeStoreSkuList(inSkuList []*dao.StoreSkuSyncInfo) []*dao.StoreSkuSyncInfo {
|
||||
if len(inSkuList) > 0 {
|
||||
boxFee := getSkuBoxFee(inSkuList[0].VendorID)
|
||||
@@ -332,10 +342,20 @@ func updateStoreSku(db *dao.DaoDB, vendorID int, storeSkuList []*dao.StoreSkuSyn
|
||||
if vendorID == model.VendorIDYB {
|
||||
err = updateYbOhterSku(db, storeSkuList)
|
||||
}
|
||||
if vendorID == model.VendorIDJDShop {
|
||||
err = updateJdsWareID(db, storeSkuList)
|
||||
}
|
||||
}
|
||||
return num, err
|
||||
}
|
||||
|
||||
func updateJdsWareID(db *dao.DaoDB, storeSkuList []*dao.StoreSkuSyncInfo) (err error) {
|
||||
for _, v := range storeSkuList {
|
||||
err = dao.UpdateJdsWareID(db, v)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func updateYbOhterSku(db *dao.DaoDB, storeSkuList []*dao.StoreSkuSyncInfo) (err error) {
|
||||
for _, v := range storeSkuList {
|
||||
err = dao.UpdateYbOtherSku(db, v)
|
||||
@@ -376,6 +396,11 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
skus = skus2
|
||||
}
|
||||
formalizeStoreSkuList(skus)
|
||||
//京东商城的商品名规则不同
|
||||
//name,空格,comment,约xxg
|
||||
if vendorID == model.VendorIDJDShop {
|
||||
formalizeStoreSkuListForJds(skus)
|
||||
}
|
||||
|
||||
singleStoreHandler, _ := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.ISingleStoreStoreSkuHandler)
|
||||
storeSkuHandler := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.IPurchasePlatformStoreSkuHandler)
|
||||
|
||||
Reference in New Issue
Block a user