This commit is contained in:
gazebo
2019-07-12 11:27:21 +08:00
parent 02cd47cef3
commit 71bd8a0c6d
5 changed files with 6 additions and 9 deletions

View File

@@ -2073,7 +2073,7 @@ func GetVendorStoreSkusInfo(ctx *jxcontext.Context, storeID int, vendorIDs, skuI
_, err = CurVendorSync.LoopStoresMap(ctx, db, fmt.Sprintf("GetVendorStoreSkusInfo storeID:%d", storeID), false, false, vendorIDs, []int{storeID}, _, err = CurVendorSync.LoopStoresMap(ctx, db, fmt.Sprintf("GetVendorStoreSkusInfo storeID:%d", storeID), false, false, vendorIDs, []int{storeID},
func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) { func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (interface{}, error) {
loopMapInfo := batchItemList[0].(*LoopStoreMapInfo) loopMapInfo := batchItemList[0].(*LoopStoreMapInfo)
if handler := CurVendorSync.GetStoreHandler(loopMapInfo.VendorID); handler != nil { if handler, _ := partner.GetPurchasePlatformFromVendorID(loopMapInfo.VendorID).(partner.IPurchasePlatformStoreSkuHandler); handler != nil {
storeSkuList, err2 := dao.GetStoreSkus2(db, loopMapInfo.VendorID, storeID, skuIDs, false) storeSkuList, err2 := dao.GetStoreSkus2(db, loopMapInfo.VendorID, storeID, skuIDs, false)
if err = err2; err == nil && len(storeSkuList) > 0 { if err = err2; err == nil && len(storeSkuList) > 0 {
bareStoreSkuInfoList := make([]*partner.BareStoreSkuInfo, len(skuIDs)) bareStoreSkuInfoList := make([]*partner.BareStoreSkuInfo, len(skuIDs))

View File

@@ -235,9 +235,8 @@ type IPurchasePlatformHandler interface {
GetStoreStatus(ctx *jxcontext.Context, vendorStoreID string) (storeStatus int, err error) GetStoreStatus(ctx *jxcontext.Context, vendorStoreID string) (storeStatus int, err error)
GetVendorCategories(ctx *jxcontext.Context) (vendorCats []*model.SkuVendorCategory, err error) GetVendorCategories(ctx *jxcontext.Context) (vendorCats []*model.SkuVendorCategory, err error)
// todo 如下两个函数需要合并一下s // todo GetStoresSku应该与GetStoreSkusInfo合并
GetStoresSku(ctx *jxcontext.Context, parentTask tasksch.ITask, storeIDs []int) (storeSkuList []*model.StoreSkuBind, err error) GetStoresSku(ctx *jxcontext.Context, parentTask tasksch.ITask, storeIDs []int) (storeSkuList []*model.StoreSkuBind, err error)
GetStoreSkusInfo(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, vendorStoreID string, inStoreSkuList []*BareStoreSkuInfo) (outStoreSkuList []*BareStoreSkuInfo, err error)
} }
// db *dao.DaoDB, // db *dao.DaoDB,

View File

@@ -3,6 +3,7 @@ package partner
import ( import (
"git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
"git.rosy.net.cn/jx-callback/business/model/dao" "git.rosy.net.cn/jx-callback/business/model/dao"
) )
@@ -89,6 +90,7 @@ type BareCategoryInfo struct {
type IPurchasePlatformStoreSkuHandler interface { type IPurchasePlatformStoreSkuHandler interface {
GetStoreSkusBatchSize(funcID int) int GetStoreSkusBatchSize(funcID int) int
GetStoreSkusInfo(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, vendorStoreID string, inStoreSkuList []*BareStoreSkuInfo) (outStoreSkuList []*BareStoreSkuInfo, err error)
UpdateStoreSkusStock(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*BareStoreSkuInfo) (err error) UpdateStoreSkusStock(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*BareStoreSkuInfo) (err error)
UpdateStoreSkusStatus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*BareStoreSkuInfo) (err error) UpdateStoreSkusStatus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*BareStoreSkuInfo) (err error)
UpdateStoreSkusPrice(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*BareStoreSkuInfo) (err error) UpdateStoreSkusPrice(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*BareStoreSkuInfo) (err error)
@@ -97,6 +99,7 @@ type IPurchasePlatformStoreSkuHandler interface {
type ISingleStoreStoreSkuHandler interface { type ISingleStoreStoreSkuHandler interface {
IPurchasePlatformStoreSkuHandler IPurchasePlatformStoreSkuHandler
// 这个函数与GetStoreSkusInfo的区别是GetStoreAllSkus取的是全信息而GetStoreSkusInfo只含库存价格与可售信息
// GetStoreAllSkus(ctx *jxcontext.Context, vendorStoreID string) (skuNameList []*SkuNameInfo, err error) // GetStoreAllSkus(ctx *jxcontext.Context, vendorStoreID string) (skuNameList []*SkuNameInfo, err error)
CreateStoreSkus(ctx *jxcontext.Context, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (err error) CreateStoreSkus(ctx *jxcontext.Context, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (err error)
UpdateStoreSkus(ctx *jxcontext.Context, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (err error) UpdateStoreSkus(ctx *jxcontext.Context, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (err error)

View File

@@ -4,7 +4,6 @@ import (
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext" "git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch" "git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
"git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/partner"
) )
func (p *PurchaseHandler) SyncStoreCategory(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, isAsync bool) (hint string, err error) { func (p *PurchaseHandler) SyncStoreCategory(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, isAsync bool) (hint string, err error) {
@@ -31,10 +30,6 @@ func (p *PurchaseHandler) GetStoresSku(ctx *jxcontext.Context, parentTask tasksc
return storeSkuList, err return storeSkuList, err
} }
func (p *PurchaseHandler) GetStoreSkusInfo(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, vendorStoreID string, inStoreSkuList []*partner.BareStoreSkuInfo) (outStoreSkuList []*partner.BareStoreSkuInfo, err error) {
return outStoreSkuList, err
}
func (p *PurchaseHandler) PruneMissingStoreSkus(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, isAsync, isContinueWhenError bool) (hint string, err error) { func (p *PurchaseHandler) PruneMissingStoreSkus(ctx *jxcontext.Context, parentTask tasksch.ITask, storeID int, isAsync, isContinueWhenError bool) (hint string, err error) {
return hint, err return hint, err
} }

View File

@@ -41,7 +41,7 @@ func (p *PurchaseHandler) GetStoreSkusInfo(ctx *jxcontext.Context, parentTask ta
stockInfo, err = api.JdAPI.QueryOpenUseable(batchSkuInfoList) stockInfo, err = api.JdAPI.QueryOpenUseable(batchSkuInfoList)
} else { } else {
priceInfo, err = api.JdAPI.GetStationInfoList(vendorStoreID, batchSkuList) priceInfo, err = api.JdAPI.GetStationInfoList(vendorStoreID, batchSkuList)
globals.SugarLogger.Debug(utils.Format4Output(priceInfo, false)) // globals.SugarLogger.Debug(utils.Format4Output(priceInfo, false))
} }
return nil, err return nil, err
}, []int{0, 1}) }, []int{0, 1})